/* schmidbauer.io / schmidbauer.jetzt – Corporate Design
   Farben: Apricot #F6B48F · Ziegelrot #E8836B · Kohle #2E2A28 · Creme #FBF4EC · Link #A0502C
   Schriften: Space Grotesk (Überschriften), Atkinson Hyperlegible (Text), JetBrains Mono (Code)
   Flächig und ruhig: keine Verläufe, keine Schatten. */

:root {
    --brand-apricot: #F6B48F;
    --brand-ziegel: #E8836B;
    --brand-kohle: #2E2A28;
    --brand-creme: #FBF4EC;
    --brand-link: #A0502C;

    --font-sans: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-heading: "Space Grotesk", "Atkinson Hyperlegible", system-ui, sans-serif;

    --ghost-accent-color: #A0502C !important;
    --color-darker-gray: #2E2A28;
    --color-primary-text: #2E2A28;
    --color-secondary-text: rgb(46 42 40 / 0.72);
    --color-border: rgb(46 42 40 / 0.14);
    --color-dark-border: rgb(46 42 40 / 0.55);
}

/* !important, weil Source die Titelschrift mit sehr spezifischen Selektoren setzt.
   Ghosts Design-Einstellung "Typografie" (--gh-font-heading) bleibt weiterhin wirksam. */
:is(h1, h2, h3, h4, h5, h6, .is-title, .gh-content :is(h2, h3)) {
    font-family: var(--gh-font-heading, var(--font-heading)) !important;
}

::selection {
    background: var(--brand-apricot);
    color: var(--brand-kohle);
}

.gh-content :not(pre) > code {
    background: rgb(246 180 143 / 0.35);
    color: var(--brand-kohle);
    border-radius: 4px;
    padding: 0.1em 0.35em;
}

.gh-content blockquote:not([class]) {
    border-left: 3px solid var(--brand-ziegel);
}

/* Wortmarke (inline SVG, Punkt bleibt Ziegelrot) */
.gh-wortmarke {
    display: block;
    height: 2.4rem;
    width: auto;
    color: var(--brand-kohle);
}

.gh-footer .gh-wortmarke {
    height: 2.2rem;
}

@media (max-width: 767px) {
    .gh-wortmarke { height: 2.1rem; }
}

/* Fußzeile: Text darf umbrechen, ruhig und klein */
.gh-footer-copyright {
    white-space: normal;
    max-width: 100%;
    font-size: 1.3rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--color-secondary-text);
}

.gh-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem 2.4rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.gh-footer-links a {
    text-decoration: underline;
    text-decoration-color: var(--brand-ziegel);
    text-underline-offset: 0.3em;
    text-decoration-thickness: 2px;
}

.gh-footer-links a:hover {
    text-decoration-color: var(--brand-link);
}

/* Formeln: KaTeX in Fließtextgröße, lange Formeln scrollen statt zu sprengen */
.katex-display {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.25rem 0;
}

.gh-footer-links {
    margin-bottom: 2.4rem;
}


/* ===== Farbwelt: flächig, mehrfarbig, ohne Verläufe und Schatten ===== */
:root {
    --brand-pfirsich: #FDE3D0;
    --brand-rose: #F6CFC6;
    --brand-sand: #F1E1CF;
    --brand-apricot-hell: #FAD2B8;
    --card-bg: var(--brand-pfirsich);
    --card-fg: #2E2A28;
}

/* Startseiten-Kopf */
.gh-hero {
    background: var(--brand-apricot);
    color: var(--brand-kohle);
}

.gh-hero-inner {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    align-items: center;
    gap: 4rem;
    padding-block: clamp(4rem, 8vw, 8rem);
}

.gh-hero-kicker {
    margin: 0 0 1.6rem;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.gh-hero-title {
    margin: 0;
    font-size: clamp(4.4rem, 9vw, 8.8rem);
    line-height: 0.98;
    letter-spacing: -0.03em;
    color: var(--brand-kohle);
}

.gh-hero-lead {
    max-width: 52ch;
    margin: 2.4rem 0 0;
    font-size: 1.9rem;
    line-height: 1.5;
}

.gh-hero-pillars {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 3rem 0 0;
    padding: 0;
    list-style: none;
}

.gh-hero-pillars a {
    display: inline-block;
    padding: 0.7rem 1.4rem;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--brand-kohle);
    background: var(--brand-creme);
    border-radius: 999px;
    text-decoration: none;
}

.gh-hero-pillars li:nth-child(2n) a { background: var(--brand-rose); }
.gh-hero-pillars li:nth-child(3n) a { background: var(--brand-kohle); color: var(--brand-creme); }
.gh-hero-pillars a:hover { background: var(--brand-ziegel); color: var(--brand-kohle); }

.gh-hero-art {
    width: 100%;
    max-width: 38rem;
    justify-self: center;
}

@media (max-width: 800px) {
    .gh-hero-inner { grid-template-columns: 1fr; gap: 3rem; }
    .gh-hero-art { max-width: 22rem; justify-self: start; }
}

/* Karten: je Themensäule eine Fläche, Rest wechselt durch */
.gh-container.is-grid .gh-card {
    background: var(--card-bg);
    color: var(--card-fg);
    border-radius: 16px;
    padding: 2.4rem;
}

.gh-container.is-grid .gh-card::before,
.gh-container.is-grid .gh-card::after { display: none; }

.gh-container.is-grid .gh-feed { overflow: visible; column-gap: 2.4rem; row-gap: 2.4rem; }

.gh-container.is-grid .gh-card-link,
.gh-container.is-grid .gh-card-title-link,
.gh-container.is-grid .gh-card-excerpt,
.gh-container.is-grid .gh-card-meta { color: var(--card-fg); }

.gh-container.is-grid .gh-card-excerpt { opacity: 0.85; }

.gh-container.is-grid .gh-card-tag {
    display: inline-block;
    padding: 0.3rem 1rem;
    margin-bottom: 1.2rem;
    font-weight: 700;
    color: var(--brand-kohle);
    background: var(--brand-creme);
    border-radius: 999px;
}

.gh-container.is-grid .gh-card-image img { border-radius: 10px; }

.gh-container.is-grid .gh-card:nth-child(4n+2) { --card-bg: var(--brand-rose); }
.gh-container.is-grid .gh-card:nth-child(4n+3) { --card-bg: var(--brand-sand); }
.gh-container.is-grid .gh-card:nth-child(4n+4) { --card-bg: var(--brand-apricot-hell); }

.gh-container.is-grid .gh-card.tag-physik-und-mathe { --card-bg: var(--brand-pfirsich); }
.gh-container.is-grid .gh-card.tag-maker-und-elektronik { --card-bg: var(--brand-apricot); }
.gh-container.is-grid .gh-card.tag-selfhosting-und-ki { --card-bg: var(--brand-rose); }
.gh-container.is-grid .gh-card.tag-latex { --card-bg: var(--brand-sand); }
.gh-container.is-grid .gh-card.tag-elektrotechnik-und-technik { --card-bg: var(--brand-kohle); --card-fg: var(--brand-creme); }
.gh-container.is-grid .gh-card.tag-elektrotechnik-und-technik .gh-card-tag { background: var(--brand-apricot); }

.gh-container-title { border-bottom-color: var(--brand-kohle); border-bottom-width: 2px; }

/* Buttons */
.gh-button {
    background: var(--brand-apricot);
    color: var(--brand-kohle);
}
.gh-button:hover { background: var(--brand-ziegel); opacity: 1; }

/* Artikel */
.gh-article-tag {
    display: inline-block;
    padding: 0.3rem 1.1rem;
    color: var(--brand-kohle);
    background: var(--brand-apricot);
    border-radius: 999px;
}

.gh-content pre {
    background: var(--brand-kohle);
    color: var(--brand-creme);
    border-radius: 12px;
}
.gh-content pre code { background: transparent; color: inherit; }

.gh-content blockquote:not([class]) {
    background: var(--brand-rose);
    border-left: 5px solid var(--brand-ziegel);
    padding: 1.2rem 2rem;
    border-radius: 0 12px 12px 0;
}

.gh-content a:not([class]) {
    text-decoration-color: var(--brand-ziegel);
    text-decoration-thickness: 2px;
    text-underline-offset: 0.2em;
}

/* Fußzeile dunkel */
.gh-footer {
    margin-top: 12rem;
    padding-top: 5rem;
    padding-bottom: 3rem;
    background: var(--brand-kohle);
    color: var(--brand-creme);
}
.gh-footer .gh-wortmarke { color: var(--brand-creme); }
.gh-footer-copyright { color: rgb(251 244 236 / 0.78); }
.gh-footer-bar { border-block-color: rgb(251 244 236 / 0.25); margin-bottom: 0; }
.gh-footer-links a { color: var(--brand-apricot); }
.gh-footer-links a:hover { color: var(--brand-creme); }
.gh-footer-links { margin-bottom: 3.2rem; }
.gh-footer a:not(.gh-button):hover { color: var(--brand-apricot); }

/* Navigation: farbiger Akzent unten */
.gh-navigation { border-bottom: 4px solid var(--brand-apricot); }

/* Tabellenköpfe stehen in Großbuchstaben; Formeln darin nicht umwandeln (sonst wird aus α ein A) */
.gh-content th .katex { text-transform: none; }

/* ===== Seite „Programme“: Kacheln aus Bildkarten mit Link (siehe brand/programme.js) ===== */
.programme-raster {
    grid-column: wide;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 34rem), 1fr));
    gap: 3.2rem;
    margin-top: 4rem;
}
.gh-content .programme-raster > .programm-karte { margin: 0; }

.programm-karte {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--brand-apricot);
    border: 2px solid transparent;
    border-radius: 18px;
    overflow: hidden;
    transition: transform 0.35s ease, border-color 0.35s ease;
}
/* Farbfolge der Kacheln; die Kartenbilder bekommen dieselbe Hintergrundfarbe (setup/programme/make-bild.py) */
.programm-karte:nth-child(4n+2) { background: var(--brand-rose); }
.programm-karte:nth-child(4n+3) { background: var(--brand-sand); }
.programm-karte:nth-child(4n+4) { background: var(--brand-apricot-hell); }

.programm-karte a { display: block; overflow: hidden; }
.programm-karte a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.programm-karte img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform 0.6s ease;
}
:is(.gh-content, .gh-programme) .programm-karte figcaption {
    position: relative;
    margin: 0;
    padding: 1.6rem 6rem 2.2rem 2.2rem;
    text-align: left;
    font-size: 1.6rem;
    line-height: 1.5;
    color: var(--brand-kohle);
}
.programm-karte figcaption :is(b, strong) {
    display: block;
    margin-bottom: 0.4rem;
    font-family: var(--font-heading);
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1.2;
}
.programm-pfeil {
    position: absolute;
    top: 1.6rem;
    right: 1.8rem;
    display: grid;
    place-items: center;
    width: 3.8rem;
    height: 3.8rem;
    border-radius: 50%;
    background: var(--brand-kohle);
    color: var(--brand-creme);
    font-size: 1.8rem;
    transition: transform 0.35s ease, background-color 0.35s ease;
}
.programm-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.programm-karte:hover { transform: translateY(-6px); border-color: var(--brand-kohle); }
.programm-karte:hover img { transform: scale(1.03); }
.programm-karte:hover .programm-pfeil { transform: translate(3px, -3px); background: var(--brand-link); }
.programm-karte:focus-within { outline: 3px solid var(--brand-link); outline-offset: 4px; }
.programm-karte a:focus-visible { outline: none; }

/* Einblenden: Kachel für Kachel, leicht versetzt */
.programme-raster.ist-animiert .programm-karte:not(.ist-sichtbar) { opacity: 0; }
.programm-karte.ist-sichtbar {
    animation: programm-rein 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
    animation-delay: calc(var(--i, 0) * 120ms);
}
@keyframes programm-rein {
    from { opacity: 0; transform: translateY(28px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .programm-karte, .programm-karte img, .programm-pfeil { transition: none; }
    .programm-karte:hover, .programm-karte:hover img, .programm-karte:hover .programm-pfeil { transform: none; }
}

/* ===== Startseite: „Aktuelles“, Karussell „Programme“ ===== */
.gh-feed-aktuell { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.4rem; }
@media (max-width: 991px) { .gh-feed-aktuell { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 767px) { .gh-feed-aktuell { grid-template-columns: 1fr; } }

.gh-weiter { margin: 3.2rem 0 0; font-size: 1.8rem; font-weight: 700; }
.gh-weiter a { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--brand-kohle); text-decoration: underline; text-decoration-color: var(--brand-ziegel); text-decoration-thickness: 2px; text-underline-offset: 0.3em; }
.gh-weiter a:hover { color: var(--brand-link); }
.gh-weiter svg { width: 1.8rem; height: 1.8rem; transition: transform 0.25s ease; }
.gh-weiter a:hover svg { transform: translateX(4px); }

.gh-programme-spur {
    --luecke: 2.4rem;
    display: flex;
    gap: var(--luecke);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 10px 2px 14px;
    scrollbar-width: thin;
    scrollbar-color: var(--brand-apricot) transparent;
}
.gh-programme-spur > :not(figure) { display: none; }
.gh-programme-spur > figure {
    flex: 0 0 calc((100% - 2 * var(--luecke)) / 3);
    margin: 0;
    scroll-snap-align: start;
}
@media (max-width: 991px) { .gh-programme-spur > figure { flex-basis: calc((100% - var(--luecke)) / 2); } }
@media (max-width: 640px) { .gh-programme-spur > figure { flex-basis: 85%; } }
.gh-programme-spur:focus-visible { outline: 3px solid var(--brand-link); outline-offset: 4px; border-radius: 18px; }
.gh-programme-spur .programm-karte:focus-within { outline-offset: -3px; }
.gh-programme.ist-statisch .gh-programme-spur { overflow-x: visible; }
/* Passen alle Kacheln nebeneinander, teilen sie sich die Breite */
.gh-programme.ist-statisch .gh-programme-spur > figure { flex-grow: 1; }
.gh-programme { margin-top: 5.6rem; }
/* Nur der letzte Abschnitt füllt hohe Bildschirme auf, sonst entstehen Lücken zwischen den Abschnitten */
.gh-aktuelles { flex-grow: 0; }
.gh-container.gh-programme .gh-container-inner .gh-container-title { display: block; }

.gh-programme-knoepfe { display: flex; justify-content: flex-end; gap: 1rem; margin-top: 1.2rem; }
.gh-programme-knoepfe[hidden] { display: none; }
.gh-programme-knopf {
    display: grid;
    place-items: center;
    width: 4.4rem;
    height: 4.4rem;
    border: 2px solid var(--brand-kohle);
    border-radius: 50%;
    background: transparent;
    color: var(--brand-kohle);
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease;
}
.gh-programme-knopf svg { width: 2rem; height: 2rem; }
.gh-programme-knopf[data-richtung="-1"] svg { transform: scaleX(-1); }
.gh-programme-knopf:hover, .gh-programme-knopf:focus-visible { background: var(--brand-kohle); color: var(--brand-creme); }

/* ===== Seite „Archiv“ (page-archiv.hbs) ===== */
.gh-archiv-rubriken { display: flex; flex-wrap: wrap; gap: 1rem; padding: 0; list-style: none; }
.gh-content .gh-archiv-rubriken li { margin: 0; padding: 0; }
.gh-archiv-rubriken a {
    display: inline-flex; align-items: center; gap: 0.8rem; padding: 0.6rem 1.4rem;
    border-radius: 999px; background: var(--brand-pfirsich); color: var(--brand-kohle); font-weight: 700; text-decoration: none;
}
.gh-archiv-rubriken li:nth-child(2n) a { background: var(--brand-rose); }
.gh-archiv-rubriken li:nth-child(3n) a { background: var(--brand-sand); }
.gh-archiv-rubriken a:hover { background: var(--brand-ziegel); }
.gh-archiv-rubriken span { font-size: 0.85em; opacity: 0.7; }
.gh-archiv-liste { padding: 0; list-style: none; }
.gh-content .gh-archiv-liste li {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1.4rem;
    margin: 0; padding: 1.2rem 0; border-bottom: 1px solid var(--color-border);
}
.gh-archiv-liste time { flex: 0 0 9.5rem; font-variant-numeric: tabular-nums; color: var(--color-secondary-text); }
.gh-archiv-liste a { flex: 1 1 24rem; font-weight: 700; }
.gh-archiv-tag { font-size: 0.8em; padding: 0.1rem 0.9rem; border-radius: 999px; background: var(--brand-pfirsich); }
