/* Maschinenschrift - minimale Basisformatierung. */

/* EB Garamond (SIL OFL 1.1).
   Lizenz: static/fonts/eb-garamond/OFL.txt
   Quelle: https://github.com/georgd/EB-Garamond
   Garamond-Renaissance-Synthese in der Linie, in der auch Sabon (Tschichold, 1967) steht. */
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/eb-garamond/EBGaramond-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/eb-garamond/EBGaramond-Italic.woff2") format("woff2");
}
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/eb-garamond/EBGaramond-Semibold.woff2") format("woff2");
}
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/eb-garamond/EBGaramond-SemiboldItalic.woff2") format("woff2");
}

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

:root {
  --color-ink: #1a1a1a;
  --color-page: #fdfdfb;
  --color-accent: #1e8e4a;
  --color-accent-hover: #1a1a1a;
  --color-mark: #f8f251; /* Textmarker-Zitronengelb, nur für ::selection */
}

/* Markieren wie mit dem Textmarker: die Geste des Lesers auf dem Dokument.
   Tinte bleibt Tinte — nur der Grund wird gelb. */
::selection {
  background: var(--color-mark);
  color: var(--color-ink);
}

html {
  font-family: "EB Garamond", "Sabon", Garamond, "Adobe Garamond Pro", Georgia, "Times New Roman", serif;
  font-size: 19px;
  line-height: 1.45;
  color: var(--color-ink);
  background: var(--color-page);
  font-feature-settings: "kern", "liga", "onum";
  text-rendering: optimizeLegibility;
}

/* Auszeichnung im Fließtext: Fett nutzt die echte Garamond-Semibold (600,
   Browser-Default 700 würde synthetisch verbreitern); Unterstreichung in
   Tinte mit Abstand — klar getrennt vom grünen Link-Unterstrich. */
main strong { font-weight: 600; }
main u {
  text-decoration-thickness: 0.055em;
  text-underline-offset: 0.16em;
}

main a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  transition: color 100ms ease, border-color 100ms ease;
}
main a:hover { color: var(--color-accent-hover); }
main a:visited { color: var(--color-accent); }
body { margin: 0; }

main {
  max-width: 36em;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  hyphens: auto;
  -webkit-hyphens: auto;
  text-align: justify;
  text-justify: inter-word;
}

main p { margin: 0 0 0.85rem; }
main p + p { text-indent: 1.4em; margin-top: 0; }
main h1, main h2, main h3, main h4 { text-align: left; hyphens: manual; }
main h1 {
  width: fit-content;
  margin: 0.5rem auto 2.5rem;
  font-weight: 400; font-size: 1.35rem;
  text-transform: uppercase; letter-spacing: 0.22em;
  text-align: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #1a1a1a;
}
main h1 + p { text-indent: 0; }
main h2 {
  margin-top: 2.75rem; margin-bottom: 1rem;
  font-weight: 600; font-size: 1rem;
  text-transform: uppercase; letter-spacing: 0.18em;
  text-align: center;
}
main h2 + p, main h2 + ul, main h2 + ol { text-indent: 0; }
main h3 {
  margin-top: 2rem; margin-bottom: 0.5rem;
  font-weight: 600; font-size: 0.9rem;
  text-transform: uppercase; letter-spacing: 0.12em;
}
main ul, main ol { text-align: left; hyphens: manual; }
main > article > ul,
main > article > ol,
main > article > .section-intro ul,
main > article > .section-intro ol,
main > article > section > ul,
main > article > section > ol {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem 1rem 2.5rem;
  background: #f8f8f3;
  border-left: 3px solid #aaa;
  list-style: none;
}
main > article > ul li + li,
main > article > ol li + li,
main > article > .section-intro ul li + li,
main > article > .section-intro ol li + li,
main > article > section > ul li + li,
main > article > section > ol li + li { margin-top: 0.4rem; }

main > article > ul > li,
main > article > .section-intro ul > li,
main > article > section > ul > li {
  position: relative;
}
main > article > ul > li::before,
main > article > .section-intro ul > li::before,
main > article > section > ul > li::before {
  content: "—";
  position: absolute;
  left: -1.5em;
  color: #888;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Header */
.site-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 2.5rem;
  max-width: 38em; margin: 0 auto; padding: 2.25rem 1.5rem 1.25rem;
  border-bottom: 1px solid #1a1a1a;
}
.site-brand {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 1.25rem;
  text-decoration: none; color: inherit;
}
.site-brand-mark { color: #1a1a1a; line-height: 0; padding-top: 0.15rem; }
.site-brand-mark .site-logo { height: 3rem; width: auto; display: block; }
.site-brand-text { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.site-brand-title {
  font-weight: 600; font-size: 1.25rem; letter-spacing: 0.14em;
  text-transform: uppercase; line-height: 1.1;
}
.site-brand-subtitle {
  font-style: italic; font-size: 0.85rem; color: #666;
  line-height: 1.4; text-wrap: balance;
}
.site-header-meta {
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.65rem;
  padding-top: 0.25rem;
}
.site-nav {
  display: flex; flex-direction: column; align-items: flex-end;
  font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: #555; gap: 0.35rem;
}
.site-nav a { color: inherit; text-decoration: none; }
.site-nav a:hover { color: #1a1a1a; }
.lang-switch {
  display: flex; gap: 0; font-size: 0.75rem; letter-spacing: 0.08em;
  text-transform: uppercase; align-items: center;
  margin-top: 0.4rem; padding-top: 0.6rem; border-top: 1px solid #ddd;
  align-self: stretch; justify-content: flex-end;
}
.lang-switch a { color: #999; text-decoration: none; padding: 0; }
.lang-switch a + a { margin-left: 0.6rem; padding-left: 0.6rem; border-left: 1px solid #ccc; }
.lang-switch a:hover { color: #1a1a1a; }
.lang-switch a[aria-current="true"], .lang-switch a.current { color: #1a1a1a; }

/* Breadcrumb (über dem Footer) */
.breadcrumb {
  max-width: 38em; margin: 4rem auto 0; padding: 0 1.5rem;
  font-size: 0.95rem;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem;
}
.breadcrumb a {
  color: var(--color-accent); text-decoration: none;
  border-bottom: 1px solid currentColor; padding-bottom: 1px;
  transition: color 100ms ease, border-color 100ms ease;
}
.breadcrumb a:hover { color: var(--color-ink); }
.breadcrumb-sep { color: #bbb; }
.breadcrumb-current { color: var(--color-ink); }

/* Footer */
.site-footer {
  max-width: 38em; margin: 4rem auto 1.5rem; padding: 1rem 1.5rem;
  border-top: 1px solid #ddd; font-size: 0.85rem; color: #555;
  text-align: left;
}
.breadcrumb + .site-footer { margin-top: 1.5rem; }
.site-footer a { color: inherit; transition: color 100ms ease; }
.site-footer a:hover { color: var(--color-ink); }
.footer-nav a { margin-right: 1rem; }

/* Hero / Section intros */
.hero p { font-size: 1.05rem; }
.hero-cta { margin-top: 1.5rem; font-size: 0.95rem; }
.hero-cta a { color: #1a1a1a; text-decoration: none; border-bottom: 1px solid #888; padding-bottom: 1px; }
.hero-cta a:hover { border-bottom-color: #1a1a1a; }

/* Today's pick (auf der Homepage in der Katalog-Sektion) */
.todays-pick { margin: 0.5rem 0 1rem; font-size: 0.9rem; color: #555; }
.todays-pick-label { color: #888; margin-right: 0.5rem; }
.todays-pick a { color: inherit; text-decoration: none; border-bottom: 1px dotted #888; }
.todays-pick a:hover { color: #1a1a1a; border-bottom-color: #1a1a1a; }

/* Drei Beispiel-Zustände (Homepage, zwischen Hero und Catalog) */
.states {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin: 3rem 0;
  padding: 2rem 0;
  border-top: 1px solid #e0e0d8;
  border-bottom: 1px solid #e0e0d8;
}
.states[hidden] { display: none; }
.state { text-align: center; }
.state svg.siegel-state { margin: 0 auto 0.75rem; display: block; }
.state-caption {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.4;
  margin: 0;
  text-wrap: balance;
}
@media (max-width: 540px) {
  .states {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Siegel groessenklassen */
svg.siegel-detail      { width: 180px; height: auto; }
svg.siegel-featured    { width: 130px; height: auto; }
svg.siegel-small       { width: 52px;  height: auto; }
svg.siegel-large       { width: 240px; height: auto; }
svg.siegel-list        { width: 72px;  height: auto; }
svg.siegel-state       { width: 110px; height: auto; }
svg.siegel-coda        { width: 90px;  height: auto; color: var(--color-ink); }

/* Schluss-Marke unter Notiz-Artikeln */
.notiz-coda { margin: 3rem 0 0; text-align: center; }

/* Werk des Tages */
.werk-des-tages {
  margin: 2.5rem 0;
  padding: 1.5rem;
  border: 1px solid #ddd;
  background: #fafaf6;
}
.werk-des-tages > header h2 { margin: 0 0 0.25rem; font-size: 1.05rem; letter-spacing: 0.04em; text-transform: uppercase; color: #555; }
.werk-des-tages .rotation-hint { margin: 0 0 1rem; font-size: 0.8rem; color: #888; }
.werk-des-tages-link {
  display: grid; grid-template-columns: auto 1fr; gap: 1.5rem; align-items: start;
  text-decoration: none; color: inherit;
}
.werk-des-tages-link:hover h3 { text-decoration: underline; }
.werk-des-tages-text h3 { margin: 0 0 0.25rem; font-size: 1.35rem; }
.werk-des-tages-author { margin: 0 0 0.75rem; color: #555; }
.werk-des-tages-narration { margin: 0; font-size: 0.95rem; }

/* Katalog-Liste */
.catalog-summary h2 { margin-top: 3rem; font-size: 1rem; letter-spacing: 0.04em; text-transform: uppercase; color: #555; }
.werke-list { list-style: none; padding: 0; margin: 1rem 0; }
.werke-list li + li { margin-top: 0.75rem; }
.werke-list a {
  display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center;
  padding: 0.5rem 0.25rem; text-decoration: none; color: inherit;
  border-bottom: 1px solid #eee;
}
.werke-list a:hover { background: #f5f5f0; }
.werke-list-title { font-weight: 500; }
.werke-list-author { color: #666; font-size: 0.9rem; }

/* Werks-Detail */
.werk-detail .werk-header {
  display: grid; grid-template-columns: auto 1fr; gap: 2rem;
  margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid #ddd;
}
.werk-glyph { padding-top: 0.5rem; }
.werk-meta h1 {
  width: auto; margin: 0 0 0.5rem;
  font-size: 1.35rem; font-weight: 400;
  text-transform: uppercase; letter-spacing: 0.12em;
  text-align: left;
  padding-bottom: 0; border-bottom: 0;
}
.werk-author { margin: 0 0 1rem; color: #555; }
.werk-facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem; margin: 0; font-size: 0.9rem; }
.werk-facts dt { color: #666; }
.werk-facts dd { margin: 0; }
.werk-narration { margin: 2rem 0; }
.werk-links li { margin: 0.25rem 0; }
.werk-downloads { margin-top: 3rem; padding: 1rem 1.25rem; background: #f5f5f0; border-left: 3px solid #999; }
.werk-downloads h2 { margin-top: 0; font-size: 1rem; letter-spacing: 0.04em; text-transform: uppercase; color: #555; }
.werk-downloads ul { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.license-hint { font-size: 0.8rem; color: #555; margin-bottom: 0; }

/* Section list (fallback) — H1 inherits centered Tschichold style from `main h1`. */

/* Werke section (Katalog-Listing) */
.werke-section header { margin-bottom: 2rem; }
.werke-section .werke-count { color: #666; font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; margin: 1.5rem 0 0.5rem; }
.werke-list-detail { list-style: none; padding: 0; margin: 0; }
.werke-list-detail li + li { margin-top: 0.5rem; }
.werke-list-entry {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center; gap: 1.25rem;
  padding: 0.75rem 0.75rem; text-decoration: none; color: inherit;
  border: 1px solid #e8e8e0; background: #fff;
  transition: background 0.15s, border-color 0.15s;
}
.werke-list-entry:hover { background: #f5f5f0; border-color: #ccc; }
.werke-list-meta { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.werke-list-title { font-weight: 500; font-size: 1.05rem; }
.werke-list-author { color: #555; font-size: 0.9rem; }
.werke-list-genre { color: #888; font-size: 0.8rem; }
.werke-list-axes { display: flex; gap: 0.75rem; font-family: ui-monospace, "Consolas", monospace; font-size: 0.85rem; color: #555; white-space: nowrap; }
.werke-list-axes .axis { padding: 0.1rem 0.4rem; background: #f5f5f0; border-radius: 2px; }
.werke-list-axes .axis-b { color: #444; }

.werke-section-aside { margin-top: 3rem; padding: 1rem 1.25rem; background: #f8f8f3; border-left: 3px solid #aaa; }
.werke-section-aside h2 { margin-top: 0; font-size: 1rem; letter-spacing: 0.04em; text-transform: uppercase; color: #555; }
.werke-section-aside ol { padding-left: 1.25rem; margin: 0.5rem 0 0; }
.werke-section-aside li + li { margin-top: 0.35rem; }
.werke-section-aside code { background: #fff; padding: 0.1rem 0.3rem; border: 1px solid #ddd; font-size: 0.9em; }

/* Siegel-Seite (auf /siegel/ bzw. /seal/) */
.siegel-page header { margin-bottom: 2rem; }
.siegel-use { margin: 1.5rem 0 2rem; max-width: 38rem; }
.siegel-license { margin-top: 2rem; padding: 1rem 1.25rem; background: #f8f8f3; border-left: 3px solid #aaa; font-size: 0.9rem; }
.siegel-license h2 { margin-top: 0; font-size: 1rem; letter-spacing: 0.04em; text-transform: uppercase; color: #555; }

/* Siegel-Generator (Builder mit Live-Preview) */
.siegel-preview { margin: 1.5rem 0 2.5rem; padding: 1.5rem; background: #fafaf6; border: 1px solid #ddd; }
.siegel-preview .preview-glyph {
  display: flex; justify-content: center; align-items: center;
  margin: 0 0 1rem; padding: 1.25rem;
  background: transparent;
  transition: background 200ms ease;
  border-radius: 2px;
}
.siegel-preview .preview-glyph.dark-backdrop {
  background: #1a1a1a;
}
.siegel-preview .preview-glyph svg { width: 200px; height: auto; }
.siegel-preview .preview-controls { display: grid; gap: 0.75rem; max-width: 360px; margin: 0 auto 1rem; }
.siegel-preview .preview-controls label { display: flex; align-items: center; gap: 0.75rem; }
.siegel-preview .preview-controls input[type="range"] { flex: 1; accent-color: var(--color-accent); }
.siegel-preview .preview-k input[type="radio"] { accent-color: var(--color-accent); }
.siegel-preview .preview-controls output { font-family: ui-monospace, "Consolas", monospace; min-width: 1.5em; }
.siegel-preview .preview-k { border: none; padding: 0; margin: 0; display: flex; gap: 1rem; }
.siegel-preview .preview-k legend { font-weight: 500; padding: 0; margin-right: 0.5rem; }
.siegel-preview .preview-color {
  border: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center;
}
.siegel-preview .preview-color legend { font-weight: 500; padding: 0; }
.siegel-preview .color-swatches { display: flex; gap: 0.4rem; }
.siegel-preview .swatch {
  width: 28px; height: 28px;
  border: 1px solid #999;
  border-radius: 2px;
  cursor: pointer;
  padding: 0;
  transition: transform 100ms ease, border-color 100ms ease;
}
.siegel-preview .swatch:hover { transform: scale(1.08); border-color: #1a1a1a; }
.siegel-preview .swatch:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.siegel-preview .swatch-black { background: #1a1a1a; }
.siegel-preview .swatch-white { background: #ffffff; }
.siegel-preview .swatch-green { background: #1e8e4a; }
.siegel-preview .color-picker-row { display: flex; gap: 0.4rem; align-items: center; }
.siegel-preview #ctrl-color {
  width: 36px; height: 28px;
  border: 1px solid #999;
  border-radius: 2px;
  padding: 0;
  cursor: pointer;
  background: transparent;
}
.siegel-preview #ctrl-color-hex {
  font-family: ui-monospace, "Consolas", monospace;
  font-size: 0.85rem;
  width: 9ch;
  padding: 0.25rem 0.4rem;
  border: 1px solid #999;
  border-radius: 2px;
  background: #fff;
}
.siegel-preview .preview-downloads { display: flex; gap: 0.75rem; justify-content: center; font-size: 0.9rem; }
.siegel-preview .preview-downloads a { color: #555; padding: 0.3rem 0.6rem; background: #fff; border: 1px solid #ddd; text-decoration: none; }
.siegel-preview .preview-downloads a:hover { background: #f5f5f0; }

/* Kolophon-Zeile + HTML-Embed (Voll-Generator) */
.siegel-preview .preview-outputs {
  max-width: 480px;
  margin: 1.25rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid #e0e0d8;
  display: grid;
  gap: 0.9rem;
}
.siegel-preview .preview-output label {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #555;
  margin-bottom: 0.3rem;
}
.siegel-preview .preview-output-row { display: flex; gap: 0.5rem; align-items: flex-start; }
.siegel-preview .preview-output-row input,
.siegel-preview .preview-output-row textarea {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, "Consolas", monospace;
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid #ddd;
  background: #fff;
  color: #333;
  resize: vertical;
}
.siegel-preview .preview-output-row button {
  font: inherit;
  font-size: 0.85rem;
  color: #555;
  padding: 0.3rem 0.6rem;
  background: #fff;
  border: 1px solid #ddd;
  cursor: pointer;
}
.siegel-preview .preview-output-row button:hover { background: #f5f5f0; }

/* Mini-Generator auf der Startseite (progressives Enhancement:
   ersetzt die drei statischen Beispiel-Zustaende, wenn JS laeuft) */
.home-generator {
  margin: 3rem 0;
  padding: 2rem 0 1.75rem;
  border-top: 1px solid #e0e0d8;
  border-bottom: 1px solid #e0e0d8;
}
.home-generator .preview-glyph { display: flex; justify-content: center; margin: 0 0 0.75rem; }
.home-generator .preview-glyph svg { width: 180px; height: auto; }
.home-generator-caption {
  text-align: center;
  font-size: 0.9rem;
  color: #555;
  margin: 0 0 1.5rem;
}
.home-generator .preview-controls { display: grid; gap: 0.75rem; max-width: 340px; margin: 0 auto; }
.home-generator .preview-controls label { display: flex; align-items: center; gap: 0.75rem; }
.home-generator .preview-controls input[type="range"] { flex: 1; accent-color: var(--color-accent); }
.home-generator .preview-controls output { font-family: ui-monospace, "Consolas", monospace; min-width: 1.5em; }
.home-generator .preview-k { border: none; padding: 0; margin: 0; display: flex; gap: 1rem; flex-wrap: wrap; }
.home-generator .preview-k legend { font-weight: 500; padding: 0; margin-right: 0.5rem; }
.home-generator .preview-k input[type="radio"] { accent-color: var(--color-accent); }
.home-generator-cta { text-align: center; margin: 1.5rem 0 0; font-size: 0.95rem; }
.home-generator-cta a { color: #1a1a1a; text-decoration: none; border-bottom: 1px solid #888; padding-bottom: 1px; }
.home-generator-cta a:hover { border-bottom-color: #1a1a1a; }

/* 404 */
.not-found { text-align: center; padding: 4rem 0; }
.not-found h1 { font-size: 2.5rem; margin: 0 0 0.5rem; }
.not-found .seal-decoration { display: flex; justify-content: center; margin: 2rem 0; opacity: 0.5; }
.not-found .seal-decoration svg { width: 130px; height: auto; }

/* Responsive */
@media (max-width: 540px) {
  .site-header { grid-template-columns: 1fr; gap: 1.25rem; padding: 1.75rem 1.25rem 0.75rem; }
  .site-brand-mark .site-logo { height: 2.4rem; }
  .site-brand-title { font-size: 1.05rem; letter-spacing: 0.1em; }
  .site-brand-subtitle { font-size: 0.8rem; }
  .site-header-meta { align-items: flex-start; }
  .site-nav { flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 0 1rem; }
  .lang-switch { justify-content: flex-start; }
  .werk-des-tages-link { grid-template-columns: 1fr; }
  .werk-detail .werk-header { grid-template-columns: 1fr; }
  .werke-list a { grid-template-columns: auto 1fr; }
  .werke-list-author { grid-column: 2; font-size: 0.85rem; }
}
