/* ==========================================================================
   GERMAN-A0-STORY.CSS — scoped styles for german-a0-story.html, the hub page for the
   ten-chapter A0 story. Same format as german-a1-stories-path-story-1.html: a hero card with
   a translation toggle, then each chapter as a .story-chapter preview
   card (eyebrow, level tag, flowing .gl-story/.gl-gloss text) linking out
   to its own lesson page (a0-chapterN-lesson.html) with the Quick Check.
   .gl-page/.gl-back-link/.gl-story/.gl-gloss/.gl-level-tag come from
   grammar-lesson.css; .card/.card-badge come from see-test.css.

   This file also re-themes the whole page with its own independent copy
   of the "modern Bauhaus" tokens (same values as german-a1-stories-path-story-1.css/
   german-a0-100-most-common-words.css) — same pattern german-a1-stories-path-story-1.css already uses for its
   own page. Uses "html:root" rather than plain ":root" for the override
   — see a1-highlights.css for why that extra specificity is worth the
   insurance.
   ========================================================================== */

html:root {
    --bg: #f7f2e7;
    --surface: #ffffff;
    --surface-2: #fbf7ee;
    --ink: #191726;
    --ink-soft: #5a5470;
    --ink-faint: #9089a3;
    --accent: #e0432b;
    --accent-2: #c23621;
    --accent-soft: rgba(224, 67, 43, 0.12);
    --gold: #b4870a;
    --gold-soft: rgba(239, 176, 0, 0.18);
    --line: #e7dec7;
    --line-strong: #d8cba8;

    --shadow-sm: 0 1px 2px rgba(25, 23, 38, 0.06), 0 1px 1px rgba(25, 23, 38, 0.04);
    --shadow-md: 0 10px 24px -8px rgba(25, 23, 38, 0.16), 0 2px 8px -2px rgba(25, 23, 38, 0.06);
    --shadow-lg: 0 0 0 1px rgba(25, 23, 38, 0.04), 0 16px 40px -16px rgba(224, 67, 43, 0.28);

    --serif: "Futura", "Avenir Next", Avenir, "Century Gothic", system-ui, sans-serif;

    --color-nom: #1d5fa6; --color-nom-bg: #e5eef8;
    --color-acc: #e0432b; --color-acc-bg: #fbe7e3;
    --color-irr: #b4870a; --color-irr-bg: #faf1d6;
    --color-coo: #0f7168; --color-coo-bg: #e2f2f0;
    --color-sub: #6c4ba6; --color-sub-bg: #eee8f7;
    --color-neg: #b8355f; --color-neg-bg: #f8e5eb;
}

@media (prefers-color-scheme: dark) {
    html:root {
        --bg: #131220;
        --surface: #1c1a2c;
        --surface-2: #211f34;
        --ink: #f3eee1;
        --ink-soft: #b3abc9;
        --ink-faint: #867f9c;
        --accent: #ff5b41;
        --accent-2: #ff7b62;
        --accent-soft: rgba(255, 91, 65, 0.16);
        --gold: #ffcb3d;
        --gold-soft: rgba(255, 203, 61, 0.18);
        --line: #33304a;
        --line-strong: #413c5c;

        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 10px 28px -10px rgba(0, 0, 0, 0.55);
        --shadow-lg: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 16px 44px -16px rgba(255, 91, 65, 0.35);

        --color-nom: #5b98e8; --color-nom-bg: rgba(91, 152, 232, 0.16);
        --color-acc: #ff5b41; --color-acc-bg: rgba(255, 91, 65, 0.16);
        --color-irr: #ffcb3d; --color-irr-bg: rgba(255, 203, 61, 0.18);
        --color-coo: #2fb6a8; --color-coo-bg: rgba(47, 182, 168, 0.16);
        --color-sub: #9a7bd6; --color-sub-bg: rgba(154, 123, 214, 0.18);
        --color-neg: #e06a94; --color-neg-bg: rgba(224, 106, 148, 0.18);
    }
}

/* ================= NAVBAR (redesigned, scoped to this page only) ================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.story-page {
    padding-top: 88px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.brand-mark {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
}

.brand-word {
    font-family: var(--serif);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.01em;
    color: var(--ink);
}

.brand-word b {
    color: var(--accent);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.nav-links > a {
    font-family: var(--mono);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-decoration: none;
    padding: 9px 14px;
    border-radius: 8px;
    color: var(--ink-soft);
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-links > a:hover {
    background: var(--surface-2);
    color: var(--ink);
}

.navbar .dropdown-item {
    position: relative;
}

.navbar .dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-family: var(--mono);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 9px 14px;
    border-radius: 8px;
    color: var(--ink-soft);
    text-decoration: none;
    border: none;
    background: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.navbar .dropdown-trigger:hover,
.navbar .dropdown-item.open .dropdown-trigger {
    background: var(--surface-2);
    color: var(--ink);
}

.navbar .dropdown-trigger.active {
    color: var(--accent);
}

.navbar .caret {
    transition: transform 0.18s ease;
    font-size: 0.7em;
}

.navbar .dropdown-item.open .caret {
    transform: rotate(180deg);
}

.navbar .dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 230px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-md);
    padding: 14px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
    overflow: hidden;
}

/* Vibrant Bauhaus accent strip across the top of the popup — same three
   primaries used throughout the site's topic-color system (matches
   german-courses-page.html). */
.navbar .dropdown-menu::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--gold), var(--color-nom));
}

.navbar .dropdown-item.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.navbar .dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--ink-soft);
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.navbar .dropdown-menu a:hover {
    background: var(--surface-2);
    color: var(--ink);
    transform: translateX(2px);
}

/* --- Language flag swatches + "Soon" badges (matches german-courses-page.html) --- */
.dropdown-flag {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.15s ease;
}

.dropdown-flag-es {
    background: linear-gradient(to bottom, #c60b1e 0 25%, #ffc400 25% 75%, #c60b1e 75% 100%);
}

.dropdown-flag-fr {
    background: linear-gradient(to right, #0055a4 0 33.33%, #ffffff 33.33% 66.66%, #ef4135 66.66% 100%);
}

.navbar .dropdown-menu a:hover .dropdown-flag-es {
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1), 0 0 0 3px var(--color-acc-bg);
}

.navbar .dropdown-menu a:hover .dropdown-flag-fr {
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1), 0 0 0 3px var(--color-nom-bg);
}

.dropdown-lang-name {
    flex: 1;
}

.dropdown-soon-badge {
    font-family: var(--mono);
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gold);
    background: var(--gold-soft);
    padding: 3px 7px;
    border-radius: 999px;
    flex-shrink: 0;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    width: 22px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

@media (max-width: 860px) {
    .nav-links {
        position: fixed;
        inset: 60px 0 auto 0;
        background: var(--surface);
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow-md);
        transform: translateY(-8px);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
        gap: 2px;
    }

    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-links > a,
    .navbar .dropdown-trigger {
        width: 100%;
    }

    .navbar .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        padding-left: 14px;
        margin-top: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
    }

    /* The gradient strip is positioned relative to the popup's own box —
       once that box goes position:static for the mobile stacked layout,
       there's no floating panel left for it to sit across, so drop it. */
    .navbar .dropdown-menu::before {
        display: none;
    }

    .navbar .dropdown-item.open .dropdown-menu {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }
}

/* ================= HERO ================= */
.story-hero-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 52px 32px 38px;
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
}

.story-hero-card::before,
.story-hero-card::after {
    content: "";
    position: absolute;
    z-index: -1;
    border-radius: 50%;
}

.story-hero-card::before {
    width: 260px;
    height: 260px;
    right: -90px;
    top: -100px;
    background: radial-gradient(circle at 30% 30%, var(--gold), transparent 70%);
    opacity: 0.5;
}

.story-hero-card::after {
    width: 170px;
    height: 170px;
    right: 70px;
    top: 110px;
    border: 24px solid var(--color-nom);
    opacity: 0.14;
}

.story-hero-card > .card-badge {
    position: static;
    display: inline-flex;
    margin: 0 0 14px;
}

.story-hero-card h1 {
    font-family: var(--serif);
    font-size: clamp(1.9rem, 4.6vw, 2.7rem);
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.06;
    text-wrap: balance;
    color: var(--ink);
    margin: 0 0 10px;
}

.story-hero-sub {
    color: var(--ink-soft);
    font-size: 0.96rem;
    line-height: 1.65;
    max-width: 560px;
    margin: 0 0 22px;
}

.story-hero-sub a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.story-hero-sub a:hover {
    text-decoration: underline;
}

.story-translation-toggle {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--ink);
    background-color: var(--surface);
    color: var(--ink);
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 8px 15px;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.story-translation-toggle:hover {
    transform: translateY(-1px);
    background: var(--ink);
    color: var(--bg);
}

.story-translation-toggle[aria-pressed="false"] {
    border-color: var(--line-strong);
    color: var(--ink-faint);
}

.story-page.translations-hidden .gl-gloss {
    display: none;
}

.story-begins-note {
    text-align: center;
    font-family: var(--mono);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--ink-faint);
    margin: 20px 0 0;
}

/* ================= LOCKED NOTICE =================
   Shown instead of the chapter list until german-a0-story.js finds node 9
   (the Quick Check) in the A0 Grammar Path's localStorage progress. */
.badge-locked {
    background-color: var(--surface-2);
    color: var(--ink-faint);
    border: 1px dashed var(--line-strong);
}

.story-locked-card {
    text-align: center;
    padding: 44px 32px;
}

.story-locked-card > .card-badge {
    position: static;
    display: inline-flex;
    margin: 0 0 6px;
}

.story-locked-card h2 {
    font-family: var(--serif);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--ink);
    margin: 10px 0 8px;
}

.story-locked-card p {
    color: var(--ink-soft);
    font-size: 0.94rem;
    line-height: 1.6;
    max-width: 460px;
    margin: 0 auto 22px;
}

.story-locked-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: #ffffff;
    font-family: var(--mono);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-decoration: none;
    padding: 11px 22px;
    border-radius: 999px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.story-locked-cta:hover {
    transform: translateY(-1px);
    background: var(--accent-2);
    box-shadow: var(--shadow-sm);
}

/* ================= CHAPTER CARDS ================= */
.story-eyebrow {
    display: block;
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-faint);
    margin-bottom: 12px;
    padding-right: 90px;
}

.story-chapter {
    display: block;
    position: relative;
    text-decoration: none;
    color: inherit;
    border-radius: 20px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.story-chapter:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-nom);
}

.story-chapter .gl-level-tag {
    position: absolute;
    top: 30px;
    right: 32px;
    background-color: var(--accent);
    color: #fff;
}

.story-chapter .gl-story {
    font-family: var(--serif);
    font-size: 1.08rem;
    line-height: 1.62;
    font-weight: 500;
    margin: 0 0 10px;
}

.story-chapter .gl-gloss {
    color: var(--ink-soft);
    font-size: 0.83rem;
    line-height: 1.55;
    margin: 0 0 16px;
}

.a0st-hl {
    padding: 1px 5px;
    border-radius: 5px;
    font-weight: 700;
    background: var(--accent-soft);
    color: var(--accent);
}

.story-chapter-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    background: none;
    color: var(--accent);
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0;
    border-radius: 0;
    transition: gap 0.15s ease;
}

.story-chapter:hover .story-chapter-cta {
    gap: 12px;
}

@media (max-width: 560px) {
    .story-chapter .gl-story {
        font-size: 1rem;
    }
}

/* --- Back link: .gl-back-link is shared (grammar-lesson.css), but this
   page redesigns it into a Bauhaus "pill chip" — soft accent-wash pill +
   circled arrow icon, matching the site's badge/pill language — instead
   of the shared component's plain text-link look. This file loads after
   grammar-lesson.css, so these same-specificity rules win via the
   cascade with no !important needed. --- */
.gl-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 999px;
    padding: 6px 16px 6px 6px;
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.gl-back-link-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--accent);
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.gl-back-link:hover {
    background: var(--accent);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.gl-back-link:hover .gl-back-link-icon {
    transform: translateX(-2px);
}
