/* ==========================================================================
   Bistro am Bahnhof Zofingen – Stylesheet (Prototyp)
   Palette warm & hell. Kontraste: Ink/Creme 13.9:1, Terracotta/Creme 5.05:1,
   Weiss/Terracotta 5.44:1, Muted/Creme 5.5:1.
   ========================================================================== */

/* Selbst gehostete Schriften (Google Fonts, SIL Open Font License), Latin-Subset, variable Schnitte 400–700 */
@font-face {
  font-family: 'Karla';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/karla-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Karla';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/karla-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/playfair-display-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/playfair-display-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --c-bg: #FAF6EF;
  --c-bg-alt: #F1E9DC;
  --c-surface: #FFFFFF;
  --c-ink: #2B2622;
  --c-muted: #6B625A;
  --c-accent: #B4471F;
  --c-accent-hover: #963A18;
  --c-accent-soft: #F4E3DA;
  --c-gold: #D9A441;
  --c-border: #E4DACB;
  --c-success: #2F6B3A;

  --f-display: "Playfair Display", "Iowan Old Style", Georgia, serif;
  --f-body: "Karla", "Helvetica Neue", Arial, sans-serif;

  --fs-0: clamp(0.9rem, 0.85rem + 0.2vw, 1rem);
  --fs-1: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  --fs-2: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --fs-3: clamp(1.6rem, 1.3rem + 1.4vw, 2.25rem);
  --fs-4: clamp(2rem, 1.4rem + 2.8vw, 3.4rem);

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;

  --radius: 6px;
  --radius-sm: 4px;
  --shadow: 0 8px 24px rgba(43, 38, 34, 0.10);
  --container: 1120px;
  --header-h: 68px;
  --chips-h: 62px; /* Höhe der Kategorie-Leiste, für Sprungziele in der Speisekarte */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--f-body);
  font-size: var(--fs-1);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-accent); text-underline-offset: 3px; }
a:hover { color: var(--c-accent-hover); }
:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--f-display); font-weight: 500; line-height: 1.15; margin: 0 0 var(--space-2); }
h1 { font-size: var(--fs-4); }
h2 { font-size: var(--fs-3); }
h3 { font-size: var(--fs-2); }
p { margin: 0 0 var(--space-2); }
.muted { color: var(--c-muted); }
.small { font-size: var(--fs-0); }
address { font-style: normal; }

.container { width: min(100% - 2rem, var(--container)); margin-inline: auto; }
.section { padding-block: var(--space-5); }
@media (min-width: 900px) { .section { padding-block: var(--space-6); } }
.section--alt { background: var(--c-bg-alt); }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--c-ink); color: #fff; padding: 0.5rem 1rem; z-index: 100; border-radius: var(--radius-sm); }
.skip-link:focus { left: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px; padding: 0.7rem 1.3rem;
  border-radius: var(--radius); border: 1.5px solid transparent;
  font-weight: 700; font-size: var(--fs-1); text-decoration: none; cursor: pointer;
  transition: background 180ms var(--ease), color 180ms var(--ease), border-color 180ms var(--ease);
}
.btn--primary { background: var(--c-accent); color: #fff; }
.btn--primary:hover { background: var(--c-accent-hover); color: #fff; }
.btn--secondary { background: transparent; color: var(--c-ink); border-color: var(--c-ink); }
.btn--secondary:hover { background: var(--c-ink); color: #fff; }
.btn--ghost { background: var(--c-surface); color: var(--c-ink); border-color: var(--c-border); }
.btn--ghost:hover { border-color: var(--c-ink); color: var(--c-ink); }
.btn--sm { min-height: 40px; padding: 0.45rem 0.95rem; font-size: var(--fs-0); }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
}
.header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--c-ink); }
.brand__logo { width: 46px; height: 46px; flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name { font-family: var(--f-display); font-weight: 600; font-size: 1.2rem; }
.brand__place { font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--c-muted); }
.nav { display: none; }
.nav a { color: var(--c-ink); text-decoration: none; font-weight: 600; padding: 0.5rem 0.8rem; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--c-accent); color: var(--c-ink); }
.header__cta { display: none; }
.menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: var(--radius); border: 1px solid var(--c-border); background: var(--c-surface); cursor: pointer; color: var(--c-ink);
}
.menu-toggle svg { width: 22px; height: 22px; }
.mobile-nav { display: none; border-top: 1px solid var(--c-border); background: var(--c-bg); }
.mobile-nav.is-open { display: block; }
.mobile-nav ul { list-style: none; margin: 0; padding: var(--space-1) 0; }
.mobile-nav a { display: block; padding: 0.9rem 0; font-weight: 600; text-decoration: none; color: var(--c-ink); border-bottom: 1px solid var(--c-border); }
.mobile-nav li:last-child a { border-bottom: 0; }
@media (min-width: 900px) {
  .nav { display: flex; gap: 0.25rem; }
  .header__cta { display: inline-flex; }
  .menu-toggle, .mobile-nav { display: none !important; }
}

/* ---------- Hero ---------- */
.hero__grid { display: grid; gap: var(--space-4); padding-block: var(--space-4) var(--space-5); align-items: center; }
@media (min-width: 900px) { .hero__grid { grid-template-columns: 1.1fr 1fr; padding-block: var(--space-5) var(--space-6); } }
.hero h1 { margin-bottom: var(--space-2); }
.hero h1 em { font-style: italic; font-weight: 400; color: var(--c-accent); }
.hero__lead { max-width: 40ch; color: var(--c-muted); font-size: var(--fs-2); margin-bottom: var(--space-3); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: var(--space-3); }
.status { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 600; font-size: var(--fs-0); margin: 0; }
.status__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c-success); }
.status.is-closed .status__dot { background: var(--c-accent); }
.hero__photos { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; max-width: 560px; }
.hero__photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); }
@media (min-width: 900px) {
  .hero__photos { gap: 0.8rem; }
  .hero__photos img:nth-child(2), .hero__photos img:nth-child(4) { transform: translateY(1.6rem); }
}

/* ---------- Hinweis «Aktuell» ---------- */
.notice { background: var(--c-accent-soft); border-block: 1px solid #E9CDBD; }
.notice__inner { display: flex; flex-wrap: wrap; gap: 0.35rem 0.6rem; padding-block: 0.75rem; font-size: var(--fs-0); }
.notice strong { color: var(--c-accent-hover); }

/* ---------- Mittagsmenü ---------- */
.menu-grid { display: grid; gap: var(--space-4); align-items: start; }
@media (min-width: 900px) { .menu-grid { grid-template-columns: 1fr 1.25fr; } }
.menu-meta { display: grid; gap: var(--space-2); }
/* Nur am Desktop klebt der Textblock neben dem PDF; am Handy würde er das Dokument überdecken. */
@media (min-width: 900px) { .menu-meta { position: sticky; top: calc(var(--header-h) + 1.5rem); } }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1.25rem; margin: 0; }
.facts > div { display: contents; }
.facts dt { color: var(--c-muted); font-size: var(--fs-0); }
.facts dd { margin: 0; font-weight: 700; }
.menu-meta__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.menu-doc { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.menu-doc__bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.7rem 1rem; border-bottom: 1px solid var(--c-border); font-size: var(--fs-0); color: var(--c-muted); }
.menu-doc__page { aspect-ratio: 1131 / 1600; background: #fff; }
.hours-note { margin-top: var(--space-2); }
.menu-doc__page img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- Speisekarte (generiert aus assets/karte-ubereats.json) ---------- */
.karte__intro { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-2) var(--space-4); margin-bottom: var(--space-3); }
.karte__intro h2 { margin-bottom: 0.35rem; }
.karte__intro p { margin: 0; max-width: 48ch; }
.karte__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.chips { position: sticky; top: calc(var(--header-h) + 1px); z-index: 30; background: var(--c-bg); border-block: 1px solid var(--c-border); margin-bottom: var(--space-4); }
.chips__inner { display: flex; gap: 0.4rem; overflow-x: auto; padding-block: 0.6rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }
.chips__inner::-webkit-scrollbar { display: none; }
.chips__inner::after { content: ""; flex: none; width: 2rem; } /* letzter Chip bleibt trotz Maske lesbar */
.chip { flex: none; white-space: nowrap; padding: 0.4rem 0.85rem; border-radius: var(--radius); border: 1px solid var(--c-border); background: var(--c-surface); color: var(--c-ink); text-decoration: none; font-weight: 600; font-size: var(--fs-0); min-height: 40px; display: inline-flex; align-items: center; }
.chip:hover { border-color: var(--c-ink); color: var(--c-ink); }
.chip.is-active { background: var(--c-ink); color: #fff; border-color: var(--c-ink); }
.karte { display: grid; gap: var(--space-5); }
/* Sprungziel: html hat scroll-padding-top (Header + 12px), dazu kommt hier die Höhe der Chip-Leiste. */
.karte__group { scroll-margin-top: var(--chips-h); }
.karte__group h3 { margin-bottom: var(--space-2); padding-bottom: 0.4rem; border-bottom: 1px solid var(--c-ink); }
.dish-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
@media (min-width: 700px) { .dish-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .dish-list { grid-template-columns: repeat(3, 1fr); } }
.dish { display: flex; gap: 0.9rem; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 0.85rem 0.85rem 0.85rem 1rem; min-height: 122px; }
.dish__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.dish__head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.dish__name { font-weight: 700; line-height: 1.25; }
.dish__desc { margin: 0; color: var(--c-muted); font-size: var(--fs-0); line-height: 1.4; }
.dish__price { margin-top: auto; padding-top: 0.35rem; font-variant-numeric: tabular-nums; font-weight: 700; }
.dish__img { flex: none; width: 100px; height: 100px; align-self: center; object-fit: cover; border-radius: var(--radius-sm); background: var(--c-bg-alt); }
.dish__badge { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 0.1rem 0.4rem; border-radius: 3px; }
.dish__badge--hot { background: var(--c-accent-soft); color: var(--c-accent-hover); }
.dish__badge--veg { background: #E4F0E6; color: var(--c-success); }
.karte__note { margin-top: var(--space-3); }

/* ---------- Öffnungszeiten & Kontakt ---------- */
.info-grid { display: grid; gap: var(--space-4); }
@media (min-width: 900px) { .info-grid { grid-template-columns: 1fr 1fr; gap: var(--space-5); } }
.hours { width: 100%; border-collapse: collapse; font-size: var(--fs-1); }
.hours th, .hours td { text-align: left; padding: 0.7rem 0; border-bottom: 1px solid var(--c-border); }
.hours th { font-weight: 600; width: 45%; }
.hours td { font-variant-numeric: tabular-nums; }
.hours-note { margin-top: var(--space-2); }
.hours tr.is-today th, .hours tr.is-today td { color: var(--c-accent); font-weight: 700; }
.hours__today { font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; margin-left: 0.4rem; background: var(--c-accent-soft); color: var(--c-accent-hover); padding: 0.15rem 0.45rem; border-radius: 3px; vertical-align: middle; }
.contact p { margin-bottom: 0.9rem; }
.contact a { color: var(--c-ink); font-weight: 600; }
.map { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--c-border); aspect-ratio: 16 / 10; background: var(--c-bg-alt); margin-top: var(--space-3); }
.map iframe { width: 100%; height: 100%; border: 0; display: block; }
.map__consent { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: var(--space-3); }
.map__consent p { max-width: 36ch; color: var(--c-muted); font-size: var(--fs-0); }

/* ---------- Footer ---------- */
.footer { background: var(--c-ink); color: #D8CFC4; padding-block: var(--space-5) var(--space-3); }
/* Startseite: Platz für die mobile Anruf-Leiste unter dem Footer */
body.has-callbar .footer { padding-bottom: calc(var(--space-3) + 84px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { body.has-callbar .footer { padding-bottom: var(--space-3); } }
.footer a { color: #fff; }
.footer__grid { display: grid; gap: var(--space-3); margin-bottom: var(--space-4); }
@media (min-width: 700px) { .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer__logo { width: 88px; height: 88px; margin-bottom: 0.75rem; }
.footer__brand { font-family: var(--f-display); color: #fff; font-size: 1.2rem; margin-bottom: 0.5rem; }
.footer__title { color: #fff; font-weight: 700; margin-bottom: 0.5rem; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.footer__bottom { border-top: 1px solid rgba(255,255,255,0.12); padding-top: var(--space-2); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem; font-size: 0.85rem; }
.footer__bottom ul { display: flex; gap: 1.2rem; }

/* ---------- Druck ---------- */
@media print { .callbar, .chips, .menu-toggle, .header__cta, .map__consent { display: none !important; } .header { position: static; } body.has-callbar .footer { padding-bottom: var(--space-3); } }

/* ---------- Mobile Anruf-Leiste ---------- */
.callbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom));
  background: var(--c-bg); border-top: 1px solid var(--c-border);
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem;
}
@media (min-width: 900px) { .callbar { display: none; } }

/* ---------- Unterseiten ---------- */
.prose { max-width: 70ch; }
.prose__kicker { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--c-muted); margin-bottom: 0.4rem; }
.page-nav { display: flex; gap: 1.2rem; margin-top: var(--space-4); padding-top: var(--space-2); border-top: 1px solid var(--c-border); font-size: var(--fs-0); }
.prose h2 { font-size: var(--fs-2); margin-top: var(--space-4); }
.todo { background: #FFF4D6; border-left: 4px solid var(--c-gold); padding: 0.6rem 0.9rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ---------- Google-Bewertungen (statisch, ohne Tracking) ---------- */
.rating { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: var(--space-2); font-size: var(--fs-0); color: var(--c-ink); text-decoration: none; }
.rating:hover { color: var(--c-ink); }
.rating__stars { display: inline-flex; gap: 1px; color: var(--c-gold); }
.rating__stars svg { width: 16px; height: 16px; }
.rating strong { font-weight: 700; }
.rating span { color: var(--c-muted); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Mittagsmenü als Text ---------- */
.menu-text { border-top: 1px solid var(--c-border); }
.menu-text summary { cursor: pointer; padding: 0.8rem 1rem; font-weight: 700; font-size: var(--fs-0); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.menu-text summary::-webkit-details-marker { display: none; }
.menu-text summary::after { content: "+"; font-size: 1.2rem; color: var(--c-muted); }
.menu-text[open] summary::after { content: "–"; }
.menu-text__body { padding: 0 1rem 1rem; display: grid; gap: 0.9rem; }
.menu-text h4 { margin: 0 0 0.3rem; font-family: var(--f-display); font-weight: 600; font-size: 1.05rem; }
.menu-text ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; font-size: var(--fs-0); }
.menu-text li { display: flex; gap: 0.5rem; justify-content: space-between; }
.menu-text li span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Sonderöffnungszeiten ---------- */
.hours tr.is-closed td { color: var(--c-muted); }
.hours tr.is-exception td { color: var(--c-accent-hover); font-weight: 700; }
.special { margin-top: var(--space-2); padding: 0.8rem 1rem; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); font-size: var(--fs-0); }
.special[hidden] { display: none; }
.special strong { display: block; margin-bottom: 0.3rem; }
.special ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.2rem; }
.special li { display: flex; justify-content: space-between; gap: 1rem; }
.special li span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Mittagsmenü-Modul ---------- */
.menu-doc__empty { padding: var(--space-3); margin: 0; color: var(--c-muted); }
.menu-text__line span { color: var(--c-ink); }
.menu-text li.menu-text__line { justify-content: flex-start; }
/* WordPress-Editorinhalte auf Unterseiten */
.prose img { height: auto; }
.prose h2 { font-size: var(--fs-2); }
