/* ─────────────────────────────────────────────────────────────────────────────
   Adel Gavranović — Übungsstunde Informatik
   Seitenspalte (fix) + Material (scrollt).

   Mobile first. One breakpoint at 860px turns the page into two columns —
   that covers iPad portrait (768px: one column, comfortable) and iPad
   landscape / laptops (two columns).
   ───────────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg:      #111111;
  --ink:     #e8e6e3;
  --ink-dim: #b8b6b1;
  --muted:   #8a8a85;
  --faint:   #6f6e6a;
  --ghost:   #575653;
  --dead:    #44433f;
  --amber:   #f0a020;
  --rule:    rgba(255, 255, 255, .14);
  --hair:    rgba(255, 255, 255, .06);
  --amber-line: rgba(240, 160, 32, .35);
  --amber-lift: #ffc35a;
  --amber-wash: rgba(240, 160, 32, .12);
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Rubriken (ECKDATEN, KONTAKT) und die Werte darunter liegen auf einer
     Grösse. Eine Zahl ändern, beide ziehen mit. */
  --side-text: 14px;

  /* Alles in einer Material-Zeile — Nummer, Datum, Thema, Dateien, "noch
     nicht" — liegt auf einer Grösse. Eine Zahl ändern, die ganze Liste zieht
     mit. */
  --row-text: 15px;

  /* Pfeil in eine Ablage — das übliche Download-Zeichen. Als Maske, nicht
     als Bild, damit es die Textfarbe erbt (amber, dunkel auf dem Button,
     schwarz im Druck). IBM Plex Mono hat kein passendes Glyph: U+2913 ⤓
     fehlt, und das blosse ↓ liest sich nicht als Download. */
  --dl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2.2v7.6'/%3E%3Cpath d='M4.6 6.7 8 10.1l3.4-3.4'/%3E%3Cpath d='M2.6 13.4h10.8'/%3E%3C/svg%3E");
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--mono);
  text-wrap: pretty;
}

a { color: var(--amber); text-decoration: none; }
a:hover, a:focus-visible { color: var(--amber-lift); }

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

.skip {
  position: absolute; left: -9999px;
  background: var(--amber); color: var(--bg);
  padding: 10px 14px; border: 0;
}
.skip:focus { left: 12px; top: 12px; z-index: 10; }

.sep   { color: var(--dead); }
.emph  { color: var(--amber); }
.date  { color: var(--faint); }

/* ── Grundgerüst ─────────────────────────────────────────────────────────── */

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 22px 40px;
}

@media (min-width: 860px) {
  .wrap {
    display: grid;
    /* Breit genug für "adel.gavranovic@inf.ethz.ch" (227px bei 14px Plex Mono)
       plus Label-Spalte und Innenabstand — darunter bricht die Mail um. */
    grid-template-columns: clamp(340px, 32vw, 380px) minmax(0, 1fr);
    gap: 0;
    padding: 56px 40px 48px;
  }
  .side {
    position: sticky;
    top: 56px;
    align-self: start;
    padding-right: 32px;
    border-right: 1px solid rgba(255, 255, 255, .1);
    min-height: 0;
  }
  main { padding-left: 40px; }
}

/* ── Seitenspalte ────────────────────────────────────────────────────────── */

header h1 {
  margin: 0;
  font-size: 27px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: -.01em;
}
.role {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.side .meta { margin-top: 28px; padding-top: 26px; border-top: 1px solid rgba(255, 255, 255, .12); }

.side h2 {
  margin: 0 0 12px;
  font-size: var(--side-text);
  font-weight: 400;
  line-height: 1;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

.pairs {
  margin: 0;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 6px 16px;
  font-size: var(--side-text);
  line-height: 1.8;
}
.pairs dt { color: var(--muted); }
.pairs dd { margin: 0; overflow-wrap: anywhere; }

.side footer {
  margin-top: 36px;
  font-size: 12px;
  line-height: 1;
  color: var(--dead);
}
.side footer p { margin: 0; }

@media (max-width: 859px) {
  .side footer { display: none; }   /* Fusszeile wandert ans Seitenende, siehe unten */
  main { margin-top: 30px; }
}

/* ── Aktuell ─────────────────────────────────────────────────────────────── */

.now {
  border-left: 3px solid var(--amber);
  padding: 2px 0 4px 20px;
}
.now h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
.now-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 20px;
  align-items: center;
  margin-top: 12px;
}
.session {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.15;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.session .date { font-size: 14px; font-weight: 400; }

.actions {
  margin: 0 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Der Knopf unter "Aktuell" zieht mit der Übungsstunde daneben fett mit. */
.now .actions .btn { font-weight: 700; }

a.btn::after,
a.chip::after {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-left: .55em;
  vertical-align: -.15em;
  background-color: currentColor;
  -webkit-mask: var(--dl) center / contain no-repeat;
  mask: var(--dl) center / contain no-repeat;
}

.btn {
  display: inline-block;
  font-size: 15px;
  line-height: 1;
  padding: 14px 20px;
  background: var(--amber);
  color: var(--bg);
  border: 1px solid var(--amber);
}
.btn:hover, .btn:focus-visible { background: #ffb43c; border-color: #ffb43c; color: var(--bg); }
.btn.ghost { background: none; color: var(--amber); border-color: var(--amber-line); }
.btn.ghost:hover { background: var(--amber-wash); color: var(--amber); }
.btn.pending { background: none; color: var(--ghost); border-color: rgba(255, 255, 255, .12); cursor: default; }

@media (max-width: 559px) {
  .session { font-size: 22px; }
  .actions { margin-left: 0; width: 100%; }
  .actions .btn { flex: 1 1 auto; text-align: center; }
}

/* ── Material ────────────────────────────────────────────────────────────── */

#material { margin-top: 48px; }

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
main h2 { margin: 0; font-size: 18px; font-weight: 700; line-height: 1; }
.note { margin: 0; font-size: 12px; line-height: 1; color: var(--ghost); }

.rows { margin-top: 16px; border-top: 1px solid var(--rule); }

/* Eine Zeile liest sich als: NN DD.MM. Thema — Dateien rechts.
   Nummer und Datum werden auf ihre Breite geschrumpft (auto), nicht auf eine
   feste Spalte: die Nummer ist zwei Zeichen breit, eine feste Spalte liesse
   daneben ein Loch. Weil Grid-Spalten über alle Zeilen geteilt werden,
   fluchten Datum und Thema trotzdem untereinander. Das Thema nimmt den Rest,
   die Dateien werden nach rechts gedrückt. */
.row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 8px 18px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--hair);
}
.row .us    { font-size: var(--row-text); color: var(--ink); }
.row .date  { font-size: var(--row-text); color: var(--muted); }
.row .topic { font-size: var(--row-text); color: var(--ink); }

/* is-now trägt zur Zeit keine Farbe mehr: die Nummer ist in jeder Zeile weiss.
   Die Klasse bleibt als Haken stehen — die laufende Woche steht ohnehin oben
   im Aktuell-Block. */

/* Eine Woche, die noch nicht war, nimmt sich zurück — Nummer, Datum und
   Thema verlieren den Kontrast, das "noch nicht" rechts trägt die Aussage. */
.row.is-future .us,
.row.is-future .date,
.row.is-future .topic { color: #4e4d4a; }

.files { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 18px; }

/* Kein Rahmen — der Kasten bleibt dem einen Knopf unter "Aktuell" vorbehalten.
   Der senkrechte Innenabstand bleibt, er trägt die Tap-Fläche; waagrecht auf 0,
   damit die Chips bündig mit der rechten Kante der Zeile abschliessen. */
.chip {
  display: inline-block;
  font-size: var(--row-text);
  line-height: 1;
  padding: 9px 0;
  color: var(--amber);
}
.chip:hover, .chip:focus-visible { color: #ffb43c; }
.chip.pending { color: var(--ghost); cursor: default; }
.soon { font-size: var(--row-text); color: var(--dead); }

/* Phone: Nummer und Datum in eine Zeile, Thema und Dateien darunter — die Chips
   bleiben dabei mindestens 44px hoch, damit sie sich mit dem Daumen treffen
   lassen. */
@media (max-width: 559px) {
  .row {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 14px 0;
  }
  .row .topic { grid-column: 1 / -1; }
  .row .files { grid-column: 1 / -1; justify-content: flex-start; }
  .chip { padding: 15px 0; }   /* 15px Zeile + 2x15 = 45px Tap-Fläche */
}

/* ── Benachrichtigungen (optional) ───────────────────────────────────────── */

main section + section { margin-top: 44px; }

.pairs.notes {
  grid-template-columns: 120px minmax(0, 1fr);
  font-size: 15px;
  line-height: 1.7;
}
.pairs.notes dd p { margin: 0 0 8px; }
.pairs.notes .lead { color: var(--ink); }
.pairs.notes dd p + p { color: var(--ink-dim); }

/* ── Fusszeile auf schmalen Schirmen ─────────────────────────────────────── */

@media (max-width: 859px) {
  main::after {
    content: "Adel Gavranović // Zürich";
    display: block;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, .1);
    font-size: 12px;
    color: var(--faint);
  }
}

@media print {
  /* Die Tokens einmal auf Papier umstellen, damit jede Farbe mitzieht — sonst
     bleiben Links amber (#f0a020 auf Weiss ist nicht lesbar) und die Grautöne
     zu hell. */
  :root {
    --bg: #ffffff;
    --ink: #000000;
    --ink-dim: #222222;
    --muted: #444444;
    --faint: #555555;
    --ghost: #666666;
    --dead: #777777;
    --amber: #000000;
    --rule: #bbbbbb;
    --hair: #dddddd;
    --amber-line: #666666;
    --amber-lift: #000000;
    --amber-wash: none;
  }
  body { background: #fff; color: #000; }
  .side { border: 0; }
  .btn, .chip { border-color: #000; color: #000; background: none; }
}
