/* =============================================================================
   MITTAGSTISCH AMSTETTEN — Design v2
   Ruhig, neutral, fokussiert (Apple/Amazon-Logik):
   - eine zurückhaltende Akzentfarbe, Farbe nur mit Bedeutung
   - Fokus pro Karte: Gericht + Preis. Alles andere im Info-Popover (Hover/Tap).
   ========================================================================== */

:root {
  /* Flächen & Text – neutrale Graustufen (Apple) */
  --bg:        #f5f5f7;
  --surface:   #ffffff;
  --surface-2: #eceef1;
  --text:      #1d1d1f;
  --muted:     #6e6e73;
  --faint:     #8e8e93;
  --border:    #e4e5e9;
  --border-2:  #d2d4da;

  /* Akzent – EIN Blau (PayPal/Apple), sparsam für Interaktion */
  --accent:    #0070e0;
  --accent-ink:#0059b8;
  --accent-soft:#e9f2fd;

  /* Bedeutungsfarben – nur für Status, abgestimmt aufs Blau */
  --ok:      #17804a;   --ok-soft:  #e4f3ea;
  --warn:    #8a6410;   --warn-soft:#f6eeda;
  --gold:    #e2a51f;

  /* Info-Popover – „erhöhte" Fläche, kontrastiert zur Karte */
  --pop:       #eaeef6;
  --pop-border:#cfd6e2;

  --shadow:  0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --shadow-pop: 0 8px 20px rgba(0,0,0,.10), 0 24px 48px rgba(0,0,0,.14);
  --radius:  18px;
  --radius-sm: 11px;
  --maxw:    800px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #0a0a0c;
    --surface:   #1a1a1d;
    --surface-2: #29292d;
    --text:      #f5f5f7;
    --muted:     #a1a1a6;
    --faint:     #86868b;
    --border:    #2c2c30;
    --border-2:  #3a3a3f;
    --accent:    #2f9bff;
    --accent-ink:#63b3ff;
    --accent-soft:#152a40;
    --ok:      #34c759;  --ok-soft:  #15291c;
    --warn:    #e0a52b;  --warn-soft:#2a2210;
    --gold:    #e6b53a;
    --pop:       #26282f;  --pop-border:#3d4049;
    --shadow:  0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
    --shadow-pop: 0 12px 28px rgba(0,0,0,.5), 0 24px 60px rgba(0,0,0,.6);
  }
}
:root[data-theme="dark"] {
  --bg:#0a0a0c; --surface:#1a1a1d; --surface-2:#29292d; --text:#f5f5f7;
  --muted:#a1a1a6; --faint:#86868b; --border:#2c2c30; --border-2:#3a3a3f;
  --accent:#2f9bff; --accent-ink:#63b3ff; --accent-soft:#152a40;
  --ok:#34c759; --ok-soft:#15291c; --warn:#e0a52b; --warn-soft:#2a2210; --gold:#e6b53a;
  --pop:#26282f; --pop-border:#3d4049;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 8px 24px rgba(0,0,0,.35);
  --shadow-pop:0 12px 28px rgba(0,0,0,.5),0 24px 60px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
a { color: var(--accent-ink); text-decoration: none; }

.skip-link { position: absolute; left: -999px; top: 0; z-index: 100; background: var(--accent); color: #fff; padding: 10px 14px; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { font-size: 26px; line-height: 1; }
.brand-logo { width: 36px; height: 36px; flex: none; display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,.18)); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-size: 18px; font-weight: 600; letter-spacing: -.015em; }
.brand-name strong { color: var(--accent); font-weight: 700; }
.brand-tag { font-size: 12px; color: var(--muted); }
.icon-btn {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 17px; cursor: pointer; display: grid; place-items: center;
  transition: background .2s ease, border-color .2s ease, transform .1s ease;
}
.icon-btn:hover { border-color: var(--border-2); }
.icon-btn:active { transform: scale(.96); }

/* ---------- Daybar ---------- */
.daybar { padding-top: 22px; }
.daybar-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.date-line { margin: 0; font-size: 25px; font-weight: 700; letter-spacing: -.02em; }
.week-line { margin: 0; font-size: 12.5px; color: var(--muted); }

/* Segmented control (iOS-Stil) */
.day-tabs {
  display: flex; gap: 3px; margin-top: 14px;
  background: var(--surface-2); border-radius: 13px; padding: 4px;
}
.day-tab {
  flex: 1 1 0; min-width: 0; cursor: pointer; border: 0; background: transparent;
  color: var(--muted); border-radius: 9px; padding: 7px 4px; font: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.day-tab .dt-dow { font-size: 13px; font-weight: 600; }
.day-tab .dt-num { font-size: 11px; color: var(--faint); }
.day-tab:hover { color: var(--text); }
.day-tab[aria-selected="true"] {
  background: var(--surface); color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.04);
}
.day-tab[aria-selected="true"] .dt-num { color: var(--accent); font-weight: 600; }
.day-tab.is-today .dt-dow::after {
  content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); margin-left: 5px; vertical-align: middle;
}

.weekend-note { margin: 10px 2px 0; font-size: 12.5px; color: var(--muted); }

/* ---------- Controls ---------- */
.controls { margin-top: 18px; display: flex; flex-direction: column; gap: 11px; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 3px 12px;
}
.search-box:focus-within { border-color: var(--border-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }
.search-icon { font-size: 15px; opacity: .55; }
.search-box input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; padding: 10px 2px; }
.search-box input::placeholder { color: var(--faint); }
.clear-btn { border: 0; background: transparent; color: var(--muted); font-size: 14px; cursor: pointer; padding: 6px; border-radius: 8px; }
.clear-btn:hover { color: var(--text); background: var(--surface-2); }

.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-more { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; margin-top: 2px;
  padding-top: 11px; border-top: 1px solid var(--border); }
.chip {
  cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 7px 13px; font: inherit; font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.chip:hover { border-color: var(--border-2); }
.chip .chip-emoji { font-size: 13px; opacity: .8; }
.chip[aria-pressed="true"] {
  background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent-ink);
}
.chip.chip-toggle { color: var(--muted); }
.chip.chip-toggle .chip-emoji { transition: transform .2s ease; }
.chip.chip-toggle[aria-expanded="true"] .chip-emoji { transform: rotate(180deg); }
.chip .chip-count { font-size: 11px; background: var(--accent); color: #fff; border-radius: 999px; padding: 0 6px; line-height: 16px; }

/* ---------- Result count ---------- */
.result-count { margin: 18px 2px 10px; font-size: 12.5px; color: var(--muted); font-weight: 500; }

/* ---------- List & Cards ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }

.card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.card:hover { border-color: var(--border-2); box-shadow: var(--shadow-pop); z-index: 5; }
.card.is-open { z-index: 25; }
.card.is-fav { box-shadow: inset 3px 0 0 var(--gold), var(--shadow); }

/* Vorderseite – bewusst reduziert */
.card-front { display: flex; gap: 12px; padding: 15px 17px; cursor: pointer; align-items: flex-start; }
.fav-star {
  all: unset; cursor: pointer; flex: none; font-size: 20px; line-height: 1.1; color: var(--border-2);
  padding: 1px 2px; transition: color .15s ease, transform .1s ease;
}
.fav-star:hover { color: var(--gold); transform: scale(1.12); }
.fav-star[aria-pressed="true"] { color: var(--gold); }
.fav-star:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

.card-main { min-width: 0; flex: 1; }
.card-topline { display: flex; align-items: center; gap: 10px; }
.card-name { margin: 0; font-size: 16.5px; font-weight: 600; letter-spacing: -.01em; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub2 { font-size: 12.5px; color: var(--muted); margin-top: 1px; }

/* Der Fokus: Gericht + Preis */
.card-hero { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-top: 11px; }
.dish { font-size: 15.5px; font-weight: 500; color: var(--text); }
.dish.muted { color: var(--muted); font-weight: 400; font-size: 14px; }
.dish .veg { font-size: 11px; color: var(--ok); margin-left: 6px; white-space: nowrap; }
.dish-more { color: var(--faint); font-size: 12px; font-weight: 400; }
.price { font-size: 17px; font-weight: 700; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.price.na { font-size: 12.5px; font-weight: 500; color: var(--faint); }

.card-foot { display: flex; align-items: center; gap: 10px; margin-top: 11px; font-size: 12px; color: var(--faint); }
.foot-hours { display: inline-flex; align-items: center; gap: 5px; }
.foot-more { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 500; }
.foot-more .chev { transition: transform .2s ease; }
.card.is-open .foot-more .chev { transform: rotate(180deg); }

/* Status-Token (rechts oben) – nur wenn bedeutungsvoll */
.freshness { flex: none; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px; }
.freshness::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.freshness.ok    { color: var(--ok);   background: var(--ok-soft); }
.freshness.warn  { color: var(--warn); background: var(--warn-soft); }
.freshness.open  { color: var(--ok); }
.freshness.plain { color: var(--faint); }

/* ---------- Info-Popover (Hover / Tap) ---------- */
.card-details {
  position: absolute; left: 0; right: 0; top: calc(100% - 10px); z-index: 40;
  background: var(--pop); border: 1px solid var(--pop-border); border-radius: 16px;
  box-shadow: var(--shadow-pop); padding: 14px 17px 16px;
  max-height: 72vh; overflow-y: auto;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
}
.card:hover > .card-details,
.card:focus-within > .card-details,
.card.is-open > .card-details {
  opacity: 1; visibility: visible; transform: translateY(0);
  transition: opacity .16s ease .12s, transform .16s ease .12s, visibility 0s;
}
.det-desc { font-size: 13.5px; color: var(--muted); margin: 0 0 12px; }
.det-rows { display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px; }
.det-row { display: flex; gap: 9px; font-size: 13.5px; align-items: baseline; }
.det-row .ic { flex: none; width: 18px; text-align: center; opacity: .8; }
.det-row .tx { color: var(--text); }
.det-note { font-size: 12.5px; color: var(--warn); margin: -4px 0 12px 27px; }
.det-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.det-tag { font-size: 11.5px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px 9px; }

.det-week { border-top: 1px solid var(--border); padding-top: 10px; margin-bottom: 13px; }
.det-week-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); margin-bottom: 7px; }
.det-day { display: flex; gap: 10px; padding: 5px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.det-day:first-of-type { border-top: 0; }
.det-day .d { flex: none; width: 30px; color: var(--muted); font-weight: 600; }
.det-day .n { flex: 1; }
.det-day .p { white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }
.det-day.sel { color: var(--text); }
.det-day.sel .d { color: var(--accent); }
.det-day.empty .n { color: var(--faint); font-style: italic; }

/* Eigene Notiz (Kommentar) je Lokal */
.foot-note { color: var(--accent); font-weight: 600; }
.det-note-wrap { border-top: 1px solid var(--border); padding-top: 11px; margin-bottom: 13px; display: flex; flex-direction: column; gap: 6px; }
.det-note-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.det-note-input {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 13.5px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px;
  padding: 8px 10px; resize: vertical; min-height: 40px; line-height: 1.45;
}
.det-note-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.det-note-input::placeholder { color: var(--faint); }

.det-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; border-radius: 10px;
  padding: 9px 13px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.btn:hover { border-color: var(--border-2); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: 52px 20px; }
.empty-emoji { font-size: 40px; margin: 0; }
.empty-title { font-size: 17px; font-weight: 600; margin: 12px 0 4px; }
.empty-text { color: var(--muted); margin: 0 0 16px; }
.btn-ghost { background: transparent; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 44px; border-top: 1px solid var(--border); }
.footer-inner { padding-block: 26px; display: flex; flex-direction: column; gap: 14px; }
.footer-cta { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 16px; display: flex; flex-direction: column; gap: 3px; }
.footer-cta strong { font-size: 14.5px; }
.footer-cta span { font-size: 13px; color: var(--muted); }
.footer-meta { margin: 0; font-size: 11.5px; color: var(--faint); line-height: 1.7; }
.footer-link { border: 0; background: none; padding: 0; margin: 0; font: inherit; font-size: 11.5px;
  color: var(--accent-ink); cursor: pointer; text-decoration: underline; }
.footer-link:hover { color: var(--accent); }

/* Impressum-Fenster (natives <dialog>) */
.imp-dialog {
  border: 1px solid var(--border-2); border-radius: 16px; padding: 0;
  max-width: 560px; width: calc(100% - 32px); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-pop);
}
.imp-dialog::backdrop { background: rgba(0,0,0,.5); backdrop-filter: blur(2px); }
.imp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 20px; border-bottom: 1px solid var(--border); }
.imp-title { margin: 0; font-size: 17px; font-weight: 700; }
.imp-close { all: unset; cursor: pointer; width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center; color: var(--muted); font-size: 15px; }
.imp-close:hover { background: var(--surface-2); color: var(--text); }
.imp-body { padding: 6px 20px 22px; max-height: 68vh; overflow-y: auto; font-size: 13.5px; line-height: 1.6; }
.imp-body h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 0 4px; }
.imp-body p { margin: 0 0 4px; color: var(--text); }
.imp-small { color: var(--muted); font-size: 12px; }
.imp-todo { color: var(--warn); font-weight: 600; }
.daten-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 4px; }
.daten-btns .btn { font-size: 13px; }

/* Spenden – dezent, offline-fest (Link + kleiner QR, kein externes Skript) */
.donate { display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 16px; }
.donate-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 170px; }
.donate-text strong { font-size: 13.5px; font-weight: 600; }
.donate-text span { font-size: 12px; color: var(--muted); }
.donate-btn { flex: none; display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  font: inherit; font-weight: 600; font-size: 13.5px; padding: 9px 18px; border-radius: 999px;
  text-decoration: none; transition: background .15s ease, border-color .15s ease, transform .1s ease; }
.donate-btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.donate-btn:active { transform: scale(.97); }
.donate-heart { color: #fff; font-size: 14px; }
.donate-qr { flex: none; width: 80px; height: 80px; border-radius: 9px; background: #fff; padding: 5px; border: 1px solid var(--border); }
@media (max-width: 460px) { .donate-qr { display: none; } }  /* am Handy tippt man den Button */

/* ---------- Responsive ---------- */
@media (min-width: 600px) {
  .date-line { font-size: 27px; }
  .card-name { font-size: 17px; }
}
@media (hover: none) {
  /* Touch: Popover nur per Tap (is-open), nicht per Hover */
  .card:hover > .card-details { opacity: 0; visibility: hidden; transform: translateY(-6px); }
  .card.is-open > .card-details { opacity: 1; visibility: visible; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
