/* Menu platform styles. Mobile first (designed at 390 px wide).
   Brand colours are set per restaurant from menu.json as CSS variables (see main.js).
   Fonts are self-hosted in app/fonts/ (SIL Open Font License), so the page makes no requests to other sites:
   Instrument Serif for dish names and prices, Inter for everything else. */

@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Neutral defaults, replaced by each restaurant's brand.colors */
  --primary: #222222;
  --on-primary: #ffffff;
  --accent: #b5832f;
  --background: #fafafa;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #5f5f5f;
  --highlight: #8a2f22;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Instrument Serif", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --radius: 14px;
  --tap: 44px;
  --space: 24px;
  --soft: color-mix(in srgb, var(--text) 7%, transparent);
  --line: color-mix(in srgb, var(--text) 12%, transparent);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  color: var(--text);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, p, dl, dd, ul, ol { margin: 0; }

:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.loading, .not-found { padding: 64px var(--space); text-align: center; color: var(--muted); }
.not-found h1 { color: var(--text); font-size: 24px; margin-bottom: 12px; }

/* ---------- Logo ---------- */

/* Logos are transparent PNG or SVG files: brand.logo.src on light backgrounds, srcOnDark over photos. */
.logo { display: block; }
.logo-text { font-family: var(--font-display); font-size: 28px; line-height: 1; }

/* ---------- Buttons ---------- */

.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 56px; padding: 0 24px;
  border: 1px solid transparent; border-radius: 999px;
  font-size: 17px; font-weight: 500; text-decoration: none;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-accent { background: var(--accent); color: var(--on-accent, #1a1a1a); }
.btn-secondary {
  justify-content: space-between;
  background: var(--surface); color: var(--text); border-color: var(--line);
}
.btn-icon { font-size: 20px; line-height: 1; }
.btn-small-link {
  min-height: var(--tap); background: none; border: 0;
  font-size: 15px; font-weight: 500; color: var(--text);
  text-decoration: underline; text-underline-offset: 4px;
}
.btn:active { transform: scale(0.98); }

.icon-btn {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--tap); height: var(--tap); border-radius: 50%;
  font-size: 30px; line-height: 1; padding-bottom: 4px; text-decoration: none;
  background: color-mix(in srgb, var(--text) 8%, transparent);
}
.text-btn {
  flex: none;
  min-height: var(--tap); padding: 0 14px; border: 0; border-radius: 999px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  background: color-mix(in srgb, var(--text) 8%, transparent);
}

/* ---------- Hub ---------- */

.hub { min-height: 100dvh; }

.hub-hero {
  position: relative;
  display: flex; align-items: center; justify-content: flex-start;
  min-height: 34dvh;
  padding: calc(28px + var(--safe-top)) var(--space) 28px;
  text-align: left;
}
/* The illustrated background fades into the page colour at the bottom. */
.hub-hero.has-bg {
  background:
    linear-gradient(to bottom, transparent 55%, var(--background) 100%),
    var(--hub-bg) center / cover no-repeat;
}
.hub-hero-inner {
  width: 100%; max-width: 432px; margin: 0 auto;
  padding: 22px 24px 20px;
  border-radius: 28px;
}
/* A soft panel keeps the logo and text readable on top of a busy pattern. */
.has-bg .hub-hero-inner, .on-page-bg .hub-hero-inner {
  background: color-mix(in srgb, var(--background) 88%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 10px 40px color-mix(in srgb, var(--text) 14%, transparent);
}
.hub-city {
  font-size: 12px; font-weight: 500; letter-spacing: 0.42em; text-transform: uppercase;
  color: var(--muted);
}
.hub-title { margin: 6px 0 4px; font-weight: 400; }
.hub-logo { width: 72%; max-width: 230px; height: auto; margin: 10px 0 12px; }
.hub-title .logo-text { font-size: 40px; }
.hub-tagline { font-size: 15px; color: var(--text); }
.hub-rating { margin-top: 8px; color: var(--muted); font-size: 14px; }

.hub-body {
  max-width: 480px; margin: 0 auto;
  padding: 8px var(--space) calc(40px + var(--safe-bottom));
}
.hub-body { display: grid; gap: 12px; }
.hub-body .hub-rating { text-align: center; margin-top: 12px; }

/* "Open now, until 3pm" / "Closed, opens at 11:30am": a small pill under the logo */
.hub-open {
  justify-self: start;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  font-size: 15px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--line);
}
.hub-open-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.hub-open.is-open .hub-open-dot { background: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }

/* A context background (for example the sidewalk pattern at the door) tiles behind the whole hub.
   Every block on it has its own solid surface, so text stays readable. */
.hub.has-page-bg { background: var(--page-bg) center top / var(--page-bg-size, auto) repeat, var(--page-bg-fallback, none) top left repeat; }
.hub.has-page-bg .hub-hero { min-height: 0; padding-bottom: 12px; }
.share-field {
  width: 100%; min-height: var(--tap); padding: 0 12px;
  font: inherit; font-size: 15px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}

/* "First time? Start here": calm highlighted card */
.start-card {
  display: flex; align-items: center; gap: 14px;
  min-height: 72px; padding: 14px 18px 14px 14px; margin-bottom: 8px;
  border-radius: 22px; text-decoration: none; color: var(--text);
  background: color-mix(in srgb, var(--blush, var(--surface)) 55%, var(--surface));
  border: 1.5px solid color-mix(in srgb, var(--primary) 55%, transparent);
  -webkit-tap-highlight-color: transparent;
}
.start-card:active { transform: scale(0.99); }
.start-card-photos { flex: none; display: flex; }
.start-card-photo {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover; display: block;
  border: 2px solid var(--surface);
}
/* Photos may be wrapped in <picture>, so overlap by position rather than by "next sibling". */
.start-card-photos > :nth-child(n+2) > .start-card-photo,
.start-card-photos > .start-card-photo:nth-child(n+2) { margin-left: -14px; }
.start-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.start-card-title { font-family: var(--font-display); font-size: 23px; line-height: 1.1; white-space: nowrap; }
.start-card-line { font-size: 14px; color: var(--muted); margin-top: 2px; }
.start-card .btn-icon { color: var(--primary); }

/* Small info cards: how it works, opening hours, ... */
.info-card {
  padding: 14px 18px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line);
}
.info-card-title {
  font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 4px;
}
.info-card-body { font-size: 15px; }
.info-card-body a { text-underline-offset: 3px; }
.hub-body .info-card:first-of-type { margin-top: 12px; }

.hub-info { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.info-title {
  font-size: 12px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 16px;
}
.info-list { font-size: 15px; }
.info-list dt { font-weight: 600; margin-top: 18px; }
.info-list dt:first-child { margin-top: 0; }
.info-list dd { color: var(--muted); }
.info-list a { color: var(--text); text-underline-offset: 3px; }
.info-line { display: block; }
.info-disclaimer { margin-top: 6px; }
.info-note { margin-top: 8px; font-size: 13px; color: var(--muted); }
.info-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.info-chip {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 18px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  text-decoration: none; font-weight: 500;
}

/* ---------- Menu header: logo, pills, dietary chips ---------- */

.menu-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  padding: calc(6px + var(--safe-top)) 12px 6px;
}
.menu-topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* "‹" and the small logo: one link back to the hub */
.menu-back {
  flex: none; min-width: 0; min-height: var(--tap);
  display: inline-flex; align-items: center; gap: 4px; padding: 0 8px 0 2px;
  text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.menu-back-arrow { font-size: 34px; line-height: 1; margin-top: -4px; }
.menu-logo { height: 34px; width: auto; }
.menu-back .logo-text { font-size: 22px; }
/* Both logos are in the link: white over photos, dark on the page colour */
.menu-logo-on-dark { display: none; }
.is-feed:not(.header-on-light) .menu-logo-on-dark, .start .menu-logo-on-dark { display: block; }
.is-feed:not(.header-on-light) .menu-logo-on-light, .start .menu-logo-on-light { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.view-toggle, .filter-btn { padding: 0; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.filter-btn { position: relative; }
/* A dot on the filter button while a filter is on */
.filter-btn.is-active::after {
  content: ""; position: absolute; top: 7px; right: 7px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 2px var(--background);
}
.ui-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.pills {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: 0 -12px; padding: 0 12px;
}
.pills::-webkit-scrollbar { display: none; }
.pill {
  /* The link is 44 px tall for easy tapping; the visible pill inside stays compact. */
  flex: none; display: flex; align-items: center; min-height: var(--tap); padding: 0;
  text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.pill-face {
  padding: 7px 16px; border-radius: 999px;
  font-size: 15px; font-weight: 500; white-space: nowrap;
  border: 1px solid transparent;
}
/* "Vegetarian ×" under the pills while a filter is on */
.filter-chips { display: flex; }
.filter-chip {
  display: flex; align-items: center; min-height: var(--tap); padding: 0;
  border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.filter-chip-face {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 8px 4px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 600;
}
.filter-chip-x { font-size: 18px; line-height: 1; opacity: 0.8; }
.section-when {
  display: inline-block; margin-top: 2px; padding: 3px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  background: var(--accent); color: var(--on-accent, #1a1a1a);
}

/* Filter sheet: one big button per filter, icon plus text */
.filter-options { display: grid; gap: 8px; }
.filter-option {
  display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 56px; padding: 0 16px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 17px; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.filter-option .diet-icon { width: 30px; height: 30px; color: var(--primary); }
.filter-option[aria-pressed="true"] {
  border: 2px solid var(--primary); font-weight: 600;
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}
.filter-option[aria-pressed="true"]::after { content: "✓"; margin-left: auto; color: var(--primary); font-size: 18px; }

/* Over photos: white text. Each card has its own dark fade at the top (.photo-card-top-shade);
   the header itself only adds a thin one. */
.is-feed .menu-header {
  color: #fff;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0));
  padding-bottom: 14px;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.is-feed .icon-btn, .start .icon-btn { background: rgba(0, 0, 0, 0.3); color: #fff; }
.is-feed .pill-face {
  color: #fff; background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.25);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.is-feed .pill[aria-current="page"] .pill-face { background: #fff; color: #111; border-color: #fff; }
.is-feed .filter-chip-face { background: #fff; color: #111; }

/* On the plain background: the list view, and a feed once its compact list reaches the top */
.is-list .menu-header {
  position: sticky; background: var(--background);
  border-bottom: 1px solid var(--line);
}
.is-feed.header-on-light .menu-header { color: var(--text); background: var(--background); border-bottom: 1px solid var(--line); }
.is-list .pill-face, .header-on-light .pill-face { color: var(--text); background: var(--surface); border-color: var(--line); }
.is-list .pill[aria-current="page"] .pill-face,
.header-on-light .pill[aria-current="page"] .pill-face { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.header-on-light .icon-btn { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
.is-list .filter-chip-face, .header-on-light .filter-chip-face { background: var(--primary); color: var(--on-primary); }

/* ---------- Feed: one dish per screen ---------- */

.feed {
  height: 100dvh; overflow-y: auto; scrollbar-width: none;
  scroll-snap-type: y mandatory; overscroll-behavior-y: contain;
  background: #000;
}
.photo-card {
  position: relative; height: 100dvh; overflow: hidden;
  scroll-snap-align: start; scroll-snap-stop: always;
  background: #000; color: #fff;
}
/* <picture> wraps a photo made by tools/build_media.py; it takes no space of its own. */
.media-picture { display: contents; }
/* Several photos (one per flavour): a sideways track with dots at the bottom of the photo */
.card-photos { position: absolute; inset: 0; }
.card-photos-track {
  display: flex; height: 100%; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
}
.card-photos-track::-webkit-scrollbar { display: none; }
/* Inside Start here, sideways swipes change the story, so the photos only change by themselves */
.card-photos-track.no-swipe { overflow-x: hidden; scroll-snap-type: none; }
.card-photos-slide { position: relative; flex: 0 0 100%; height: 100%; scroll-snap-align: start; }
.card-photos-dots {
  position: absolute; left: 0; right: 0; bottom: calc(6px + var(--safe-bottom)); z-index: 2;
  display: flex; justify-content: center; gap: 6px; pointer-events: none;
}
.photo-card-media {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.photo-card-shade, .photo-card-top-shade { position: absolute; left: 0; right: 0; pointer-events: none; }
/* Dark fade at the bottom (behind the name, text and price), like the reference layout: clear at the top
   of the bottom 42%, about 75% black at the bottom edge. Eased stops so there is no visible line. */
.photo-card-shade {
  bottom: 0; height: 42%;
  background: linear-gradient(to top,
    rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.66) 22%, rgba(0, 0, 0, 0.48) 45%,
    rgba(0, 0, 0, 0.26) 68%, rgba(0, 0, 0, 0.09) 86%, rgba(0, 0, 0, 0) 100%);
}
/* Dark fade at the top (behind the logo, buttons and pills): 55% black at the edge, clear by 28% */
.photo-card-top-shade {
  top: 0; height: 28%;
  background: linear-gradient(to bottom,
    rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.42) 30%, rgba(0, 0, 0, 0.2) 62%, rgba(0, 0, 0, 0.06) 85%, rgba(0, 0, 0, 0) 100%);
}
.photo-card-bottom {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column;
  padding: 0 16px calc(20px + var(--safe-bottom)) var(--space);
}
/* The info button covers the whole bottom area (::after), so tapping the price or the
   "Tap for details" line opens the details too. The heart sits above it. */
.photo-card-info {
  display: block; text-align: left;
  padding: 24px 0 0;
  border: 0; background: none; color: #fff; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.photo-card-info::after { content: ""; position: absolute; inset: 0; }
.photo-card-name {
  display: block;
  font-family: var(--font-display); font-weight: 400;
  font-size: 44px; line-height: 1; letter-spacing: -0.01em;
}
.photo-card-line { display: block; margin-top: 10px; font-size: 16px; line-height: 1.4; color: rgba(255, 255, 255, 0.85); }
.photo-card-price-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.photo-card-prices { flex: 1; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.photo-card-price-row .like-btn { position: relative; z-index: 1; flex: none; }
.photo-card-more { display: block; margin-top: 10px; font-size: 12px; font-weight: 400; color: rgba(255, 255, 255, 0.6); }
/* "Swipe up" on the first card, until the first swipe */
.swipe-hint {
  align-self: center; display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  margin-top: 8px; font-size: 13px; font-weight: 600; color: #fff;
  pointer-events: none; transition: opacity 0.5s ease;
  animation: hint-bob 1.8s ease-in-out infinite;
}
.swipe-hint .ui-icon { width: 20px; height: 20px; stroke-width: 2.2; }
.swipe-hint.is-gone { opacity: 0; animation: none; }
@keyframes hint-bob { 0%, 100% { transform: none; } 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .swipe-hint { animation: none; } }
.photo-card.is-soldout .photo-card-media { filter: grayscale(1) brightness(0.7); }

/* Price: serif numerals in a rounded translucent pill */
.price-pill {
  display: inline-flex; align-items: baseline; gap: 8px;
  min-height: var(--tap); padding: 6px 18px; border-radius: 16px;
  font-family: var(--font-display); font-size: 30px; line-height: 1.1; white-space: nowrap;
  color: #fff; background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.3);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
/* "· 6 pieces", small next to the price */
.price-count { font-size: 15px; white-space: nowrap; }
.photo-card .price-count { color: rgba(255, 255, 255, 0.85); }
.sheet .price-count { color: var(--muted); }
.price-pill-light { color: var(--text); background: var(--surface); border-color: var(--line); }

/* Small labels: Sold out, Chef's pick, Best seller */
.labels { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.label {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
}
.photo-card .label-soldout { background: #fff; color: #111; text-transform: uppercase; font-weight: 700; }
.photo-card .label-badge { background: var(--accent); color: var(--on-accent, #111); }
.photo-card .label-flavours {
  color: #fff; background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.35);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}

/* Dietary badges: small and calm */
.diet-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; color: #fff; }
.diet-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.diet-icon { width: 28px; height: 28px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.diet-ring { stroke-width: 1.4; }
.diet-badges-list { margin: 6px 0 0; color: var(--primary); }
.diet-badges-list .diet-icon { width: 24px; height: 24px; }
.diet-badges.with-labels { gap: 6px 14px; color: var(--text); }
.with-labels .diet-icon { color: var(--primary); }

/* Heart (like) button */
.like-wrap { display: flex; flex-direction: column; align-items: center; }
.like-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--tap); height: var(--tap); padding: 0;
  border: 0; border-radius: 50%; background: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.heart-icon { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: transform 0.15s ease; }
.like-btn[aria-pressed="true"] .heart-icon { fill: currentColor; }
.like-btn:active .heart-icon { transform: scale(0.85); }
.photo-card .like-btn {
  width: 52px; height: 52px; color: #fff;
  background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.3);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.photo-card .like-wrap { position: relative; z-index: 1; }
.like-count { font-size: 12px; font-weight: 600; margin-top: 2px; }
@media (prefers-reduced-motion: reduce) { .heart-icon { transition: none; } }

.feed::-webkit-scrollbar { display: none; }
.feed:focus-visible { outline-offset: -3px; }

/* End of a feed: dishes without a photo, as a compact list on the page colour */
.feed-end {
  min-height: 100dvh; scroll-snap-align: start;
  padding: calc(150px + var(--safe-top)) 0 calc(32px + var(--safe-bottom));
  background: var(--background); color: var(--text);
}
.feed-end .section-title, .feed-end .section-note { padding: 0 var(--space); }

/* Shown when a photo file is missing: a soft brand-coloured block, no letters */
.media-fallback { background: color-mix(in srgb, var(--primary) 70%, var(--background)); }

/* ---------- List view ---------- */

.list-view { padding: 8px 0 calc(32px + var(--safe-bottom)); max-width: 640px; margin: 0 auto; }
.list-section + .list-section { margin-top: 20px; }
.section-title {
  font-family: var(--font-display); font-weight: 400; font-size: 32px; line-height: 1.1;
  padding: 16px var(--space) 4px;
}
.list-view .section-when { margin: 4px var(--space) 0; }
/* Intro at the top of a group (for example Pastéis), for diners who don't know the dishes */
.group-intro {
  margin: 16px var(--space) 8px; padding: 14px 18px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line);
}
.group-intro .section-when { margin: 0 0 8px; }
.group-intro-text { font-size: 15px; line-height: 1.5; }
.section-note { padding: 4px var(--space) 8px; font-size: 14px; color: var(--muted); }
.list { list-style: none; padding: 0; margin: 0; }
.list-item {
  display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 72px; padding: 14px var(--space);
  border: 0; background: none; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.list li + li .list-item { border-top: 1px solid var(--line); }
.list-thumb { flex: none; width: 64px; height: 64px; border-radius: 14px; overflow: hidden; }
.list-thumb .thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.list-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list-name { font-family: var(--font-display); font-size: 23px; line-height: 1.15; }
.list-sub { font-size: 14px; color: var(--muted); margin-top: 2px; }
.list-price { flex: none; display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.list-price-main { font-family: var(--font-display); font-size: 22px; white-space: nowrap; }
.list-price-count { font-size: 13px; color: var(--muted); white-space: nowrap; }
.list-item.is-soldout { opacity: 0.55; }
.list-item .labels { margin: 6px 0 0; }
.list-item .label, .sheet .label { background: var(--accent); color: var(--on-accent, #111); }
.list-item .label-soldout, .sheet .label-soldout { background: var(--text); color: var(--background); text-transform: uppercase; font-weight: 700; }

.empty { padding: 40px var(--space); text-align: center; color: var(--muted); display: grid; gap: 16px; justify-items: center; }

/* ---------- Bottom sheet (details, Wi-Fi) ---------- */

.sheet {
  position: fixed; inset: auto 0 0 0; margin: 0 auto;
  width: 100%; max-width: 640px; max-height: 90dvh;
  padding: 10px 0 0; border: 0; border-radius: 24px 24px 0 0;
  background: var(--background); color: var(--text);
  overflow: hidden; display: flex; flex-direction: column;
  animation: sheet-up 0.22s ease-out;
}
.sheet:not([open]) { display: none; }
.sheet::backdrop { background: rgba(0, 0, 0, 0.5); }
@keyframes sheet-up { from { transform: translateY(40px); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }

.sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 4px; flex: none; }
.sheet-close {
  position: absolute; top: 8px; right: 10px; width: var(--tap); height: var(--tap); z-index: 1;
  border: 0; border-radius: 50%; background: color-mix(in srgb, var(--background) 80%, transparent);
  font-size: 28px; line-height: 1; cursor: pointer;
}
.sheet-body {
  overflow-y: auto; padding: 16px var(--space) calc(28px + var(--safe-bottom));
  display: flex; flex-direction: column; gap: 14px;
}
.sheet-media { margin: -16px calc(-1 * var(--space)) 0; }
/* Photo gallery: swipe sideways, dots show which photo */
.gallery { position: relative; }
.gallery-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track:focus-visible { outline-offset: -3px; }
.gallery-slide { flex: 0 0 100%; margin: 0; scroll-snap-align: start; }
.gallery-caption { padding: 8px var(--space) 0; font-size: 14px; color: var(--muted); }
.gallery-slide .media, .gallery-slide .media-fallback { width: 100%; height: 34dvh; object-fit: cover; display: block; }
.gallery-dots {
  position: absolute; left: 0; right: 0; top: calc(34dvh - 22px);
  display: flex; justify-content: center; gap: 6px; pointer-events: none;
}
.gallery-dot {
  width: 7px; height: 7px; border-radius: 4px;
  background: rgba(255, 255, 255, 0.6); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
  transition: width 0.2s ease;
}
.gallery-dot.is-active { width: 18px; background: #fff; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding-right: 40px; }
.sheet-title { flex: 1; min-width: 0; font-family: var(--font-display); font-weight: 400; font-size: 38px; line-height: 1.05; }
.sheet-sub { color: var(--muted); margin-top: -8px; }
.sheet-price-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.sheet-unit { font-size: 14px; color: var(--muted); }
.sheet .labels { margin: 0; }
.sheet .like-btn { color: var(--primary); }
.sheet .like-wrap { color: var(--primary); }
.sheet-desc { font-size: 17px; }
.sheet-note { font-size: 15px; font-weight: 600; }
.sheet-section { border-top: 1px solid var(--line); padding-top: 12px; }
.sheet-section-title {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
}
.sheet-section-hint { letter-spacing: 0.06em; }
.option-list { list-style: none; padding: 0; margin: 6px 0 0; }
.option-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.option-list li:last-child { border-bottom: 0; }
/* Sizes: name (with its count) left, price right, in the price font */
.sheet-sizes .option-list li { align-items: baseline; font-size: 17px; }
.size-price { font-family: var(--font-display); font-size: 24px; line-height: 1; white-space: nowrap; }

.option-price { color: var(--muted); white-space: nowrap; }
.sheet-dietary { font-size: 15px; border-top: 1px solid var(--line); padding-top: 12px; }
.sheet-dietary .diet-badges { margin: 8px 0 0; }
/* "What do the icons mean?": a quiet text link in the muted colour, full 44 px tap height */
.legend-link {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0; margin-top: 2px;
  border: 0; background: none; cursor: pointer;
  font-size: 14px; color: var(--muted);
  text-decoration: underline; text-underline-offset: 3px;
}

/* Legend for the dietary icons */
.legend-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.legend-list li { display: flex; align-items: center; gap: 12px; font-size: 16px; }
.legend-list .diet-icon { width: 32px; height: 32px; color: var(--primary); }

/* Where it's from: small map of Brazil */
.sheet-origin {
  display: flex; align-items: center; gap: 16px;
  border-top: 1px solid var(--line); padding-top: 12px;
}
.origin-map { flex: none; width: 110px; }
.origin-map svg { display: block; width: 100%; height: auto; }
.origin-map .state {
  fill: color-mix(in srgb, var(--text) 13%, var(--background));
  stroke: var(--background); stroke-width: 0.8; stroke-linejoin: round;
}
.origin-map .state.is-origin { fill: var(--primary); }
.origin-text { display: flex; flex-direction: column; gap: 2px; }
.origin-title { font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.origin-label { font-size: 16px; }
.allergens { font-size: 15px; }
.allergen-note { font-size: 15px; font-weight: 600; }
.restaurant-disclaimer { font-size: 14px; color: var(--muted); }

/* ---------- First time? Start here (stories) ---------- */

.start .menu-header { color: #fff; padding-top: calc(8px + var(--safe-top)); }
/* Thin segmented bars, one per dish; the current one fills up */
.story-bars { display: flex; gap: 4px; margin-bottom: 4px; }
.story-bar { flex: 1; height: 3px; border-radius: 2px; overflow: hidden; background: rgba(255, 255, 255, 0.35); }
.story-bar-fill { display: block; height: 100%; background: #fff; transform-origin: left; transform: scaleX(0); }
.slides {
  display: flex; height: 100dvh; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-width: none; background: #000;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always; }
.slide-end {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
  padding: var(--space); background: var(--background);
}
.slide-end-text { font-family: var(--font-display); font-size: 40px; color: var(--text); }
.slide-end .btn { max-width: 320px; }

/* ---------- Wider screens (over 500 px): the app sits in a phone-sized column ---------- */
@media (min-width: 501px) {
  body {
    background: color-mix(in srgb, var(--background) 85%, var(--text));
  }
  #app {
    width: 430px; height: 100dvh; margin: 0 auto; overflow: hidden;
    background: var(--background);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.12);
    /* Makes position: fixed children (the menu header) stick to the column, not the window */
    transform: translateZ(0);
  }
  .screen {
    height: 100%; min-height: 0; overflow-y: auto;
    scrollbar-width: none;
  }
  .screen::-webkit-scrollbar { display: none; }
  .screen.is-feed, .screen.start { overflow: hidden; }
  .feed, .photo-card, .slides, .slide { height: 100%; }
  .feed-end { min-height: 100%; }
  .menu-header { position: absolute; }
  .is-list .menu-header { position: sticky; }
  .hub-hero { min-height: 300px; }
  .sheet { max-width: 430px; }
}

/* ---------- Preview mode (?preview=1, for demos) ---------- */

/* Everything at the top already pads by --safe-top, so adding the bar's height moves it below the bar. */
html.is-preview { --preview-h: 56px; --safe-top: calc(env(safe-area-inset-top, 0px) + var(--preview-h)); }
.preview-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: flex; align-items: center; gap: 8px;
  height: calc(var(--preview-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 0 0 12px;
  background: #111; color: #fff;
  font-size: 14px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.preview-label {
  flex: none; padding: 4px 8px; border-radius: 6px;
  background: #ffd84d; color: #111; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; font-size: 12px;
}
.preview-scroll {
  display: flex; gap: 12px; overflow-x: auto; padding-right: 12px; scrollbar-width: none;
}
.preview-scroll::-webkit-scrollbar { display: none; }
.preview-group { display: flex; gap: 6px; flex: none; }
.preview-group + .preview-group { padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, 0.25); }
.preview-btn {
  flex: none; min-height: 44px; padding: 0 12px; border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.4); background: transparent; color: #fff;
  font: inherit; white-space: nowrap; cursor: pointer;
}
.preview-btn[aria-pressed="true"] { background: #fff; color: #111; border-color: #fff; font-weight: 600; }
.preview-btn:focus-visible { outline: 3px solid #ffd84d; outline-offset: 2px; }
/* Wider screens: the app is a 430px column; the bar runs across the window above it */
@media (min-width: 501px) {
  html.is-preview #app { margin-top: var(--preview-h); height: calc(100dvh - var(--preview-h)); }
  html.is-preview { --safe-top: env(safe-area-inset-top, 0px); }
}
