/* ==========================================================================
   certana/faq
   Mobil: Überschrift + „Alle anzeigen“ nebeneinander, schlichte Fragen-Karten
          ohne Nummern, nur die ersten n Fragen (Feld „Anzahl auf Smartphones“).
   Ab 1200px: links Überschrift, Einleitung und Bild mit Sprechblase,
             rechts nummeriertes Akkordeon.
   ========================================================================== */

.faq {
    --faq-bg: #f8fbfd;
    padding-block: clamp(3rem, 6vw, 5rem);
    background: var(--faq-bg);
}

.faq__inner {
    display: grid;
    gap: 1.5rem;
}

/* Kopf ------------------------------------------------------------------- */
.faq__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.faq__eyebrow { display: none; margin-bottom: 1rem; }

.faq__title {
    margin: 0;
    font-family: var(--font-serif);
    font-size: clamp(1.75rem, 1.1rem + 2.6vw, 3.5rem);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.015em;
    color: var(--c-ink);
    text-wrap: balance;
}

.faq__lead {
    display: none;
    max-width: 28rem;
    margin: 1.4rem 0 0;
    font-size: clamp(1rem, 0.94rem + 0.3vw, 1.1875rem);
    line-height: 1.6;
    color: var(--c-muted);
}

.faq__all {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex: none;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #3b6fc4;
    text-decoration: none;
    white-space: nowrap;
}
.faq__all .icon { width: 16px; height: 16px; transition: transform 0.2s var(--ease); }
.faq__all:hover { color: var(--c-accent-strong); }
.faq__all:hover .icon { transform: translateX(3px); }
.faq__all--foot { display: none; }

/* Bild nur ab Desktop */
.faq__figure { display: none; }

/* Liste ------------------------------------------------------------------ */
.faq__list {
    display: grid;
    gap: 0.6rem;
    align-content: start;
}

.faq-item {
    background: #fff;
    border: 1px solid rgba(11, 18, 32, 0.06);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(11, 18, 32, 0.03), 0 10px 28px -22px rgba(11, 18, 32, 0.3);
}
.faq-item--desktop-only { display: none; }

.faq-item__heading {
    margin: 0;
    font-family: var(--font-sans);
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: 0;
}

.faq-item__toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1.05rem 1.1rem 1.05rem 1.25rem;
    border: 0;
    border-radius: 14px;
    background: none;
    text-align: left;
    color: var(--c-ink);
    cursor: pointer;
}
.faq-item__toggle:focus-visible { outline-offset: -2px; }

.faq-item__number {
    display: none;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9eef5;
    font-size: 1.0625rem;
    font-weight: 500;
    color: var(--c-ink);
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.faq-item__question {
    flex: 1 1 auto;
    font-size: 0.975rem;
    font-weight: 450;
    line-height: 1.4;
}

.faq-item__toggle .icon--chevron-down {
    flex: none;
    width: 20px;
    height: 20px;
    color: #3d4a5c;
    transition: transform 0.25s var(--ease), color 0.2s var(--ease);
}

/* Geöffnet */
.faq-item__toggle:not(.collapsed) .icon--chevron-down {
    transform: rotate(180deg);
    color: var(--c-accent);
}
.faq-item__toggle:not(.collapsed) .faq-item__number {
    background: var(--c-accent);
    color: #fff;
}
.faq-item__toggle:not(.collapsed) .faq-item__question { font-weight: 550; }
.faq-item__toggle:hover .faq-item__question { color: var(--c-accent-strong); }

.faq-item__answer {
    margin: 0 1rem 1rem;
    padding: 1rem 1.1rem;
    border-radius: 10px;
    background: #fafbfc;
    box-shadow: inset 0 0 0 1px rgba(11, 18, 32, 0.04);
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--c-muted);
}
.faq-item__answer > :last-child { margin-bottom: 0; }
.faq-item__answer a { color: var(--c-ink); text-underline-offset: 3px; }
.faq-item__answer a:hover { color: var(--c-accent-strong); }

/* Smartphone: Kurzüberschrift statt langer Überschrift */
.faq__title-full { display: none; }

/* Tablet: Nummern, Einleitung ------------------------------------------- */
@media (min-width: 768px) {
    .faq__title-full { display: inline; }
    .faq__title-short { display: none; }
    .faq__eyebrow { display: block; }
    .faq__lead { display: block; }
    .faq-item__number { display: inline-flex; }
    .faq-item__toggle { gap: 1.5rem; padding: 1.15rem 1.4rem; }
    .faq-item__question { font-size: 1.125rem; }
    .faq-item__answer { margin: 0 1.4rem 1.4rem; padding: 1.2rem 1.6rem; font-size: 1rem; }
    .faq-item--desktop-only { display: block; }
    .faq__all--head { display: none; }
    .faq__all--foot { display: inline-flex; justify-self: start; margin-top: 0.75rem; }
}

/* Desktop: zweispaltig mit Bild ------------------------------------------ */
@media (min-width: 1200px) {
    .faq__inner {
        grid-template-columns: minmax(0, 30rem) minmax(0, 1fr);
        gap: clamp(2rem, 4vw, 4rem);
        align-items: start;
    }

    .faq__list { gap: 1rem; }

    .faq-item__toggle { gap: 1.75rem; padding: 1.3rem 1.5rem; }
    .faq-item__question { font-size: clamp(1.0625rem, 0.9rem + 0.4vw, 1.25rem); }

    .faq__figure {
        position: relative;
        display: block;
        max-width: 34rem;
        margin: 2.25rem 0 0 calc(-1 * min(var(--gutter), 3.75rem));
    }
    .faq__image {
        display: block;
        width: 100%;
        height: auto;
        -webkit-mask-image: linear-gradient(180deg, #000 82%, transparent 100%);
        mask-image: linear-gradient(180deg, #000 82%, transparent 100%);
    }

    /* Sprechblase */
    .faq__bubble {
        position: absolute;
        top: 15%;
        left: 53%;
        display: flex;
        align-items: flex-start;
        gap: 0.85rem;
        max-width: 15.5rem;
        padding: 1rem 1.15rem;
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 18px 40px -18px rgba(11, 18, 32, 0.35);
        font-size: 0.875rem;
        line-height: 1.4;
        color: var(--c-ink);
    }
    .faq__bubble::after {
        content: "";
        position: absolute;
        left: 1.6rem;
        bottom: -10px;
        border-width: 10px 12px 0 0;
        border-style: solid;
        border-color: #fff transparent transparent transparent;
    }
    .faq__bubble-icon {
        display: inline-flex;
        flex: none;
        color: var(--c-accent);
    }
    .faq__bubble-icon .icon { width: 40px; height: 40px; stroke-width: 1.5; }
    .faq__bubble-body { display: grid; gap: 0.15rem; }
    .faq__bubble-title { font-weight: 600; color: var(--c-ink); }
    .faq__bubble-link { text-decoration: none; }
    .faq__bubble-link:hover { color: var(--c-accent-strong); text-decoration: underline; text-underline-offset: 3px; }
    .faq__bubble-text { color: #3d4452; }
}
