/* ==========================================================================
   Rafael Gutmann · Projektübersicht
   Ein Stylesheet für alle Seiten. Richtung und Tokens: siehe DESIGN.md.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  --ink:        #0B1B2B;
  --navy-800:   #12293F;
  --navy-700:   #16324F;
  --blue-600:   #1E5F8C;
  --blue-500:   #2E7FB8;
  --blue-400:   #4FA3D1;
  --blue-100:   #DCEBF5;
  --blue-50:    #F2F8FC;
  --paper:      #FFFFFF;
  --text:       #1A2430;
  --muted:      #5B6B7C;
  --rule:       #D8DEE4;

  --font-display: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --font-text:    system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Feste Typo-Skala: 13 / 14 / 16 / 19 / 24 / 32 / 48px */
  --fs-13: .8125rem;
  --fs-14: .875rem;
  --fs-16: 1rem;
  --fs-19: 1.1875rem;
  --fs-24: 1.5rem;
  --fs-32: 2rem;
  --fs-48: 3rem;

  --container: 68.75rem;   /* 1100px */
  --gutter: 1rem;
  --measure: 68ch;
  --num-col: 3rem;         /* 48px Spalte für laufende Nummern */
  --t: 120ms ease;
}

@media (min-width: 760px) {
  :root { --gutter: 2.5rem; }
}

/* --------------------------------------------------------------------------
   2. Basis
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; border-radius: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-text);
  font-size: var(--fs-16);
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
}

h1, h2, h3, h4, p, ul, ol, dl, dt, dd, figure { margin: 0; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
}

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

a {
  color: var(--blue-600);
  text-decoration: underline;
  text-underline-offset: .15em;
  transition: color var(--t), background-color var(--t), border-color var(--t);
}
a:hover { color: var(--navy-700); }

:focus-visible {
  outline: 3px solid var(--blue-500);
  outline-offset: 2px;
}

.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 10;
  padding: .5rem 1rem;
  background: var(--navy-700);
  color: var(--paper);
}
.skip-link:focus { top: 1rem; }

/* --------------------------------------------------------------------------
   3. Farbband und Kopfzeile
   -------------------------------------------------------------------------- */
.band {
  height: 6px;
  background: var(--navy-700);
}

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--rule);
}
.topbar__brand {
  font-size: var(--fs-13);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--navy-700);
  text-decoration: none;
}
.topbar__brand:hover { text-decoration: underline; }
.topbar__link { font-size: var(--fs-16); }

/* --------------------------------------------------------------------------
   4. Seitenanfang
   -------------------------------------------------------------------------- */
.intro { padding-block: 4rem 3rem; }

.intro h1 {
  font-size: var(--fs-48);
  line-height: 1.1;
  color: var(--ink);
}

.intro__text {
  margin-top: 1.5rem;
  max-width: 62ch;
  font-size: var(--fs-19);
  line-height: 1.55;
}

.facts {
  margin-top: 2rem;
  max-width: 62ch;
  display: grid;
  grid-template-columns: 8rem 1fr;
  border-top: 1px solid var(--rule);
}
.facts dt,
.facts dd {
  padding: .75rem 0;
  border-bottom: 1px solid var(--rule);
}
.facts dt {
  font-size: var(--fs-14);
  color: var(--muted);
  padding-top: .85rem;
}
.facts dd { font-size: var(--fs-16); }

.intro__link {
  display: inline-block;
  margin-top: 2rem;
}

/* --------------------------------------------------------------------------
   5. Abschnitte
   -------------------------------------------------------------------------- */
.section {
  padding-block: 3rem 4rem;
  border-top: 1px solid var(--rule);
}
.section--tint { background: var(--blue-50); }

.section__title {
  font-size: var(--fs-32);
  color: var(--navy-700);
  margin-bottom: 2rem;
}

/* --------------------------------------------------------------------------
   6. Projektverzeichnis
   -------------------------------------------------------------------------- */
.index {
  list-style: none;
  padding: 0;
}

.entry {
  position: relative;
  display: grid;
  grid-template-columns: var(--num-col) 240px 1fr auto;
  column-gap: 1.5rem;
  align-items: start;
  padding: 1.5rem 1rem;
  margin-inline: -1rem;
  transition: background-color var(--t);
}
.entry + .entry { border-top: 1px solid var(--rule); }
.entry:hover { background: var(--blue-50); }

.entry__num,
.entry__arrow {
  font-size: var(--fs-14);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: .35rem;
}
.entry__arrow {
  font-size: var(--fs-16);
  transition: color var(--t);
}
.entry:hover .entry__arrow { color: var(--blue-600); }

.entry__media {
  width: 240px;
  max-width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--blue-100);
}
.entry__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.entry__body { min-width: 0; }

.entry__kicker {
  font-size: var(--fs-13);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.entry__title {
  margin-top: .25rem;
  font-size: var(--fs-24);
}
.entry__title a {
  color: var(--navy-700);
  text-decoration: none;
}
/* Ganze Zeile klickbar: der Titel-Link deckt den Eintrag ab. Ohne JS. */
.entry__title a::after {
  content: "";
  position: absolute;
  inset: 0;
}
.entry:hover .entry__title a { text-decoration: underline; }

.entry__text {
  margin-top: .5rem;
  max-width: var(--measure);
}

.entry__tech {
  margin-top: .75rem;
  font-size: var(--fs-14);
  color: var(--muted);
}
.entry__tech .sep { margin-inline: .5em; }

/* Fokus auf der ganzen Zeile, wo :has() verfügbar ist */
@supports selector(:has(a)) {
  .entry:has(.entry__title a:focus-visible) {
    outline: 3px solid var(--blue-500);
    outline-offset: 0;
  }
  .entry__title a:focus-visible { outline: none; }
}

/* --------------------------------------------------------------------------
   7. Arbeitsweise
   -------------------------------------------------------------------------- */
.method {
  list-style: none;
  padding: 0;
  max-width: var(--measure);
  counter-reset: step;
}
.method li {
  display: grid;
  grid-template-columns: var(--num-col) 1fr;
  column-gap: 1.5rem;
  padding: 1.5rem 0;
}
.method li + li { border-top: 1px solid var(--rule); }
.method li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-size: var(--fs-14);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: .2rem;
}
.method h3 {
  font-size: var(--fs-19);
  color: var(--navy-700);
}
.method p { margin-top: .5rem; }

/* --------------------------------------------------------------------------
   8. Footer
   -------------------------------------------------------------------------- */
.footer {
  background: var(--ink);
  color: var(--blue-100);
  padding-block: 3rem 1.5rem;
}
.footer a { color: var(--blue-400); }
.footer a:hover { color: var(--paper); }

.footer__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.footer h2 {
  font-family: var(--font-text);
  font-size: var(--fs-13);
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--blue-400);
  margin-bottom: .75rem;
}
.footer dl { display: grid; gap: .25rem; }
.footer dt { font-size: var(--fs-14); color: var(--blue-400); }
.footer ul { list-style: none; padding: 0; display: grid; gap: .25rem; }

.footer__bottom {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, .15);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  font-size: var(--fs-14);
}

/* --------------------------------------------------------------------------
   8a. Unterseiten: Brotkrumen, Titelblock, Faktenleiste, Titelbild
   -------------------------------------------------------------------------- */
.crumbs {
  list-style: none;
  padding: 0;
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  font-size: var(--fs-14);
  color: var(--muted);
}
.crumbs .sep { margin-inline: .6em; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--navy-700); }

.title { padding-block: 2.5rem 2rem; }

.title__kicker {
  font-size: var(--fs-13);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--blue-600);
}
.title h1 {
  margin-top: .5rem;
  font-size: var(--fs-48);
  line-height: 1.1;
  color: var(--ink);
}
.title__text {
  margin-top: 1.5rem;
  max-width: 62ch;
  font-size: var(--fs-19);
  line-height: 1.55;
}

.facts--project {
  margin-top: 0;
  max-width: var(--measure);
  grid-template-columns: 10rem 1fr;
}

.cover {
  margin-block: 2.5rem 3rem;
  aspect-ratio: 3 / 2;
  background: var(--blue-100);
}
.cover img { width: 100%; height: 100%; object-fit: cover; }

/* --------------------------------------------------------------------------
   8b. Unterseiten: Fließtext
   -------------------------------------------------------------------------- */
.prose { max-width: var(--measure); }
.prose h2 {
  font-size: var(--fs-24);
  color: var(--navy-700);
  margin-top: 3rem;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 {
  font-size: var(--fs-19);
  color: var(--navy-700);
  margin-top: 2rem;
}
.prose p { margin-top: 1rem; }
.prose ul { margin-top: 1rem; padding-left: 1.25rem; }
.prose li + li { margin-top: .5rem; }
.prose .method { margin-top: 1rem; }
.prose dl { margin-top: 1rem; }
.prose dt { font-size: var(--fs-14); color: var(--muted); margin-top: .75rem; }
.prose dd { margin-top: .1rem; }

/* Ausfüll- und Prüfstellen: sichtbar, ohne Dekoration */
.todo {
  background: var(--blue-100);
  color: var(--text);
  padding-inline: .15em;
}

/* --------------------------------------------------------------------------
   8c. Unterseiten: Dokumentation (Tabelle), Abbildungen, Video, Seitennavigation
   -------------------------------------------------------------------------- */
.docs {
  margin-top: 4rem;
  padding-block: 3rem;
  background: var(--blue-50);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.docs h2 {
  font-size: var(--fs-24);
  color: var(--navy-700);
}
.docs p { margin-top: .75rem; max-width: var(--measure); }

.table-wrap { margin-top: 1.5rem; overflow-x: auto; }
.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-16);
}
.doc-table th,
.doc-table td {
  text-align: left;
  vertical-align: top;
  padding: .75rem 1.5rem .75rem 0;
  border-bottom: 1px solid var(--rule);
}
.doc-table th {
  font-size: var(--fs-14);
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom-color: var(--navy-700);
}
.doc-table td:last-child,
.doc-table th:last-child { padding-right: 0; white-space: nowrap; }

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}
.gallery figure { margin: 0; }
.gallery a { display: block; }
.gallery img { width: 100%; height: auto; background: var(--blue-100); }
figcaption {
  margin-top: .5rem;
  font-size: var(--fs-14);
  color: var(--muted);
}

/* Unterabschnitte auf Projektseiten: 24px-Überschrift, weniger Abstand */
.section--sub { padding-block: 2.5rem 1rem; border-top: 0; }
.section--sub .section__title { font-size: var(--fs-24); margin-bottom: 0; }

.video { margin-top: 1.5rem; }
.video video { width: 100%; height: auto; background: var(--ink); }

.pagenav {
  margin-top: 4rem;
  padding-block: 1.5rem 3rem;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

/* --------------------------------------------------------------------------
   9. Responsiv
   -------------------------------------------------------------------------- */
@media (max-width: 700px) {
  .gallery { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .entry {
    grid-template-columns: var(--num-col) 1fr;
    row-gap: 1rem;
  }
  .entry__num { grid-row: 1 / span 2; }
  .entry__media { grid-column: 2; width: 100%; max-width: 360px; }
  .entry__body { grid-column: 2; }
  .entry__arrow { display: none; }
  .footer__grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .intro { padding-block: 3rem 2.5rem; }
  .intro h1,
  .title h1 { font-size: var(--fs-32); }
  .section__title { font-size: var(--fs-24); }
  .facts { grid-template-columns: 1fr; }
  .facts dt { padding-bottom: 0; border-bottom: 0; }
  .facts dd { padding-top: .25rem; }
}

/* --------------------------------------------------------------------------
   10. Bewegung reduzieren
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
