/* jonatanbischof.ch – Richtung E
   Aufbau: schwarze Startseite mit Bildreihen, Index als schwarzes Panel rechts,
   Projekt / About / News als weisses Panel links. Farben: nur Schwarz, Weiss, Rot. */

@font-face { font-family: "Instrument Sans"; src: url("/fonts/instrument-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/fonts/instrument-sans-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/fonts/instrument-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --rot: #ff2929;
  --schwarz: #000000;
  --weiss: #ffffff;
  --rand: 1.2rem;      /* Abstand zum Rand */
  --fuge: 0.4rem;      /* Abstand zwischen Bildern */
  --spalte: 1.9rem;    /* Abstand zwischen Textspalten */
  --text: 1.1rem;      /* Lauftext */
  --gross: 2rem;       /* Kopfzeile */
}

/* Die ganze Seite skaliert mit der Fensterbreite: 1rem = 0.9 % der Breite */
html { font-size: clamp(11px, 0.9vw, 22px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--schwarz); color: var(--weiss); font-family: "Instrument Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: var(--text); line-height: 1.25; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
p, h1, dl, dd, figure { margin: 0; }
img, video { display: block; max-width: 100%; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--rot); outline-offset: 2px; }

/* ---------- Kopfzeile ---------- */
.hd { position: fixed; top: 0; left: 0; right: 0; z-index: 30; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--spalte); align-items: start; padding: var(--rand); font-size: var(--gross); line-height: 1; color: var(--weiss); mix-blend-mode: difference; pointer-events: none; }
.hd a { pointer-events: auto; justify-self: start; }
.hd__clock { font-variant-numeric: tabular-nums; }
.hd .hd__plus { justify-self: end; width: 1em; height: 1em; }
.hd__plus svg { width: 100%; height: 100%; }

/* ---------- Startseite ---------- */
.intro { min-height: 80vh; min-height: 80svh; display: flex; align-items: flex-end; padding: var(--rand); box-sizing: border-box; }
.intro__grid { display: grid; grid-template-columns: 4fr 2fr 6fr; gap: var(--spalte); width: 100%; }
.intro a { text-decoration: underline; text-underline-offset: 0.15em; }
.intro a:hover { color: var(--rot); }

.rows { display: flex; flex-direction: column; gap: var(--fuge); }
.row { display: flex; gap: var(--fuge); }
/* Jede Zelle bekommt ihre Breite aus dem Seitenverhältnis: so sind alle Bilder einer Reihe gleich hoch */
.cell { position: relative; flex: var(--r, 1.5) 1 0; min-width: 0; aspect-ratio: var(--r, 1.5); display: block; overflow: hidden; background: var(--schwarz); }
.cell img, .cell video { width: 100%; height: 100%; object-fit: cover; }
.cap { position: absolute; left: var(--rand); right: var(--rand); bottom: var(--rand); color: var(--rot); }
.cap b { font-weight: 700; text-transform: uppercase; }
a.cell:hover .cap { color: var(--weiss); }

.platzhalter { width: 100%; height: 100%; background: var(--schwarz); color: var(--rot); display: flex; align-items: center; justify-content: center; text-align: center; padding: var(--rand); box-sizing: border-box; overflow-wrap: anywhere; }

.fuss { display: flex; justify-content: space-between; gap: var(--spalte); padding: var(--rand); }
.fuss a:hover { color: var(--rot); }

/* ---------- Panels ---------- */
.scrim { position: fixed; inset: 0; z-index: 32; display: none; cursor: default; }
.panel { position: fixed; top: 0; bottom: 0; z-index: 40; display: none; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; box-sizing: border-box; padding: 1rem; }
.panel--index { right: 0; width: 50%; background: var(--schwarz); color: var(--rot); z-index: 36; }
.panel--page { left: 0; width: 40%; background: var(--weiss); color: var(--schwarz); }
.panel--page.panel--breit { width: 64.4%; }

.is-index .panel--index, .is-page .panel--page { display: block; }
.is-index .scrim, .is-page .scrim { display: block; }
/* Hinter dem weissen Panel verschwimmt die Startseite */
.is-page .home, .is-page .hd { filter: blur(0.45rem); }
.is-page .hd { pointer-events: none; }

.panel__x { display: block; width: var(--gross); height: var(--gross); margin-left: auto; }
.panel__x svg { width: 100%; height: 100%; }
.panel__x:hover { color: var(--rot); }
.panel--index .panel__x { color: var(--weiss); position: sticky; top: 0; }
.panel--index .panel__x:hover { color: var(--rot); }
.panel__kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--spalte); margin-bottom: 3.6rem; }
.panel__kopf h1 { font-size: var(--text); font-weight: 400; line-height: 1.25; text-transform: lowercase; }

/* Index */
.ix-list { display: flex; flex-direction: column; }
.ix-list--top { margin: 1.4rem 0 3.6rem; }
.ix { display: grid; grid-template-columns: 2fr 4fr 2.8fr 3.2fr; gap: 0 1rem; font-size: 1.3rem; line-height: 1.22; }
.ix > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.ix:hover, a.ix[aria-current="page"] { color: var(--weiss); }
.ix--aus { opacity: 0.5; }

/* Weisses Panel: Fakten links, Text rechts */
.cols { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: var(--spalte); margin-bottom: 3.6rem; }
.fakten { grid-column: 1 / 3; display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--spalte); align-content: start; text-transform: lowercase; }
.fakten dd { min-width: 0; overflow-wrap: anywhere; }
.fakten a, .text a { text-decoration: underline; text-underline-offset: 0.15em; }
.fakten a:hover, .text a:hover, .weiter a:hover { color: var(--rot); }
.text { display: flex; flex-direction: column; gap: 1.25em; min-width: 0; }
.text .claim { font-style: italic; }
.text--about { max-width: 46rem; }
.text--about .portrait { max-width: 22rem; }
.text--about .portrait img { width: 100%; height: auto; }
.text--about .links { text-transform: lowercase; }

.rows--panel .cell { background: var(--weiss); margin: 0; }
.legende { padding: 0.2rem 0 1rem; }
.weiter { display: flex; justify-content: space-between; gap: var(--spalte); padding: 3.6rem 0 1rem; text-transform: lowercase; }

.news .cols { margin-bottom: 4.5rem; }
.fakten--news > span { display: block; }
.news__bild { max-width: 30rem; }
.news__bild img, .news__bild video { width: 100%; height: auto; }
.news__bild .platzhalter { aspect-ratio: 3 / 2; }

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
  html { font-size: 14px; }
  :root { --rand: 1rem; --fuge: 0rem; --text: 1.1rem; --gross: 1.55rem; --spalte: 1.2rem; }
  .hd { grid-template-columns: auto 1fr auto; }
  .hd__clock { justify-self: center !important; }
  .intro { min-height: 88vh; min-height: 88svh; }
  .intro__grid { grid-template-columns: 1fr; gap: 2rem; }
  .row { flex-direction: column; }
  .cell { flex: none; width: 100%; }
  .panel, .panel--page.panel--breit { width: 100%; }
  .panel__kopf { margin-bottom: 2.4rem; }
  .ix { grid-template-columns: 3.2rem minmax(0, 1.5fr) minmax(0, 1fr); font-size: 1.2rem; line-height: 1.5; }
  .ix > span:nth-child(4) { display: none; }
  .cols { grid-template-columns: 1fr; gap: 2.4rem; margin-bottom: 2.4rem; }
  .fakten { grid-column: auto; grid-template-columns: 2fr 3fr; }
  .rows--panel { gap: 0.4rem; }
  .rows--panel .row { gap: 0.4rem; }
  .weiter { flex-direction: column; gap: 0.6rem; }
  .panel__x, .hd .hd__plus { width: 2rem; height: 2rem; }
  /* Grosse Trefferfläche für Schliessen und Plus */
  .panel__x, .hd__plus { position: relative; }
  .panel__x::after, .hd__plus::after { content: ""; position: absolute; inset: -0.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .is-page .home, .is-page .hd { filter: none; opacity: 0.35; }
}
