/* ##########################################################
    Website FAQ Page StyleSheet (new design)
    Load after layouts/app.css. That file already provides the shared
    cc- tokens, header, footer, .cc-card, .cc-tag, .cc-link, .cc-section
    and .cc-eyebrow. This file only adds what the FAQ page needs on top.
############################################################# */

/* the `hidden` attribute must win over the display rules below */
.cc-faq-page [hidden] { display: none !important; }

/* ======== 1. Small shared pieces used by this page ======== */
.cc-faq-page .cc-h1 {
    margin-bottom: 24px;
    text-wrap: balance;
    font-family: var(--serif);
    font-weight: 400;
    font-size: 52px;
    line-height: 1.02;
    letter-spacing: -0.02em;
    color: var(--navy);
}

.cc-faq-page .cc-h1 em {
    font-style: normal;
    color: var(--mint-deep);
}

.cc-page-hero {
    padding: var(--section) 0;
    background: var(--cream);
}

/* breadcrumb */
.cc-crumbs {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    list-style: none;
    font-size: 13px;
    color: var(--muted);
}

.cc-crumbs li+li::before {
    content: "/";
    margin-right: 8px;
    color: var(--muted-2);
}
.cc-crumbs a:hover { color: var(--navy); }
.cc-crumbs [aria-current] { color: var(--navy); }

/* search field */
.cc-field-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--muted-2);
    pointer-events: none;
}

.cc-search-input {
    width: 100%;
    height: 48px;
    padding: 0 42px 0 44px;
    border: 1px solid var(--border);
    border-radius: var(--r-btn);
    background: var(--white);
    font-size: 15px;
    color: var(--text);
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}

.cc-search-input:focus { border-color: var(--navy); }
.cc-search-input::placeholder { color: var(--muted-2); }
.cc-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 16px;
    cursor: pointer;
}

.cc-clear:hover {
    background: var(--border);
    color: var(--navy);
}

/* ======== 2. Search in the page hero ======== */
.cc-faq-search {
    position: relative;
    max-width: 560px;
}

/* ======== 3. Topic pills: FAQ (all) + one per topic ======== */
.cc-faq-topics {
    margin: 20px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cc-faq-topic {
    height: 40px;
    padding: 0 8px 0 16px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--white);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.cc-faq-topic:hover { border-color: var(--navy); }
.cc-faq-topic-name {
    font-size: 14px;
    font-weight: 400;
    color: var(--muted);
}

.cc-faq-topic-count {
    min-width: 24px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--cream);
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    color: var(--muted);
}

.cc-faq-topic.active {
    border-color: var(--navy);
    background: var(--navy);
}

.cc-faq-topic.active .cc-faq-topic-name {
    font-weight: 500;
    color: var(--white);
}

.cc-faq-topic.active .cc-faq-topic-count {
    background: var(--navy-3);
    color: var(--white);
}

.cc-faq-topic.empty {
    opacity: 0.45;
    pointer-events: none;
}

/* ======== 4. Questions: one card per topic, both levels open and close ======== */
.cc-faq-group {
    padding: 0;
    overflow: hidden;
}
.cc-faq-group+.cc-faq-group { margin-top: 16px; }

/* topic heading = button that folds the whole topic */
.cc-faq-gh {
    width: 100%;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 0;
    background: var(--white);
    text-align: left;
    cursor: pointer;
}

.cc-faq-gh-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--mint-soft);
    color: var(--mint-deep);
    font-size: 20px;
}

.cc-faq-gh h2 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 22px;
    line-height: 1.25;
    color: var(--navy);
}

.cc-faq-gh-count {
    min-width: 26px;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--cream);
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    color: var(--muted);
}

.cc-faq-gh-chev {
    margin-left: auto;
    display: inline-flex;
    font-size: 20px;
    color: var(--muted);
    transition: transform 0.2s;
}

.cc-faq-group.open .cc-faq-gh { border-bottom: 1px solid var(--border); }
.cc-faq-group.open .cc-faq-gh-chev {
    transform: rotate(180deg);
    color: var(--navy);
}
.cc-faq-group:not(.open) .cc-faq-list { display: none; }

/* questions */
.cc-faq-list { padding: 0 24px; }
.cc-faq-item+.cc-faq-item { border-top: 1px solid var(--border); }

.cc-faq-q {
    width: 100%;
    min-height: 40px;
    padding: 18px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    border: 0;
    background: none;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
    color: var(--navy);
    cursor: pointer;
}

.cc-faq-pm {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--navy);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.cc-faq-pm svg {
    width: 16px;
    height: 16px;
}

.cc-faq-item.open .cc-faq-pm {
    border-color: var(--navy);
    background: var(--navy);
    color: var(--white);
}

.cc-faq-item.open .cc-faq-pm-v { display: none; }
/* answers: tinted panel with a mint edge, so they read apart from the question */
.cc-faq-a {
    display: none;
    margin: 0 48px 20px 0;
    padding: 16px 20px;
    border-left: 3px solid var(--mint-deep);
    border-radius: 0 12px 12px 0;
    background: var(--cream);
    font-size: 15px;
    line-height: 1.65;
    color: #4A4A4A;
}

.cc-faq-item.open .cc-faq-a { display: block; }
.cc-faq-a p+p, .cc-faq-a p+ul, 
.cc-faq-a p+ol, .cc-faq-a ul+p, 
.cc-faq-a ol+p {
    margin-top: 10px;
}

.cc-faq-a ul, .cc-faq-a ol {
    padding-left: 20px;
    display: grid;
    gap: 4px;
}

.cc-faq-a b {
    font-weight: 600;
    color: var(--navy);
}

.cc-faq-a a:not(.cc-link) {
    color: var(--mint-deep);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cc-faq-tags {
    padding-left: 0 !important;
    list-style: none;
    gap: 10px !important;
}

.cc-faq-tags .cc-tag { margin-right: 6px; }

.cc-faq-regs {
    padding-left: 0 !important;
    list-style: none;
    gap: 12px !important;
}

.cc-faq-regs li {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cc-faq-logo {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    padding: 2px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--white);
}

.cc-faq-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

@media (hover: hover) and (pointer: fine) {
    .cc-faq-gh:hover h2, .cc-faq-q:hover {
        color: var(--mint-deep);
    }

    .cc-faq-q:hover .cc-faq-pm {
        border-color: var(--navy);
    }
}

/* nothing matches the search */
.cc-faq-empty {
    padding: 28px;
    text-align: center;
    font-size: 15px;
    color: var(--muted);
}

.cc-faq-empty b {
    display: block;
    margin-bottom: 4px;
    font-family: var(--serif);
    font-weight: 400;
    font-size: 20px;
    color: var(--navy);
}

/* ======== 5. Khmer adjustments ======== */
html[lang="km"] .cc-faq-page .cc-h1,
html[lang="km"] .cc-faq-gh h2,
html[lang="km"] .cc-faq-empty b {
    line-height: 1.4;
    letter-spacing: normal;
}

html[lang="km"] .cc-crumbs {
    letter-spacing: normal;
    text-transform: none;
}

html[lang="km"] .cc-faq-a {
    line-height: 1.8;
}

/* ======== 6. Responsive ======== */
@media (max-width: 1024px) {
    .cc-faq-page .cc-h1 {
        font-size: 44px;
    }

    /* topic pills scroll sideways instead of wrapping */
    .cc-faq-topics {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .cc-faq-topics::-webkit-scrollbar {
        display: none;
    }

    .cc-faq-topic {
        flex-shrink: 0;
        white-space: nowrap;
    }
}

@media (max-width: 640px) {
    .cc-faq-page .cc-h1 {
        font-size: 36px;
    }

    .cc-faq-search {
        max-width: none;
    }

    .cc-clear {
        width: 36px;
        height: 36px;
        right: 6px;
    }

    .cc-faq-topics {
        margin: 16px calc(-1 * var(--gutter)) 0;
        padding: 0 var(--gutter);
    }

    .cc-faq-group+.cc-faq-group {
        margin-top: 12px;
    }

    .cc-faq-gh {
        padding: 16px 20px;
        gap: 12px;
    }

    .cc-faq-gh-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        font-size: 18px;
    }

    .cc-faq-gh h2 {
        font-size: 19px;
    }

    .cc-faq-list {
        padding: 0 20px;
    }

    .cc-faq-q {
        padding: 16px 0;
        font-size: 15px;
    }

    .cc-faq-pm {
        width: 28px;
        height: 28px;
    }

    .cc-faq-a {
        margin: 0 0 18px;
        padding: 14px 16px;
        font-size: 14px;
    }
}