/*
 * Editor Components — Frontend Stylesheet
 *
 * This file provides frontend rendering styles for all structured components
 * generated by the TinyMCE editor. It mirrors the editor's internal content_style
 * so that pages render identically on the public frontend.
 *
 * Components covered:
 *   - CTA Buttons (.cta-btn)
 *   - Content Sections (.content-section)
 *   - Multi-Column Layouts (.multi-column-layout)
 *   - Styled Div Sections (.styled-section)
 *   - Card Containers (.card-container-wrapper)
 *   - Bootstrap Accordions (.accordion)
 *   - FAQ / Custom Accordions (.faq-accordion-one-col)
 *   - Structured Sections (.structured-section)
 *   - Article Templates (.article-template)
 *   - Callout / Note / Warning Blocks (.callout-block, .note-block, .warning-block)
 */

/* =============================================================================
   CTA Button Styles
   ============================================================================= */
.cta-btn {
    display: inline-block;
    padding: 10px 22px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: opacity 0.2s, box-shadow 0.2s, background-color 0.2s, border-color 0.2s;
    line-height: 1.5;
    border: 2px solid transparent;
}
.cta-btn--primary { background-color: #007bff; color: #ffffff; border-color: #007bff; }
.cta-btn--primary:hover { background-color: #0056b3; border-color: #0056b3; color: #ffffff; text-decoration: none; }
.cta-btn--secondary { background-color: transparent; color: #007bff; border-color: #007bff; }
.cta-btn--secondary:hover { background-color: #007bff; color: #ffffff; text-decoration: none; }
.cta-btn--danger { background-color: #dc3545; color: #ffffff; border-color: #dc3545; }
.cta-btn--danger:hover { background-color: #b02a37; border-color: #b02a37; color: #ffffff; text-decoration: none; }
.cta-btn--success { background-color: #28a745; color: #ffffff; border-color: #28a745; }
.cta-btn--success:hover { background-color: #1e7e34; border-color: #1e7e34; color: #ffffff; text-decoration: none; }
.cta-btn--sm { padding: 6px 14px; font-size: 13px; }
.cta-btn--md { padding: 10px 22px; font-size: 15px; }
.cta-btn--lg { padding: 14px 30px; font-size: 17px; }


/* =============================================================================
   Content Section Styles (predefined variants)
   ============================================================================= */
.content-section {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 48px 0;
    margin: 0;
}
.content-section--standard { background-color: #ffffff; }
.content-section--highlight {
    background-color: #f4f6f9;
    border-top: 1px solid #e5e8ed;
    border-bottom: 1px solid #e5e8ed;
}
.content-section--alt {
    background-color: #eef2ff;
    border-top: 1px solid #d0d9f5;
    border-bottom: 1px solid #d0d9f5;
}
.content-section .section-inner,
.content-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
}
.content-section .container-fluid {
    width: 100%;
    padding: 0 24px;
    box-sizing: border-box;
}
.content-section h1,
.content-section h2,
.content-section h3,
.content-section h4,
.content-section h5,
.content-section h6 { margin-top: 0; margin-bottom: 16px; color: #1a1a2e; font-weight: 700; }
.content-section h2 { font-size: 28px; }
.content-section h3 { font-size: 22px; }
.content-section p { margin: 0 0 16px 0; line-height: 1.7; color: #444; }
.content-section p:last-child { margin-bottom: 0; }
.content-section ul,
.content-section ol { margin: 16px 0; padding-left: 28px; }
.content-section li { margin: 8px 0; line-height: 1.7; color: #444; }
.content-section img { max-width: 100%; height: auto; border-radius: 6px; margin: 16px 0; }
.content-section a { color: #007bff; text-decoration: none; }
.content-section a:hover { text-decoration: underline; }

@media (max-width: 768px) {
    .content-section { padding: 32px 0; }
    .content-section .section-inner,
    .content-section .container,
    .content-section .container-fluid { padding: 0 16px; }
    .content-section h2 { font-size: 22px; }
    .content-section h3 { font-size: 18px; }
}


/* =============================================================================
   Multi-Column Layout Styles
   ============================================================================= */
.multi-column-layout {
    display: grid;
    gap: 30px;
    margin: 20px 0;
    width: 100%;
}
.multi-column-layout[data-columns="2"] { grid-template-columns: repeat(2, 1fr); }
.multi-column-layout[data-columns="3"] { grid-template-columns: repeat(3, 1fr); }
.multi-column-layout[data-columns="4"] { grid-template-columns: repeat(4, 1fr); }
.multi-column-layout[data-columns="5"] { grid-template-columns: repeat(5, 1fr); }
.multi-column-layout[data-columns="6"] { grid-template-columns: repeat(6, 1fr); }
.column-item { padding: 20px; background-color: #f9f9f9; border: 1px solid #e0e0e0; border-radius: 5px; }
.column-item h1, .column-item h2, .column-item h3,
.column-item h4, .column-item h5, .column-item h6 { margin-top: 0; margin-bottom: 15px; color: #333; font-weight: 600; }
.column-item h1 { font-size: 24px; }
.column-item h2 { font-size: 20px; }
.column-item h3 { font-size: 18px; }
.column-item p { margin: 0 0 15px 0; line-height: 1.6; color: #555; }
.column-item p:last-child { margin-bottom: 0; }
.column-item .content-block { margin: 15px 0; padding: 15px; background-color: #fff; border-left: 3px solid #fff; border-radius: 3px; }
.column-item .content-block p { margin: 0 0 10px 0; }
.column-item .content-block p:last-child { margin-bottom: 0; }
.column-item ul, .column-item ol { margin: 15px 0; padding-left: 30px; }
.column-item li { margin: 5px 0; line-height: 1.6; }
.column-item img { max-width: 100%; height: auto; margin: 15px 0; border-radius: 5px; }
.column-item a { color: #007bff; text-decoration: none; }
.column-item a:hover { text-decoration: underline; }

@media (max-width: 1200px) {
    .multi-column-layout[data-columns="6"] { grid-template-columns: repeat(3, 1fr); }
    .multi-column-layout[data-columns="5"] { grid-template-columns: repeat(3, 1fr); }
    .multi-column-layout[data-columns="4"] { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 992px) {
    .multi-column-layout[data-columns="6"],
    .multi-column-layout[data-columns="5"],
    .multi-column-layout[data-columns="4"],
    .multi-column-layout[data-columns="3"] { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .multi-column-layout { grid-template-columns: 1fr !important; }
}


/* =============================================================================
   Styled Div Section Styles
   ============================================================================= */
.styled-section {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 25px;
    margin: 20px 0;
}
.styled-section h1, .styled-section h2, .styled-section h3,
.styled-section h4, .styled-section h5, .styled-section h6 { margin-top: 0; margin-bottom: 15px; color: #333; font-weight: 600; }
.styled-section p { margin: 0 0 15px 0; line-height: 1.6; color: #555; }
.styled-section p:last-child { margin-bottom: 0; }
.styled-section .section-content { margin-top: 20px; padding: 15px; background-color: #ffffff; border-left: 4px solid #eee; border-radius: 4px; }
.styled-section .section-content ul,
.styled-section .section-content ol { margin: 10px 0; padding-left: 25px; }
.styled-section .section-content li { margin: 5px 0; line-height: 1.6; }
.styled-section img { max-width: 100%; height: auto; margin: 15px 0; border-radius: 5px; }


/* =============================================================================
   Card Container Styles
   ============================================================================= */
.card-container-wrapper {
    display: grid;
    gap: 20px;
    margin: 20px 0;
    width: 100%;
}
.card-container-wrapper[data-cards-per-row="1"] { grid-template-columns: repeat(1, 1fr); }
.card-container-wrapper[data-cards-per-row="2"] { grid-template-columns: repeat(2, 1fr); }
.card-container-wrapper[data-cards-per-row="3"] { grid-template-columns: repeat(3, 1fr); }
.card-container-wrapper[data-cards-per-row="4"] { grid-template-columns: repeat(4, 1fr); }
.card-container-wrapper[data-cards-per-row="6"] { grid-template-columns: repeat(6, 1fr); }
.card-item {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.card-item:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.12); transform: translateY(-2px); }
.card-content { padding: 20px; }
.card-content h1, .card-content h2, .card-content h3,
.card-content h4, .card-content h5, .card-content h6 { margin-top: 0; margin-bottom: 15px; color: #333; font-weight: 600; }
.card-content p { margin: 0 0 15px 0; line-height: 1.6; color: #555; }
.card-content p:last-child { margin-bottom: 0; }
.card-content ul, .card-content ol { margin: 15px 0; padding-left: 25px; }
.card-content li { margin: 5px 0; line-height: 1.6; }
.card-content img { max-width: 100%; height: auto; margin: 15px 0; border-radius: 5px; }
.card-content a { color: #007bff; text-decoration: none; }
.card-content a:hover { text-decoration: underline; }

@media (max-width: 1200px) {
    .card-container-wrapper[data-cards-per-row="6"] { grid-template-columns: repeat(3, 1fr); }
    .card-container-wrapper[data-cards-per-row="4"] { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 992px) {
    .card-container-wrapper[data-cards-per-row="4"],
    .card-container-wrapper[data-cards-per-row="6"] { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .card-container-wrapper { grid-template-columns: 1fr !important; }
}


/* =============================================================================
   Bootstrap Accordion Styles
   ============================================================================= */
.accordion { margin: 20px 0; }
.accordion-item {
    background-color: #fff;
    border: 1px solid rgba(0,0,0,0.125);
    border-radius: 0.375rem;
    margin-bottom: -1px;
}
.accordion-item:first-of-type { border-top-left-radius: 0.375rem; border-top-right-radius: 0.375rem; }
.accordion-item:last-of-type { border-bottom-left-radius: 0.375rem; border-bottom-right-radius: 0.375rem; }
.accordion-header { margin-bottom: 0; }
.accordion-button {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    color: #212529;
    text-align: left;
    background-color: #fff;
    border: 0;
    border-radius: 0;
    cursor: pointer;
    overflow-anchor: none;
    transition: color 0.15s, background-color 0.15s, border-color 0.15s, box-shadow 0.15s, border-radius 0.15s;
}
.accordion-button:not(.collapsed) { color: #0c63e4; background-color: #e7f1ff; box-shadow: inset 0 -1px 0 rgba(0,0,0,0.125); }
.accordion-button::after {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    margin-left: auto;
    content: "";
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23212529'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-size: 1.25rem;
    transition: transform 0.2s ease-in-out;
}
.accordion-button:not(.collapsed)::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%230c63e4'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    transform: rotate(-180deg);
}
.accordion-button:focus { z-index: 3; border-color: #86b7fe; outline: 0; box-shadow: 0 0 0 0.25rem rgba(13,110,253,0.25); }
.accordion-collapse { height: 0; overflow: hidden; transition: height 0.35s ease; }
.accordion-collapse.show { height: auto; }
.accordion-body { padding: 1rem 1.25rem; }
.accordion-body p { margin: 0 0 15px 0; line-height: 1.6; color: #555; }
.accordion-body p:last-child { margin-bottom: 0; }
.accordion-body h1, .accordion-body h2, .accordion-body h3,
.accordion-body h4, .accordion-body h5, .accordion-body h6 { margin-top: 20px; margin-bottom: 10px; color: #333; font-weight: 600; }
.accordion-body h1:first-child, .accordion-body h2:first-child,
.accordion-body h3:first-child, .accordion-body h4:first-child,
.accordion-body h5:first-child, .accordion-body h6:first-child { margin-top: 0; }
.accordion-body ul, .accordion-body ol { margin: 15px 0; padding-left: 30px; }
.accordion-body li { margin: 5px 0; line-height: 1.6; }
.accordion-body img { max-width: 100%; height: auto; margin: 15px 0; border-radius: 5px; }
.accordion-body a { color: #007bff; text-decoration: none; }
.accordion-body a:hover { text-decoration: underline; }


/* =============================================================================
   FAQ / Custom Accordion Styles
   ============================================================================= */
.faq-accordion-one-col,
.accordion-one-col { margin: 20px 0; }
.faq-column,
.accord-column { width: 100%; }
.faq-item,
.accord-item {
    border: 1px solid #e0e0e0;
    margin-bottom: 15px;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}
.faq-question,
.accord-heading {
    padding: 15px 20px;
    background-color: #f5f5f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s;
}
.faq-question:hover,
.accord-heading:hover { background-color: #e8e8e8; }
.faq-question h4,
.accord-heading h4 { margin: 0; font-size: 16px; font-weight: 600; color: #333; flex: 1; }
.faq-actions,
.accord-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.faq-toggle,
.accord-toggle {
    font-size: 20px;
    font-weight: bold;
    color: #666;
    transition: transform 0.3s ease;
    min-width: 24px;
    text-align: center;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    display: inline-block;
}
.faq-toggle:hover, .accord-toggle:hover { color: #007bff; }
.faq-item.active .faq-toggle,
.accord-item.active .accord-toggle { transform: rotate(90deg); color: #007bff; }
/* Hide admin-only remove buttons on public frontend */
.faq-remove,
.accord-remove { display: none; }
.faq-answer,
.accord-inner-text {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    background-color: #fff;
}
.faq-item.active .faq-answer,
.accord-item.active .accord-inner-text { padding: 15px 20px; max-height: 1000px; }
.faq-answer p,
.accord-inner-text p { margin: 0; color: #555; line-height: 1.6; }


/* =============================================================================
   Structured Section Styles (legacy .structured-section class)
   ============================================================================= */
.structured-section { display: block; width: 100%; box-sizing: border-box; }
.structured-section .section-content-wrapper { width: 100%; }
.structured-section .section-content-wrapper h1,
.structured-section .section-content-wrapper h2,
.structured-section .section-content-wrapper h3,
.structured-section .section-content-wrapper h4,
.structured-section .section-content-wrapper h5,
.structured-section .section-content-wrapper h6 { margin-top: 0; margin-bottom: 15px; color: #333; font-weight: 600; }
.structured-section .section-content-wrapper p { margin: 0 0 15px 0; line-height: 1.6; color: #555; }
.structured-section .section-content-wrapper p:last-child { margin-bottom: 0; }
.structured-section .section-content-wrapper ul,
.structured-section .section-content-wrapper ol { margin: 15px 0; padding-left: 25px; }
.structured-section .section-content-wrapper li { margin: 5px 0; line-height: 1.6; }
.structured-section .section-content-wrapper img { max-width: 100%; height: auto; margin: 15px 0; border-radius: 5px; }
.structured-section .section-content-wrapper a { color: #007bff; text-decoration: none; }
.structured-section .section-content-wrapper a:hover { text-decoration: underline; }
.structured-section .container { width: 100%; max-width: 1200px; margin-left: auto; margin-right: auto; padding-left: 15px; padding-right: 15px; box-sizing: border-box; }
.structured-section .container-fluid { width: 100%; padding-left: 15px; padding-right: 15px; box-sizing: border-box; }


/* =============================================================================
   Article Template Styles
   ============================================================================= */
.article-template { display: block; width: 100%; box-sizing: border-box; margin: 20px 0; }
.article-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; box-sizing: border-box; }
.article-wrapper { display: flex; gap: 30px; align-items: flex-start; box-sizing: border-box; }
.article-wrapper .article-main-content { flex: 1; min-width: 0; }
.article-wrapper .article-sidebar { flex: 0 0 300px; min-width: 0; }
.article-header { margin-bottom: 30px; padding-bottom: 20px; border-bottom: 2px solid #e0e0e0; }
.article-title { margin: 0 0 15px 0; font-size: 36px; font-weight: 700; color: #333; line-height: 1.2; }
.article-meta { display: flex; gap: 20px; flex-wrap: wrap; font-size: 14px; color: #666; }
.article-meta .article-author { font-weight: 600; color: #007bff; }
.article-meta .article-date { color: #999; }
.article-section { margin-bottom: 40px; padding-bottom: 30px; border-bottom: 1px solid #f0f0f0; }
.article-section:last-of-type { border-bottom: none; margin-bottom: 0; }
.article-section h2, .article-section h3, .article-section h4 { margin-top: 0; margin-bottom: 20px; color: #333; font-weight: 600; }
.article-section h2 { font-size: 28px; }
.article-section h3 { font-size: 24px; }
.article-section p { margin: 0 0 20px 0; line-height: 1.8; color: #555; font-size: 16px; }
.article-section p:last-child { margin-bottom: 0; }
.article-section ul, .article-section ol { margin: 20px 0; padding-left: 30px; line-height: 1.8; }
.article-section li { margin: 10px 0; color: #555; }
.article-section img { max-width: 100%; height: auto; margin: 25px 0; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.article-section blockquote { margin: 25px 0; padding: 20px 25px; border-left: 4px solid #007bff; background-color: #f8f9fa; font-style: italic; color: #555; }
.article-sidebar { background-color: #f9f9f9; border: 1px solid #e0e0e0; border-radius: 8px; padding: 20px; }
.sidebar-widget { margin-bottom: 25px; }
.sidebar-widget:last-child { margin-bottom: 0; }
.sidebar-widget h3 { margin: 0 0 15px 0; font-size: 18px; font-weight: 600; color: #333; }
.sidebar-widget p { margin: 0 0 15px 0; line-height: 1.6; color: #666; font-size: 14px; }
.article-footer { margin-top: 40px; padding-top: 30px; border-top: 2px solid #e0e0e0; }
.article-tags { margin: 0 0 15px 0; font-size: 14px; color: #666; }
.article-tags span { display: inline-block; margin-right: 8px; padding: 4px 12px; background-color: #f0f0f0; border-radius: 15px; color: #555; font-size: 12px; }

@media (max-width: 992px) {
    .article-wrapper { flex-direction: column; }
    .article-wrapper .article-sidebar { flex: 1; width: 100%; margin-top: 30px; }
    .article-title { font-size: 28px; }
    .article-section h2 { font-size: 24px; }
}
@media (max-width: 768px) {
    .article-container { padding: 0 15px; }
    .article-title { font-size: 24px; }
    .article-section { margin-bottom: 30px; }
    .article-section h2 { font-size: 20px; }
    .article-section p { font-size: 15px; }
    .article-footer { margin-top: 30px; }
}


/* =============================================================================
   Callout / Note / Warning Block Styles
   ============================================================================= */
.callout-block,
.note-block,
.warning-block {
    margin: 20px 0;
    border-radius: 8px;
    border-left: 4px solid;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}
.callout-block { background-color: #e7f3ff; border-left-color: #2196F3; }
.note-block    { background-color: #fff9e6; border-left-color: #ff9800; }
.warning-block { background-color: #ffebee; border-left-color: #f44336; }
.callout-header { display: flex; align-items: center; padding: 15px 20px; border-bottom: 1px solid rgba(0,0,0,0.08); }
.callout-block  .callout-header { background-color: rgba(33,150,243,0.1); }
.note-block     .callout-header { background-color: rgba(255,152,0,0.1); }
.warning-block  .callout-header { background-color: rgba(244,67,54,0.1); }
.callout-icon { font-size: 24px; margin-right: 12px; line-height: 1; display: inline-block; width: 24px; height: 24px; text-align: center; }
.callout-icon.callout-icon-info::before   { content: "ℹ"; font-size: 20px; font-weight: bold; color: #1976D2; font-style: normal; }
.callout-icon.callout-icon-note::before   { content: "N"; font-size: 18px; font-weight: bold; color: #F57C00; }
.callout-icon.callout-icon-warning::before{ content: "!"; font-size: 20px; font-weight: bold; color: #C62828; }
.callout-title { margin: 0; font-size: 18px; font-weight: 600; color: #333; flex: 1; }
.callout-block  .callout-title { color: #1976D2; }
.note-block     .callout-title { color: #F57C00; }
.warning-block  .callout-title { color: #C62828; }
.callout-content { padding: 20px; }
.callout-content p { margin: 0 0 15px 0; line-height: 1.7; color: #555; font-size: 15px; }
.callout-content p:last-child { margin-bottom: 0; }
.callout-content h1, .callout-content h2, .callout-content h3,
.callout-content h4, .callout-content h5, .callout-content h6 { margin-top: 0; margin-bottom: 15px; color: #333; font-weight: 600; }
.callout-content ul, .callout-content ol { margin: 15px 0; padding-left: 25px; }
.callout-content li { margin: 8px 0; line-height: 1.7; color: #555; }
.callout-content img { max-width: 100%; height: auto; margin: 15px 0; border-radius: 5px; }
.callout-content a { color: #007bff; text-decoration: none; font-weight: 500; }
.callout-content a:hover { text-decoration: underline; }
.callout-content code { background-color: rgba(0,0,0,0.05); padding: 2px 6px; border-radius: 3px; font-family: monospace; font-size: 14px; }
.callout-content pre { background-color: rgba(0,0,0,0.05); padding: 15px; border-radius: 5px; overflow-x: auto; }
.callout-content pre code { background-color: transparent; padding: 0; }

@media (max-width: 768px) {
    .callout-header { padding: 12px 15px; }
    .callout-icon { font-size: 20px; margin-right: 10px; }
    .callout-title { font-size: 16px; }
    .callout-content { padding: 15px; }
    .callout-content p { font-size: 14px; }
}
