/* Bel Vino · Editor der Speisekarte */
@font-face { font-family: "EB Garamond"; src: url("fonts/EBGaramond-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; }
@font-face { font-family: "EB Garamond"; src: url("fonts/EBGaramond-RegularItalic.ttf") format("truetype"); font-weight: 400; font-style: italic; }
@font-face { font-family: "EB Garamond"; src: url("fonts/EBGaramond-SemiBold.ttf") format("truetype"); font-weight: 600; font-style: normal; }
@font-face { font-family: "EB Garamond"; src: url("fonts/EBGaramond-SemiBoldItalic.ttf") format("truetype"); font-weight: 600; font-style: italic; }
@font-face { font-family: "Pinyon Script"; src: url("PinyonScript-Regular.ttf") format("truetype"); }

:root {
  --grund: #F4EFE7;
  --karte: #FFFFFF;
  --tinte: #231F1C;
  --leder: #4B3A2F;
  --eiche: #A8865A;
  --eiche-text: #85663E;
  --bordeaux: #6E1E2A;
  --stein: #6A615A;
  --linie: #E4DBCE;
  --feld: #FBF9F6;
  --geaendert: #FBEFEA;
  --fehler: #B3261E;
  --serif: "EB Garamond", Garamond, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --leiste-h: 64px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: calc(var(--leiste-h) + 16px); }
body {
  margin: 0;
  background: var(--grund);
  color: var(--tinte);
  font: 16px/1.45 var(--sans);
}
button, input { font: inherit; color: inherit; }

/* ------------------------------------------------------------ Kopfleiste */
.leiste {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: var(--leiste-h);
  padding: 10px 24px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--linie);
}
.marke { display: flex; align-items: baseline; gap: 14px; min-width: 0; white-space: nowrap; }
.marke__name { font-family: "Pinyon Script", "Edwardian Script ITC", cursive; font-size: 30px; line-height: 1; color: var(--tinte); }
.marke__titel { font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--leder); white-space: nowrap; }
.aktionen { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.status { font-size: 14px; color: var(--stein); margin-right: 6px; }
.status b { color: var(--bordeaux); font-weight: 600; }

.knopf {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 8px 16px;
  border-radius: 8px; border: 1px solid transparent;
  background: none; cursor: pointer; white-space: nowrap;
  font-size: 15px;
}
.knopf:focus-visible { outline: 2px solid var(--bordeaux); outline-offset: 2px; }
.knopf--haupt { background: var(--bordeaux); color: #fff; font-weight: 600; }
.knopf--haupt:hover { background: #5A1722; }
.knopf--haupt[disabled] { background: #8E5A62; cursor: progress; }
.knopf--rand { border-color: var(--linie); background: var(--karte); }
.knopf--rand:hover { border-color: var(--eiche); }
.knopf--leise { color: var(--stein); padding-inline: 10px; }
.knopf--leise:hover { color: var(--tinte); background: rgba(0, 0, 0, .04); }
.drehen { width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: drehen .8s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ Meldungen */
.meldungen { max-width: 1680px; margin: 0 auto; padding: 0 24px; }
.meldung {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 14px; padding: 12px 16px;
  border-radius: 10px; border: 1px solid var(--linie); background: var(--karte);
  font-size: 15px;
}
.meldung--warnung { border-color: #E3C9A0; background: #FFF8EC; }
.meldung--fehler { border-color: #E9B8B4; background: #FFF4F3; color: var(--fehler); }
.meldung--ok { border-color: #C9D8C2; background: #F5FAF2; }
.meldung__text { flex: 1 1 320px; }
.meldung .knopf { min-height: 34px; padding: 6px 12px; font-size: 14px; }

/* ------------------------------------------------------------ Layout */
.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 440px;
  gap: 28px;
  max-width: 1680px; margin: 0 auto; padding: 20px 24px 80px;
  align-items: start;
}

.navi { position: sticky; top: calc(var(--leiste-h) + 20px); max-height: calc(100vh - var(--leiste-h) - 40px); overflow: auto; padding-bottom: 12px; }
.suche {
  width: 100%; padding: 10px 12px; margin-bottom: 14px;
  border: 1px solid var(--linie); border-radius: 8px; background: var(--karte);
}
.suche:focus { outline: 2px solid var(--bordeaux); outline-offset: 0; border-color: transparent; }
.navi__gruppe { margin: 14px 0 4px; font-family: var(--serif); font-size: 18px; font-style: italic; color: var(--eiche-text); }
.navi a {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 5px 10px; border-radius: 6px;
  color: var(--leder); text-decoration: none; font-size: 15px;
}
.navi a:hover { background: rgba(0, 0, 0, .04); color: var(--tinte); }
.navi a .zahl { color: var(--bordeaux); font-weight: 600; font-size: 13px; }
.navi a.ist-leer { display: none; }
.navi__hilfe { margin-top: 20px; font-size: 13px; color: var(--stein); }

/* ------------------------------------------------------------ Bereiche */
.gruppe-titel { margin: 34px 0 10px; font-family: var(--serif); font-weight: 400; font-style: italic; font-size: 26px; color: var(--eiche-text); }
.gruppe-titel:first-child { margin-top: 0; }
.bereich {
  margin-bottom: 18px;
  background: var(--karte); border: 1px solid var(--linie); border-radius: 12px;
  overflow: hidden;
}
.bereich[hidden] { display: none; }
.bereich__kopf {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--linie);
}
.bereich__titel { margin: 0; font-family: var(--serif); font-weight: 600; font-style: italic; font-size: 24px; line-height: 1.1; }
.bereich__de { font-family: var(--serif); font-size: 17px; color: var(--eiche-text); }
.bereich__schalter { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--leder); cursor: pointer; }
.bereich__schalter input { width: 18px; height: 18px; accent-color: var(--bordeaux); }
.unterkopf { padding: 12px 20px 4px; font-size: 14px; color: var(--stein); font-style: italic; }

.zeile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 16px;
  padding: 10px 20px 10px 17px;
  border-left: 3px solid transparent;
  border-top: 1px solid #F1ECE4;
}
.unterkopf + .zeile, .bereich__kopf + .zeile { border-top: 0; }
.zeile.ist-geaendert { border-left-color: var(--bordeaux); background: linear-gradient(to right, #FDF7F4, transparent 60%); }
.zeile[hidden] { display: none; }
.zeile__haupt { min-width: 0; }
.zeile__info { display: block; margin: 3px 0 0 2px; font-size: 13px; color: var(--stein); }
.zeile__preise { display: flex; gap: 6px 14px; align-items: flex-start; justify-content: flex-end; flex-wrap: wrap; }
.zeile__text { grid-column: 1 / -1; }

.feld {
  width: 100%; padding: 7px 10px;
  border: 1px solid transparent; border-radius: 7px;
  background: var(--feld);
}
.feld:hover { border-color: var(--linie); }
.feld:focus { outline: none; border-color: var(--bordeaux); background: #fff; box-shadow: 0 0 0 3px rgba(110, 30, 42, .12); }
.feld--name { font-family: var(--serif); font-size: 20px; font-weight: 600; line-height: 1.2; color: var(--tinte); }
.feld--text { font-size: 14px; color: var(--leder); padding-block: 5px; }
.feld.ist-geaendert { background: var(--geaendert); }
.feld.ist-falsch { border-color: var(--fehler); background: #FFF4F3; }

.preis { display: flex; align-items: center; gap: 6px; }
.preis__label { font-size: 13px; color: var(--stein); white-space: nowrap; }
.preis .feld {
  width: 88px; text-align: right;
  font-family: var(--serif); font-size: 20px; font-weight: 500;
  font-variant-numeric: lining-nums tabular-nums;
}
.preis .feld::placeholder { color: #C9BFB3; }
.bereich__leer { padding: 16px 20px; color: var(--stein); font-size: 14px; }
.keine-treffer { padding: 40px 0; text-align: center; color: var(--stein); }

/* ------------------------------------------------------------ Vorschau */
.vorschau {
  position: sticky; top: calc(var(--leiste-h) + 20px);
  height: calc(100vh - var(--leiste-h) - 40px);
  display: flex; flex-direction: column;
  background: #E7E2DA; border: 1px solid var(--linie); border-radius: 12px; overflow: hidden;
}
.vorschau__kopf { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--karte); border-bottom: 1px solid var(--linie); }
.vorschau__titel { font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--leder); }
.ueberlauf { font-size: 13px; color: var(--fehler); font-weight: 600; }
.vorschau__zu { display: none; margin-left: auto; }
.vorschau__rahmen { position: relative; flex: 1; }
.vorschau__rahmen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; transition: opacity .15s; }
.vorschau-auf { display: none; }

/* ------------------------------------------------------------ Ablegen (Drag & Drop) */
.ablage { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(35, 31, 28, .45); }
.ablage[hidden] { display: none; }
.ablage__feld {
  padding: 48px 64px; border: 3px dashed #fff; border-radius: 18px;
  color: #fff; font-family: var(--serif); font-style: italic; font-size: 30px;
  background: rgba(110, 30, 42, .55);
}

/* ------------------------------------------------------------ Schmalere Bildschirme */
@media (max-width: 1280px) {
  .layout { grid-template-columns: 200px minmax(0, 1fr); }
  .vorschau {
    position: fixed; z-index: 30; top: var(--leiste-h); right: 0; bottom: 0; height: auto;
    width: min(460px, 100vw); border-radius: 0; box-shadow: -8px 0 30px rgba(0, 0, 0, .18);
    transform: translateX(105%); transition: transform .2s;
  }
  .vorschau.ist-offen { transform: none; }
  .vorschau__zu { display: inline-flex; }
  .vorschau-auf { display: inline-flex; position: fixed; right: 20px; bottom: 20px; z-index: 25; box-shadow: 0 4px 16px rgba(0, 0, 0, .15); }
}
@media (max-width: 860px) {
  :root { --leiste-h: 0px; }
  .leiste { position: static; flex-direction: column; align-items: stretch; padding: 12px 16px; }
  .aktionen { justify-content: flex-start; }
  .meldungen { padding: 0 16px; }
  .layout { grid-template-columns: minmax(0, 1fr); padding: 16px 16px 80px; gap: 16px; }
  .navi { position: static; max-height: none; }
  #navListe { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
  .navi__gruppe, .navi__hilfe { display: none; }
  .navi a { flex: none; border: 1px solid var(--linie); background: var(--karte); }
  .vorschau { top: 0; }
  .zeile { padding-inline: 14px 14px; gap: 6px 10px; }
  .zeile:has(.preis + .preis) { grid-template-columns: minmax(0, 1fr); }
  .zeile:has(.preis + .preis) .zeile__preise { justify-content: flex-start; }
  .preis .feld { width: 80px; }
  .bereich__kopf { padding-inline: 16px; }
}

/* ------------------------------------------------------------ Nur Chrome (Safari-Sperre, index.html) */
.nur-chrome-hinweis { display: none; }
.nur-chrome body > :not(.nur-chrome-hinweis) { display: none !important; }
.nur-chrome .nur-chrome-hinweis { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; }
.nur-chrome-hinweis__karte {
  max-width: 520px; padding: 36px 32px; text-align: center;
  background: var(--karte); border: 1px solid var(--linie); border-radius: 14px;
}
.nur-chrome-hinweis__karte .marke__name { font-size: 40px; margin-bottom: 10px; }
.nur-chrome-hinweis__karte h1 { margin: 0 0 14px; font-family: var(--serif); font-weight: 600; font-style: italic; font-size: 28px; color: var(--bordeaux); }
.nur-chrome-hinweis__karte p { margin: 0 0 12px; color: var(--leder); }
.nur-chrome-hinweis__karte .knopf { margin-top: 10px; }
