/* Schriften: lokal ausgeliefert (keine Anfragen an Google) */
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans-latin-standard-normal.woff2") format("woff2-variations");
  font-weight: 400 700; font-stretch: 75% 100%; 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: "Instrument Sans";
  src: url("fonts/instrument-sans-latin-ext-standard-normal.woff2") format("woff2-variations");
  font-weight: 400 700; font-stretch: 75% 100%; 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: "Newsreader";
  src: url("fonts/newsreader-latin-standard-normal.woff2") format("woff2-variations");
  font-weight: 200 800; 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: "Newsreader";
  src: url("fonts/newsreader-latin-ext-standard-normal.woff2") format("woff2-variations");
  font-weight: 200 800; 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: "Newsreader";
  src: url("fonts/newsreader-latin-standard-italic.woff2") format("woff2-variations");
  font-weight: 200 800; 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: "Newsreader";
  src: url("fonts/newsreader-latin-ext-standard-italic.woff2") format("woff2-variations");
  font-weight: 200 800; 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;
}

:root {
  --ground: #f7f6f2;
  --ink: #16150f;
  --text: #2c2b26;
  --muted: #4a4943;
  --tile: #cfc9bd;
  --phase: #2e2e2b;
  /* ab 1920 px (Seite wird nicht breiter als 1920 px) */
  --aside-w: 300px;
  --pad: 56px;
  --gap: 48px;
  --card-w: 856px;
  --title: 40px;
  --text-size: 19px;
  --text-big: 30px;
  --act-max: 130px;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
img, video { display: block; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.aside :focus-visible, .gallery :focus-visible { outline-color: #fff; }

/* ---------- Grundgerüst: Seite scrollt vertikal, Einträge wandern horizontal ---------- */
.page { position: relative; }
/* Natives Einrasten: horizontal an unsichtbaren Marken (Kartenpositionen), vertikal direkt an den Karten */
html { scroll-snap-type: y mandatory; }
.snaps { position: absolute; top: 0; left: 0; width: 1px; pointer-events: none; }
.snaps i { position: absolute; left: 0; width: 1px; height: 1px; scroll-snap-align: start; }
.viewport { position: sticky; top: 0; height: 100vh; height: 100dvh; min-height: 560px; max-width: 1920px; overflow: hidden; display: flex; }
/* rechter Abschluss: Einträge laufen weich aus statt hart abgeschnitten */
.viewport::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 96px; pointer-events: none; background: linear-gradient(to right, rgba(247, 246, 242, 0), var(--ground) 85%); }

/* ---------- Farbblock mit Zeitleiste ---------- */
.aside {
  position: relative; flex: none; width: var(--aside-w); height: 100%; overflow: hidden;
  background: var(--phase); color: #fff; transition: background-color .6s ease;
}
.aside::before { content: ""; position: absolute; left: 40px; top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, .4); }
.rail {
  position: absolute; inset: 0;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 36px, #000 calc(100% - 36px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 36px, #000 calc(100% - 36px), transparent 100%);
}
.row {
  position: absolute; left: 0; right: 0; height: 40px; padding: 0; border: 0; background: transparent;
  display: flex; align-items: center; cursor: pointer; text-align: left;
  color: rgba(255, 255, 255, .62); font-size: 14px; font-weight: 500;
  transition: top .6s ease, opacity .3s ease, color .2s ease;
}
.row:hover { color: #fff; }
.row::before { content: ""; flex: none; width: 15px; height: 3px; margin: 0 16px 0 33px; background: currentColor; }
.row.is-active { opacity: 0; pointer-events: none; }
.act {
  position: absolute; left: 0; right: 10px; padding: 0 0 4px; border: 0; background: transparent; color: #fff;
  display: flex; align-items: flex-end; cursor: pointer; text-align: left; overflow: hidden;
}
.act::before { content: ""; flex: none; width: 39px; height: 4px; margin: 0 0 2px 25px; background: #fff; }
.act-wrap { display: block; padding-left: 8px; }
.act-wrap.enter { animation: rise .5s ease both; }
.act-title {
  display: block; margin: 0; writing-mode: vertical-rl; transform: rotate(180deg); white-space: normal;
  font-size: var(--act-max); line-height: .86; font-weight: 700; font-stretch: 75%; letter-spacing: -.02em;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.mbar { display: none; }

/* ---------- Einträge ---------- */
.track {
  position: relative; flex: 1 1 auto; min-width: 0; height: 100%; overflow: hidden;
  display: flex; align-items: stretch; padding: var(--pad) var(--pad) var(--pad) 0;
}
.phase { flex: none; display: flex; align-items: flex-start; gap: var(--gap); padding-left: var(--pad); padding-right: 40px; }
.card { width: var(--card-w); flex: none; max-height: 100%; overflow: hidden; display: flex; flex-direction: column; gap: 18px; }
.card-date { font-size: 15px; font-weight: 600; letter-spacing: .01em; color: var(--c); text-decoration: none; }
.card-date:hover { text-decoration: underline; text-underline-offset: 3px; }
.card-title { margin: -6px 0 0; font-size: var(--title); line-height: .96; font-weight: 700; font-stretch: 80%; letter-spacing: -.01em; }
.card-text { margin: 4px 0 0; max-width: 560px; font-family: var(--serif); font-size: var(--text-size); line-height: 1.5; color: var(--text); white-space: pre-line; }
.card.no-media .card-text { margin-top: 10px; font-size: var(--text-big); line-height: 1.22; }
.helpers { margin: 0; font-size: 15px; line-height: 1.5; }
.helpers b { font-weight: 600; margin-right: .6em; }
.helpers span { color: var(--muted); }

.media { flex: none; margin-top: 10px; display: grid; gap: 4px; }
.media.n1 { grid-template-columns: 1fr; }
.media.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.media.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.media.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile { position: relative; aspect-ratio: 4 / 3; padding: 0; border: 0; background: var(--tile); cursor: zoom-in; overflow: hidden; }
.media.n1 .tile { aspect-ratio: 3 / 2; }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; left: 0; bottom: 0; width: 48px; height: 48px; background: var(--c); color: #fff; display: flex; align-items: center; justify-content: center; }
.more { position: absolute; inset: 0; background: var(--c); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 48px; font-weight: 700; font-stretch: 80%; }

.empty { margin: auto; font-family: var(--serif); font-size: 28px; color: var(--muted); }

/* ---------- Galerie ---------- */
.gallery { position: fixed; inset: 0; z-index: 50; outline: none; background: #16150f; color: #f7f6f2; display: flex; flex-direction: column; }
.gallery[hidden] { display: none; }
.g-head { flex: none; display: flex; align-items: stretch; justify-content: space-between; gap: 24px; }
.g-meta { display: flex; align-items: stretch; gap: 24px; min-width: 0; }
.g-bar { flex: none; width: 12px; background: var(--c); transition: background-color .4s ease; }
.g-text { display: flex; flex-direction: column; gap: 6px; padding: 22px 0 18px; min-width: 0; }
.g-sub { font-size: 14px; font-weight: 600; color: #b9b6ac; }
.g-title { font-size: 34px; line-height: 1; font-weight: 700; font-stretch: 80%; }
.g-close { flex: none; width: 88px; border: 0; background: transparent; color: #f7f6f2; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.g-close svg { width: 30px; height: 30px; }
.g-close:hover { color: #fff; }
.g-stage { flex: 1 1 auto; min-height: 0; display: flex; align-items: stretch; }
.g-nav { flex: none; width: 88px; border: 0; background: transparent; color: #f7f6f2; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.g-nav:disabled { opacity: .25; cursor: default; }
.g-hint { font-size: 11px; font-weight: 500; letter-spacing: .04em; color: #b9b6ac; max-width: 70px; text-align: center; min-height: 14px; }
.g-media { flex: 1 1 auto; min-width: 0; position: relative; margin-top: 8px; background: #0f0e0a; overflow: hidden; }
/* Bilder gleiten seitlich herein und hinaus */
.g-slide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; transform: translateX(0); transition: transform .5s cubic-bezier(.22, .7, .2, 1), opacity .5s ease; }
.g-slide.from-right, .g-slide.out-right { transform: translateX(100%); }
.g-slide.from-left, .g-slide.out-left { transform: translateX(-100%); }
.g-slide.fade { opacity: 0; transform: none; }
.g-slide img, .g-slide video { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.g-caption { flex: none; min-height: 40px; display: flex; align-items: center; justify-content: center; margin: 0; padding: 10px 88px 0; font-family: var(--serif); font-style: italic; font-size: 18px; color: #d9d6cc; text-align: center; }
.g-foot { flex: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; padding: 10px 88px 24px; }
.g-info { min-width: 0; max-width: 680px; transition: opacity .3s ease; }
.g-info.swap { opacity: 0; }
.g-desc { margin: 0; font-family: var(--serif); font-size: 18px; line-height: 1.5; color: #e9e6dd; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.g-desc:empty, .g-helpers:empty { display: none; }
.g-helpers { margin: 8px 0 0; font-size: 14px; line-height: 1.5; color: #b9b6ac; }
.g-helpers b { color: #f7f6f2; font-weight: 600; margin-right: .6em; }
.g-thumbs { flex: none; display: flex; justify-content: flex-end; gap: 6px; max-width: 50%; overflow-x: auto; padding: 4px 2px; }
.g-thumb { flex: none; position: relative; width: 84px; height: 56px; padding: 0; border: 0; background: #2a2924; opacity: .5; cursor: pointer; overflow: hidden; }
.g-thumb img, .g-thumb video { width: 100%; height: 100%; object-fit: cover; }
.g-thumb[aria-current="true"] { opacity: 1; outline: 2px solid #f7f6f2; outline-offset: 2px; }
.g-thumb .badge { width: 20px; height: 20px; }

/* ---------- Breakpoints ---------- */
@media (max-width: 1919px) {
  :root { --pad: 48px; --gap: 40px; --card-w: 620px; }
}
@media (max-width: 1439px) {
  :root { --aside-w: 240px; --pad: 32px; --gap: 32px; --card-w: 420px; --title: 30px; --text-size: 17px; --text-big: 24px; --act-max: 96px; }
  .row { font-size: 13px; }
  .card { gap: 14px; }
  .card-date { font-size: 13px; }
  .helpers { font-size: 14px; }
  .badge { width: 36px; height: 36px; }
  .more { font-size: 32px; }
}

/* ---------- 768–1439: Farbblock links, Seite scrollt nach unten, Karten über die Breite ---------- */
@media (max-width: 1439px) {
  :root { --aside-w: 220px; --act-max: 80px; }
  .viewport { position: static; height: auto; min-height: 0; overflow: visible; display: flex; align-items: flex-start; }
  .viewport::after { display: none; }
  .aside { position: sticky; top: 0; height: 100vh; height: 100dvh; }
  .track { height: auto; overflow: visible; display: block; padding: 40px 32px 80px; }
  .phase { display: block; padding: 0; }
  .card { width: auto; max-width: 880px; max-height: none; margin: 0 0 64px; scroll-snap-align: start; scroll-margin-top: 40px; }
}

/* ---------- Handy: normale Seite, Phase als Leiste oben ---------- */
@media (max-width: 767px) {
  .viewport { display: block; }
  .aside { position: sticky; top: 0; z-index: 5; width: auto; height: auto; overflow: visible; }
  .aside::before, .rail { display: none; }
  .mbar { display: block; padding: 14px 20px 10px; }
  .m-title { margin: 0 0 8px; font-size: 36px; line-height: .95; font-weight: 700; font-stretch: 75%; letter-spacing: -.01em; }
  .m-title.enter { animation: rise .4s ease both; }
  .m-line { position: relative; display: flex; height: 28px; margin: 0 -20px; padding: 0 20px; overflow-x: auto; scrollbar-width: none; }
  .m-line::before { content: ""; position: absolute; left: 0; right: 0; top: 14px; height: 1px; background: rgba(255, 255, 255, .4); }
  .m-dot { position: relative; flex: none; width: 30px; height: 28px; padding: 0; border: 0; background: transparent; cursor: pointer; }
  .m-dot::after { content: ""; position: absolute; left: 0; top: 9px; width: 2px; height: 10px; background: rgba(255, 255, 255, .62); transition: all .25s ease; }
  .m-dot[aria-current="true"]::after { top: 4px; width: 4px; height: 20px; background: #fff; }
  .track { padding: 24px 20px 64px; }
  .card { margin: 0 0 56px; gap: 12px; scroll-margin-top: calc(var(--mbar-h, 96px) + 16px); }
  .card-title { font-size: 30px; }
  .card-text { font-size: 18px; }
  .card.no-media .card-text { font-size: 24px; }
  .g-title { font-size: 24px; }
  .g-text { padding: 14px 0 12px; }
  .g-close, .g-nav { width: 52px; }
  .g-close svg { width: 24px; height: 24px; }
  .g-hint { display: none; }
  .g-caption { padding: 10px 16px 0; font-size: 16px; }
  .g-foot { flex-direction: column; align-items: stretch; gap: 14px; padding: 8px 16px 16px; }
  .g-desc { font-size: 16px; -webkit-line-clamp: 3; }
  .g-thumbs { max-width: none; justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
