/*
 * Foundation: self-hosted fonts, design tokens, reset, base typography.
 *
 * Values come from .claude/harmonie-handoff/docs/03-design-system.md and are approved —
 * do not tune them. The token names are German because the design system names them that
 * way; keeping them identical makes a diff against the prototype possible. Everything
 * else (class names, comments) is English, as everywhere in this project.
 *
 * Load order: app.css → layout.css → components.css (see templates/base.html.twig).
 */

/* ---------------------------------------------------------------- fonts ---------- */

/*
 * Self-hosted, no external request — not at runtime, not during the build. The
 * unicode-range values are taken verbatim from the Fontsource stylesheets, so German text
 * only ever fetches the "latin" file. Provenance: assets/fonts/README.md.
 */

@font-face {
    font-family: 'Playfair Display';
    src: url("../fonts/playfair-display-latin-400-normal-tUnOGM4.woff2") format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Playfair Display';
    src: url("../fonts/playfair-display-latin-ext-400-normal-7PtAatT.woff2") format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Playfair Display';
    src: url("../fonts/playfair-display-latin-500-normal-bgysjnA.woff2") format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Playfair Display';
    src: url("../fonts/playfair-display-latin-ext-500-normal-P-S6RH8.woff2") format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Playfair Display';
    src: url("../fonts/playfair-display-latin-400-italic-apaznox.woff2") format('woff2');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Playfair Display';
    src: url("../fonts/playfair-display-latin-ext-400-italic-7usWtQZ.woff2") format('woff2');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Libre Franklin';
    src: url("../fonts/libre-franklin-latin-300-normal-wTO7pUc.woff2") format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Libre Franklin';
    src: url("../fonts/libre-franklin-latin-ext-300-normal-IhHhhvZ.woff2") format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Libre Franklin';
    src: url("../fonts/libre-franklin-latin-400-normal-CAeyPgU.woff2") format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Libre Franklin';
    src: url("../fonts/libre-franklin-latin-ext-400-normal-rIpEWz5.woff2") format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Libre Franklin';
    src: url("../fonts/libre-franklin-latin-500-normal-vXQ-Tbg.woff2") format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Libre Franklin';
    src: url("../fonts/libre-franklin-latin-ext-500-normal-rbilUr3.woff2") format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Libre Franklin';
    src: url("../fonts/libre-franklin-latin-600-normal-EKPKI7f.woff2") format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Libre Franklin';
    src: url("../fonts/libre-franklin-latin-ext-600-normal-4ahTs-a.woff2") format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------------------------------------------------------------- tokens --------- */

:root {
    /* Palette (docs/03). Contrast on --papier: --tinte 14.8:1, --tinte2 8.7:1,
       --akzent 4.9:1, --grau 4.6:1. Never use --akzent for text below 16px on --papier2. */
    --papier: #fbf8f3;
    --papier2: #f3ece0;
    --weiss: #fffdf9;
    --tinte: #1c1a17;
    --tinte2: #463f36;
    --grau: #7b736a;
    --linie: #dfd6c6;
    --linie2: #ede6da;
    --akzent: #8c6b3f;
    --akzent-hell: #b08b57;
    --akzent-tint: #f0e7d6;
    --rot: #8e2f24;
    --gruen: #3d5c3a;

    /* Values the design system names inline in its component descriptions. They live here
       so a single component never carries a raw hex code. */
    --kopf-grund: rgb(251 248 243 / 94%); /* translucent header over --papier */
    --tinte-linie: #6a6156; /* border of secondary buttons on --tinte */
    --tinte-text: #ede6da; /* body copy on --tinte */
    --inaktiv-grund: #e6e1d8;
    --inaktiv-text: #a79e90;
    --feld-inaktiv: #f2efe9;
    --fehler-flaeche: #f7edeb;
    --erfolg-flaeche: #f0f3ec;
    --unterstreichung: #c9b48f; /* underline colour of links in running text */

    /* Type */
    --schrift-titel: 'Playfair Display', georgia, 'Times New Roman', times, serif;
    --schrift-text: 'Libre Franklin', system-ui, -apple-system, 'Segoe UI', arial, sans-serif;

    /* Spacing raster 8 · 16 · 24 · 40 · 64 · 96 (docs/03) */
    --raum1: 0.444rem; /* 8px  */
    --raum2: 0.889rem; /* 16px */
    --raum3: 1.333rem; /* 24px */
    --raum4: 2.222rem; /* 40px */
    --raum5: 3.556rem; /* 64px */
    --raum6: 5.333rem; /* 96px */

    /* Layout */
    --inhaltsbreite: 1240px;
    --seitenrand: clamp(1rem, 4vw, 2.5rem);
    --textbreite: 68ch;
    --leadbreite: 60ch;
    --kopfhoehe: 88px;
    --sticky-abstand: 110px; /* sticky side columns clear the header */

    /* The only two shadows in the whole design (docs/03, "Was es nicht gibt") */
    --schatten-bild: 0 18px 44px rgb(28 26 23 / 9%);
    --schatten-knopf: 0 6px 20px rgb(28 26 23 / 14%);

    /* Stacking order, collected so the layers stay comparable */
    --z-nach-oben: 45;
    --z-overlay: 50;
    --z-kopf: 60;
    --z-hinweis: 70;
    --z-sprungmarke: 100;
}

/* ---------------------------------------------------------------- reset ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

/*
 * The design system asks for an 18px base. Expressed as a percentage instead of `18px` so
 * a reader who raised the browser's default font size keeps that gain (WCAG 1.4.4);
 * 112.5% of the 16px default is exactly the specified 18px.
 */
html {
    font-size: 112.5%;
    -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    background: var(--papier);
    color: var(--tinte);
    font-family: var(--schrift-text);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.72;
    text-rendering: optimizelegibility;
    -webkit-font-smoothing: antialiased;
}

img,
picture,
svg {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

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

input,
select,
textarea {
    color: inherit;
    font: inherit;
}

textarea {
    resize: vertical;
}

ul,
ol {
    list-style: none;
}

table {
    border-collapse: collapse;
    width: 100%;
}

th {
    text-align: left;
    font-weight: 600;
}

address {
    font-style: normal;
}

/* ---------------------------------------------------------------- typography ----- */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--schrift-titel);
    font-weight: 500;
    letter-spacing: -0.005em;
    line-height: 1.18;
    text-wrap: balance;
}

h1 {
    font-size: clamp(2.1rem, 1.4rem + 2.4vw, 3.4rem);
}

h2 {
    font-size: clamp(1.7rem, 1.2rem + 1.4vw, 2.4rem);
}

h3 {
    font-size: clamp(1.35rem, 1.25rem + 0.3vw, 1.6rem);
}

h4 {
    font-size: 1.15rem;
}

p {
    text-wrap: pretty;
}

strong,
b {
    font-weight: 600;
}

/* Dates, tables and pagination all show figures that have to line up (docs/03). */
time,
th,
td {
    font-variant-numeric: tabular-nums;
}

a {
    color: var(--akzent);
    text-decoration-color: var(--unterstreichung);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover {
    color: var(--tinte);
    text-decoration-color: var(--akzent);
}

/* Focus is never removed and never replaced by a box-shadow (docs/09). */
:focus-visible {
    outline: 3px solid var(--akzent);
    outline-offset: 3px;
}

::selection {
    background: var(--akzent-tint);
}

/* ---------------------------------------------------------------- text blocks ---- */

/*
 * .prose wraps every stretch of editorial running text: a measured column, paragraph
 * rhythm and the three markup elements the editors can produce (p, h2, blockquote) plus
 * inline em/strong/a — the whitelist of App\Service\RestrictedMarkup.
 */
.prose {
    max-width: var(--textbreite);
    color: var(--tinte2);
}

.prose > * + * {
    margin-top: var(--raum3);
}

.prose h2 {
    color: var(--tinte);
    margin-top: var(--raum4);
}

.prose h3 {
    color: var(--tinte);
    margin-top: var(--raum4);
}

.prose blockquote {
    border-left: 2px solid var(--akzent);
    padding-left: clamp(1.1rem, 2vw, 1.3rem);
    font-family: var(--schrift-titel);
    font-size: clamp(1.12rem, 1.05rem + 0.2vw, 1.18rem);
    font-style: italic;
    line-height: 1.5;
    color: var(--tinte);
}

.prose ul,
.prose ol {
    padding-left: var(--raum3);
}

.prose ul > li {
    list-style: disc;
}

.prose ol > li {
    list-style: decimal;
}

.prose li + li {
    margin-top: var(--raum1);
}

/* Lead paragraph under an H1 — shorter measure than the body column (docs/03). */
.lead {
    max-width: var(--leadbreite);
    font-size: clamp(1.1rem, 1.05rem + 0.15vw, 1.12rem);
    color: var(--tinte2);
}

/* Small print: captions, dates, hints. */
.meta {
    font-size: 0.85rem;
    color: var(--grau);
    line-height: 1.55;
}

/* Uppercase kicker above a heading, and the section label inside cards. */
.kicker {
    font-size: 0.74rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--akzent);
    line-height: 1.4;
}

/* Screen-reader-only text. Not display:none — it has to stay announced. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
