/* ==================================================================
   Gleis Wirt — digital menu
   Gleis Wirt brand: blue & red on warm paper,
   slab/serif headings (Bitter) over clean sans (Inter).
   Mobile-first. No horizontal scroll. Big tap targets.
   ================================================================== */

:root {
  /* Palette — Gleis Wirt brand: blue / white / red on warm paper */
  --wood-bg:      #f4ece0;  /* warm cream / aged paper       */
  --wood-bg-2:    #efe4d4;  /* slightly deeper for banding    */
  --card:         #fffefb;  /* card surface                   */
  --ink:          #201d1a;  /* near-black text                */
  --ink-soft:     #625c54;  /* muted body / descriptions      */
  --ink-faint:    #9a8f80;  /* allergen codes, fine print     */
  --blue:         #1338e6;  /* brand blue (header, headings)  */
  --blue-2:       #0e2bb8;
  --red:          #ff462d;  /* brand red/orange (accent, CTA) */
  --red-2:        #e83a22;
  --line:         #e6dcc8;  /* hairline dividers               */
  --shadow:       0 6px 20px rgba(19, 56, 230, 0.10);
  --shadow-soft:  0 2px 8px rgba(19, 56, 230, 0.07);

  --serif: "Bitter", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --header-h: 128px; /* approx sticky header height for scroll offsets */
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--wood-bg);
  /* Real paper texture (cropped from the brand kit), tiled, with a subtle
     brand-color wash layered on top. */
  background-image:
    radial-gradient(circle at 20% -10%, rgba(255, 70, 45, 0.08), transparent 55%),
    radial-gradient(circle at 90% 0%, rgba(19, 56, 230, 0.06), transparent 45%),
    url("assets/paper-texture.jpg");
  background-repeat: no-repeat, no-repeat, repeat;
  background-size: auto, auto, 700px 700px;
  background-attachment: fixed, fixed, fixed;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

/* ------------------------------------------------------------------ */
/* Language nudge banner                                              */
/* ------------------------------------------------------------------ */
.lang-nudge {
  display: block;
  width: 100%;
  border: 0;
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: var(--red);
  color: #ffffff;
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  letter-spacing: 0.01em;
}
.lang-nudge:active { filter: brightness(0.96); }

/* ------------------------------------------------------------------ */
/* Header                                                             */
/* ------------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, var(--blue) 0%, var(--blue-2) 100%);
  color: #ffffff;
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.logo {
  flex: none;
  height: 52px;
  width: auto;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.brand-text { min-width: 0; }

.brand-name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: #ffffff;
}

.brand-tagline {
  margin: 2px 0 0;
  font-size: 0.72rem;
  font-weight: 500;
  color: #cdd8ff;
  letter-spacing: 0.02em;
  max-width: 42ch;
}

/* Language toggle */
.lang-toggle {
  flex: none;
  display: inline-flex;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 3px;
}
.lang-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #e6ecff;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 7px 11px;
  min-height: 34px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.lang-btn.active {
  background: var(--red);
  color: #ffffff;
  box-shadow: var(--shadow-soft);
}

/* Category nav */
.cat-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 16px 12px;
  background: rgba(0, 0, 0, 0.14);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.cat-nav::-webkit-scrollbar { display: none; }

.cat-link {
  flex: none;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: transparent;
  color: #e6ecff;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 8px 14px;
  min-height: 38px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.cat-link.active {
  background: #f4ece0;
  color: var(--blue);
  border-color: #f4ece0;
}

/* ------------------------------------------------------------------ */
/* Menu sections                                                      */
/* ------------------------------------------------------------------ */
.menu {
  max-width: 680px;
  margin: 0 auto;
  padding: 8px 14px 40px;
}

.category {
  scroll-margin-top: var(--header-h);
  margin: 0 2px 22px;
  border: 1.5px solid var(--blue);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow-soft);
}
.category--red { border-color: var(--red); }

.cat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px 16px;
  background: var(--blue);
}
.category--red .cat-header { background: var(--red); }

.cat-header .cat-icon { font-size: 1.25rem; }
.cat-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: 0.01em;
  color: #ffffff;
  margin: 0;
}

.category > .dish,
.category > .compact-block {
  margin: 14px 14px 0;
}
.category > .dish:last-child,
.category > .compact-block:last-child {
  margin-bottom: 14px;
}

/* Dish card — large photo on top, details below */
.dish {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden; /* clip the photo to the card's rounded top corners */
}
.dish--share {
  border-color: var(--red);
  box-shadow: 0 0 0 1px var(--red), var(--shadow);
  background: linear-gradient(180deg, #fffaf0, #fff6e8);
}

.dish-thumb {
  position: relative;
  flex: none;
  width: 100%;
  aspect-ratio: 3 / 4;
  display: grid;
  place-items: center;
  font-size: 3.6rem;
  background: linear-gradient(150deg, #f0e3cf, #e7d3b6);
  border-bottom: 1px solid rgba(120, 90, 55, 0.14);
  overflow: hidden;
  /* NOTE: placeholder tiles. To use real photography, set `img` on the dish
     in data.js and this becomes an <img> — see renderDish() in app.js. */
}

/* "Live photo": tap, or stay in view a couple seconds, to play the loop. */
.dish-thumb--live { cursor: pointer; }

.dish-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.dish-thumb--live.is-live-active .dish-video { opacity: 1; }

.dish-live-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  background: rgba(20, 16, 10, 0.55);
  backdrop-filter: blur(2px);
  color: #fff;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: opacity 0.3s ease;
}
.dish-thumb--live.is-live-active .dish-live-badge { opacity: 0.85; }

.dish-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 0 rgba(255, 70, 45, 0.6);
  animation: dish-live-pulse 1.6s ease-out infinite;
}
.dish-thumb--live.is-live-active .dish-live-dot { animation-play-state: paused; }

@keyframes dish-live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 70, 45, 0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(255, 70, 45, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 70, 45, 0); }
}
.dish-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.dish-body { padding: 12px 14px 14px; min-width: 0; }

.dish-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.dish-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  margin: 0;
  line-height: 1.2;
}

.dish-price {
  flex: none;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--red);
  white-space: nowrap;
}
.dish-price::after { content: " €"; font-size: 0.8em; }

.dish-desc {
  margin: 4px 0 0;
  font-size: 0.86rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

.dish-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.01em;
}
.tag--vegan      { background: #e3f0dc; color: #2f5a2a; }
.tag--vegetarian { background: #eaf1de; color: #4a5a24; }
.tag--share      { background: #ffe3dc; color: #b23319; }

.serves {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.allergen-codes {
  font-size: 0.72rem;
  color: var(--ink-faint);
  letter-spacing: 0.03em;
}

.addon {
  margin-top: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--blue-2);
  background: #eaefff;
  border: 1px dashed #c7d3fb;
  border-radius: 8px;
  padding: 5px 9px;
  display: inline-block;
}

/* Compact category (Beilagen) — one large shared image, list of items */
.compact-block {
  background: var(--card);
  overflow: hidden;
}
.compact-banner { display: flex; flex-direction: column; }
.compact-banner .dish-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  font-size: 3rem;
  border-radius: 0;
}
.compact-banner span.cb-text {
  font-size: 0.82rem;
  color: var(--ink-soft);
  padding: 10px 14px 4px;
}

.compact-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px dashed var(--line);
}
.compact-item:last-child { border-bottom: 0; padding-bottom: 16px; }
.compact-item .ci-main { flex: 1; min-width: 0; }
.compact-item .ci-name { font-weight: 600; font-size: 0.94rem; color: var(--ink); }
.compact-item .ci-desc { font-size: 0.8rem; color: var(--ink-soft); }
.compact-item .ci-codes { font-size: 0.7rem; color: var(--ink-faint); }
.compact-item .ci-price {
  flex: none;
  font-family: var(--serif);
  font-weight: 600;
  color: var(--red);
  white-space: nowrap;
}
.compact-item .ci-price::after { content: " €"; font-size: 0.8em; }

/* ------------------------------------------------------------------ */
/* Footer                                                             */
/* ------------------------------------------------------------------ */
.site-footer {
  background: linear-gradient(180deg, var(--blue-2), var(--blue));
  color: #eef1ff;
  text-align: center;
  margin-top: 20px;
}
.footer-banner {
  display: block;
  width: 100%;
  height: auto;
}
.footer-content {
  padding: 26px 20px calc(28px + env(safe-area-inset-bottom));
}
.insta {
  display: inline-block;
  margin: 4px 0 14px;
  color: var(--red);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.insta:active { opacity: 0.8; }

.review-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 18px;
  padding: 12px 22px;
  min-height: 44px;
  background: var(--red);
  color: #ffffff;
  text-decoration: none;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.92rem;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
}
.review-btn:active { filter: brightness(0.95); }
.footer-made { margin: 2px 0; font-size: 0.9rem; }
.footer-address { margin: 2px 0 18px; font-size: 0.85rem; color: #b9c6f5; }

/* Allergen legend (collapsible) */
.allergens {
  max-width: 460px;
  margin: 0 auto;
  text-align: left;
  background: rgba(0,0,0,0.16);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 4px 14px;
}
.allergens summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  padding: 12px 2px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
  color: #ffffff;
}
.allergens summary::-webkit-details-marker { display: none; }
.allergens .chevron { transition: transform 0.2s; color: var(--red); }
.allergens[open] .chevron { transform: rotate(180deg); }
.allergen-hint { margin: 0 0 8px; font-size: 0.76rem; color: #b7c4f2; }
.allergen-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
}
.allergen-list li { font-size: 0.82rem; color: #e3e8fb; }
.allergen-list b {
  display: inline-grid;
  place-items: center;
  width: 20px; height: 20px;
  margin-right: 6px;
  border-radius: 5px;
  background: var(--red);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
}

.footer-note {
  margin: 18px 0 0;
  font-size: 0.72rem;
  color: #9fb0e0;
}

/* ------------------------------------------------------------------ */
/* Small screens & niceties                                          */
/* ------------------------------------------------------------------ */
@media (max-width: 360px) {
  .brand-name { font-size: 1.3rem; }
  .allergen-list { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .dish-live-dot { animation: none !important; }
}
