/* Speisekarten-Admin Schinderhannes. Tokens aus src/styles/global.css der Hauptseite,
   bewusst kopiert (das Admin hat keinen Build). Keine Inline-Styles (CSP). */

@font-face {
  font-family: 'Fraunces Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('fonts/fraunces-latin-wght-normal.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'Bricolage Grotesque Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url('fonts/bricolage-grotesque-latin-wght-normal.woff2') format('woff2-variations');
}

:root {
  --papier: #F6F2E8;
  --papier-tief: #EFE8D6;
  --flaeche: #FCFAF3;
  --linie: #DFD6BF;
  --tinte: #121A29;
  --text-neben: #4E576A;
  --tanne: #141E2F;
  --backstein: #9E3F2A;
  --backstein-tief: #7F2E1C;
  --backstein-hauch: #F0E3D8;
  --erfolg: #2F5D3A;
  --erfolg-hauch: #E3EDE2;

  --serife: 'Fraunces Variable', Georgia, 'Times New Roman', serif;
  --sans: 'Bricolage Grotesque Variable', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius: 16px;
  --radius-eingabe: 10px;
  --wrap: 76rem;
  --rand: clamp(1rem, 4vw, 2.5rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --schatten: 0 18px 44px -22px rgb(20 30 47 / 0.32);
  --leiste-hoehe: 4.75rem;

  color-scheme: light;
}

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

html, body { background-color: #F6F2E8; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--tinte);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

h1, h2, h3 {
  font-family: var(--serife);
  font-weight: 620;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.6rem); }
h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.9rem); }
p { margin: 0 0 1em; }
a { color: var(--backstein); text-underline-offset: 0.18em; }
a:hover { color: var(--backstein-tief); }

:focus-visible {
  outline: 3px solid var(--backstein);
  outline-offset: 2px;
  border-radius: 4px;
}

[hidden] { display: none !important; }

.neben { color: var(--text-neben); }
.klein { font-size: 0.9375rem; color: var(--text-neben); }

.marke {
  font-family: var(--serife);
  font-weight: 700;
  font-size: 1.35rem;
  margin: 0;
  color: var(--tinte);
}
.marke span {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-neben);
  margin-left: 0.35rem;
}

/* ---------- Knöpfe ---------- */

.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.9rem;
  padding: 0.7rem 1.35rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  background: transparent;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  color: var(--tinte);
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.knopf:active { transform: translateY(1px); }
.knopf:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.knopf--voll { background: var(--backstein); color: #FDFBF5; }
.knopf--voll:hover:not(:disabled) { background: var(--backstein-tief); color: #FDFBF5; box-shadow: 0 10px 22px -12px rgb(126 46 28 / 0.55); }

.knopf--leise { border-color: var(--linie); background: var(--flaeche); }
.knopf--leise:hover:not(:disabled) { border-color: var(--tinte); }

.knopf--klein { min-height: 2.75rem; padding: 0.45rem 0.95rem; font-size: 0.9375rem; font-weight: 650; }
.knopf--breit { width: 100%; }
.knopf--gefahr { color: var(--backstein); }
.knopf--gefahr:hover:not(:disabled) { border-color: var(--backstein); }

/* Kleine Pfeil-Knöpfe: quadratisch, trotzdem 44 px Tippfläche */
.knopf--pfeil { min-width: 2.75rem; padding: 0.45rem; font-size: 1rem; }

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

.anmelden {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem var(--rand);
}
.anmelde-kasten {
  width: min(100%, 26rem);
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 5vw, 2.5rem);
  box-shadow: var(--schatten);
}
.anmelde-kasten h1 { font-size: 1.75rem; margin: 0.35rem 0 1.25rem; }
.anmelde-kasten .klein { margin: 1.25rem 0 0; }

/* ---------- Formulare ---------- */

.formular { display: grid; gap: 0.35rem; }
.formular label { font-weight: 650; margin-top: 0.65rem; }
.formular label:first-of-type { margin-top: 0; }
.formular input[type='text'],
.formular input[type='password'] {
  width: 100%;
  min-height: 3rem;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--linie);
  border-radius: var(--radius-eingabe);
  background: #FFFFFF;
  font: inherit;
  color: var(--tinte);
}
.formular input:focus-visible { outline-offset: 0; border-color: var(--backstein); }
.formular input[aria-invalid='true'] { border-color: var(--backstein); }
.formular .knopf--breit { margin-top: 1.1rem; }
.optional { font-weight: 450; color: var(--text-neben); }

.preisfelder { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.9rem; }
.preisfelder label { display: block; margin-bottom: 0.35rem; }

.haken {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-top: 0.8rem;
  font-weight: 650;
  cursor: pointer;
}
.haken input { width: 1.35rem; height: 1.35rem; margin: 0.15rem 0 0; flex: none; accent-color: var(--backstein); }
.haken small { display: block; font-weight: 450; color: var(--text-neben); font-size: 0.875rem; }

.hinweis {
  margin: 0.9rem 0 0;
  padding: 0.75rem 0.95rem;
  border-radius: var(--radius-eingabe);
  font-size: 0.975rem;
}
.hinweis--fehler { background: var(--backstein-hauch); color: var(--backstein-tief); }
.hinweis ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }

/* ---------- Kopf und Leiste ---------- */

.kopf {
  border-bottom: 1px solid var(--linie);
  background: var(--papier);
  padding-top: env(safe-area-inset-top);
}
.kopf-innen {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0.85rem var(--rand);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
}
.kopf-rechts { display: flex; align-items: center; gap: 0.85rem; }
.angemeldet { font-size: 0.9375rem; color: var(--text-neben); }

/* Handy: Leiste unten fixiert, Desktop: oben mitlaufend */
.leiste {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 20;
  background: var(--flaeche);
  border-top: 1px solid var(--linie);
  box-shadow: 0 -12px 30px -24px rgb(20 30 47 / 0.5);
  padding-bottom: env(safe-area-inset-bottom);
}
.leiste-innen {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0.75rem var(--rand);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.leiste-text { margin: 0; font-weight: 650; line-height: 1.3; }
.leiste-text.hat-aenderungen { color: var(--backstein-tief); }
.leiste .knopf { flex: none; }

@media (min-width: 900px) {
  .leiste {
    position: sticky;
    top: 0;
    inset: auto;
    border-top: 0;
    border-bottom: 1px solid var(--linie);
    box-shadow: 0 12px 30px -26px rgb(20 30 47 / 0.5);
    padding-bottom: 0;
  }
}

/* ---------- Editor ---------- */

.editor {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) var(--rand) calc(var(--leiste-hoehe) + 3rem + env(safe-area-inset-bottom));
}
@media (min-width: 900px) {
  .editor { padding-bottom: 4rem; }
}
.einleitung { max-width: 44rem; margin-bottom: 2rem; }
.einleitung p { color: var(--text-neben); }

.spalten {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}
@media (min-width: 900px) {
  .spalten { grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 3vw, 3rem); }
}

.spalte { display: grid; gap: 1.25rem; min-width: 0; }
.spalte-titel {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-neben);
  margin: 0;
}

.gruppe {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: clamp(1rem, 3vw, 1.75rem);
  min-width: 0;
}
.gruppe-kopf {
  display: grid;
  gap: 0.6rem;
  padding-bottom: 0.9rem;
  margin-bottom: 0.4rem;
  border-bottom: 1px solid var(--linie);
}
.gruppe-titel { font-size: 1.4rem; margin: 0; overflow-wrap: anywhere; }
.neu-marke {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--backstein-hauch);
  color: var(--backstein-tief);
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 700;
  vertical-align: 0.2em;
}

.aktionen { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }
.aktionen select {
  min-height: 2.75rem;
  max-width: 100%;
  padding: 0.4rem 2rem 0.4rem 0.85rem;
  border: 1.5px solid var(--linie);
  border-radius: 999px;
  background: var(--flaeche);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 650;
  color: var(--tinte);
}

.gerichte { list-style: none; margin: 0; padding: 0; }
.gericht {
  padding: 0.9rem 0;
  border-bottom: 1px dashed var(--linie);
}
.gericht:last-child { border-bottom: 0; }
.gericht--variante { padding-left: 1.1rem; }
.gericht-zeile {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.9rem;
}
.gericht-name { font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; min-width: 0; }
.gericht--variante .gericht-name { font-weight: 520; color: var(--text-neben); }
.gericht-beschreibung { display: block; font-size: 0.9rem; font-weight: 450; color: var(--text-neben); margin-top: 0.1rem; }
.gericht-preis { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.merkmale { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.35rem; }
.merkmal {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: var(--papier-tief);
  color: var(--text-neben);
}
.gericht .aktionen { margin-top: 0.6rem; }

.gericht--geloescht .gericht-name,
.gericht--geloescht .gericht-preis,
.gericht--geloescht .gericht-beschreibung { text-decoration: line-through; color: var(--text-neben); }
.geloescht-hinweis { font-size: 0.875rem; font-weight: 650; color: var(--backstein-tief); }

.gruppe-fuss { margin-top: 0.9rem; }
.spalte-fuss { display: flex; }

/* ---------- Frühere Karten und Hilfe ---------- */

.abschnitt { margin-top: clamp(3rem, 6vw, 4.5rem); max-width: 48rem; }
.versionen { list-style: none; margin: 1.25rem 0 0; padding: 0; border-top: 1px solid var(--linie); }
.version {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--linie);
}
.version-zeit { font-weight: 650; font-variant-numeric: tabular-nums; }
.version-aktuell { font-size: 0.9375rem; font-weight: 650; color: var(--erfolg); }
.hilfe ol { padding-left: 1.3rem; display: grid; gap: 0.5rem; }

/* ---------- Dialoge ---------- */

.dialog {
  width: min(calc(100% - 2rem), 34rem);
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 0;
  border-radius: var(--radius);
  background: var(--flaeche);
  color: var(--tinte);
  box-shadow: 0 30px 80px -30px rgb(20 30 47 / 0.6);
  overflow-y: auto;
}
.dialog--breit { width: min(calc(100% - 2rem), 42rem); }
.dialog::backdrop { background: rgb(12 20 32 / 0.55); }
.dialog h2 { font-size: 1.6rem; }
.dialog-knoepfe {
  display: flex;
  flex-wrap: wrap-reverse;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.4rem;
}

.aenderungen { margin: 0.5rem 0 0; padding-left: 1.2rem; display: grid; gap: 0.45rem; }
.aenderungen li { overflow-wrap: anywhere; }

@media (max-width: 519.98px) {
  .preisfelder { grid-template-columns: 1fr; }
  .dialog-knoepfe .knopf { flex: 1 1 100%; }
  .leiste-text { font-size: 0.9375rem; }
  .kopf-rechts { width: 100%; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
