/* ==========================================================================
   Fearless Engineers · VHS: Kursübersicht und Kursbereich
   Designsprache wie ARES (theme.css, "haja"-Theme der Lernhefte): Tafelgrün,
   Gold und Orange als Akzente, Haja Display in Versalien für Titel, Mono für
   kleine Etiketten. Ruhig gehalten: keine Unschärfe, keine dekorativen
   Verläufe, keine Animationen.
   ========================================================================== */

@font-face {
  font-family: "Haja Display";
  src: url("assets/theme/ObelixPro-DE.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* Tafelgrün */
  --bg: #0c1f08;
  --bg-2: #112a0c;
  --surface: #17340f;
  --surface-2: #1e4214;
  --topbar: #1c4510;

  /* Kreide */
  --ink: #f3f8f0;
  --text: #cbd8c7;
  --muted: #bdd0b6;
  --soft: #9db098;
  --line: rgba(206, 226, 198, .18);
  --line-2: rgba(206, 226, 198, .32);

  /* Akzente */
  --gold: #fdbd2e;
  --gold-hi: #ffd05f;
  --rust: #fd8c3d;

  --display: "Haja Display", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: Menlo, "SF Mono", Consolas, monospace;

  --tafel: url("assets/theme/tafel.webp");
  --wrap: 1240px;
}

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

html { background: var(--bg); scroll-behavior: smooth; scroll-padding-top: 24px; }

body {
  margin: 0;
  min-width: 320px;
  font: 16px/1.65 var(--sans);
  color: var(--text);
  background:
    linear-gradient(rgba(8, 28, 6, .9), rgba(8, 28, 6, .94)),
    var(--tafel) center top / cover fixed,
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--gold); }
a:hover { color: var(--gold-hi); }
p { margin: 0 0 16px; }
p:last-child { margin-bottom: 0; }
strong { color: var(--ink); font-weight: 650; }
code { font: 13px var(--mono); color: var(--gold); overflow-wrap: anywhere; }

:focus-visible { outline: 2px solid #f3bc69; outline-offset: 3px; }

/* Titel ------------------------------------------------------------------- */
h1, h2, .display {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--ink);
  margin: 0 0 .55em;
  text-wrap: balance;
}
h1 { font-size: clamp(30px, 4vw, 46px); line-height: 1.1; }
h2 { font-size: clamp(22px, 2.4vw, 28px); line-height: 1.2; }
h3 { font-size: 18px; line-height: 1.35; font-weight: 640; color: var(--ink); margin: 0 0 8px; }

.eyebrow {
  font: 600 11.5px/1.6 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 12px;
}

.subhead {
  font: 600 11px/1.6 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--soft);
  margin: 0 0 14px;
}

.lead { font-size: 17px; line-height: 1.65; max-width: 720px; color: var(--text); }

.skip-link {
  position: fixed; top: -100px; left: 20px; z-index: 20;
  padding: 10px 20px; border-radius: 4px;
  background: var(--gold); color: var(--bg);
}
.skip-link:focus { top: 12px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 40px; }

/* Knöpfe, Etiketten --------------------------------------------------------- */
.button, button.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 46px; padding: 10px 20px;
  border: 1px solid var(--line-2); border-radius: 9px;
  background: var(--surface-2); color: var(--ink);
  font: 650 15px/1.4 var(--sans); text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.button:hover { border-color: var(--gold); background: #2a5219; color: var(--ink); }
.button.primary { background: var(--gold); border-color: var(--gold); color: #162906; }
.button.primary:hover { background: var(--gold-hi); border-color: var(--gold-hi); color: #162906; }
.button.quiet { background: transparent; border-color: transparent; color: var(--muted); }
.button.quiet:hover { color: var(--ink); background: transparent; border-color: var(--line-2); }
.button.small { min-height: 40px; padding: 7px 16px; font-size: 14px; }
.button[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.button svg { width: 18px; height: 18px; flex: 0 0 18px; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }

.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.badge {
  display: inline-flex; align-items: center; padding: 4px 10px;
  border: 1px solid rgba(253, 189, 46, .38); border-radius: 5px;
  color: #f1daa1; background: rgba(253, 189, 46, .07);
  font: 10.5px/1.6 var(--mono); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
}
.badge.neutral { color: var(--muted); background: rgba(189, 208, 182, .06); border-color: var(--line); }
.badge.rust { color: #ffc79c; background: rgba(253, 140, 61, .09); border-color: rgba(253, 140, 61, .45); }

.hint { font-size: 13px; line-height: 1.55; color: var(--soft); }

/* Kopfzeile ----------------------------------------------------------------- */
.topbar {
  position: relative; display: flex; align-items: center; gap: 28px;
  min-height: 76px; padding: 12px 40px;
  background: var(--topbar) var(--tafel) center / cover no-repeat;
}
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--gold); }

.brand { display: flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; min-width: 0; }
.brand:hover { color: var(--ink); }
.brand-logo { width: 42px; height: 42px; border-radius: 50%; flex: 0 0 42px; display: block; }
.brand-text { font-family: var(--display); font-size: 20px; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.brand-dot { color: var(--gold); margin-left: .25em; }
.brand-sub {
  font: 11px var(--mono); letter-spacing: .16em; color: #dbe9d4;
  padding-left: 14px; border-left: 1px solid var(--line-2);
}

.topnav { margin-left: auto; display: flex; align-items: center; gap: 26px; }
.topnav a { color: #dbe9d4; text-decoration: none; font-size: 14.5px; font-weight: 600; }
.topnav a:hover { color: #fff; }
.signin {
  min-height: 38px; padding: 6px 16px; border-radius: 9px;
  background: transparent; border: 1px solid rgba(223, 186, 92, .55);
  color: #f1daa1; font: 600 14px var(--sans); cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.signin:hover { background: rgba(223, 186, 92, .1); border-color: var(--gold); }
.signin svg { width: 16px; height: 16px; }

/* Seitenkopf (beide Seiten) ---------------------------------------------------- */
.page-head { padding: 48px 0 40px; border-bottom: 1px solid var(--line); }
.crumbs { font: 12px var(--mono); letter-spacing: .06em; color: var(--soft); margin-bottom: 18px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.page-head h1 { margin-bottom: 12px; }

.facts-inline { display: flex; flex-wrap: wrap; gap: 14px 44px; margin: 22px 0 0; }
.facts-inline dt { font: 600 10.5px/1.7 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--soft); }
.facts-inline dd { margin: 2px 0 0; font-size: 15px; color: var(--ink); }

/* Kursübersicht -------------------------------------------------------------- */
.courses { padding: 44px 0 84px; }

.course {
  display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  background: linear-gradient(150deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden;
}
.course-visual {
  padding: 32px; display: flex; flex-direction: column; justify-content: center; gap: 18px; min-width: 0;
  background: #0e150d; border-right: 1px solid var(--line);
}
.window-bar {
  display: flex; align-items: center; gap: 7px; padding: 9px 12px;
  background: #162014; border-bottom: 1px solid var(--line);
  font: 11.5px var(--mono); letter-spacing: .08em; color: var(--soft);
}
.window-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); display: block; }
.window-bar span { margin-left: 8px; }
.editor { border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: #101a0e; }
.editor pre {
  margin: 0; padding: 16px 18px; font: 14.5px/1.75 var(--mono); color: #e8f0e4;
  overflow-x: auto; white-space: pre;
}
.editor .ln { color: var(--soft); user-select: none; display: inline-block; width: 2ch; margin-right: 1.4ch; text-align: right; }
.editor .kw { color: var(--gold); }
.editor .str { color: #9ee493; }
.editor .com { color: var(--soft); }
.terminal { border: 1px solid var(--line); border-radius: 10px; background: #0a110a; padding: 12px 16px; font: 13.5px/1.7 var(--mono); color: #d8e2d6; }
.terminal .prompt { color: var(--rust); user-select: none; }

.course-body { padding: 34px 38px 34px; min-width: 0; }
.course-title { font-size: clamp(26px, 3vw, 34px); line-height: 1.12; margin-bottom: 14px; }
.course-lead { color: var(--text); margin-bottom: 22px; max-width: 620px; }

.facts { margin: 0 0 26px; }
.facts > div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.facts > div:last-child { border-bottom: 1px solid var(--line); }
.facts dt { font: 600 11px/1.9 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--soft); }
.facts dd { margin: 0; color: var(--ink); font-size: 15.5px; line-height: 1.55; }

.more { margin-top: 22px; color: var(--soft); font-size: 14.5px; }

/* Kursbereich ---------------------------------------------------------------- */
.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 52px; padding: 44px 0 84px; align-items: start; }
.side { position: sticky; top: 24px; }
.side-title { font: 600 11px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--soft); margin: 0 0 12px; }
.side ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.side a {
  display: block; padding: 8px 0 8px 16px; margin-left: -1px;
  border-left: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: 14.5px; line-height: 1.45;
}
.side a:hover { color: var(--ink); }
.side a.is-active { color: var(--ink); border-left-color: var(--gold); font-weight: 650; }
.side .sub { display: block; font: 11px var(--mono); letter-spacing: .04em; color: var(--soft); margin-top: 1px; font-weight: 400; }

.content { min-width: 0; }
.content > section, .termine-folgend { margin-bottom: 64px; }
.content > section:last-child { margin-bottom: 0; }
.block-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; margin-bottom: 12px; }
.block-head h2 { margin: 0; }
.content .lead { margin-bottom: 30px; }
.content .subhead { margin-top: 34px; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.tile {
  display: flex; flex-direction: column; gap: 6px; padding: 22px;
  background: linear-gradient(150deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: 12px; min-width: 0;
}
.tile:hover { border-color: var(--line-2); }
.tile-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.ftype { font: 700 11px var(--mono); letter-spacing: .1em; color: #162906; background: var(--gold); padding: 3px 9px; border-radius: 5px; }
.ftype.zip { background: var(--rust); }
.tile-meta { font: 12px var(--mono); color: var(--soft); letter-spacing: .03em; }
.tile p { font-size: 14.5px; line-height: 1.6; flex: 1; margin-bottom: 14px; }
.tile .button { align-self: flex-start; }
.tile.pending { background: transparent; border-style: dashed; border-color: var(--line-2); max-width: 520px; }
.tile.pending h3 { color: var(--muted); }

/* Aufgabentabelle */
.table-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: rgba(14, 21, 13, .5); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
caption { text-align: left; padding: 14px 18px; font-size: 13px; color: var(--soft); caption-side: bottom; border-top: 1px solid var(--line); }
thead th {
  text-align: left; padding: 12px 18px; font: 600 10.5px var(--mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--soft); background: #162014; border-bottom: 1px solid var(--line);
}
tbody th[scope="colgroup"] {
  text-align: left; padding: 11px 18px; font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold); background: rgba(253, 189, 46, .06); border-top: 1px solid var(--line);
}
tbody td { padding: 13px 18px; border-top: 1px solid var(--line); vertical-align: top; color: var(--text); }
tbody td.nr { font: 600 13px var(--mono); color: var(--rust); white-space: nowrap; }
tbody td.titel { color: var(--ink); font-weight: 650; }
tbody td.zeit, tbody td.seite { white-space: nowrap; color: var(--muted); }
tbody td.seite a { color: var(--gold); text-decoration: none; border-bottom: 1px solid rgba(253, 189, 46, .4); }
tbody td.seite a:hover { border-bottom-color: var(--gold-hi); }

.rights { margin: 14px 0 0; max-width: 820px; }
.nowrap { white-space: nowrap; }

/* Inhalt des Lernhefts */
.contents { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.part { padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: rgba(14, 21, 13, .5); min-width: 0; }
.part-no { display: inline-block; font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--rust); text-decoration: none; margin-bottom: 6px; }
.part-no:hover { color: #ffb27a; }
.part h4 { font-size: 16.5px; line-height: 1.35; font-weight: 650; color: var(--ink); margin: 0 0 6px; }
.part p { font-size: 14px; line-height: 1.6; color: var(--muted); }
.contents-more { display: flex; flex-wrap: wrap; gap: 8px 26px; margin: 14px 0 0; font-size: 14px; }
.contents-more a { color: var(--gold); text-decoration: none; border-bottom: 1px solid rgba(253, 189, 46, .4); }

/* Hinweise zum Fragen */
.hints { list-style: none; margin: 26px 0 0; padding: 0; max-width: 820px; }
.hints li { position: relative; padding: 0 0 0 22px; margin: 0 0 12px; font-size: 15px; line-height: 1.6; color: var(--text); }
.hints li::before { content: ""; position: absolute; left: 0; top: .8em; width: 10px; height: 2px; background: var(--gold); }

/* Termine ohne Unterlagen */
.termine-folgend { display: grid; gap: 14px; }
.termin-kurz { padding: 20px 24px; border: 1px dashed var(--line-2); border-radius: 12px; }
.termin-kurz .block-head { margin-bottom: 8px; }
.termin-kurz h2 { font-size: 21px; }
.termin-kurz p { font-size: 15px; color: var(--muted); }

/* Einrichtung */
.howto { list-style: none; counter-reset: s; margin: 0 0 26px; padding: 0; max-width: 820px; }
.howto li {
  counter-increment: s; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 12px;
  padding: 14px 0; border-top: 1px solid var(--line); font-size: 15.5px; line-height: 1.6;
}
.howto li:last-child { border-bottom: 1px solid var(--line); }
.howto li::before { content: "0" counter(s); font: 600 13px var(--mono); color: var(--rust); padding-top: 2px; letter-spacing: .04em; }
.callout { padding: 14px 17px; border-left: 2px solid var(--rust); background: rgba(253, 140, 61, .06); font-size: 14.5px; margin: 0 0 22px; max-width: 820px; }
.callout.spaced { margin-top: 22px; margin-bottom: 0; }

/* Fußzeile --------------------------------------------------------------------- */
.site-footer {
  max-width: var(--wrap); margin: 0 auto; padding: 28px 40px 36px;
  border-top: 1px solid var(--line); color: var(--soft); font-size: 12.5px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px;
}
.site-footer .mark { font-family: var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }

/* Kontakt ------------------------------------------------------------------------- */
.contact { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.contact-link { min-height: 44px; padding: 9px 18px; font-size: 14.5px; }
.contact-link:not(.primary) svg { color: var(--gold); }
.contact-link.discord:not(.primary) svg { color: #9aa4ff; }
.contact-link svg { width: 19px; height: 19px; flex-basis: 19px; }

/* Noch nicht freigeschaltete Termine */
.termin-kurz.is-locked { opacity: .5; }
.termin-kurz.is-locked h2 { color: var(--muted); }
.side a.is-later { color: var(--soft); opacity: .6; }
.side a.is-later.is-active { opacity: 1; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ==========================================================================
   Anpassung an schmalere Fenster
   ========================================================================== */
@media (max-width: 1100px) {
  .wrap { padding: 0 32px; }
  .topbar, .site-footer { padding-left: 32px; padding-right: 32px; }
  .course { grid-template-columns: minmax(0, 1fr); }
  .course-visual { border-right: 0; border-bottom: 1px solid var(--line); }
  .layout { grid-template-columns: 196px minmax(0, 1fr); gap: 36px; }
}

@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; gap: 10px 20px; padding-top: 12px; padding-bottom: 14px; }
  .topnav { gap: 16px; }
  .topnav a { display: none; }
  .wrap, .topbar, .site-footer { padding-left: 24px; padding-right: 24px; }
  .page-head { padding: 36px 0 30px; }
  .courses { padding: 32px 0 60px; }
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .contents { grid-template-columns: minmax(0, 1fr); }

  .layout { grid-template-columns: minmax(0, 1fr); gap: 26px; padding-top: 30px; }
  .side { position: static; }
  .side ul { display: flex; gap: 8px; overflow-x: auto; border-left: 0; padding-bottom: 6px; }
  .side li { flex: 0 0 auto; }
  .side a, .side a.is-active {
    margin: 0; padding: 7px 14px; border: 1px solid var(--line-2); border-radius: 999px; white-space: nowrap; font-size: 13.5px;
  }
  .side a.is-active { border-color: var(--gold); }
  .side .sub { display: none; }
}

@media (max-width: 620px) {
  .brand-text { font-size: 16px; letter-spacing: .1em; }
  .brand-sub { display: none; }
  .brand-logo { width: 36px; height: 36px; flex-basis: 36px; }
  .course-body { padding: 26px 22px; }
  .course-visual { padding: 22px; }
  .facts > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .facts-inline { gap: 12px 28px; }

  /* Tabelle als Karten */
  thead { display: none; }
  table, tbody, tr, td, caption, tbody th[scope="colgroup"] { display: block; }
  tbody tr { padding: 14px 18px; border-top: 1px solid var(--line); }
  tbody td { padding: 0; border: 0; }
  tbody td.nr { display: inline; margin-right: 10px; }
  tbody td.titel { display: inline; }
  tbody td.inhalt { margin: 6px 0 8px; font-size: 14px; }
  tbody td.zeit, tbody td.seite { display: inline; font-size: 13px; margin-right: 14px; }
  tbody th[scope="colgroup"] { padding: 11px 18px; }
}
