/* Volkslauf in Ostwestfalen-Lippe – v0.1
   Idee: Chronik mit Startnummern. Kapitelnummern sind Startnummern (gelbes Schild mit Nadellöchern),
   Fotos tragen den Text, Bildunterschriften stehen wie in einem Fotoalbum direkt am Bild. */

:root {
  --ink: #17211d;
  --wald: #24453a;
  --wald-dark: #1a3329;
  --papier: #f5f5f1;
  --weiss: #ffffff;
  --gelb: #f0c419;
  --grau: #5f6a64;
  --linie: #d5d8d2;

  --serif: 'Literata', Georgia, 'Times New Roman', serif;
  --kond: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;

  --gutter: 1.25rem;
  --lesebreite: 38rem;
  --breit: 56rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--papier);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.72;
  font-kerning: normal;
  hyphens: auto;
  -webkit-hyphens: auto;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--wald); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--gelb); outline-offset: 3px; box-shadow: 0 0 0 5px var(--ink); }
.skip { position: absolute; left: -999px; top: 0; background: var(--gelb); color: var(--ink); padding: .6rem 1rem; z-index: 100; font-family: var(--kond); font-weight: 600; }
.skip:focus { left: 0; }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .55rem var(--gutter);
  background: var(--wald-dark);
  color: var(--weiss);
}
.brand { display: flex; align-items: center; gap: .7rem; color: inherit; text-decoration: none; min-width: 0; }
.brand__mark { flex: none; width: 1.5rem; height: 1.05rem; background: var(--gelb); border-radius: 2px; position: relative; }
.brand__mark::before, .brand__mark::after { content: ''; position: absolute; top: .22rem; width: .17rem; height: .17rem; border-radius: 50%; background: var(--wald-dark); }
.brand__mark::before { left: .22rem; } .brand__mark::after { right: .22rem; }
.brand__text { font-family: var(--kond); font-weight: 600; font-size: 1.15rem; line-height: 1.1; letter-spacing: .01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toc-open {
  flex: none; font: 600 1.05rem/1 var(--kond); letter-spacing: .02em;
  color: var(--ink); background: var(--gelb); border: 0; border-radius: 2px; padding: .55rem .95rem; cursor: pointer;
}
.toc-open:hover { background: var(--weiss); }

/* ---------- Startnummer ---------- */
.bib {
  display: inline-grid; place-items: center; flex: none;
  min-width: 3.1rem; height: 2.3rem; padding: 0 .55rem;
  background: var(--gelb); color: var(--ink);
  font-family: var(--kond); font-weight: 700; font-size: 1.55rem; line-height: 1;
  border-radius: 2px; position: relative;
  box-shadow: inset 0 0 0 2px var(--ink);
}
.bib::before, .bib::after { content: ''; position: absolute; top: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--papier); box-shadow: inset 0 0 0 1px var(--ink); }
.bib::before { left: 5px; } .bib::after { right: 5px; }
.bib--sm { min-width: 2.4rem; height: 1.8rem; font-size: 1.15rem; }
.bib--sm::before, .bib--sm::after { top: 3px; width: 4px; height: 4px; }
.bib--lg { min-width: 5.2rem; height: 3.6rem; font-size: 2.6rem; }
.bib--lg::before, .bib--lg::after { top: 6px; width: 7px; height: 7px; }
.bib--lg::before { left: 7px; } .bib--lg::after { right: 7px; }

/* ---------- Startseite ---------- */
.hero { background: var(--wald); color: var(--weiss); display: grid; gap: 2rem; padding: 2.5rem var(--gutter) 3rem; }
.hero__title { font-family: var(--kond); font-weight: 700; font-size: clamp(2.6rem, 9vw, 5.6rem); line-height: .95; letter-spacing: -.005em; margin: 0 0 1rem; hyphens: manual; text-wrap: balance; }
.hero__sub { font-size: 1.1rem; margin: 0 0 1.75rem; color: #dfe7e2; max-width: 30rem; }
.hero__img { margin: 0; }
.hero__img img { width: 100%; box-shadow: 0 0 0 6px var(--papier); }
.hero__img figcaption { font-size: .85rem; font-style: italic; margin-top: 1rem; color: #cbd6cf; }
.btn { display: inline-block; font: 600 1.15rem/1 var(--kond); letter-spacing: .02em; background: var(--gelb); color: var(--ink); padding: .9rem 1.3rem; border-radius: 2px; text-decoration: none; }
.btn:hover { background: var(--weiss); color: var(--ink); }

.prose p { margin: 0 0 1.1em; }
.prose--intro { max-width: var(--lesebreite); margin: 3rem auto 0; padding: 0 var(--gutter); font-size: 1.15rem; }

.index { max-width: var(--lesebreite); margin: 3rem auto 4rem; padding: 0 var(--gutter); }
.index__h { font-family: var(--kond); font-weight: 700; font-size: 2.2rem; line-height: 1; margin: 0 0 1.5rem; }
.index__part h3 { font-family: var(--kond); font-weight: 600; font-size: 1.5rem; margin: 2rem 0 .3rem; border-bottom: 3px solid var(--ink); padding-bottom: .35rem; }
.index__desc { margin: .5rem 0 0; color: var(--grau); font-size: .95rem; }
.index__list { list-style: none; margin: 0; padding: 0; }
.index__list li { border-bottom: 1px solid var(--linie); }
.index__list a { display: flex; align-items: center; gap: 1rem; padding: .85rem 0; text-decoration: none; color: var(--ink); }
.index__list a:hover .index__title { text-decoration: underline; text-decoration-thickness: .08em; }
.index__title { font-family: var(--kond); font-weight: 500; font-size: 1.45rem; line-height: 1.15; }

/* ---------- Kapitel ---------- */
.btn + .btn { margin-left: .6rem; margin-top: .6rem; }
.btn--ghost { background: transparent; color: var(--weiss); box-shadow: inset 0 0 0 2px var(--weiss); }
.btn--ghost:hover { background: var(--weiss); color: var(--ink); }
.tool { max-width: var(--breit); margin: -1rem auto 2rem; }
.tool__btn { font: 500 1.05rem/1 var(--kond); background: transparent; color: var(--wald); border: 0; padding: .4rem 0; cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }
.tool__btn:hover { color: var(--ink); }
.chapter { padding: 2.5rem var(--gutter) 1rem; }
.chapter__head { max-width: var(--breit); margin: 0 auto 2rem; display: flex; gap: 1.25rem; align-items: flex-start; }
.chapter__head > div { max-width: var(--lesebreite); }
.chapter__part { margin: 0 0 .4rem; font-family: var(--kond); font-weight: 500; font-size: 1.1rem; color: var(--grau); }
.chapter__title { font-family: var(--kond); font-weight: 700; font-size: clamp(2.2rem, 7vw, 3.8rem); line-height: 1; margin: 0; hyphens: manual; text-wrap: balance; }
.chapter__lead { font-size: 1.25rem; line-height: 1.55; margin: 1rem 0 0; color: #333f39; }

.flow { max-width: var(--breit); margin: 0 auto; display: flow-root; }
.flow > p { max-width: var(--lesebreite); margin: 0 0 1.15em; margin-inline: auto; text-wrap: pretty; }
.flow .sub { max-width: var(--lesebreite); margin: 2.2em auto .6em; font-family: var(--kond); font-weight: 600; font-size: 1.7rem; line-height: 1.1; }
.flow .rule { max-width: var(--lesebreite); border: 0; border-top: 3px solid var(--ink); margin: 2.5rem auto; }

.fig { margin: 2rem 0; }
.fig img { width: 100%; background: var(--linie); }
.fig__zoom { display: block; cursor: zoom-in; }
.fig figcaption { font-size: .88rem; line-height: 1.45; font-style: italic; color: var(--grau); margin-top: .55rem; padding-left: .75rem; border-left: 3px solid var(--gelb); }
.fig--wide { clear: both; }
.fig--small { max-width: 24rem; margin-inline: auto; clear: both; }
.fig--portrait { max-width: 11rem; margin: .4rem auto 1.5rem; }

.gallery { list-style: none; margin: 2rem 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 1rem; clear: both; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery--portrait { grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); }
.gallery--portrait img { aspect-ratio: 3 / 4; object-position: 50% 20%; }
.gallery p { font-size: .85rem; font-style: italic; margin: .3rem 0 0; color: var(--grau); line-height: 1.35; }

.pull { max-width: var(--lesebreite); margin: 2.2rem auto; padding: .2rem 0 .2rem 1.1rem; border-left: 6px solid var(--gelb); font-size: 1.3rem; line-height: 1.45; font-style: italic; clear: both; }
.pull p { margin: 0; }
.pull footer { font-size: .9rem; font-style: normal; color: var(--grau); margin-top: .5rem; }

.pager { max-width: var(--breit); margin: 3rem auto 0; padding: 1.5rem var(--gutter) 3rem; display: grid; gap: 1rem; border-top: 3px solid var(--ink); }
.pager__a { display: block; padding: 1rem 1.1rem; background: var(--weiss); box-shadow: inset 0 0 0 2px var(--ink); text-decoration: none; color: var(--ink); }
.pager__a small { display: block; font-family: var(--kond); font-weight: 500; font-size: 1rem; color: var(--grau); }
.pager__a span { font-family: var(--kond); font-weight: 600; font-size: 1.45rem; line-height: 1.15; }
.pager__a:hover { background: var(--gelb); }
.pager__a:hover small { color: var(--ink); }
.pager__a--next { text-align: right; }

/* ---------- Inhaltsverzeichnis (Dialog) ---------- */
.toc { border: 0; padding: 1.25rem var(--gutter) 2rem; width: min(34rem, 100%); max-height: 100dvh; height: 100dvh; margin: 0 0 0 auto; background: var(--papier); color: var(--ink); }
.toc::backdrop { background: rgba(23, 33, 29, .6); }
.toc__close { display: flex; justify-content: flex-end; margin-bottom: .5rem; }
.toc__close button { font: 600 1.05rem/1 var(--kond); background: var(--ink); color: var(--weiss); border: 0; padding: .55rem .95rem; border-radius: 2px; cursor: pointer; }
.toc__part { font-family: var(--kond); font-weight: 600; font-size: 1.4rem; margin: 1.2rem 0 .3rem; border-bottom: 3px solid var(--ink); padding-bottom: .3rem; }
.toc__list { list-style: none; margin: 0; padding: 0; }
.toc__list a { display: flex; align-items: center; gap: .8rem; padding: .55rem 0; font-family: var(--kond); font-weight: 500; font-size: 1.25rem; line-height: 1.15; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--linie); }
.toc__list a:hover, .toc__list a[aria-current] { background: var(--gelb); }

/* ---------- Lightbox ---------- */
.lb { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100dvh; width: 100vw; height: 100dvh; }
.lb::backdrop { background: rgba(10, 14, 12, .94); }
.lb__inner { height: 100%; display: grid; grid-template-rows: 1fr auto; align-items: center; justify-items: center; gap: .75rem; padding: 3rem 1rem 1rem; }
.lb img { max-width: 100%; max-height: calc(100dvh - 9rem); object-fit: contain; }
.lb p { margin: 0; color: #e9eee9; font-size: .95rem; font-style: italic; text-align: center; max-width: 40rem; }
.lb button { position: absolute; top: .75rem; right: .75rem; font: 600 1.05rem/1 var(--kond); background: var(--gelb); border: 0; padding: .6rem 1rem; border-radius: 2px; cursor: pointer; color: var(--ink); }

/* ---------- Fuß ---------- */
.footer { background: var(--wald-dark); color: #dfe7e2; padding: 2rem var(--gutter); font-size: .95rem; line-height: 1.5; }
.footer__inner { max-width: var(--breit); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 1rem 3rem; justify-content: space-between; }
.footer p { margin: 0; }
.footer a { color: var(--weiss); margin-right: 1.2rem; }

/* ---------- Ab Tablet ---------- */
@media (min-width: 40rem) {
  :root { --gutter: 2rem; }
  body { font-size: 1.125rem; }
  .fig--portrait { float: right; clear: right; width: 8rem; margin: .3rem 0 1rem 1.5rem; }
  .fig--portrait img { aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 20%; }
  .pager { grid-template-columns: 1fr 1fr; }
  .fig--wide { margin-inline: calc(-1 * min(2rem, 4vw)); }
}
@media (min-width: 60rem) {
  .hero { grid-template-columns: 1.1fr 1fr; align-items: center; gap: 4rem; padding: 4rem max(var(--gutter), calc((100vw - 72rem) / 2)) 4.5rem; }
  .chapter { padding-top: 4rem; }
  .fig--wide { margin-inline: -3rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- Druck ---------- */
@media print {
  .topbar, .toc-open, .pager, .skip, .footer nav, .tool { display: none; }
  body { background: #fff; font-size: 11pt; }
  .fig, .pull { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* ---------- Druck / PDF (A5 wie die gedruckte Broschüre) ---------- */
@page { size: A5; margin: 16mm 14mm 18mm; }
@media print {
  body { font-size: 10pt; line-height: 1.5; }
  .footer { display: none; }
  .chapter { padding: 0; }
  .chapter__head { margin: 0 0 6mm; gap: 4mm; }
  .chapter__title { font-size: 22pt; }
  .bib--lg { min-width: 14mm; height: 10mm; font-size: 18pt; }
  .chapter__lead { font-size: 11pt; }
  .flow, .flow > p, .flow .sub, .pull, .fig figcaption { max-width: none; }
  .fig--wide, .fig--small { margin-inline: 0; margin-block: 4mm; }
  .fig--portrait { float: right; width: 26mm; margin: 1mm 0 3mm 5mm; break-inside: avoid; }
  .fig--portrait:nth-of-type(even) { float: left; margin: 1mm 5mm 3mm 0; }
  .fig--portrait img { aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 20%; }
  .fig figcaption { font-size: 8pt; }
  .flow > p { orphans: 3; widows: 3; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Absatz mit Bild (Porträt neben dem passenden Absatz) ---------- */
.flow > .ti { max-width: var(--lesebreite); margin: 0 auto 1.4em; }
.ti { display: flex; flex-direction: column; }
.ti__text p { margin: 0 0 1em; text-wrap: pretty; }
.ti__text p:last-child { margin-bottom: 0; }
.ti__fig { order: -1; margin: 0 auto 1rem; width: 11rem; max-width: 70%; }
.ti__fig img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 20%; background: var(--linie); }
.ti__fig figcaption { font-size: .88rem; line-height: 1.45; font-style: italic; color: var(--grau); margin-top: .5rem; padding-left: .75rem; border-left: 3px solid var(--gelb); }
@media (min-width: 40rem) {
  .ti { flex-direction: row; align-items: flex-start; gap: 1.5rem; }
  .ti__text { flex: 1 1 auto; min-width: 0; }
  .ti__fig { flex: none; width: 7.5rem; max-width: none; margin: .2rem 0 0; order: 1; }
  .ti--left .ti__fig { order: -1; }
}
@media (min-width: 62rem) {
  .ti { display: block; position: relative; }
  .ti__fig { position: absolute; top: .2rem; width: 8.5rem; }
  .ti--right .ti__fig { left: calc(100% + 1.75rem); }
  .ti--left .ti__fig { right: calc(100% + 1.75rem); }
  .flow > .ti:last-child { min-height: 15.5rem; }
}
@media print {
  .flow > .ti { max-width: none; }
  .ti, .ti--left, .ti--right { display: flex !important; position: static; flex-direction: row; gap: 4mm; }
  .ti__fig, .ti--left .ti__fig, .ti--right .ti__fig { position: static; width: 26mm; flex: none; margin: 0; order: 1; }
  .ti--left .ti__fig { order: -1; }
  .ti { break-inside: avoid; }
}

/* ---------- Bücherübersicht ---------- */
.crumb{margin-left:.9rem;margin-right:auto;font:600 .95rem/1 "Barlow Condensed",sans-serif;letter-spacing:.04em;text-transform:uppercase;color:inherit;opacity:.8;text-decoration:none;padding-left:.9rem;border-left:1px solid currentColor}
.crumb:hover{opacity:1}
.lib-head{max-width:56rem;margin:0 auto;padding:2.5rem 1rem 1rem}
.lib-head__title{font:700 clamp(2.2rem,7vw,4rem)/1 "Barlow Condensed",sans-serif;text-transform:uppercase;color:var(--wald);margin:0 0 1rem}
.lib-head__intro{font-size:1.1rem;max-width:38rem}
.shelf{max-width:56rem;margin:0 auto;padding:1rem 1rem 3rem;display:grid;gap:1.5rem;grid-template-columns:1fr}
@media (min-width:40rem){.shelf{grid-template-columns:repeat(2,1fr)}}
.card{position:relative;background:#fff;border:1px solid var(--linie);border-radius:.4rem;overflow:hidden;display:flex;flex-direction:column;transition:box-shadow .15s,transform .15s}
.card:not(.card--soon):hover{box-shadow:0 .5rem 1.5rem rgba(23,33,29,.15);transform:translateY(-2px)}
.card__link{position:absolute;inset:0;z-index:2}
.card__img{position:relative;aspect-ratio:4/3;background:var(--wald-dark);overflow:hidden}
.card__img img{width:100%;height:100%;object-fit:cover;display:block}
.card--soon .card__img img{filter:grayscale(1) opacity(.45)}
.card__ph{position:absolute;inset:0;background:repeating-linear-gradient(135deg,var(--wald) 0 14px,var(--wald-dark) 14px 28px);opacity:.7}
.card__tag{position:absolute;left:.8rem;bottom:.8rem;background:var(--gelb);color:var(--ink);font:700 .9rem/1 "Barlow Condensed",sans-serif;letter-spacing:.06em;text-transform:uppercase;padding:.4rem .6rem}
.card__body{padding:1rem 1.1rem 1.2rem}
.card__title{font:700 1.5rem/1.1 "Barlow Condensed",sans-serif;color:var(--wald);margin:0 0 .3rem}
.card__sub{margin:0 0 .5rem;color:var(--grau);font-style:italic}
.card__desc{margin:0 0 .7rem;font-size:.95rem}
.card__meta{margin:0;font:600 .85rem/1 "Barlow Condensed",sans-serif;letter-spacing:.06em;text-transform:uppercase;color:var(--grau)}
.card--soon{border-style:dashed;background:transparent}
