/* ============================================================
   FAQ page — /faq
   Colors come from abcubed-luxury.css variables so :root.light swaps them.
   ============================================================ */

:root {
    --faq-rule: color-mix(in srgb, var(--smoke) 12%, transparent);
}

/* ── Hero ─────────────────────────────────────────────────── */
/* The shared .page-header.section-padding is 100px top and bottom (plus the container's pt-100,
   which clears the absolute navbar). The FAQ hero is a compact lead-in to the search bar, and the
   bar flows straight into the topic tabs, so both are trimmed here. */
.page-header.section-padding.faq-hero {
    padding-top: 40px;
    padding-bottom: 40px;
}

.faq-title {
    font-size: clamp(2.8rem, 6vw, 5.2rem);
    line-height: 1.05;
}

.faq-intro {
    max-width: 560px;
    margin: 1.5rem auto 0;
}

.faq-search {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 640px;
    margin: 2.5rem auto 0;
    background: var(--ink-2);
    border: 1px solid var(--gold-line);
}

.faq-search:focus-within {
    border-color: var(--gold);
}

.faq-search__icon {
    flex-shrink: 0;
    margin-left: 1.25rem;
    color: var(--ash);
}

.faq-search__input {
    flex: 1;
    min-width: 0;
    height: 56px;
    padding: 0 1rem;
    background: transparent;
    border: 0;
    border-radius: 0;
    color: var(--smoke);
    font-family: var(--body);
    font-size: 16px;
    font-weight: 300;
}

.faq-search__input:focus {
    outline: none;
}

.faq-search__input::placeholder {
    color: var(--ash);
}

/* Native clear button is replaced by .faq-search__clear (same "+ rotated 45°" icon as an open question). */
.faq-search__input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

.faq-search__clear {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-right: 0.25rem;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    color: var(--gold);
    cursor: pointer;
}

.faq-search__clear[hidden] {
    display: none;
}

.faq-search__clear:hover {
    color: var(--gold-2);
}

.faq-search__clear:focus-visible {
    outline: 1px solid var(--gold);
    outline-offset: -6px;
}

.faq-search__clear-icon {
    transform: rotate(45deg);
}

/* ── Topic tabs ───────────────────────────────────────────── */
.faq-tabs-bar {
    border-bottom: 1px solid var(--faq-rule);
}

.faq-tabs {
    display: flex;
    gap: 2.25rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.faq-tabs::-webkit-scrollbar {
    display: none;
}

/* Centered when the tabs fit; auto margins (unlike justify-content: center) keep the
   first tab reachable when the row overflows and scrolls on narrow screens. */
.faq-tab:first-child {
    margin-left: auto;
}

.faq-tab:last-child {
    margin-right: auto;
}

.faq-tab {
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 52px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    color: var(--ash);
    font-family: var(--body);
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
}

.faq-tab:hover {
    color: var(--smoke);
}

.faq-tab[aria-pressed="true"] {
    color: var(--gold);
}

.faq-tab[aria-pressed="true"]::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 1px;
    background: var(--gold);
}

.faq-tab:focus-visible {
    outline: 1px solid var(--gold);
    outline-offset: -3px;
}

/* Trim the label's box to cap height and baseline so flex centring lines up with the visible text. */
.faq-tab > span:not(.faq-tab__count) {
    text-box: trim-both cap alphabetic;
}

/* Dots are hidden by default and only appear while searching (.is-searching is set by faq.js). */
.faq-tab__count {
    display: none;
    flex-shrink: 0;
    align-self: center;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold);
    transform: translateY(0.15em);
}

/* Show a dot only on tabs that have a matching question. */
.faq-tabs.is-searching .faq-tab__count:not(.is-empty) {
    display: block;
}

/* While searching, tabs with no matching question are muted. */
.faq-tabs.is-searching .faq-tab.is-muted {
    opacity: 0.35;
}

/* ── Groups & questions ───────────────────────────────────── */
.faq-body {
    padding-bottom: 5rem;
}

.faq-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 4rem;
    padding: 2.5rem 0;
    border-top: 1px solid var(--faq-rule);
}

.faq-group.is-first {
    border-top-color: transparent;
}

.faq-group[hidden] {
    display: none;
}

.faq-group__label {
    flex: 1 1 220px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-top: 1rem;
}

.faq-group__title {
    margin: 0;
    font-family: var(--body);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--smoke);
}

.faq-group__count {
    font-size: 14px;
    color: var(--ash);
}

.faq-group__items {
    flex: 999 1 560px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.faq-q {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 56px;
    padding: 1rem 0;
    list-style: none;
    cursor: pointer;
    font-family: var(--body);
    font-size: 18px;
    font-weight: 400;
    line-height: 1.45;
    color: var(--smoke);
}

.faq-q::-webkit-details-marker {
    display: none;
}

.faq-q:hover,
.faq-item[open] > .faq-q {
    color: var(--gold);
}

.faq-q:focus-visible {
    outline: 1px solid var(--gold);
    outline-offset: 3px;
}

.faq-q__icon {
    flex-shrink: 0;
}

.faq-item[open] .faq-q__icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 2.5rem 1rem 0;
}

.faq-answer p {
    max-width: 640px;
    margin: 0;
    font-size: 16px;
    line-height: 1.7;
    color: var(--ash);
}

.faq-answer p + p {
    margin-top: 1rem;
}

.faq-answer a {
    color: var(--gold);
}

.faq-answer a:hover {
    color: var(--gold-2);
}

/* ── Answer rich text ─────────────────────────────────────── */
/* :not(:first-child) outranks the shipped `.faq-answer p { margin: 0 }` so every block keeps the p + p rhythm */
.faq-answer > :not(:first-child) {
    margin-top: 1rem;
}

.faq-answer h3 {
    max-width: 640px;
    margin-bottom: 0;
    font-family: var(--body);
    font-size: 17px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--smoke);
}

.faq-answer > h3:not(:first-child) {
    margin-top: 1.5rem;
}

.faq-answer > h3 + :not(:first-child) {
    margin-top: 0.5rem;
}

.faq-answer ul,
.faq-answer ol {
    max-width: 640px;
    margin-bottom: 0;
    padding-left: 1.25rem;
}

.faq-answer ul {
    list-style: disc;
}

.faq-answer ol {
    list-style: decimal;
}

.faq-answer ul ul {
    list-style: circle;
}

.faq-answer li {
    list-style: inherit;
    font-size: 16px;
    line-height: 1.7;
    color: var(--ash);
}

.faq-answer li + li {
    margin-top: 0.35rem;
}

.faq-answer li::marker {
    color: var(--gold);
}

.faq-answer li.lex-nested-listitem {
    list-style: none;
}

.faq-answer li > ul,
.faq-answer li > ol {
    margin-top: 0.35rem;
}

.faq-answer strong,
.faq-answer b {
    font-weight: 600;
    color: var(--smoke);
}

.faq-answer em,
.faq-answer i {
    font-style: italic;
}

.faq-answer u,
.faq-answer .lex-underline {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.faq-answer s,
.faq-answer .lex-strikethrough {
    text-decoration: line-through;
}

.faq-answer .lex-underline-strikethrough {
    text-decoration: underline line-through;
    text-underline-offset: 3px;
}

.faq-answer sup,
.faq-answer sub {
    position: relative;
    font-size: 0.75em;
    line-height: 0;
    vertical-align: baseline;
}

.faq-answer sup {
    top: -0.5em;
}

.faq-answer sub {
    bottom: -0.25em;
}

.faq-answer a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.faq-answer a:focus-visible {
    outline: 1px solid var(--gold);
    outline-offset: 2px;
}

/* ── Empty state ──────────────────────────────────────────── */
.faq-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 5rem 0;
    text-align: center;
}

.faq-empty[hidden] {
    display: none;
}

.faq-empty__text {
    margin: 0;
    font-size: 18px;
    color: var(--smoke);
}

/* ── CTA ──────────────────────────────────────────────────── */
.faq-cta {
    border-top: 1px solid var(--gold-line);
    border-bottom: 1px solid var(--gold-line);
}

.faq-cta__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
}

.faq-cta__copy {
    flex: 1 1 420px;
}

.faq-cta__copy .body-text {
    max-width: 520px;
}

.faq-cta__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ── Motion ───────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
    .faq-tab,
    .faq-q {
        transition: color 0.2s ease;
    }

    .faq-q__icon {
        transition: transform 0.25s ease;
    }

    /*
     * The panel itself toggles instantly; only the answer fades and rises in on open.
     * Opacity/transform stay on the compositor. Animating the panel's height instead re-ran layout
     * for everything below it on every frame (twice over, since `name="faq"` closes another item at
     * the same moment), which is what made the accordion lag.
     */
    .faq-item[open] > .faq-answer {
        animation: faq-answer-in 0.28s cubic-bezier(0.23, 1, 0.32, 1);
    }
}

@keyframes faq-answer-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Small screens ────────────────────────────────────────── */
@media (max-width: 767.98px) {
    .faq-body > .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .faq-group {
        padding: 2rem 0;
    }

    .faq-answer {
        padding-right: 0;
    }

    .faq-q {
        font-size: 17px;
    }
}

/* ── Swipeable tab row (phones and small tablets; below the desktop breakpoint) ── */
@media (max-width: 991.98px) {
    /* Fades an edge while tabs are off-screen on that side (has-more = right, has-less = left; set by faq.js).
       The left edge is never faded at the start, so "All questions" stays fully visible there. */
    .faq-tabs.has-more:not(.has-less) {
        -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 96px), transparent);
        mask-image: linear-gradient(to right, #000 calc(100% - 96px), transparent);
    }

    .faq-tabs.has-less:not(.has-more) {
        -webkit-mask-image: linear-gradient(to right, transparent, #000 96px);
        mask-image: linear-gradient(to right, transparent, #000 96px);
    }

    .faq-tabs.has-less.has-more {
        -webkit-mask-image: linear-gradient(to right, transparent, #000 96px, #000 calc(100% - 96px), transparent);
        mask-image: linear-gradient(to right, transparent, #000 96px, #000 calc(100% - 96px), transparent);
    }
}
