/* =====================================================================
 * components/accordion.css — FAQ accordion (and any future
 * [data-accordion] group).
 *
 * Markup is native <details>/<summary>, so every answer is fully
 * readable and keyboard-operable WITHOUT JavaScript (graceful
 * degradation, CLAUDE.md "content works without the enhancement layer").
 * The smooth open/close animation + single-open behaviour are layered
 * on by js/components/accordion.js using the already-global GSAP — they
 * are pure enhancement.
 *
 * Tokens / currentColor only. No hex literals (hex audit stays clean).
 * ===================================================================== */

.accordion {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.accordion__item {
    background-color: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* <summary> is the trigger. Hide the native disclosure marker in every
   engine; the rotating chevron below is our indicator. */
.accordion__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    width: 100%;
    padding: var(--space-4) var(--space-5);
    text-align: left;
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    line-height: var(--lh-snug, 1.3);
    color: var(--color-text);
    cursor: pointer;
    list-style: none;
    transition: background-color var(--transition-fast),
                color var(--transition-fast);
}

/* WebKit/Blink older marker + standards ::marker, both suppressed. */
.accordion__trigger::-webkit-details-marker { display: none; }
.accordion__trigger::marker { content: ''; }

.accordion__trigger:hover {
    background-color: var(--color-surface);
    color: var(--color-primary);
}

.accordion__trigger:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: -2px;
}

.accordion__question {
    flex: 1 1 auto;
}

.accordion__icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--color-accent);
    transition: transform var(--transition-base);
    flex-shrink: 0;
}

/* Rotate the chevron when the <details> is open. Works natively (no JS):
   it is bound to the [open] attribute the browser toggles. */
.accordion__item[open] .accordion__icon {
    transform: rotate(180deg);
}

/* The panel is clipped so the JS height tween reads cleanly. Without JS,
   the browser simply shows/hides this when [open] toggles — no height is
   set, so it renders at natural height. */
.accordion__panel {
    overflow: hidden;
}

.accordion__body {
    padding: var(--space-4) var(--space-5);
    color: var(--color-text-muted);
    line-height: var(--lh-relaxed);
}
