/* ==========================================================================
   MAZEDONISCHE GESCHICHTE — STYLESHEET v1
   Built on the YABAAA v3 system: same class names, same data-attributes,
   same breakpoints (900px: rail unsticks, 600px: density). Existing page
   templates work unchanged. Palette: parchment, oxblood, bronze.

    1. Fonts                 8. Components
    2. Tokens                9. History components (new)
    3. Reset & base         10. Lightbox
    4. Navigation           11. Footer
    5. Page shell           12. Embedded games / interactives
    6. Rail + TOC           13. Status page ("im Aufbau") & home (new)
    7. Blocks               14. Motion & print
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. FONTS — Playfair 700 for headings, Source Sans 400/600 for text.
   Same files as yabaaa.com: copy them into /fonts/.
   No unicode-range on purpose: the old range stopped at U+00FF, so „ “ – …
   were drawn in Georgia/Arial in the middle of a sentence.
   -------------------------------------------------------------------------- */
@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/playfair-display-v40-cyrillic_latin-700.woff2') format('woff2');
}
@font-face {
    font-family: 'Source Sans 3';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/source-sans-3-v19-cyrillic_latin-regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Source Sans 3';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/source-sans-3-v19-cyrillic_latin-600.woff2') format('woff2');
}

/* Metric-matched fallbacks — keeps layout still while the fonts swap in. */
@font-face {
    font-family: 'Playfair Fallback';
    src: local('Georgia'), local('Times New Roman');
    size-adjust: 97%; ascent-override: 92%; descent-override: 24%; line-gap-override: 0%;
}
@font-face {
    font-family: 'Source Sans Fallback';
    src: local('Arial'), local('Helvetica Neue');
    size-adjust: 94%; ascent-override: 104%; descent-override: 27%; line-gap-override: 0%;
}

/* --------------------------------------------------------------------------
   2. TOKENS — token names are the same as yabaaa v3; only values changed.
   All text/background pairs pass WCAG AA (4.5:1).
   -------------------------------------------------------------------------- */
:root {
    color-scheme: light;

    /* Colour */
    --brand:        #5E1A17;   /* oxblood — headings, footer, mobile panel  */
    --brand-2:      #8A2B22;   /* lighter oxblood — links, nav bar           */
    --brand-tint:   #F3E6D6;   /* warm tint — placeholders, callouts, th     */
    --ink:          #2A211C;   /* iron-gall ink — body text                  */
    --ink-soft:     #5F5247;   /* secondary text                             */
    --bg:           #F7F1E6;   /* parchment — page background                */
    --surface:      #FFFCF5;   /* fresh paper — cards, panels                */
    --line:         #E6D9C4;
    --line-strong:  #CDB894;
    --warn:         #8E4A0E;
    --warn-tint:    #FBEEDC;
    --accent:       #8A5A14;   /* bronze — numbers, active TOC item          */
    --accent-tint:  #FAF1DF;
    --accent-dark:  #6B440C;
    --accent-hover: #F2E2C2;   /* hover fill on bronze-tinted items          */
    --panel:        #F2E6D1;   /* vellum — rail header, fact boxes           */
    --panel-line:   #E0CDA9;
    --gold:         #B8913E;   /* ornaments and hairlines only, never text   */
    --on-dark:      #EFE4D2;   /* text on oxblood                            */

    /* Type */
    --font-head: 'Playfair Display', 'Playfair Fallback', Georgia, serif;
    --font-body: 'Source Sans 3', 'Source Sans Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --t-display: clamp(2.4rem, 1.5rem + 3.6vw, 3.9rem);
    --t-h1:   clamp(2rem,   1.35rem + 2.6vw, 3rem);
    --t-h2:   clamp(1.5rem, 1.2rem  + 1.3vw, 2.1rem);
    --t-h3:   clamp(1.2rem, 1.1rem  + 0.5vw, 1.45rem);
    --t-body: 1.0625rem;
    --t-small: 0.9375rem;
    --t-tiny:  0.8125rem;
    --measure: 100%;

    /* Space — 4px scale */
    --s1: 0.25rem;  --s2: 0.5rem;   --s3: 0.75rem;  --s4: 1rem;
    --s5: 1.5rem;   --s6: 2rem;     --s7: 3rem;     --s8: 4rem;

    /* Shell */
    --nav-h: 56px;
    --page-max: 1520px;
    --rail-w: 400px;
    --gutter: clamp(1rem, 3vw, 2rem);
    --gap: clamp(2rem, 4vw, 3.5rem);
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 2px rgba(70,35,15,.07), 0 4px 14px rgba(70,35,15,.06);
}

/* --------------------------------------------------------------------------
   3. RESET & BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

/* The hidden attribute always wins over component display rules. */
[hidden] { display: none !important; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--t-body);
    line-height: 1.7;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    /* Footer sits at the bottom of the window on short pages. */
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}
body > main { flex: 1 0 auto; width: 100%; }

::selection { background: #E9D3AE; color: var(--ink); }

img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4 {
    font-family: var(--font-head);
    font-weight: 700;
    color: var(--brand);
    line-height: 1.22;
    text-wrap: balance;
}
h1 { font-size: var(--t-h1); }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); }
h4 { font-size: 1.125rem; font-family: var(--font-body); font-weight: 600; }

/* Left-aligned and hyphenated (hyphenation follows <html lang="…">). */
p, li { text-wrap: pretty; hyphens: auto; }

a { color: var(--brand-2); text-underline-offset: .15em; }
a:hover { color: var(--brand); }

abbr[title] { text-decoration: underline dotted; cursor: help; }
sup, sub { line-height: 0; }
hr { border: 0; height: 1px; background: var(--line-strong); }

/* Anything with an id lands below the sticky bar when jumped to. */
:where([id]) { scroll-margin-top: calc(var(--nav-h) + var(--s5)); }

:focus-visible {
    outline: 3px solid var(--brand-2);
    outline-offset: 2px;
    border-radius: 2px;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 10003;
    background: var(--brand); color: #fff; padding: var(--s3) var(--s5);
    text-decoration: none;
}
.skip-link:focus { left: 0; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
}

/* --------------------------------------------------------------------------
   4. NAVIGATION
   Markup: <nav class="site-nav"> with two lists —
     ul.sidebar[data-nav-panel]  the mobile slide-out panel
     ul (bar)                    .nav-home, .hide-on-mobile items, .menu-button
   The current page gets aria-current="page" from main.js automatically.
   -------------------------------------------------------------------------- */
.site-nav {
    background: var(--brand-2);
    /* Bronze hairline under the bar; inset so the bar height stays --nav-h. */
    box-shadow: inset 0 -2px 0 var(--gold), 0 1px 6px rgba(0,0,0,.14);
    position: sticky;
    top: 0;
    z-index: 10002;
}
.site-nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    max-width: var(--page-max);
    margin-inline: auto;
}
.site-nav li { height: var(--nav-h); }

.site-nav a,
.site-nav button {
    height: 100%;
    padding: 0 clamp(14px, 2.4vw, 26px);
    display: flex;
    align-items: center;
    gap: var(--s2);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.0625rem;
    transition: background-color .2s ease, box-shadow .2s ease;
}
/* Hover only on devices that really hover — no "stuck" highlight after a tap. */
@media (hover: hover) {
    .site-nav a:hover,
    .site-nav button:hover { background: rgba(255,255,255,.12); color: #fff; }
}
.site-nav a[aria-current="page"] { box-shadow: inset 0 -4px 0 var(--gold); }
.site-nav svg { fill: currentColor; flex: none; }
.site-nav :focus-visible { outline-color: #fff; outline-offset: -4px; }

/* Brand / home link */
.site-nav .nav-home { margin-right: auto; }
.site-nav .nav-home a {
    gap: var(--s3);
    font-family: var(--font-head);
    font-size: clamp(1.05rem, 1rem + .4vw, 1.3rem);
    letter-spacing: .01em;
    white-space: nowrap;
}
.site-nav .nav-home svg { width: 28px; height: 28px; color: #F3D9A0; }

/* Slide-out panel (mobile). Hidden with visibility as well as transform so
   its links are not reachable with Tab while it is closed. */
.site-nav .sidebar {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(280px, 82vw);
    max-width: none;
    margin: 0;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--brand);
    box-shadow: -8px 0 24px rgba(0,0,0,.28);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .25s ease, visibility 0s linear .25s;
}
.site-nav .sidebar[data-open="true"] {
    transform: translateX(0);
    visibility: visible;
    transition: transform .25s ease, visibility 0s linear 0s;
}
.site-nav .sidebar li { height: auto; }
.site-nav .sidebar li + li { border-top: 1px solid rgba(255,255,255,.08); }
.site-nav .sidebar a,
.site-nav .sidebar button { height: 52px; }
.site-nav .sidebar a[aria-current="page"] {
    box-shadow: inset 4px 0 0 var(--gold);
    background: rgba(255,255,255,.08);
}
.site-nav .sidebar .sidebar-close { justify-content: flex-end; width: 100%; }

.nav-scrim {
    position: fixed; inset: 0; background: rgba(30,12,8,.5);
    opacity: 0; pointer-events: none; transition: opacity .25s ease; z-index: 10001;
}
.nav-scrim[data-open="true"] { opacity: 1; pointer-events: auto; }

.menu-button { display: none; }
@media (max-width: 600px) {
    .hide-on-mobile { display: none; }
    .menu-button { display: block; }
}

/* --------------------------------------------------------------------------
   5. PAGE SHELL
   -------------------------------------------------------------------------- */
.page {
    max-width: var(--page-max);
    margin-inline: auto;
    padding: var(--s6) var(--gutter) var(--s8);
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, var(--rail-w)) minmax(0, 1fr);
    gap: var(--gap);
    align-items: start;
}
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; gap: var(--s6); }
}

/* Single column pages (home, about, legal): readable width, centred. */
.content--narrow { max-width: 52rem; margin-inline: auto; }

/* --------------------------------------------------------------------------
   6. RAIL — breadcrumb, H1, lead image, description, meta, TOC
   -------------------------------------------------------------------------- */
.rail {
    position: sticky;
    top: calc(var(--nav-h) + var(--s4));
    max-height: calc(100dvh - var(--nav-h) - var(--s6));
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    padding-right: var(--s2);
}
@media (max-width: 900px) {
    .rail { position: static; max-height: none; overflow: visible; padding-right: 0; }
}

.breadcrumb {
    font-size: var(--t-tiny);
    color: var(--ink-soft);
    margin-bottom: var(--s4);
    display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2);
}
.breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand-2); text-decoration: underline; }
.breadcrumb .sep { color: var(--line-strong); }
.breadcrumb .current { color: var(--ink); }

.rail > header {
    background: var(--panel);
    border: 1px solid var(--panel-line);
    border-radius: var(--radius);
    padding: var(--s4);
}

.rail h1 { margin-bottom: var(--s4); }

/* LCP element. 840px source, displayed at 420 max. */
.rail__figure {
    margin: 0 0 var(--s4);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--brand-tint);
    aspect-ratio: 4 / 3;
}
.rail__figure img { width: 100%; height: 100%; object-fit: cover; }

.rail__lead {
    font-size: var(--t-small);
    color: var(--ink-soft);
    margin-bottom: var(--s4);
}

.rail__meta {
    display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4);
    font-size: var(--t-tiny);
    color: var(--ink-soft);
}
.rail__meta span { display: inline-flex; align-items: center; gap: var(--s2); }
.rail__meta svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; }

/* Table of contents — <details> so mobile collapses with no JS */
.toc {
    margin-top: var(--s2);
    background: var(--accent-tint);
    border: 1px solid var(--panel-line);
    border-radius: var(--radius);
    padding: var(--s3) var(--s4);
}
.toc > summary {
    font-family: var(--font-head);
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--brand);
    cursor: pointer;
    list-style: none;
    padding: var(--s2) 0;
    display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
}
.toc > summary::-webkit-details-marker { display: none; }
.toc > summary::after {
    content: "";
    flex: none;
    width: 9px; height: 9px;
    border-right: 2px solid var(--brand-2);
    border-bottom: 2px solid var(--brand-2);
    transform: rotate(45deg);
    transition: transform .2s ease;
}
.toc[open] > summary::after { transform: rotate(-135deg); }

.toc__list {
    list-style: none;
    padding: 0;
    margin: var(--s2) 0 0;
    counter-reset: toc;
}
.toc__list li { counter-increment: toc; }
.toc__list a {
    display: flex;
    gap: var(--s3);
    padding: var(--s2) var(--s3);
    border-radius: var(--radius-sm);
    border-left: 3px solid transparent;
    color: var(--ink-soft);
    font-size: var(--t-small);
    line-height: 1.4;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}
.toc__list a::before {
    content: counter(toc);
    flex: 0 0 1.4em;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
    font-weight: 700;
}
.toc__list a:hover { background: var(--accent-hover); color: var(--accent-dark); }
.toc__list a[aria-current="true"] {
    background: var(--accent);
    border-left-color: var(--accent-dark);
    color: #fff;
    font-weight: 600;
}
.toc__list a[aria-current="true"]::before { color: #fff; }

@media (max-width: 900px) {
    .toc__list { max-height: 40vh; overflow-y: auto; }
}

/* --------------------------------------------------------------------------
   7. BLOCKS — the H2 section patterns
   Three primitives: base, --split, --stack. Everything else is a component
   dropped inside .block__body.
   -------------------------------------------------------------------------- */
.content > .block + .block { margin-top: var(--s8); }

.block { scroll-margin-top: calc(var(--nav-h) + var(--s5)); }

.block__head {
    display: flex;
    align-items: flex-start;
    gap: var(--s3);
    margin-bottom: var(--s4);
}
/* Optional. Mirrors the TOC number so the reader can match rail to section. */
.block__num {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: clamp(1.9rem, 1.5rem + 1.2vw, 2.4rem);
    height: clamp(1.9rem, 1.5rem + 1.2vw, 2.4rem);
    margin-top: .18em;
    border-radius: 50%;
    font-family: var(--font-body);
    font-size: clamp(1rem, .9rem + .3vw, 1.2rem);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: #fff;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-tint), 0 0 0 4px var(--panel-line);
}
.block__head h2 { margin: 0; }

.block__body > * + * { margin-top: var(--s4); }
:where(.block__body) :where(p, ul, ol) { max-width: var(--measure); }
:where(.block__body) :where(ul, ol) { padding-left: 1.25rem; }
:where(.block__body) :where(li + li) { margin-top: var(--s2); }

/* Pattern 2/3/4/9 — text beside media */
.block--split .block__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 38%);
    gap: var(--gap);
    align-items: start;
}
.block--split .block__body > * + * { margin-top: 0; }
.block--split .block__text > * + * { margin-top: var(--s4); }

/* Media first (pattern 3) */
.block--split-start .block__body { grid-template-columns: minmax(0, 38%) minmax(0, 1fr); }
.block--split-start .block__media { order: -1; }

@media (max-width: 900px) {
    .block--split .block__body,
    .block--split-start .block__body {
        grid-template-columns: 1fr;
        gap: var(--s5);
    }
    .block--split .block__media,
    .block--split-start .block__media { order: 0; }
}

/* Pattern 5 — media between two text passages: plain flow, nothing needed */
.block--stack .block__media { margin-block: var(--s5); }

/* --------------------------------------------------------------------------
   8. COMPONENTS
   -------------------------------------------------------------------------- */

/* Figure ------------------------------------------------------------------ */
.figure { margin: 0; }
.figure img {
    width: 100%;
    border-radius: var(--radius);
    background: var(--brand-tint);
}
.figure figcaption {
    font-size: var(--t-tiny);
    color: var(--ink-soft);
    margin-top: var(--s2);
}
.figure--portrait img { aspect-ratio: 3 / 4; object-fit: cover; }
.figure--wide img { aspect-ratio: 16 / 9; object-fit: cover; }
/* Maps and documents: never cropped, framed like a plate in a book. */
.figure--map img {
    object-fit: contain;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    padding: var(--s2);
}

/* Feature list (pattern 6) ------------------------------------------------- */
.feature-list { list-style: none; padding-left: 0; }
.feature-list li {
    position: relative;
    padding-left: 1.75rem;
}
.feature-list li::before {
    content: "";
    position: absolute;
    left: 2px; top: .62em;
    width: 7px; height: 7px;
    background: var(--accent);
    transform: rotate(45deg);
}

/* Downloads (pattern 4) — handles 0 to 8 PDFs -------------------------------*/
.downloads > li { margin-top: 0; }
.downloads {
    list-style: none;
    padding-left: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: var(--s3);
    max-width: none;
}
.download {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s3) var(--s4);
    background: var(--accent-tint);
    border: 2px solid var(--panel-line);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--ink);
    transition: border-color .15s ease, background-color .15s ease;
}
.download:hover { border-color: var(--accent); background: var(--accent-hover); color: var(--accent-dark); }
.download svg { flex: 0 0 22px; width: 22px; height: 22px; stroke: var(--accent-dark); fill: none; stroke-width: 1.9; }
.download__name { font-weight: 600; font-size: var(--t-small); line-height: 1.3; }
.download__meta { display: block; font-weight: 400; font-size: var(--t-tiny); color: var(--ink-soft); }

/* Comparison (pattern 9) --------------------------------------------------- */
.compare {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--s4);
}
.compare__col {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--s4);
}
.compare__col h3 {
    font-family: var(--font-body);
    font-size: var(--t-small);
    font-weight: 600;
    color: var(--brand);
    padding-bottom: var(--s2);
    border-bottom: 1px solid var(--line);
    margin-bottom: var(--s3);
}
.compare__col ul { list-style: none; padding-left: 0; font-size: var(--t-small); }
.compare__col li { padding-left: 1.25rem; position: relative; }
.compare__col li::before {
    content: "";
    position: absolute; left: 0; top: .6em;
    width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong);
}

/* Callout (pattern 10) ----------------------------------------------------- */
/* Markup: <div class="callout"><svg…/><div><p>…</p><p>…</p></div></div> */
.callout {
    display: flex;
    gap: var(--s3);
    padding: var(--s4);
    background: var(--brand-tint);
    border-left: 4px solid var(--brand-2);
    border-radius: 0 var(--radius) var(--radius) 0;
    max-width: var(--measure);
}
.callout svg { flex: 0 0 20px; width: 20px; height: 20px; margin-top: .2em; stroke: var(--brand-2); fill: none; stroke-width: 1.8; }
.callout p { font-size: var(--t-small); max-width: none; }
.callout p + p { margin-top: var(--s2); }
.callout--warn { background: var(--warn-tint); border-left-color: var(--warn); }
.callout--warn svg { stroke: var(--warn); }

/* Gallery (pattern 8) — 6 to 20 images, brick layout ------------------------*/
.gallery > li { margin-top: 0; }
.gallery {
    --row: 8.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    grid-auto-rows: var(--row);
    grid-auto-flow: dense;
    gap: var(--s2);
    list-style: none;
    padding-left: 0;
    max-width: none;
}
.gallery__item {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--brand-tint);
    cursor: zoom-in;
    display: block;
    width: 100%;
    height: 100%;
}
.gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.gallery__item:hover img { transform: scale(1.04); }
.gallery__item--wide { grid-column: span 2; }
.gallery__item--tall { grid-row: span 2; }
.gallery__item--big  { grid-column: span 2; grid-row: span 2; }

@media (max-width: 600px) {
    .gallery { --row: 6rem; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); }
}

/* Video facade (pattern 7) — no third-party JS until clicked ----------------*/
.video {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--brand);
    width: 100%;
    display: block;
    cursor: pointer;
}
.video img { width: 100%; height: 100%; object-fit: cover; opacity: .82; transition: opacity .2s ease; }
.video:hover img { opacity: .68; }
.video__play {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 66px; height: 66px;
    border-radius: 50%;
    background: rgba(255,252,245,.94);
    display: grid;
    place-items: center;
    pointer-events: none;
}
.video__play::after {
    content: "";
    border-left: 19px solid var(--brand);
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    margin-left: 5px;
}
.video iframe { width: 100%; height: 100%; border: 0; }

/* FAQ (optional pattern 11) ------------------------------------------------ */
.faq { max-width: var(--measure); }
.faq__item {
    border-bottom: 1px solid var(--line);
}
.faq__item > summary {
    padding: var(--s4) var(--s6) var(--s4) 0;
    position: relative;
    cursor: pointer;
    font-weight: 600;
    color: var(--brand);
    list-style: none;
}
.faq__item > summary::-webkit-details-marker { display: none; }
.faq__item > summary::after {
    content: "";
    position: absolute; right: var(--s3); top: 50%;
    width: 9px; height: 9px;
    border-right: 2px solid var(--brand-2);
    border-bottom: 2px solid var(--brand-2);
    transform: translateY(-65%) rotate(45deg);
    transition: transform .2s ease;
}
.faq__item[open] > summary::after { transform: translateY(-25%) rotate(-135deg); }
.faq__item > summary:hover { color: var(--brand-2); }
.faq__answer { padding-bottom: var(--s4); }
.faq__answer p { font-size: var(--t-small); }

/* Author / disclaimer ------------------------------------------------------ */
.article-note {
    margin-top: var(--s8);
    padding-top: var(--s4);
    border-top: 1px solid var(--line);
    font-size: var(--t-tiny);
    color: var(--ink-soft);
    max-width: var(--measure);
}

/* Tables ------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table-wrap table { border-collapse: collapse; width: 100%; font-size: var(--t-small); }
.table-wrap th, .table-wrap td { padding: var(--s3); border-bottom: 1px solid var(--line); text-align: left; }
.table-wrap th { background: var(--brand-tint); color: var(--brand); font-weight: 600; }

/* --------------------------------------------------------------------------
   9. HISTORY COMPONENTS — new, for article pages
   -------------------------------------------------------------------------- */

/* Timeline ------------------------------------------------------------------
   <ol class="timeline">
     <li class="timeline__item">
       <h3>Osmanische Zeit</h3>
       <p class="timeline__date">Ende 14. Jh. – 1912</p>
       <p>Text …</p>
     </li>
   </ol>
   The date sits under the heading in the HTML (better for screen readers)
   and is shown above it. */
.timeline {
    position: relative;
    list-style: none;
    padding-left: 0;
    max-width: none;
}
.timeline::before {
    content: "";
    position: absolute;
    left: 7px; top: .7rem; bottom: .7rem;
    width: 2px;
    background: var(--line-strong);
}
.timeline__item {
    position: relative;
    display: flex;
    flex-direction: column;
    padding-left: 2.25rem;
}
.timeline__item + .timeline__item { margin-top: var(--s5); }
.timeline__item::before {
    content: "";
    position: absolute;
    left: 0; top: .3rem;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--surface);
    border: 3px solid var(--accent);
}
.timeline__item h3 { font-size: var(--t-h3); }
.timeline__date {
    order: -1;
    font-size: var(--t-tiny);
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--accent-dark);
}
.timeline__item > p:not(.timeline__date) { margin-top: var(--s2); }

/* Source quote ---------------------------------------------------------------
   <figure class="quote">
     <blockquote><p>…</p></blockquote>
     <figcaption>Name, <cite>Werk</cite>, Jahr</figcaption>
   </figure>                                    (a bare <blockquote> works too) */
.quote { margin: 0; max-width: var(--measure); }
blockquote {
    position: relative;
    padding: var(--s4) var(--s5) var(--s4) 3.4rem;
    background: var(--surface);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 1.125rem;
    max-width: var(--measure);
}
blockquote::before {
    content: "\201C";
    content: "\201C" / "";
    position: absolute;
    left: .85rem; top: .35rem;
    font-family: var(--font-head);
    font-size: 3.2rem;
    line-height: 1;
    color: var(--gold);
}
blockquote p + p { margin-top: var(--s2); }
.quote figcaption {
    margin-top: var(--s2);
    padding-left: 3.4rem;
    font-size: var(--t-small);
    color: var(--ink-soft);
}
.quote figcaption::before { content: "— "; }
cite { font-style: italic; }

/* Fact box ("Steckbrief") ------------------------------------------------------
   <dl class="facts"><dt>Zeitraum</dt><dd>…</dd><dt>Ort</dt><dd>…</dd></dl> */
.facts {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: var(--s2) var(--s4);
    padding: var(--s4);
    background: var(--panel);
    border: 1px solid var(--panel-line);
    border-radius: var(--radius);
    font-size: var(--t-small);
    max-width: var(--measure);
}
.facts dt { font-weight: 600; color: var(--brand); }
@media (max-width: 600px) {
    .facts { grid-template-columns: 1fr; gap: 0; }
    .facts dd + dt { margin-top: var(--s3); }
}

/* Footnotes and references ------------------------------------------------------
   In text: <sup><a href="#q1" id="r1">1</a></sup>
   At end:  <ol class="references"><li id="q1">… <a href="#r1">↩</a></li></ol> */
sup > a { text-decoration: none; font-weight: 600; padding: 0 .1em; }
.references {
    font-size: var(--t-small);
    color: var(--ink-soft);
    padding-left: 1.5rem;
    max-width: var(--measure);
}
.references li + li { margin-top: var(--s2); }
.references li:target {
    background: var(--accent-hover);
    border-radius: var(--radius-sm);
    outline: 4px solid var(--accent-hover);
}

/* Ornament — a centred rule with a diamond. <div class="ornament" aria-hidden="true"><span></span></div> */
.ornament {
    display: flex;
    align-items: center;
    gap: .7rem;
    width: min(15rem, 60%);
    margin: var(--s5) auto;
    color: var(--gold);
}
.ornament::before,
.ornament::after { content: ""; flex: 1; height: 1px; background: currentColor; }
.ornament span {
    flex: none;
    width: 8px; height: 8px;
    background: currentColor;
    transform: rotate(45deg);
}

/* Badge — small all-caps label */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    padding: var(--s1) var(--s3);
    border: 1px solid var(--panel-line);
    border-radius: 999px;
    background: var(--accent-tint);
    color: var(--accent-dark);
    font-size: var(--t-tiny);
    font-weight: 600;
    letter-spacing: .08em;
    line-height: 1.6;
    text-transform: uppercase;
}
.badge svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }

/* --------------------------------------------------------------------------
   10. LIGHTBOX — native <dialog>: free focus trap and Escape
   -------------------------------------------------------------------------- */
.lightbox {
    border: 0;
    padding: 0;
    background: transparent;
    max-width: 100vw;
    max-height: 100dvh;
    width: 100%;
    height: 100%;
}
.lightbox::backdrop { background: rgba(24,12,8,.93); }
.lightbox__stage {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    padding: var(--s5);
}
.lightbox img {
    max-width: 100%;
    max-height: 82dvh;
    width: auto;
    object-fit: contain;
    border-radius: var(--radius-sm);
}
.lightbox__caption {
    color: var(--on-dark);
    font-size: var(--t-small);
    text-align: center;
    margin-top: var(--s3);
    max-width: 60ch;
}
.lightbox__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px; height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,.14);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    line-height: 1;
}
.lightbox__btn:hover { background: rgba(255,255,255,.26); }
.lightbox__prev { left: var(--s4); }
.lightbox__next { right: var(--s4); }
.lightbox__close {
    position: absolute;
    top: var(--s4); right: var(--s4);
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,.14);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
}
.lightbox__close:hover { background: rgba(255,255,255,.26); }

/* --------------------------------------------------------------------------
   11. FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
    background: var(--brand);
    color: var(--on-dark);
    padding: var(--s6) var(--gutter);
    margin-top: var(--s8);
    box-shadow: inset 0 2px 0 var(--gold);
}
.site-footer :focus-visible { outline-color: #fff; }
.footer-languages {
    display: flex; justify-content: center; align-items: center; gap: var(--s3);
    font-size: var(--t-small);
    margin-bottom: var(--s4);
}
.footer-languages a { color: var(--on-dark); text-decoration: none; }
.footer-languages a:hover { color: #fff; text-decoration: underline; }
.footer-languages .separator { color: rgba(239,228,210,.4); }

.footer-container {
    max-width: var(--page-max);
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s4);
}
.footer-brand {
    font-family: var(--font-head);
    font-size: 1.25rem;
    color: #fff;
}
.footer-share { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2); }
.footer-share a {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: 50%;
    color: var(--on-dark);
    transition: background-color .2s ease, color .2s ease;
}
.footer-share a:hover { background: rgba(255,255,255,.12); color: #fff; }
.footer-share svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 2; }

.footer-legal { font-size: var(--t-small); text-align: center; }
.footer-legal a { color: var(--on-dark); }
.footer-legal a:hover { color: #fff; }
.footer-legal .separator { color: rgba(239,228,210,.4); margin: 0 var(--s2); }

/* --------------------------------------------------------------------------
   12. EMBEDDED GAMES / INTERACTIVES — quiz, map, game in an <iframe>
   Used only on pages with <main class="page page--game">.
   -------------------------------------------------------------------------- */
.play-jump {
    display: none;
    align-items: center;
    justify-content: center;
    gap: var(--s2);
    min-height: 52px;
    margin: 0 0 var(--s4);
    padding: var(--s3) var(--s5);
    border-radius: var(--radius);
    background: var(--accent-dark);
    color: #fff;
    font-weight: 600;
    font-size: 1.125rem;
    text-decoration: none;
    transition: background-color .15s ease;
}
.play-jump:hover { background: var(--brand); color: #fff; }
.play-jump svg { flex: 0 0 22px; width: 22px; height: 22px; fill: currentColor; }

.game-frame {
    scroll-margin-top: calc(var(--nav-h) + var(--s2));
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--brand);
    box-shadow: var(--shadow);
}
.game-frame iframe {
    display: block;
    width: 100%;
    height: min(85dvh, 800px);
    border: 0;
}

.game-actions { display: flex; flex-wrap: wrap; gap: var(--s3); }
.game-action {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    min-height: 44px;
    padding: var(--s2) var(--s4);
    border: 2px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--brand);
    font-weight: 600;
    font-size: var(--t-small);
    text-decoration: none;
    transition: border-color .15s ease, color .15s ease;
}
.game-action:hover { border-color: var(--brand-2); color: var(--brand-2); }
.game-action svg { flex: 0 0 20px; width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }

@media (max-width: 900px) {
    .page--game .play-jump { display: flex; }
    .page--game .rail__figure { display: none; }
    .game-frame iframe { height: calc(100dvh - var(--nav-h) - 1rem); }
}

/* --------------------------------------------------------------------------
   13. STATUS PAGE ("im Aufbau") & HOME
   A framed title-page card for the homepage, maintenance and 404 pages.
   -------------------------------------------------------------------------- */
.status {
    position: relative;
    max-width: 48rem;
    margin: var(--s4) auto var(--s8);
    padding: clamp(2.25rem, 6vw, 4.25rem) clamp(1.25rem, 5vw, 3.75rem);
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
/* Inner hairline — a printed title page. */
.status::before {
    content: "";
    position: absolute;
    inset: 8px;
    border: 1px solid var(--panel-line);
    border-radius: calc(var(--radius) - 4px);
    pointer-events: none;
}
.status__title {
    font-size: var(--t-display);
    margin-top: var(--s4);
    letter-spacing: -.005em;
}
.status__lead {
    max-width: 36rem;
    margin: var(--s4) auto 0;
    font-size: clamp(1.0625rem, 1rem + .35vw, 1.25rem);
    color: var(--ink-soft);
}
.status .callout {
    max-width: 34rem;
    margin-inline: auto;
    text-align: left;
}
.status__actions { margin-top: var(--s5); }
.status__actions a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: var(--s2) var(--s5);
    border-radius: var(--radius);
    background: var(--brand-2);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .15s ease;
}
.status__actions a:hover { background: var(--brand); color: #fff; }

/* --------------------------------------------------------------------------
   14. MOTION & PRINT
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
    .gallery__item:hover img { transform: none; }
}

@media print {
    .site-nav, .site-footer, .toc, .nav-scrim, .lightbox, .skip-link,
    .play-jump, .game-frame, .game-actions { display: none !important; }
    .layout { display: block; }
    .rail { position: static; max-height: none; }
    body { background: #fff; font-size: 11pt; }
    .status { box-shadow: none; }
    .block { break-inside: avoid; }
    a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
}
