/* ==========================================================================
   altemüller.de — Stylesheet
   Ein einziges Stylesheet fuer die gesamte Seite. Keine externen Abhaengigkeiten.
   Aufbau: 1 Schriften · 2 Farbtokens · 3 Grundlagen · 4 Layout · 5 Kopf/Fuss
           6 Typografie · 7 Galerie · 8 Lightbox · 9 Video · 10 Listen/Vita
           11 Hilfsklassen · 12 Druck
   ========================================================================== */

/* -------------------------------------------------------------- 1 Schriften */
/* Variable Fonts, lokal ausgeliefert (kein Google-Fonts-Aufruf, keine Cookies) */
@font-face {
  font-family: 'Bodoni Moda';
  src: url('../fonts/bodoni-moda-latin-wght-normal.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Bodoni Moda';
  src: url('../fonts/bodoni-moda-latin-wght-italic.woff2') format('woff2');
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ----------------------------------------------------------- 2 Farbtokens */
:root {
  --font-display: 'Bodoni Moda', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --measure: 40rem;
  --wrap: 74rem;
  --gap: clamp(0.75rem, 1.6vw, 1.25rem);
  --pad-x: clamp(1.1rem, 5vw, 3rem);
  --radius: 2px;

  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);

  /* Dunkel ist die Grundstimmung der Seite (Buehnenlicht). */
  color-scheme: dark;
  --bg: #0c0c0e;
  --bg-sunken: #08080a;
  --surface: #17171b;
  --surface-2: #1f1f25;
  --text: #ece8e0;
  --muted: #a8a299;
  --line: #2c2c33;
  --line-strong: #6a6a75;
  --accent: #d8ad60;
  --accent-hover: #ecc37c;
  --accent-ink: #14100a;
  --shadow: 0 1.5rem 3rem rgb(0 0 0 / 55%);
  --texture-opacity: 0.16;
}

/* Helles Schema: folgt dem Systemwunsch, ausser der Besucher hat manuell gewaehlt */
@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    color-scheme: light;
    --bg: #f6f4f0;
    --bg-sunken: #eae6df;
    --surface: #ffffff;
    --surface-2: #f1eee8;
    --text: #171614;
    --muted: #57534b;
    --line: #dcd6cc;
    --line-strong: #847c6e;
    --accent: #8a6524;
    --accent-hover: #6d4f19;
    --accent-ink: #ffffff;
    --shadow: 0 1.25rem 2.5rem rgb(40 33 20 / 18%);
    --texture-opacity: 0.05;
  }
}
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f6f4f0;
  --bg-sunken: #eae6df;
  --surface: #ffffff;
  --surface-2: #f1eee8;
  --text: #171614;
  --muted: #57534b;
  --line: #dcd6cc;
  --line-strong: #847c6e;
  --accent: #8a6524;
  --accent-hover: #6d4f19;
  --accent-ink: #ffffff;
  --shadow: 0 1.25rem 2.5rem rgb(40 33 20 / 18%);
  --texture-opacity: 0.05;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.65;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Tafeltextur als ruhiger Untergrund – rein dekorativ, daher via ::before */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: image-set(
    url('../img/bg/texture-768.avif') type('image/avif'),
    url('../img/bg/texture-768.webp') type('image/webp'),
    url('../img/bg/texture-768.jpg') type('image/jpeg')
  );
  background-size: cover;
  background-position: center;
  opacity: var(--texture-opacity);
}
@media (min-width: 60em) {
  body::before {
    background-image: image-set(
      url('../img/bg/texture-1440.avif') type('image/avif'),
      url('../img/bg/texture-1440.webp') type('image/webp'),
      url('../img/bg/texture-1440.jpg') type('image/jpeg')
    );
  }
}

img, video, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { color: var(--accent-hover); }

:where(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius);
}

::selection { background: var(--accent); color: var(--accent-ink); }

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: clamp(2rem, 5vw, 3.5rem) 0;
}

/* ------------------------------------------------------------- 4 Layout */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}
.prose { max-width: var(--measure); }

main { flex: 1 0 auto; padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(3.5rem, 8vw, 6rem); }

.section + .section { margin-top: clamp(3rem, 7vw, 5.5rem); }

/* --------------------------------------------------------- 5 Kopf / Fuss */
.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  z-index: 100;
  padding: 0.7rem 1.1rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  border-radius: var(--radius);
  transition: top 0.15s var(--ease);
}
.skip-link:focus { top: 0.5rem; color: var(--accent-ink); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
/* Halbtransparent nur dort, wo beides sicher getragen wird */
@supports (backdrop-filter: blur(1px)) and (background: color-mix(in srgb, red 50%, transparent)) {
  .site-header {
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: saturate(140%) blur(14px);
  }
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem clamp(1rem, 3vw, 2.5rem);
  padding-block: 0.9rem;
}

.brand {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1rem + 0.8vw, 1.5rem);
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--text);
  text-decoration: none;
  line-height: 1.15;
  margin-right: auto;
}
.brand:hover { color: var(--text); }
.brand__role {
  display: block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.2rem;
}

.nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem clamp(0.6rem, 2vw, 1.6rem);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav a {
  display: block;
  padding: 0.35rem 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.nav a:hover { color: var(--text); border-bottom-color: var(--line-strong); }
.nav a[aria-current='page'] { color: var(--text); border-bottom-color: var(--accent); }

/* Auf schmalen Geraeten: Name und Schalter in der ersten Zeile,
   die Navigation darunter ueber die volle Breite. */
@media (max-width: 34em) {
  .site-header__inner { align-items: center; }
  .brand { flex: 1 1 auto; order: 1; min-width: 0; }
  .theme-toggle { order: 2; }
  .nav { order: 3; flex: 1 0 100%; }
  /* etwas enger, damit die Zeile neben dem Schalter Platz hat */
  .brand__role { font-size: 0.66rem; letter-spacing: 0.1em; }
}

.theme-toggle {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  /* --line-strong statt --line: Raender von Bedienelementen brauchen 3:1 (WCAG 1.4.11) */
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.theme-toggle:hover { color: var(--text); border-color: var(--line-strong); }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; fill: currentColor; }

/* Gezeigt wird immer das Symbol des Schemas, in das man wechselt.
   Grundstimmung ist dunkel, also zunaechst die Sonne. */
.theme-toggle .icon-sun  { display: block; }
.theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) .theme-toggle .icon-sun  { display: none; }
  :root:not([data-theme='dark']) .theme-toggle .icon-moon { display: block; }
}
:root[data-theme='light'] .theme-toggle .icon-sun  { display: none; }
:root[data-theme='light'] .theme-toggle .icon-moon { display: block; }
:root[data-theme='dark']  .theme-toggle .icon-sun  { display: block; }
:root[data-theme='dark']  .theme-toggle .icon-moon { display: none; }
/* Ohne JavaScript hat der Schalter keine Wirkung – dann bleibt er verborgen. */
html.no-js .theme-toggle { display: none; }

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-sunken);
  padding-block: clamp(2rem, 5vw, 3rem);
  font-size: 0.92rem;
  color: var(--muted);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem clamp(1rem, 4vw, 2.5rem);
  align-items: baseline;
  justify-content: space-between;
}
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer a { color: var(--muted); text-decoration-color: var(--line-strong); }
.site-footer a:hover { color: var(--accent-hover); }

/* --------------------------------------------------------- 6 Typografie */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.005em;
  text-wrap: balance;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2.15rem, 1.4rem + 3.4vw, 4rem); }
h2 { font-size: clamp(1.5rem, 1.15rem + 1.5vw, 2.25rem); margin-top: 0; }
h3 {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9em;
}
p { margin: 0 0 1.15em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

/* Fliesstext-Listen (Impressum, Datenschutz) */
.prose ul, .prose ol { margin: 0 0 1.15em; padding-left: 1.3em; }
.prose li { margin-bottom: 0.4em; }
.prose li::marker { color: var(--accent); }

code {
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Consolas, 'Liberation Mono', monospace;
  font-size: 0.9em;
  padding: 0.12em 0.4em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.1rem;
}
.lead {
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  line-height: 1.55;
  color: var(--text);
}
.muted { color: var(--muted); }

/* Kopfbereich einer Seite */
.page-head { margin-bottom: clamp(2rem, 5vw, 3.25rem); }
.page-head h1 { margin-bottom: 0.35em; }

/* Startseite: Name gross, Portrait daneben */
.hero {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: center;
  margin-bottom: clamp(3rem, 7vw, 5rem);
}
@media (min-width: 46em) {
  .hero { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
}
.hero h1 {
  margin-bottom: 0.3em;
  letter-spacing: -0.02em;
}
.hero__portrait {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--surface);
  overflow: hidden;
}
.hero__portrait img { width: 100%; }
@media (min-width: 46em) {
  .hero__portrait { max-width: 22rem; margin-left: auto; }
}

/* Zitat / Kritik */
blockquote.pull {
  margin: 0;
  padding: 0 0 0 clamp(1rem, 3vw, 1.75rem);
  border-left: 2px solid var(--accent);
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 1.05rem + 0.8vw, 1.6rem);
  line-height: 1.4;
  color: var(--text);
}
.quote-source {
  display: block;
  margin-top: 1rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ------------------------------------------------------------ 7 Galerie */
.gallery {
  columns: 3;
  column-gap: var(--gap);
}
@media (max-width: 60em) { .gallery { columns: 2; } }
@media (max-width: 30em) { .gallery { columns: 1; } }

.gallery figure {
  break-inside: avoid;
  margin: 0 0 var(--gap);
  /* Chromium braucht diese Zeile, sonst zerreisst es Elemente in Spalten */
  page-break-inside: avoid;
}

.gallery a {
  display: block;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ph, var(--surface));
  outline-offset: 3px;
}
.gallery img {
  width: 100%;
  transition: transform 0.5s var(--ease), filter 0.35s var(--ease);
}
.gallery a::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: inherit;
  pointer-events: none;
}
:root[data-theme='light'] .gallery a::after,
:root:not([data-theme='dark']) .gallery a::after { border-color: rgb(0 0 0 / 9%); }

@media (hover: hover) {
  .gallery a:hover img { transform: scale(1.035); }
  .gallery a:hover { box-shadow: var(--shadow); }
}
@media (prefers-reduced-motion: reduce) {
  .gallery a:hover img { transform: none; }
}

/* Bildunterschrift nur fuer Screenreader – die Bilder sprechen fuer sich */
.gallery figcaption {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ----------------------------------------------------------- 8 Lightbox */
.lightbox {
  width: min(100vw, 100%);
  max-width: none;
  max-height: none;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  overflow: hidden;
}
.lightbox::backdrop { background: rgb(6 6 8 / 97%); }
@supports (backdrop-filter: blur(1px)) {
  .lightbox::backdrop { background: rgb(6 6 8 / 88%); backdrop-filter: blur(16px); }
}

.lightbox__inner {
  display: grid;
  grid-template-rows: 1fr auto;
  height: 100%;
  padding: clamp(0.75rem, 2.5vw, 2rem);
  gap: 0.75rem;
}
.lightbox__stage {
  display: grid;
  place-items: center;
  min-height: 0;
}
/* Die Vorlagen sind hoechstens 793 px breit. Damit sie den Platz trotzdem
   nutzen, duerfen sie moderat wachsen – die Obergrenze setzt das Skript je
   Bild auf das 1,6-Fache der Originalgroesse, darueber wird es matschig. */
.lightbox__stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.lightbox__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.lightbox__caption {
  flex: 1 1 18rem;
  text-align: center;
  min-width: 0;
}
.lightbox__count { font-variant-numeric: tabular-nums; letter-spacing: 0.08em; }

.lb-btn {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.lb-btn:hover { background: var(--surface-2); border-color: var(--accent); }
.lb-btn svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lb-btn--close {
  position: absolute;
  top: clamp(0.75rem, 2.5vw, 2rem);
  right: clamp(0.75rem, 2.5vw, 2rem);
  z-index: 2;
}

/* -------------------------------------------------------------- 9 Video */
.video {
  margin: 0 0 clamp(2.5rem, 6vw, 4rem);
  max-width: 60rem;
}
.video:last-child { margin-bottom: 0; }
.video h2 { margin-bottom: 0.5em; }
.video video {
  width: 100%;
  height: auto;
  background: #000;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.video__meta {
  margin-top: 0.85rem;
  font-size: 0.88rem;
  color: var(--muted);
}
.video__meta span + span::before { content: ' · '; }

/* ------------------------------------------------------- 10 Listen/Vita */
.facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.55rem clamp(1rem, 3vw, 2rem);
  margin: 0;
  font-size: 0.98rem;
}
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.vita { margin: 0; padding: 0; list-style: none; }
.vita > li {
  display: grid;
  gap: 0.15rem clamp(1rem, 3vw, 2rem);
  padding: clamp(0.9rem, 2vw, 1.25rem) 0;
  border-top: 1px solid var(--line);
}
.vita > li:last-child { border-bottom: 1px solid var(--line); }
@media (min-width: 40em) {
  .vita > li { grid-template-columns: 7.5rem minmax(0, 1fr); }
}
.vita__year {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.vita__venue {
  font-weight: 600;
  margin: 0 0 0.35rem;
}
.vita ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.35rem;
}
.vita ul li { position: relative; padding-left: 1.05rem; }
.vita ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 0.4rem;
  height: 1px;
  background: var(--line-strong);
}
.vita .role { font-weight: 500; }
.vita .credit { color: var(--muted); }

.linklist { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.1rem; }
.linklist li { border-top: 1px solid var(--line); }
.linklist li:last-child { border-bottom: 1px solid var(--line); }
.linklist a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0.25rem;
  text-decoration: none;
  color: var(--text);
  transition: padding-left 0.2s var(--ease), color 0.15s var(--ease);
}
.linklist a:hover { color: var(--accent-hover); padding-left: 0.6rem; }
.linklist .host {
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.card-grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}
.card {
  padding: clamp(1.1rem, 3vw, 1.6rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card h3 { margin-top: 0; }

/* --------------------------------------------------- 11 Hilfsklassen */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 0.35rem; list-style: none; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: '/'; margin-right: 0.35rem; color: var(--line-strong); }
.breadcrumb a { color: var(--muted); }

.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.btn:hover { background: var(--accent); color: var(--accent-ink); }

/* ------------------------------------------------------------- 12 Druck */
@media print {
  :root { --bg: #fff; --text: #000; --muted: #444; --line: #bbb; --accent: #000; }
  body::before, .site-header, .site-footer, .theme-toggle, .lightbox { display: none !important; }
  body { font-size: 11pt; }
  a { color: #000; text-decoration: underline; }
  a[href^='http']::after { content: ' (' attr(href) ')'; font-size: 9pt; word-break: break-all; }
  .gallery { columns: 2; }
  main { padding: 0; }
}
