@import url("fonts/fonts.css");

/* ============================================================
   gelato.fredon.de: gemeinsames Design für alle Seiten
   ============================================================ */

/* Light ist die Grundlage; der Dark-Block weiter unten tauscht nur
   die Farbtoken aus. Alles andere bleibt identisch. */
:root {
  --bg: #fcfcfa;
  --surface: #ffffff;
  --surface-2: #f3f5f0;
  --ink: #1c231a;
  --body: #4a5546;
  --dim: #6a7665;
  --line: rgb(28 35 26 / 13%);
  --accent: #3f7d4e;
  --accent-ink: #ffffff;
  --accent-soft: rgb(63 125 78 / 10%);
  /* Eigene Warnfarbe, damit ein Hinweis nicht wie ein Akzent aussieht */
  --warn-ink: #a4530c;
  --warn-line: rgb(164 83 12 / 45%);
  --warn-soft: rgb(164 83 12 / 8%);
  --shadow: 0 1px 2px rgb(28 35 26 / 6%), 0 6px 18px rgb(28 35 26 / 5%);
  --r: 14px;
  --wrap: 940px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101510;
    --surface: #1a221a;
    --surface-2: #232d23;
    --ink: #ecf1e9;
    --body: #c8d2c4;
    --dim: #94a190;
    --line: rgb(236 241 233 / 15%);
    --accent: #86c99a;
    --accent-ink: #101510;
    --accent-soft: rgb(134 201 154 / 13%);
    --warn-ink: #e5a75c;
    --warn-line: rgb(229 167 92 / 42%);
    --warn-soft: rgb(229 167 92 / 11%);
    --shadow: none;
  }
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Barlow", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 {
  font-family: "Barlow Semi Condensed", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.005em;
  line-height: 1.15;
  margin: 0;
}

a { color: var(--accent); }

p { margin: 0 0 14px; }

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

.eyebrow {
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12.5px;
  color: var(--dim);
  margin: 0;
}

.skip { position: absolute; left: -9999px; }

.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 10px;
  font-weight: 600;
}

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

/* ---------- Kopf und Navigation ---------- */

/* Navigation ohne JavaScript: <details> liefert das Auf- und Zuklappen
   nativ mit, inklusive Tastaturbedienung. Das Burger-Menü gilt auf jeder
   Bildschirmgröße; auf breiten Schirmen wird nur das Panel schmaler und
   rechtsbündig statt über die volle Breite. */

.site-nav {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.site-nav .wrap {
  position: relative; /* Bezugspunkt für das aufgeklappte Panel */
  display: flex;
  align-items: center;
  gap: 12px;
  padding-block: 12px;
}

.brand {
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}

.brand span { color: var(--accent); }

.nav-drop { flex: 0 0 auto; }

/* Nur die drei Striche, kein Beschriftungstext. Der zugängliche Name
   kommt über aria-label am summary. */
.nav-drop summary {
  display: grid;
  place-items: center;
  width: 42px;
  height: 38px;
  list-style: none;
  cursor: pointer;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.nav-drop summary::-webkit-details-marker { display: none; }
.nav-drop summary:hover { background: var(--surface-2); }
.nav-drop summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Burger-Symbol aus drei Balken, damit keine Icon-Schrift nötig ist */
.burger {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.burger::before, .burger::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .18s, top .18s;
}

.burger::before { top: -6px; }
.burger::after { top: 6px; }

.nav-drop[open] .burger { background: transparent; }
.nav-drop[open] .burger::before { top: 0; transform: rotate(45deg); }
.nav-drop[open] .burger::after { top: 0; transform: rotate(-45deg); }

.nav-menu {
  position: absolute;
  top: 100%;
  right: 16px;
  left: 16px;
  z-index: 30;
  margin: 6px 0 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgb(28 35 26 / 18%);
}

.nav-menu a {
  display: block;
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--body);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
}

.nav-menu a:hover { background: var(--surface-2); color: var(--ink); }

/* Auf breiteren Schirmen kein Vollbreiten-Panel, sondern ein
   rechtsbündiges Aufklappmenü unter dem Burger */
@media (min-width: 560px) {
  .nav-menu { left: auto; min-width: 240px; }
}

@media (prefers-reduced-motion: reduce) {
  .burger::before, .burger::after { transition: none; }
}

.site-head {
  padding: 40px 0 30px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
}

.site-head h1 { font-size: clamp(30px, 6.5vw, 46px); margin: 10px 0 14px; }
.site-head h1 em { font-style: normal; color: var(--accent); }

.lead { color: var(--body); font-size: 17px; max-width: 58ch; margin: 0; }

/* ---------- Inhalt ---------- */

main { padding-bottom: 30px; }

main p { color: var(--body); max-width: 68ch; }

.section-title {
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 13px;
  color: var(--dim);
  margin: 40px 0 14px;
  /* Die Abschnitte sind Sprungziele aus dem Menü; ohne Offset
     verschwindet die Überschrift sonst hinter dem oberen Rand. */
  scroll-margin-top: 16px;
}

/* ---------- Kartenraster ---------- */

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 620px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 920px) {
  .grid.three { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 20px;
}

.card h3 { font-size: 20px; margin-bottom: 6px; }
.card p { color: var(--body); font-size: 15.5px; }
.card p:last-child { margin-bottom: 0; }

.card .role {
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2px;
}

/* Zweispaltige Aufzählung für die Ausrüstungsliste */
.cols { margin: 0 0 14px; padding-left: 22px; }
.cols li { color: var(--body); margin-bottom: 6px; }

@media (min-width: 620px) {
  .cols { columns: 2; column-gap: 34px; }
  .cols li { break-inside: avoid; }
}

/* ---------- Rezepte ---------- */

.recipe-title {
  font-size: clamp(21px, 4.4vw, 26px);
  margin: 30px 0 12px;
}

.steps { margin: 0 0 16px; padding-left: 22px; max-width: 68ch; }
.steps li { color: var(--body); margin-bottom: 10px; }

/* Breite Inhalte scrollen im eigenen Container, nicht die Seite */
.scroll-x { overflow-x: auto; margin: 0 0 16px; }

table { border-collapse: collapse; width: 100%; min-width: 440px; font-size: 15.5px; }

caption {
  text-align: left;
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  padding-bottom: 8px;
}

th, td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--body);
}

th {
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
}

/* Mengenspalte: gleiche Ziffernbreite, damit die Zahlen beim
   Nachrechnen nicht springen */
td span[data-basis], output {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink);
}

.callout {
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
  margin: 20px 0;
}

.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--ink); font-weight: 600; }
.callout ul { margin: 8px 0 0; padding-left: 20px; }
.callout li { color: var(--body); font-size: 15.5px; margin-bottom: 5px; }
.callout li:last-child { margin-bottom: 0; }

/* Ein Hinweis, der nicht schmückt, sondern bremst: eigene Farbe statt Akzent */
.callout.warnung {
  background: var(--warn-soft);
  border-color: var(--warn-line);
}

/* ---------- Anmeldung ---------- */

/* Die Anmeldeseiten tragen wenig Inhalt. Volle Textbreite ließe die paar
   Zeilen verloren wirken, deshalb ein schmalerer Satzspiegel. */
.schmal { max-width: 560px; padding-block: 40px 30px; }

.anmelde-titel { font-size: clamp(26px, 5.5vw, 34px); margin-bottom: 14px; }

.abgemeldet {
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 15px;
}

.form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 20px;
  margin: 18px 0;
}

.field input[type="email"] {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
}

.field input[type="email"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.form .btn-row { margin-bottom: 0; }

/* Leiste über dem Generator: wer angemeldet ist und wie man es beendet */
.sitzung {
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.sitzung .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  padding-block: 8px;
}

.sitzung-wer {
  margin: 0;
  font-size: 14px;
  color: var(--dim);
  overflow-wrap: anywhere;
}

.sitzung form { margin: 0; }

.btn.klein { font-size: 14px; padding: 6px 14px; border-radius: 8px; }

/* ---------- Rezeptgenerator ---------- */

.generator {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 20px;
  margin: 20px 0 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px 20px;
}

@media (min-width: 640px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid .span-2 { grid-column: 1 / -1; }
}

.field label, .field .feld-label {
  display: block;
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 6px;
}

.field .hint {
  color: var(--dim);
  font-size: 13.5px;
  margin: 6px 0 0;
  max-width: none;
}

select, .field input[type="number"] {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
}

select:focus-visible,
.field input[type="number"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

/* Zahlenfeld und Einheit teilen sich eine Zeile, die Einheit trägt den Kontext */
.mit-einheit { display: flex; align-items: center; gap: 10px; }
.mit-einheit input { flex: 1 1 auto; min-width: 0; }

.mit-einheit .unit {
  flex: 0 0 auto;
  color: var(--dim);
  font-size: 13.5px;
  white-space: nowrap;
}

input[type="range"] {
  width: 100%;
  margin: 10px 0 0;
  accent-color: var(--accent);
}

/* Segmentierte Auswahl: die Radios bleiben bedienbar, sichtbar sind die Labels */
.segment { display: flex; flex-wrap: wrap; gap: 6px; }

.segment input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.segment label {
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--body);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 15px;
  margin: 0;
  cursor: pointer;
}

.segment label:hover { border-color: var(--accent); color: var(--ink); }

.segment input:checked + label {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.segment input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Bleibt nur eine Möglichkeit, ist das eine Information und keine Auswahl */
.nur-anzeige .segment label { cursor: default; opacity: 1; }
.nur-anzeige .segment input:disabled + label {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--dim);
}

.rezept-kopf {
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 600;
  font-size: 16.5px;
  color: var(--ink);
}

td.num, th.num { text-align: right; white-space: nowrap; }
td.dim { color: var(--dim); }
tfoot th, tfoot td { border-top: 2px solid var(--line); border-bottom: 0; color: var(--ink); }
tfoot th { text-align: left; }

.kennzahlen {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

@media (min-width: 560px) {
  .kennzahlen { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .kennzahlen { grid-template-columns: repeat(3, 1fr); }
}

.kennzahl {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.kennzahl.ausserhalb { border-color: var(--warn-line); background: var(--warn-soft); }

.kennzahl-kopf {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
}

.kennzahl-titel {
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.kennzahl-wert {
  font-family: "Barlow Semi Condensed", sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.kennzahl-einheit { font-size: 14px; color: var(--dim); margin-left: 2px; }

.kennzahl-fenster { color: var(--dim); font-size: 12.5px; margin: 8px 0 0; }

/* Der Balken zeigt das erlaubte Fenster als Fläche und den Istwert als Strich.
   Die drei Positionen kommen als Prozentwerte aus dem Skript. */
.balken {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.balken::before {
  content: "";
  position: absolute;
  inset-block: 0;
  left: var(--von);
  right: calc(100% - var(--bis));
  background: var(--accent-soft);
  border-inline: 1px solid var(--accent);
}

.balken::after {
  content: "";
  position: absolute;
  inset-block: 0;
  left: var(--wert);
  width: 3px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--ink);
}

.kennzahl.ausserhalb .balken::after { background: var(--warn-ink); }

/* ---------- Fuß ---------- */

.site-foot {
  border-top: 1px solid var(--line);
  padding: 24px 16px;
  color: var(--dim);
  font-size: 14px;
  text-align: center;
}

.site-foot p { margin: 0 0 4px; }
.site-foot a { color: var(--dim); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* ---------- Druck ---------- */

@media print {
  body { background: #fff; color: #111; font-size: 11.5pt; }
  .site-nav, .site-foot, .generator, #warnungen { display: none !important; }
  .site-head { background: #fff; border-bottom: 2px solid #111; padding-top: 0; }
  .site-head h1 em { color: #111; }
  .card { box-shadow: none; border: 1px solid #bbb; break-inside: avoid; }
  .steps li, .cols li, main p, .card p, td { color: #222; }
  a { color: #111; }
  table { min-width: 0; }
}
