/* Schmaus & Mausis
   Gestaltung nach Apples Human Interface Guidelines: Klarheit, Zuruecknahme
   des Rahmens hinter den Inhalt, Tiefe durch Schichtung.
   Schrift: SF Pro ueber -apple-system (auf Apple-Geraeten), sonst Systemschrift.
   Keine externen Schriften - kein Datenabfluss an Dritte. */

:root {
  /* --- Vorgegebene Markenfarben --- */
  --bg:          #ecdfd2;   /* Hintergrund                       */
  --plum:        #5f3475;   /* Akzent Text und Flaechen 1        */
  --magenta:     #893172;   /* Akzent Text und Flaechen 2        */
  --btn:         #213885;   /* Bedienelemente                    */
  --btn-deep:    #081849;   /* Bedienelemente, gedrueckt/dunkel  */

  /* --- Abgeleitete Toene (aus dem Hintergrund bzw. Pflaume entwickelt) --- */
  --surface:     #f7f1ea;   /* Karten und Gruppen                */
  --surface-hi:  #fbf7f2;   /* hoechste Ebene                    */
  --ink:         #2a2033;   /* Fliesstext            11,9:1      */
  --ink-2:       #6b5c63;   /* Sekundaertext          4,8:1      */
  --line:        #dbc9b8;   /* Trennlinien                       */
  --fill:        #e6d8c9;   /* Fuellflaechen, leere Balken       */
  --neutral:     #c9b6a8;   /* Bewertung unter 6                 */

  /* --- Apple-Typografie: Groessen und Zeichenabstaende --- */
  --t-large:     clamp(2.15rem, 5.6vw, 3.25rem);
  --t-title1:    1.75rem;
  --t-title2:    1.3rem;
  --t-headline:  1.0625rem;   /* 17px, halbfett */
  --t-body:      1.0625rem;   /* 17px           */
  --t-subhead:   0.9375rem;   /* 15px           */
  --t-foot:      0.8125rem;   /* 13px           */
  --t-caption:   0.75rem;     /* 12px           */

  /* --- Radien: kraeftig gerundet, wie in Apples Bedienoberflaechen --- */
  --r-s: 12px;
  --r-m: 16px;
  --r-l: 22px;

  /* --- Tiefe: weiche, tief gestreute Schatten statt harter Kanten --- */
  --sh-1: 0 1px 2px rgba(42, 32, 51, .05), 0 4px 12px -6px rgba(42, 32, 51, .12);
  --sh-2: 0 2px 4px rgba(42, 32, 51, .06), 0 14px 34px -14px rgba(42, 32, 51, .26);
  --sh-3: 0 30px 70px -22px rgba(8, 24, 73, .42);

  --maxw: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
               Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--t-body);
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--magenta); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--plum); }

:where(a, button, input, select, textarea, .rcard):focus-visible {
  outline: 3px solid var(--magenta);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Ziffern immer gleich breit - Punktzahlen springen dadurch nicht */
.stat b, .badge, .pin, .crow .val, .d-total b, .result-count { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- Kopfbereich */

.site-head { padding: 68px 0 30px; text-align: center; }

.site-head h1 {
  margin: 0;
  font-size: var(--t-large);
  font-weight: 700;
  letter-spacing: -.035em;   /* Apple: grosse Titel enger setzen */
  line-height: 1.03;
  color: var(--plum);
}
.site-head h1 .amp { color: var(--magenta); font-style: italic; font-weight: 600; }

.site-head p {
  margin: 15px auto 0;
  max-width: 44ch;
  color: var(--ink-2);
  font-size: 1.1rem;
  line-height: 1.42;
}

.stats {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 10px 44px; margin: 34px 0 6px;
}
.stat { text-align: center; }
.stat b {
  display: block;
  font-size: 2.05rem; font-weight: 700;
  letter-spacing: -.025em; line-height: 1.1;
  color: var(--btn-deep);
}
.stat span {
  font-size: var(--t-caption); font-weight: 600;
  text-transform: uppercase; letter-spacing: .085em;
  color: var(--ink-2);
}

/* --------------------------------------------------------------------- Karte */

.map-section { margin: 38px 0 48px; }

#map {
  height: 540px;
  border-radius: var(--r-l);
  border: 1px solid var(--line);
  box-shadow: var(--sh-2);
  background: var(--fill);
  z-index: 0;
}
@media (max-width: 700px) { #map { height: 390px; border-radius: var(--r-m); } }

.map-note {
  margin: 12px 4px 0;
  font-size: var(--t-foot); color: var(--ink-2);
}

/* Kartennadel: Tropfenform mit der Punktzahl */
.pin {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50% 50% 50% 3px;
  transform: rotate(-45deg);
  border: 2.5px solid var(--surface-hi);
  box-shadow: 0 4px 10px rgba(8, 24, 73, .38);
  font-weight: 700; font-size: var(--t-foot);
}
.pin span { transform: rotate(45deg); }

.leaflet-popup-content-wrapper {
  border-radius: var(--r-m);
  font-family: inherit;
  background: var(--surface-hi);
  color: var(--ink);
  box-shadow: var(--sh-2);
}
.leaflet-popup-content { margin: 0; width: 236px !important; }
.leaflet-popup-tip { background: var(--surface-hi); }
.pop img {
  width: 100%; height: 120px; object-fit: cover; display: block;
  border-radius: var(--r-m) var(--r-m) 0 0;
}
.pop-body { padding: 12px 14px 14px; }
.pop-body strong { display: block; font-size: var(--t-headline); font-weight: 600; line-height: 1.25; }
.pop-body .meta { color: var(--ink-2); font-size: var(--t-foot); margin: 3px 0 10px; }
.pop-body button {
  font: inherit; font-size: var(--t-foot); font-weight: 600;
  background: var(--btn); color: #fff; border: 0;
  border-radius: 9px; padding: 8px 14px; cursor: pointer;
  min-height: 34px;
}
.pop-body button:hover { background: var(--btn-deep); }

/* ------------------------------------------------------------------- Filter */

/* Apples "Material": durchscheinende, unscharfe Flaeche ueber dem Inhalt */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center;
  padding: 13px 18px; margin: 0 0 30px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  box-shadow: var(--sh-1);
  position: sticky; top: 12px; z-index: 400;
}
@supports not (backdrop-filter: blur(1px)) { .toolbar { background: var(--surface); } }

.toolbar input[type=search], .toolbar select {
  font: inherit; font-size: var(--t-subhead); color: var(--ink);
  background: var(--surface-hi);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  min-height: 40px;
}
.toolbar input[type=search] { flex: 1 1 210px; min-width: 0; }
.toolbar label {
  font-size: var(--t-foot); font-weight: 500; color: var(--ink-2);
  display: flex; gap: 7px; align-items: center;
}
.toolbar .spacer { flex: 1 1 auto; }
.result-count { font-size: var(--t-foot); color: var(--ink-2); font-weight: 500; }

/* ------------------------------------------------------------------ Ranking */

.section-title { display: flex; align-items: baseline; gap: 12px; margin: 0 0 20px; }
.section-title h2 {
  margin: 0; font-size: var(--t-title2); font-weight: 700;
  letter-spacing: -.018em; color: var(--plum);
}

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(292px, 1fr)); gap: 22px; }

.rcard {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  overflow: hidden;
  box-shadow: var(--sh-1);
  cursor: pointer; text-align: left;
  padding: 0; font: inherit; color: inherit;
  transition: transform .18s cubic-bezier(.32, .72, 0, 1),
              box-shadow .18s cubic-bezier(.32, .72, 0, 1);
}
.rcard:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.rcard:active { transform: translateY(-1px) scale(.995); }

.rcard .shot { position: relative; aspect-ratio: 3/2; background: var(--fill); overflow: hidden; }
.rcard .shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rcard .shot.empty::after {
  content: "🍽"; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.7rem; opacity: .3;
}

.rank {
  position: absolute; top: 12px; left: 12px;
  background: color-mix(in srgb, var(--btn-deep) 76%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: #fff;
  font-size: var(--t-caption); font-weight: 700; letter-spacing: .03em;
  padding: 4px 10px; border-radius: 20px;
}

.badge {
  position: absolute; bottom: 12px; right: 12px;
  min-width: 3.2em; text-align: center;
  padding: 6px 11px; border-radius: 20px;
  font-weight: 700; font-size: var(--t-subhead);
  border: 2px solid color-mix(in srgb, var(--surface-hi) 90%, transparent);
  box-shadow: 0 3px 10px rgba(8, 24, 73, .3);
}

.rcard .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.rcard h3 {
  margin: 0; font-size: var(--t-headline); font-weight: 600;
  line-height: 1.28; letter-spacing: -.012em;
}
.rcard .where { font-size: var(--t-subhead); color: var(--ink-2); }
.rcard .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 12px; }

.tag {
  font-size: var(--t-caption); font-weight: 500;
  padding: 4px 9px; border-radius: 7px;
  background: var(--fill); color: var(--ink-2);
}
.tag.veg { background: color-mix(in srgb, var(--plum) 12%, var(--surface)); color: var(--plum); }

.empty-state {
  padding: 56px 24px; text-align: center; color: var(--ink-2);
  background: var(--surface);
  border: 1px dashed var(--line); border-radius: var(--r-l);
}

/* ------------------------------------------------------------------- Detail */

dialog.detail {
  width: min(880px, calc(100vw - 32px));
  max-height: calc(100vh - 56px);
  padding: 0; border: 0; border-radius: var(--r-l);
  background: var(--surface-hi); color: var(--ink);
  box-shadow: var(--sh-3);
  overflow: auto;
}
dialog.detail::backdrop {
  background: color-mix(in srgb, var(--btn-deep) 55%, transparent);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}

.d-close {
  position: sticky; top: 12px; float: right;
  margin: 12px 14px 0 0; z-index: 5;
  width: 44px; height: 44px; border-radius: 50%;   /* Apple: 44px Trefferflaeche */
  border: 0; cursor: pointer; font-size: 1.05rem; line-height: 1;
  background: color-mix(in srgb, var(--btn-deep) 72%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: #fff;
}
.d-close:hover { background: var(--btn-deep); }

.d-gallery {
  display: flex; gap: 4px; overflow-x: auto;
  scroll-snap-type: x mandatory; background: var(--fill);
}
.d-gallery img { height: 310px; flex: 0 0 auto; scroll-snap-align: center; object-fit: cover; }

/* Einzelbild fuellt die Breite - sonst bliebe rechts eine leere Flaeche */
.d-gallery.single img { width: 100%; height: 340px; }

@media (max-width: 620px) {
  .d-gallery img { height: 215px; }
  .d-gallery.single img { height: 215px; }
}

.d-head { padding: 26px 28px 4px; }
.d-head h2 {
  margin: 0 0 5px; font-size: var(--t-title1); font-weight: 700;
  letter-spacing: -.025em; line-height: 1.14; color: var(--plum);
}
.d-head .where { color: var(--ink-2); font-size: var(--t-subhead); }

.d-total {
  display: flex; align-items: baseline; gap: 15px; flex-wrap: wrap;
  margin: 20px 28px; padding: 18px 22px;
  background: var(--bg);
  border-radius: var(--r-m);
}
.d-total b { font-size: 2.5rem; font-weight: 700; line-height: 1; letter-spacing: -.03em; color: var(--btn-deep); }
.d-total .lbl { font-weight: 600; color: var(--plum); }
.d-total .sub { font-size: var(--t-foot); color: var(--ink-2); }

.d-facts {
  display: flex; flex-wrap: wrap; gap: 10px 28px;
  padding: 18px 28px 0; font-size: var(--t-subhead);
}
.d-facts div span { color: var(--ink-2); font-size: var(--t-caption); font-weight: 600;
                    text-transform: uppercase; letter-spacing: .06em; }

.d-notes { white-space: pre-wrap; }

.d-crit { padding: 22px 28px 32px; }
.d-crit h3 {
  font-size: var(--t-caption); font-weight: 700;
  text-transform: uppercase; letter-spacing: .085em;
  color: var(--ink-2); margin: 16px 0 14px;
}

.crow {
  display: grid; grid-template-columns: 1.5rem 1fr 3.4rem;
  gap: 11px; align-items: center; padding: 7px 0;
  font-size: var(--t-subhead);
}
.crow .bar { height: 8px; border-radius: 5px; background: var(--fill); overflow: hidden; }
.crow .bar i { display: block; height: 100%; border-radius: 5px; }
.crow .val { text-align: right; font-weight: 700; }
.crow.na { opacity: .5; }
.crow .cname { display: flex; flex-direction: column; }
.crow .cname > span { font-weight: 500; }
.crow .cname small { color: var(--ink-2); font-size: var(--t-caption); line-height: 1.32; }

/* ---------------------------------------------------------------- Fusszeile */

.site-foot {
  margin-top: 66px; padding: 28px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--ink-2); font-size: var(--t-foot);
}
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; }
.site-foot a { color: var(--ink-2); }
.site-foot a:hover { color: var(--plum); }

.loading { padding: 64px 24px; text-align: center; color: var(--ink-2); }

/* ------------------------------------------------- Rechtsseiten (schlichter) */

main.page { max-width: 720px; }
main.page h2 { color: var(--plum); font-size: var(--t-title2); letter-spacing: -.015em; margin-top: 34px; }
main.page .hinweis {
  background: color-mix(in srgb, var(--plum) 9%, var(--surface));
  border: 1px solid var(--line); border-left: 4px solid var(--plum);
  border-radius: var(--r-s); padding: 16px 18px;
}

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