/* ============================================================
   FAQ CONTENT
   BEM block: faq
   ============================================================ */

/* ---- LAYOUT ---- */

.faq {
    padding: 100px 120px 0 120px;
    background: #fff;
    overflow-x: clip;
}

.faq__inner {
    display: flex;
    gap: 64px;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
}

/* ---- SIDEBAR ---- */

.faq__sidebar {
    width: 360px;
    flex-shrink: 0;
    position: sticky;
    top: 148px;
    align-self: flex-start;
}

.faq__sidebar-img {
    width: 100%;
    overflow: hidden;
}

.faq__sidebar-img img {
    display: block;
    width: 100%;
    height: auto;
}

.faq__sidebar-toc {
    background: var(--color-bg-light);
    padding: 24px 32px 32px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq__sidebar-title {
    font-family: var(--font-neo);
    font-size: 32px;
    line-height: 38px;
    letter-spacing: -1px;
    color: #000;
    margin: 0;
}

.faq__toc-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq__toc-nav a {
    font-family: var(--font-inter);
    font-size: 14px;
    line-height: 22px;
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.faq__toc-nav a::before {
    content: '';
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    border-radius: 2px;
    background: var(--color-primary);
    position: relative;
    top: -1px;
}

.faq__toc-nav a:hover {
    opacity: 0.75;
}

.faq__sidebar-help {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
}

.faq__help-label {
    font-family: var(--font-inter);
    font-size: 14px;
    line-height: 22px;
    color: var(--color-text-muted);
    margin: 0;
}

/* ---- MAIN ---- */

.faq__main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 44px;
}

/* ---- GROUP ---- */

.faq__group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-margin-top: 130px;
}

.faq__group-header {
    display: flex;
    align-items: center;
    gap: 24px;
}

.faq__group-dot {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    background: var(--color-primary);
    border-radius: 2px;
}

.faq__group-title {
    font-family: var(--font-neo);
    font-size: 48px;
    line-height: 58px;
    letter-spacing: -1.8px;
    color: var(--color-primary);
    margin: 0;
}

/* ---- ACCORDION ---- */

.faq__list {
    display: flex;
    flex-direction: column;
}

.faq__item {
    border-bottom: 1px solid var(--color-divider);
}

.faq__item:first-child {
    border-top: none;
}

.faq__question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 0;
    font-family: var(--font-neo);
    font-size: 24px;
    line-height: 28px;
    color: #000;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.faq__question::-webkit-details-marker {
    display: none;
}

.faq__item[open] > .faq__question {
    color: #000;
}

/* Closed state: grey title */
.faq__item:not([open]) > .faq__question {
    color: var(--color-text-muted);
}

/* Hover on closed item */
.faq__item:not([open]) > .faq__question:hover {
    color: #000;
    background: var(--color-bg-light);
}

/* Arrow icon — uses mask so color changes via background-color */
.faq__question::after {
    content: '';
    flex-shrink: 0;
    width: 32px;
    height: 16px;
    -webkit-mask-image: url('../assets/icons/arrow-accordion.svg');
    mask-image: url('../assets/icons/arrow-accordion.svg');
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
    /* closed = grey, rotated 180° (chevron pointing down) */
    background-color: #5f5f5f;
    transform: rotate(180deg);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.faq__item[open] > .faq__question::after {
    /* open = green, chevron pointing up (original orientation) */
    background-color: var(--color-primary);
    transform: rotate(0deg);
}

.faq__answer {
    display: flex;
    gap: 32px;
    padding-bottom: 32px;
}

/* Green left bar */
.faq__answer::before {
    content: '';
    flex-shrink: 0;
    width: 3px;
    background: var(--color-primary);
    border-radius: 2px;
    align-self: stretch;
}

.faq__answer p {
    font-family: var(--font-inter);
    font-size: 19px;
    font-weight: 400;
    line-height: 30px;
    color: #000;
    opacity: 0.7;
    margin: 0;
}

/* ==============================
   Responsive
   ============================== */

@media (max-width: 1170px) {
    .faq {
        padding: 0;
    }

    .faq__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        max-width: 100%;
    }

    .faq__sidebar {
        width: 100%;
        position: static;
    }

    .faq__sidebar-toc {
        padding: 32px 24px;
    }

    .faq__sidebar-title {
        font-size: 32px;
        line-height: 37px;
        letter-spacing: 0;
    }

    .faq__main {
        padding: 32px 24px;
        gap: 48px;
    }

    .faq__group-dot {
        width: 12px;
        height: 12px;
    }

    .faq__group-title {
        font-size: 32px;
        line-height: 37px;
        letter-spacing: 0;
    }

    .faq__question {
        font-size: 18px;
        line-height: normal;
        padding: 20px 0;
    }

    .faq__answer p {
        font-size: 14px;
        line-height: 22px;
    }
}
