/* ---------------------------------------------------------------- Basis */

:root {
  --fg: #000;
  --bg: #fff;
  --line: 1.25rem;                              /* Zeilenhöhe = 20px */
  --edge: 0.5rem;                               /* Abstand der Texte zum Rand */
  --bar: calc(var(--line) + 2 * var(--edge));   /* Höhe einer Textleiste = 2.25rem */
  --space: 1.25rem;                             /* allgemeiner Abstand */
}

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

html {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 100%;                              /* 1rem = 16px */
  line-height: var(--line);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
}

h1, h2, h3, h4, p, ul, ol, dl, dd, address, button {
  font: inherit;
  line-height: inherit;
}

ul, ol {
  list-style: none;
}

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

a,
button {
  color: inherit;
  text-decoration: none;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

a:hover,
a[aria-current],
button:hover {
  text-decoration: underline;
  text-decoration-thickness: 0.0625rem;
  text-underline-offset: 0.2rem;
}

:focus-visible {
  outline: 0.0625rem solid var(--fg);
  outline-offset: 0.1875rem;
}

/* ------------------------------------------------------- Menü & Fußzeile */

.bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0 var(--space);
  padding: var(--edge);
}

/* obere Leiste: fixiert, nur Text */
.bar--top {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  pointer-events: none;
}

.bar--top a {
  pointer-events: auto;
}

.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space);
}

/* ----------------------------------------------- Startseite: Streubild */

.scatter {
  position: relative;
  margin: calc(var(--bar) + 2.5rem) var(--bar) 2.5rem;
}

.scatter__item {
  display: block;
}

.scatter__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #f2f2f2;
}

/* ohne JavaScript: einfaches Raster */
html:not(.js) .scatter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space);
}

html:not(.js) .scatter__item {
  width: 8.75rem;
}

/* mit JavaScript: Platzierung durch scatter.js */
.js .scatter {
  visibility: hidden;
}

.js .scatter.is-ready {
  visibility: visible;
}

.js .scatter__item {
  position: absolute;
}

/* gestaffelter Schatten: setzt an den Ecken an und läuft nach unten rechts weich aus */
.scatter__item img {
  box-shadow:
    0.0625rem 0.0625rem 0.0625rem rgba(0, 0, 0, 0.3),
    0.125rem 0.125rem 0.1875rem rgba(0, 0, 0, 0.22),
    0.25rem 0.25rem 0.375rem rgba(0, 0, 0, 0.18),
    0.4375rem 0.4375rem 0.625rem rgba(0, 0, 0, 0.14);
}

/* ---------------------------------------------- Werkansicht: Passepartout */

/* Rand ringsum = Höhe einer Textleiste; oben liegt die fixierte Leiste darin */
.passepartout {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100vh;
  height: 100dvh;
  padding-top: var(--bar);
}

.stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0 var(--bar);
  container-type: size;
}

/* Werk im Ausschnitt: so groß wie möglich, feine Schrägschnitt-Kante */
.stage__bild {
  width: min(100cqw, 100cqh * var(--ratio));
  height: auto;
  aspect-ratio: var(--ratio);
  padding: 0.25rem;
  background: linear-gradient(135deg, #e9e9e6, #fafaf8 50%, #f1f1ee);
  box-shadow:
    0 0 0 0.0625rem rgba(0, 0, 0, 0.06),
    inset 0 0 0 0.0625rem rgba(0, 0, 0, 0.04);
}

.stage__bild[hidden] {
  display: none;
}

.stage__nav {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
}

.stage__nav--prev {
  left: 0;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpath d='M20 6 10 16l10 10' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E") 16 16, w-resize;
}

.stage__nav--next {
  right: 0;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpath d='m12 6 10 10-10 10' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E") 16 16, e-resize;
}

.stage__nav:hover {
  text-decoration: none;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space);
}

.zaehler {
  font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------- Textseiten */

.sections {
  padding: calc(var(--bar) + 2.5rem) var(--edge) 3.75rem;
}

.section {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) 3fr;
  gap: 0 var(--space);
}

.section + .section {
  margin-top: 3.75rem;
}

.section__body {
  max-width: 40rem;
  font-style: normal;
}

.prose > * + * {
  margin-top: var(--line);
}

.prose h2,
.prose h3 {
  margin-top: 2.5rem;
}

.prose a {
  text-decoration: underline;
  text-decoration-thickness: 0.0625rem;
  text-underline-offset: 0.2rem;
}

.prose ul > li::before {
  content: "– ";
}

.prose blockquote {
  padding-left: 1.5rem;
}

.rows {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 0 var(--space);
}

.portrait {
  width: 20rem;
}

.intro {
  margin-bottom: var(--line);
}

.section__body:has(.index) {
  max-width: 60rem;
}

.index a {
  display: grid;
  grid-template-columns: 3fr 1fr 3fr 2fr;
  gap: 0 1rem;
}

.vorschau {
  position: fixed;
  z-index: 5;
  object-fit: cover;
  background: #f2f2f2;
  pointer-events: none;
  visibility: hidden;
}

.vorschau.is-visible {
  visibility: visible;
}

@media (max-width: 45rem) {
  .scatter {
    margin-left: var(--edge);
    margin-right: var(--edge);
  }

  .section {
    grid-template-columns: 1fr;
  }

  .section__label {
    margin-bottom: var(--line);
  }

  .index a {
    grid-template-columns: 1fr auto;
  }

  .index a span:nth-child(n + 3) {
    display: none;
  }
}
