/* ============================================================
   FAQ page — loaded only on templates/faq.php
   Tokens lifted from Figma (file phVFbha00acATWXQdMOxV0,
   node 5595:1081).
   ============================================================ */

.faq-page {
    --faq-card-bg:       #F8F8F9; /* Light Gray/100 */
    --faq-card-bg-hover: #EFEFF1;
    --faq-text:          #101F29; /* Petrol Dark / Dark Blue/400 */
    --faq-text-muted:    #8D8D91; /* Light Gray/400 */
    --faq-accent:        #0078FF; /* Primary/Vivid Blue */
    --faq-nav-blue:      #0178FF; /* Dark Blue */
    --faq-radius:        16px;
    --faq-gap:           20px;
    padding-top: 64px;     /* hero → content gap from Figma */
    padding-bottom: 80px;
}

/* Match the Figma frame proportions on wide viewports (1920px design).
   Content width in Figma = 228 (sidebar) + 83 (gutter) + 938 (main) = 1249px. */
@media (min-width: 1200px) {
    .faq-page > .container {
        max-width: 1320px;
    }
}

/* ---------- Layout ---------- */

.faq-page .faq-layout {
    display: grid;
    grid-template-columns: 228px 1fr;
    gap: 83px;
    align-items: start;
}

.faq-page .faq-sidebar { position: sticky; top: 100px; }

.faq-page .faq-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.faq-page .faq-cat {
    background: transparent;
    border: 0;
    padding: 0;
    color: var(--faq-text);
    font: 400 18px/1 inherit;
    cursor: pointer;
    text-align: start;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}
.faq-page .faq-cat:focus { outline: none; box-shadow: none; }
.faq-page .faq-cat:focus-visible {
    outline: 2px solid var(--faq-accent);
    outline-offset: 6px;
    border-radius: 4px;
}
.faq-page .faq-cat:hover { opacity: 0.85; }
.faq-page .faq-cat.is-active {
    font-size: 20px;
    font-weight: 700;
}

/* ---------- Main ---------- */

.faq-page .faq-main { min-width: 0; }

.faq-page .faq-main-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
    background: transparent;
    box-shadow: none;
}

.faq-page .faq-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: var(--faq-accent);
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
}
.faq-page .faq-section-icon {
    display: inline-flex;
    width: 24px;
    height: 24px;
    color: inherit;
    flex-shrink: 0;
}
.faq-page .faq-section-icon svg { width: 100%; height: 100%; }

/* ---------- Search ---------- */

.faq-page .faq-search {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--faq-card-bg);
    border-radius: 12px;
    padding: 12px 18px;
    width: min(380px, 100%);
    box-sizing: border-box;
    transition: box-shadow .15s ease;
}
.faq-page .faq-search:focus-within {
    box-shadow: 0 0 0 3px rgba(0, 120, 255, 0.15);
}
.faq-page .faq-search-icon {
    width: 16px; height: 16px;
    color: var(--faq-text-muted);
    flex-shrink: 0;
}
.faq-page .faq-search-input {
    flex: 1;
    background: transparent;
    border: 0;
    border-inline-start: 1px solid #E1E1E3;
    padding-inline-start: 12px;
    outline: none;
    font: 400 14px/1.4 inherit;
    color: var(--faq-text);
    min-width: 0;
}
.faq-page .faq-search-input::placeholder { color: var(--faq-text-muted); }

/* ---------- Accordion ---------- */

.faq-page .faq-list { display: flex; flex-direction: column; gap: var(--faq-gap); }

.faq-page .faq-item {
    background: var(--faq-card-bg);
    border-radius: var(--faq-radius);
    overflow: hidden;
    transition: background-color .15s ease;
}
.faq-page .faq-item:hover     { background: var(--faq-card-bg-hover); }
.faq-page .faq-item.is-hidden { display: none; }

.faq-page .faq-item .faq-item-q {
    position: relative;
    width: 100%;
    background: transparent;
    border: 0;
    padding: 22px !important;          /* equal padding on all four sides */
    display: block;
    cursor: pointer;
    text-align: start;
    color: #101F29;
    font-family: 'iStoria', sans-serif;
    font-size: 18px;
    font-style: normal;
    font-weight: 600 !important;
    line-height: normal;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}
.faq-page .faq-item-q .faq-item-title {
    display: block;
    padding-inline-end: 44px;          /* keep the title clear of the chevron */
    color: #101F29;
    font-family: 'iStoria', sans-serif;
    font-size: 18px;
    font-style: normal;
    font-weight: 600 !important;
    line-height: normal;
}
.faq-page .faq-item-q:focus { outline: none; box-shadow: none; }
.faq-page .faq-item-q:focus-visible {
    outline: 2px solid var(--faq-accent);
    outline-offset: -2px;
}

.faq-page .faq-item-chevron {
    position: absolute;
    top: 50%;
    inset-inline-end: 22px;
    margin-top: -16px;          /* half of the 32px height — vertical center without transform */
    width: 32px; height: 32px;
    border-radius: 50%;
    background: #FFFFFF;
    display: grid;
    place-items: center;
    color: var(--faq-text);
    transition: transform .2s ease;
    pointer-events: none;       /* clicks pass through to the parent button */
}
.faq-page .faq-item-chevron svg { width: 14px; height: 14px; }
.faq-page .faq-item.is-open .faq-item-chevron { transform: rotate(180deg); }

.faq-page .faq-item-a-wrap {
    display: block;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height .3s ease, visibility 0s linear .3s;
}
.faq-page .faq-item.is-open .faq-item-a-wrap {
    max-height: 2000px;
    visibility: visible;
    transition: max-height .3s ease, visibility 0s linear 0s;
}

.faq-page .faq-item-a {
    padding: 0 22px 26px;
    color: var(--faq-text);
    font-size: 15px;
    line-height: 24px;
}
.faq-page .faq-item-a p:last-child { margin-bottom: 0; }

/* ---------- Empty state ---------- */

.faq-page .faq-empty {
    padding: 64px 24px;
    text-align: center;
    color: var(--faq-text-muted);
}
.faq-page .faq-empty-text {
    font-size: 15px;
    margin: 0 0 14px;
}
.faq-page .faq-empty-reset {
    background: var(--faq-accent);
    color: #fff;
    border: 0;
    border-radius: 999px;
    padding: 9px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}
.faq-page .faq-empty-reset:hover { filter: brightness(0.95); }
.faq-page .faq-empty-reset:focus { outline: none; box-shadow: none; }
.faq-page .faq-empty-reset:focus-visible {
    outline: 2px solid var(--faq-text);
    outline-offset: 3px;
}

/* ---------- Mobile ---------- */

@media (max-width: 991.98px) {
    .faq-page .faq-layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .faq-page .faq-sidebar { position: static; order: -1; }
    .faq-page .faq-cat-list {
        flex-direction: row;
        gap: 8px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 6px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .faq-page .faq-cat-list::-webkit-scrollbar { display: none; }
    .faq-page .faq-cat {
        flex: 0 0 auto;
        scroll-snap-align: start;
        padding: 8px 16px;
        border-radius: 999px;
        background: var(--faq-card-bg);
        font-size: 14px;
        font-weight: 600;
        color: var(--faq-text-muted);
    }
    .faq-page .faq-cat.is-active {
        background: var(--faq-accent);
        color: #ffffff;
        font-size: 14px;
    }
    .faq-page .faq-main-head {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }
    .faq-page .faq-search { width: 100%; height: auto; padding: 14px 20px; }
    .faq-page .faq-section-title { font-size: 24px; }
    .faq-page .faq-section-icon { width: 26px; height: 26px; }
    .faq-page .faq-item .faq-item-q { padding: 18px !important; font-size: 16px; }
    .faq-page .faq-item-q .faq-item-title { font-size: 16px; padding-inline-end: 38px; }
    .faq-page .faq-item-chevron { inset-inline-end: 18px; width: 28px; height: 28px; margin-top: -14px; }
    .faq-page .faq-section-title { font-size: 20px; }
    .faq-page .faq-section-icon { width: 22px; height: 22px; }
    .faq-page .faq-item-a { padding: 0 18px 20px; font-size: 14px; line-height: 22px; }
    .faq-page .faq-item-chevron { width: 36px; height: 36px; }
    .faq-page .faq-item-a { padding: 0 22px 26px; font-size: 16px; line-height: 24px; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    .faq-page .faq-item-chevron,
    .faq-page .faq-item-a-wrap,
    .faq-page .faq-item,
    .faq-page .faq-search { transition: none !important; }
}
