/* ============================================================
   AussieDeutsch — German-themed stylesheet
   Palette: German flag (Black / Red / Gold) + warm parchment
   ============================================================ */

:root {
    /* German flag colours — pure, no muddying */
    --black:   #1a1a1a;
    --red:     #DD0000;
    --gold:    #FFCE00;

    /* Extended palette */
    --black-deep:   #0d0d0d;
    --black-soft:   #2a2a2a;
    --red-dark:     #AA0000;
    --red-mid:      #CC0000;
    --gold-light:   #FFE566;
    --gold-dark:    #C9A800;
    --gold-pale:    #FFF8DC;

    /* Neutrals */
    --parchment:    #FAF6EE;
    --parchment-2:  #F3EDD8;
    --cream:        #FFFDF7;
    --text-dark:    #1C1C1C;
    --text-mid:     #444;
    --text-light:   #777;
    --border:       #E0D8C8;
    --border-strong:#C8BFA0;

    /* White */
    --white: #ffffff;

    /* Fonts */
    --font-fraktur:  'UnifrakturMaguntia', serif;
    --font-display:  'Playfair Display', Georgia, serif;
    --font-body:     'Source Serif 4', Georgia, serif;

    /* Spacing */
    --max-width: 1200px;
    --header-h:  64px;

    /* Shadows */
    --shadow-sm:  0 1px 4px rgba(0,0,0,.08);
    --shadow-md:  0 4px 16px rgba(0,0,0,.12);
    --shadow-lg:  0 8px 32px rgba(0,0,0,.16);

    /* Transitions */
    --ease: .2s ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-dark);
    background: var(--parchment);
}

a { color: var(--red); text-decoration: none; transition: color var(--ease); }
a:hover { color: var(--red-dark); }
img { max-width: 100%; height: auto; display: block; }

h1,h2,h3,h4,h5,h6 {
    font-family: var(--font-display);
    font-weight: 800;
    line-height: 1.2;
    color: var(--black);
    margin: 0 0 .75em;
}
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.1rem; font-weight: 600; }

p { margin: 0 0 1.25em; }
ul, ol { margin: 0 0 1.25em; padding-left: 1.5em; }
li { margin-bottom: .4em; }

strong { font-weight: 700; }

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================================
   GERMAN FLAG STRIPE — decorative top bar (3 equal bands)
   ============================================================ */
body::before {
    content: '';
    display: block;
    height: 6px;
    background: linear-gradient(to right,
        #1a1a1a 0%,     #1a1a1a 33.33%,
        #DD0000 33.33%, #DD0000 66.66%,
        #FFCE00 66.66%, #FFCE00 100%
    );
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

/* ============================================================
   HEADER
   ============================================================ */
#site-header {
    background: var(--black-deep);
    position: sticky;
    top: 6px;
    z-index: 999;
    border-bottom: 3px solid var(--gold);
    box-shadow: 0 2px 12px rgba(0,0,0,.4);
    overflow: visible;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
    gap: 16px;
}

/* ============================================================
   LOGO
   ============================================================ */
.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

/* SVG badge logo */
.logo-badge {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: block;
    border-radius: 3px;
    overflow: hidden;
}

.logo-wordmark {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.logo-top {
    font-family: var(--font-fraktur);
    font-size: 1.05rem;
    color: var(--gold);
    letter-spacing: .02em;
}

.logo-bottom {
    font-family: var(--font-display);
    font-size: .72rem;
    font-weight: 600;
    color: rgba(255,255,255,.55);
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-top: 1px;
}

/* ============================================================
   NAV — top level
   ============================================================ */
.main-nav {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
}

.main-nav > ul {
    display: flex;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    height: var(--header-h);
    align-items: center;
}

.main-nav > ul > li {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.main-nav > ul > li > a {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 9px;
    height: 100%;
    color: #ccc;
    font-family: var(--font-body);
    font-size: .82rem;
    font-weight: 500;
    letter-spacing: .01em;
    white-space: nowrap;
    transition: color var(--ease), background var(--ease);
    border-bottom: 3px solid transparent;
    margin-bottom: -3px; /* sit on the gold border */
}

.main-nav > ul > li > a:hover,
.main-nav > ul > li.active > a,
.main-nav > ul > li:focus-within > a {
    color: var(--gold);
    background: rgba(255,204,0,.07);
    border-bottom-color: var(--gold);
}

/* dropdown caret */
.main-nav > ul > li.has-dropdown > a::after {
    content: '';
    display: inline-block;
    width: 0; height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    opacity: .6;
    margin-left: 2px;
    transition: transform var(--ease);
}

.main-nav > ul > li.has-dropdown:hover > a::after,
.main-nav > ul > li.has-dropdown:focus-within > a::after {
    transform: rotate(180deg);
}

/* ============================================================
   NAV — dropdowns
   ============================================================ */
.nav-dropdown {
    display: none; /* hidden by default — most reliable cross-browser */
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 210px;
    background: var(--black-deep);
    border: 1px solid rgba(255,206,0,.2);
    border-top: 3px solid var(--gold);
    border-radius: 0 0 6px 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,.55);
    padding: 6px 0;
    list-style: none;
    margin: 0;
    z-index: 2000;
    animation: dropIn .15s ease forwards;
}

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.main-nav > ul > li:hover > .nav-dropdown,
.main-nav > ul > li:focus-within > .nav-dropdown {
    display: block;
}

.nav-dropdown li a {
    display: block;
    padding: 9px 18px;
    color: rgba(255,255,255,.72);
    font-family: var(--font-body);
    font-size: .85rem;
    white-space: nowrap;
    transition: background var(--ease), color var(--ease), padding var(--ease);
    border-left: 3px solid transparent;
}

.nav-dropdown li a:hover {
    background: rgba(255,206,0,.08);
    color: var(--gold);
    border-left-color: var(--gold);
    padding-left: 22px;
}

/* ============================================================
   MOBILE TOGGLE
   ============================================================ */
.nav-toggle {
    display: none;
    background: none;
    border: 1px solid rgba(255,204,0,.4);
    color: var(--gold);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    line-height: 1;
}

/* ============================================================
   HERO — clean black with sharp red/gold accents, no olive
   ============================================================ */
.hero {
    position: relative;
    background-color: var(--black-deep);
    background-image:
        radial-gradient(ellipse at 20% 80%, rgba(221,0,0,.22) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 15%, rgba(255,206,0,.14) 0%, transparent 45%);
    color: var(--white);
    padding: 100px 24px 90px;
    text-align: center;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg,
        var(--black-deep) 0%, var(--red) 40%, var(--gold) 100%);
}

.hero-eyebrow {
    display: inline-block;
    background: var(--red);
    color: var(--white);
    font-family: var(--font-body);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    padding: 5px 16px;
    border-radius: 2px;
    margin-bottom: 24px;
}

.hero h1 {
    color: var(--white);
    margin-bottom: .5em;
    text-shadow: 0 2px 12px rgba(0,0,0,.5);
}

.hero h1 em {
    font-style: normal;
    color: var(--gold);
}

.hero p {
    max-width: 640px;
    margin: 0 auto 36px;
    font-size: 1.15rem;
    color: rgba(255,255,255,.8);
    line-height: 1.7;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-block;
    padding: 13px 30px;
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-decoration: none;
    transition: all var(--ease);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--gold);
    color: var(--black-deep);
    box-shadow: 0 4px 16px rgba(255,206,0,.3);
}
.btn-primary:hover {
    background: var(--gold-light);
    color: var(--black-deep);
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(255,206,0,.4);
}

.btn-outline {
    background: transparent;
    color: var(--gold);
    border: 2px solid var(--gold);
}
.btn-outline:hover {
    background: var(--gold);
    color: var(--black-deep);
}

.btn-red {
    background: var(--red);
    color: var(--white);
}
.btn-red:hover {
    background: var(--red-dark);
    color: var(--white);
    transform: translateY(-2px);
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: 72px 0; }

.section-title {
    text-align: center;
    margin-bottom: 48px;
}

.section-title h2 {
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg,
        var(--black) 0%, var(--red) 50%, var(--gold) 100%);
    margin: 12px auto 0;
    border-radius: 2px;
}

.section-title p {
    color: var(--text-mid);
    font-size: 1.05rem;
    max-width: 560px;
    margin: 16px auto 0;
}

/* ============================================================
   FEATURE CARDS
   ============================================================ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-top: 4px solid var(--black);
    border-radius: 6px;
    padding: 32px 28px;
    transition: all var(--ease);
    text-decoration: none;
    color: inherit;
    display: block;
}

.feature-card:hover {
    border-top-color: var(--red);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    color: inherit;
}

.feature-card:nth-child(2n) { border-top-color: var(--red); }
.feature-card:nth-child(3n) { border-top-color: var(--gold-dark); }
.feature-card:nth-child(2n):hover { border-top-color: var(--black); }

.card-icon { font-size: 2.4rem; margin-bottom: 16px; display: block; }
.feature-card h3 { margin-bottom: .4em; font-size: 1.3rem; }
.feature-card p { color: var(--text-mid); font-size: .95rem; margin: 0; line-height: 1.6; }

/* ============================================================
   FEATURED ARTICLES
   ============================================================ */
.articles-list { display: flex; flex-direction: column; gap: 16px; }

.article-row {
    background: var(--white);
    border: 1px solid var(--border);
    border-left: 5px solid var(--red);
    border-radius: 4px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    text-decoration: none;
    color: inherit;
    transition: all var(--ease);
}

.article-row:hover {
    border-left-color: var(--gold-dark);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
    color: inherit;
}

.article-row h3 { margin: 0; font-size: 1.1rem; font-weight: 600; color: var(--text-dark); }

.article-row .cat-badge {
    font-size: .75rem;
    background: var(--parchment-2);
    color: var(--text-mid);
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ============================================================
   BLOG GRID
   ============================================================ */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
}

.post-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    transition: all var(--ease);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.post-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); color: inherit; }
.post-card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }

.post-card .cat-badge {
    font-size: .75rem;
    background: var(--red);
    color: var(--white);
    padding: 3px 10px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 12px;
    align-self: flex-start;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.post-card h2 { font-size: 1.2rem; margin-bottom: .5em; line-height: 1.3; }
.post-card p { color: var(--text-mid); font-size: .95rem; margin: 0; flex: 1; }
.post-card-date { font-size: .8rem; color: var(--text-light); margin-top: 16px; }

/* ============================================================
   SINGLE POST
   ============================================================ */
.post-header {
    background: var(--black-deep);
    background-image: radial-gradient(ellipse at 40% 60%, rgba(221,0,0,.18) 0%, transparent 60%);
    color: var(--white);
    padding: 72px 24px 64px;
    position: relative;
}

.post-header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--black) 0%, var(--red) 50%, var(--gold) 100%);
}

.post-header .cat-badge {
    background: var(--red);
    color: var(--white);
    font-size: .78rem;
    padding: 4px 12px;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: .1em;
    display: inline-block;
    margin-bottom: 20px;
}

.post-header h1 { color: var(--white); }
.post-header .post-meta { color: rgba(255,255,255,.6); font-size: .9rem; margin-top: 16px; }

.post-body { max-width: 760px; margin: 0 auto; padding: 56px 24px 72px; }
.post-body h2 { margin-top: 1.8em; padding-bottom: .3em; border-bottom: 2px solid var(--border); }

.post-body blockquote {
    border-left: 5px solid var(--gold);
    margin: 2em 0;
    padding: 16px 24px;
    background: var(--parchment-2);
    font-style: italic;
    color: var(--text-mid);
}

.post-body code {
    background: var(--parchment-2);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: .9em;
    font-family: monospace;
}

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.breadcrumbs {
    background: var(--parchment-2);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    font-size: .82rem;
    color: var(--text-light);
}

.breadcrumbs a { color: var(--red); }
.breadcrumbs span { margin: 0 8px; }

/* ============================================================
   SIDEBAR LAYOUT
   ============================================================ */
.content-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    align-items: start;
    padding: 56px 0 72px;
}

.sidebar { position: sticky; top: calc(var(--header-h) + 24px); }

.sidebar-widget {
    background: var(--white);
    border: 1px solid var(--border);
    border-top: 4px solid var(--gold-dark);
    border-radius: 6px;
    padding: 24px;
    margin-bottom: 24px;
}

.sidebar-widget h4 {
    margin-bottom: 16px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-mid);
}

.sidebar-widget ul { list-style: none; padding: 0; margin: 0; }
.sidebar-widget li { border-bottom: 1px solid var(--border); }
.sidebar-widget li:last-child { border-bottom: none; }
.sidebar-widget li a {
    display: block;
    padding: 8px 0;
    color: var(--text-dark);
    font-size: .95rem;
    transition: color var(--ease);
}
.sidebar-widget li a:hover { color: var(--red); padding-left: 6px; }

/* ============================================================
   CATEGORY PAGE HEADER
   ============================================================ */
.category-header {
    background: var(--black-soft);
    background-image: radial-gradient(ellipse at 70% 50%, rgba(255,206,0,.08) 0%, transparent 60%);
    color: var(--white);
    padding: 64px 24px 56px;
    text-align: center;
    position: relative;
}

.category-header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--black) 0%, var(--red) 50%, var(--gold) 100%);
}

.category-header h1 { color: var(--white); }
.category-header p { color: rgba(255,255,255,.75); max-width: 560px; margin: 12px auto 0; }

/* ============================================================
   STATIC PAGE
   ============================================================ */
.page-header {
    background: var(--parchment-2);
    border-bottom: 3px solid var(--border-strong);
    padding: 48px 24px;
}

.page-header h1 { margin: 0; }
.page-content { max-width: 800px; padding: 56px 24px 72px; }

/* ============================================================
   CONTACT FORM
   ============================================================ */
.contact-form .form-group { margin-bottom: 24px; }

.contact-form label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }

.contact-form input,
.contact-form textarea,
.contact-form select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 1rem;
    background: var(--white);
    transition: border-color var(--ease);
}

.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-color: var(--gold-dark); }
.contact-form textarea { min-height: 150px; resize: vertical; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    background: var(--black-deep);
    color: rgba(255,255,255,.7);
    margin-top: 80px;
    border-top: 4px solid var(--gold);
}

.footer-inner {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 48px;
    padding: 60px 0 40px;
}

.footer-fraktur {
    font-family: var(--font-fraktur);
    font-size: 3rem;
    color: var(--gold);
    display: block;
    line-height: 1;
    margin-bottom: 12px;
}

.footer-tagline { font-size: .9rem; color: rgba(255,255,255,.5); margin: 0; line-height: 1.5; }

.footer-links h4 {
    color: var(--white);
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: 16px;
    font-family: var(--font-body);
}

.footer-links ul { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: rgba(255,255,255,.55); font-size: .9rem; transition: color var(--ease); }
.footer-links a:hover { color: var(--gold); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    padding: 20px 0;
    text-align: center;
    font-size: .85rem;
    color: rgba(255,255,255,.35);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 48px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: .95rem;
    font-family: var(--font-body);
}

.pagination a { color: var(--red); background: var(--white); }
.pagination a:hover { background: var(--red); color: var(--white); border-color: var(--red); }
.pagination .current { background: var(--black); color: var(--gold); border-color: var(--black); }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    padding: 14px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: .95rem;
    border-left: 4px solid transparent;
}

.alert-success { background: #f0fdf4; border-color: #22c55e; color: #15803d; }
.alert-error   { background: #fef2f2; border-color: var(--red); color: var(--red-dark); }
.alert-info    { background: var(--gold-pale); border-color: var(--gold-dark); color: #7a5a00; }

/* ============================================================
   DECORATIVE
   ============================================================ */
.stripe-divider {
    width: 80px;
    height: 5px;
    background: linear-gradient(90deg, var(--black) 0%, var(--red) 50%, var(--gold) 100%);
    border-radius: 3px;
    margin: 0 auto 32px;
}

.section-alt { background: var(--white); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
    .footer-inner { grid-template-columns: 1fr 1fr; }
    .content-with-sidebar { grid-template-columns: 1fr; }
    .sidebar { position: static; }

    /* Tighten nav font on medium screens */
    .main-nav > ul > li > a { font-size: .82rem; padding: 0 10px; }
}

@media (max-width: 768px) {
    .nav-toggle { display: block; }

    .main-nav {
        display: none;
        position: absolute;
        top: calc(var(--header-h) + 6px);
        left: 0; right: 0;
        background: var(--black-deep);
        border-top: 2px solid var(--gold);
        padding: 8px 0;
        z-index: 998;
        flex-direction: column;
        align-items: stretch;
    }

    body.nav-open .main-nav { display: flex; }

    .main-nav > ul {
        flex-direction: column;
        height: auto;
        gap: 0;
        width: 100%;
    }

    .main-nav > ul > li {
        height: auto;
        display: block;
        border-bottom: 1px solid rgba(255,255,255,.06);
    }

    .main-nav > ul > li > a {
        padding: 12px 20px;
        height: auto;
        border-bottom: none;
        margin-bottom: 0;
        font-size: .9rem;
        width: 100%;
    }

    /* Mobile: dropdowns accordion below parent */
    .nav-dropdown {
        position: static;
        box-shadow: none;
        border: none;
        border-left: 3px solid var(--gold);
        border-radius: 0;
        background: rgba(255,255,255,.04);
        padding: 0;
        display: none;
        animation: none;
    }

    .main-nav > ul > li.open > .nav-dropdown { display: block; }
    /* Disable desktop hover-open on mobile */
    .main-nav > ul > li:hover > .nav-dropdown { display: none; }
    .main-nav > ul > li.open > .nav-dropdown  { display: block; }

    .nav-dropdown li a {
        padding: 9px 16px 9px 28px;
        font-size: .85rem;
    }

    /* Mobile: clicking parent toggles dropdown */
    .main-nav > ul > li.has-dropdown > a::after { float: right; margin-top: 8px; }

    .footer-inner { grid-template-columns: 1fr; gap: 32px; }
    .hero { padding: 72px 20px 64px; }
    .cards-grid { grid-template-columns: 1fr; }
    .blog-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    body { font-size: 16px; }
    .section { padding: 48px 0; }
}

/* ============================================================
   SECTION LANDING PAGE LAYOUT
   ============================================================ */
.section-landing-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    grid-template-areas: "sidebar main";
    gap: 40px;
    align-items: start;
    padding: 48px 0 80px;
    width: 100%;
    box-sizing: border-box;
}

/* ── Sidebar ── */
.section-sidebar {
    grid-area: sidebar;
    position: sticky;
    top: calc(var(--header-h) + 20px);
    min-width: 0;
}

.section-main {
    grid-area: main;
    min-width: 0;
}

.section-subnav-widget h4 {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 12px;
}

.section-subnav-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.section-subnav-widget li {
    border-bottom: 1px solid var(--border);
}

.section-subnav-widget li:last-child {
    border-bottom: none;
}

.section-subnav-widget li a {
    display: block;
    padding: 10px 12px;
    font-size: .95rem;
    color: var(--text-dark);
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all var(--ease);
}

.section-subnav-widget li a:hover,
.section-subnav-widget li.active a {
    color: var(--red);
    border-left-color: var(--red);
    background: rgba(221,0,0,.04);
    padding-left: 16px;
}

/* ── Main content area ── */
.section-main {
    min-width: 0; /* prevent grid blowout */
}

.section-body-content {
    margin-bottom: 48px;
    line-height: 1.8;
}

.section-body-content h2 {
    margin-top: 2em;
}

.section-body-content h2:first-child {
    margin-top: 0;
}

/* ── Sub-category cards grid ── */
.section-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 56px;
}

.section-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--border);
    border-top: 4px solid var(--black);
    border-radius: 6px;
    padding: 24px 22px 20px;
    text-decoration: none;
    color: inherit;
    transition: all var(--ease);
}

.section-card:nth-child(2n) { border-top-color: var(--red); }
.section-card:nth-child(3n) { border-top-color: var(--gold-dark); }

.section-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    color: inherit;
    border-top-color: var(--red);
}

.section-card h3 {
    font-size: 1.1rem;
    margin: 0 0 .5em;
    color: var(--black);
}

.section-card p {
    font-size: .92rem;
    color: var(--text-mid);
    line-height: 1.55;
    flex: 1;
    margin: 0 0 16px;
}

.section-card-cta {
    font-size: .85rem;
    font-weight: 600;
    color: var(--red);
    margin-top: auto;
}

.section-card:hover .section-card-cta {
    color: var(--red-dark);
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .section-landing-layout {
        grid-template-columns: 1fr;
        grid-template-areas: "main" "sidebar";
        gap: 24px;
        padding: 32px 0 48px;
    }
    .section-sidebar {
        position: static;
    }

    /* On mobile, make the subnav horizontal pill buttons */
    .section-subnav-widget ul {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    .section-subnav-widget li {
        border-bottom: none;
    }
    .section-subnav-widget li a {
        border: 1px solid var(--border);
        border-left: 3px solid transparent;
        border-radius: 4px;
        padding: 6px 12px;
        font-size: .82rem;
        white-space: nowrap;
    }
    .section-subnav-widget li a:hover,
    .section-subnav-widget li.active a {
        border-color: var(--red);
        padding-left: 12px;
    }
    .section-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Reading progress bar ── */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--gold);
    z-index: 9999;
    transition: width .1s linear;
}

/* ── ToC ── */
#toc-box ol li a {
    transition: color .15s;
}

/* ============================================================
   FLASHCARDS PAGE
   ============================================================ */

/* Card 3-D flip */
#card-scene { user-select: none; }

#card-front kbd,
#card-back kbd {
    background: var(--border);
    border: 1px solid var(--border-strong);
    border-radius: 3px;
    padding: 1px 6px;
    font-size: .76rem;
    font-family: monospace;
}

/* Audio button pulse animation */
@keyframes audio-pulse {
    0%   { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,206,0,.5); }
    70%  { transform: scale(1.12); box-shadow: 0 0 0 8px rgba(255,206,0,0); }
    100% { transform: scale(1); }
}
#audio-btn:active { animation: audio-pulse .3s ease; }

/* Deck tabs scrollbar hide */
#deck-tabs::-webkit-scrollbar { display: none; }

/* Rating buttons */
#rating-buttons button:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* Done screen */
#done-screen h2 { font-family: var(--font-display); }

/* Mobile adjustments */
@media (max-width: 600px) {
    #card-front, #card-back { padding: 20px 16px; }
    #rating-buttons { gap: 8px; }
    #rating-buttons button { padding: 10px 18px; font-size: .82rem; }
}
