/* Menu page base styles, shared by every template.
   Colours come from CSS variables written by app/Lib/color.php (--bg, --card, --ink, --muted, --line,
   --accent, --on-accent, --tint, --on-tint, --hero, --on-hero, --c-50 ... --c-900).
   Body classes: fam-{list|cards|ruled|grid|book}  hero-{band|split|overlay|center|plain}
                 font-{...}  hfont-{...}  mode-{light|dark}  t-{template key}
   Template-specific touches live in themes/{key}.css. */

:root {
  --radius: 14px;
  --wrap: 1080px;
  --gutter: clamp(16px, 4vw, 32px);
  --f-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --f-rounded: ui-rounded, "SF Pro Rounded", Nunito, "Varela Round", system-ui, sans-serif;
  --f-condensed: "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
  --f-slab: Rockwell, "Roboto Slab", "Zilla Slab", "Rockwell Nova", Georgia, "Times New Roman", serif;
  --f-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --f-body: var(--f-sans);
  --f-head: var(--f-sans);
  --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 4px 16px rgb(0 0 0 / .05);
}
.font-serif { --f-body: var(--f-serif); }
.font-rounded { --f-body: var(--f-rounded); }
.font-mono { --f-body: var(--f-mono); }
.hfont-serif { --f-head: var(--f-serif); }
.hfont-rounded { --f-head: var(--f-rounded); }
.hfont-condensed { --f-head: var(--f-condensed); }
.hfont-mono { --f-head: var(--f-mono); }
.hfont-slab { --f-head: var(--f-slab); }
.font-slab { --f-body: var(--f-slab); }
.mode-dark { color-scheme: dark; --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 6px 20px rgb(0 0 0 / .25); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body.m { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.m-wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }

/* ---------- preview banner (panel only) ---------- */
.m-preview { position: sticky; top: 0; z-index: 30; background: #1f1d2b; color: #fff; font: 600 13px/1.3 var(--f-sans);
  padding: 8px var(--gutter); display: flex; gap: 12px; align-items: center; justify-content: center; text-align: center; }
.m-preview b { background: #fbbf24; color: #1f1d2b; padding: 2px 8px; border-radius: 99px; }

/* ---------- top bar: language ---------- */
.m-top { position: absolute; top: 12px; right: var(--gutter); z-index: 5; }
.m-lang { display: inline-flex; padding: 3px; gap: 2px; border-radius: 99px; background: rgb(0 0 0 / .28); backdrop-filter: blur(6px); }
.m-lang a { padding: 4px 10px; border-radius: 99px; font: 700 12px/1.4 var(--f-sans); letter-spacing: .04em; text-decoration: none; color: #fff; }
.m-lang a[aria-current] { background: #fff; color: #111; }

/* ---------- hero ---------- */
.m-hero { position: relative; background: var(--hero); color: var(--on-hero); isolation: isolate; }
.m-hero-in { display: flex; gap: 20px; align-items: flex-end; padding-block: clamp(56px, 9vw, 96px) clamp(24px, 4vw, 40px); }
.m-logo { flex: none; width: clamp(64px, 10vw, 88px); aspect-ratio: 1; border-radius: calc(var(--radius) * .8); object-fit: cover;
  background: var(--card); box-shadow: 0 0 0 3px var(--hero); }
.m-kicker { margin: 0 0 6px; font: 600 13px/1.3 var(--f-sans); letter-spacing: .08em; text-transform: uppercase; opacity: .82; }
.m-hero h1 { margin: 0; font: 700 clamp(2rem, 6vw, 3.6rem)/1.02 var(--f-head); letter-spacing: -.03em; text-wrap: balance; }
.m-lead { margin: 10px 0 0; max-width: 52ch; font-size: clamp(.95rem, 2.2vw, 1.08rem); opacity: .9; text-wrap: pretty; }
.m-table { display: inline-block; margin: 12px 0 0; padding: 4px 12px; border-radius: 99px; background: var(--on-hero); color: var(--hero); font: 700 .9rem/1.4 var(--f-sans); }
.m-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.m-quick a { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 14px; border-radius: 99px;
  border: 1px solid currentColor; text-decoration: none; font-weight: 650; font-size: .9rem; }
.m-quick a:first-child { background: var(--on-hero); color: var(--hero); border-color: var(--on-hero); }
.m-quick svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.hero-split .m-hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; align-items: stretch; }
.hero-split .m-cover { position: relative; min-height: 300px; }
.hero-split .m-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-split .m-hero-in { align-items: center; height: 100%; }
.hero-overlay .m-cover { position: absolute; inset: 0; z-index: -2; }
.hero-overlay .m-cover img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay .m-cover::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--hero) 55%, transparent), color-mix(in srgb, var(--hero) 92%, transparent)); }
.hero-overlay .m-hero-in { min-height: clamp(260px, 38vw, 380px); }
.hero-band .m-hero-in { padding-block: clamp(64px, 10vw, 112px) clamp(28px, 5vw, 48px); }
.hero-center .m-hero-in { flex-direction: column; align-items: center; text-align: center; padding-block: clamp(64px, 10vw, 104px) clamp(24px, 4vw, 40px); }
.hero-center .m-lead { margin-inline: auto; }
.hero-center .m-quick { justify-content: center; }
.hero-plain .m-hero { border-bottom: 1px solid var(--line); }
.hero-plain .m-hero-in { padding-block: clamp(56px, 8vw, 88px) 28px; }
.hero-plain .m-lang, .hero-center .m-lang, .t-kafe .m-lang { background: var(--tint); }
.hero-plain .m-lang a, .hero-center .m-lang a, .t-kafe .m-lang a { color: var(--on-tint); }
.hero-plain .m-lang a[aria-current], .hero-center .m-lang a[aria-current], .t-kafe .m-lang a[aria-current] { background: var(--accent); color: var(--on-accent); }

/* ---------- sticky category bar + search ---------- */
.m-nav { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.m-preview + .m-hero + .m-nav, body:has(.m-preview) .m-nav { top: 33px; }
.m-nav-in { display: flex; gap: 10px; align-items: center; padding-block: 10px; }
.m-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; scroll-snap-type: x proximity; }
.m-chips::-webkit-scrollbar { display: none; }
.m-chips a { flex: none; scroll-snap-align: start; padding: 7px 14px; border-radius: 99px; background: var(--card); border: 1px solid var(--line);
  text-decoration: none; font-weight: 650; font-size: .92rem; white-space: nowrap; }
.m-chips a[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.m-search { position: relative; flex: 0 1 220px; }
.m-search input { width: 100%; min-height: 40px; padding: 8px 12px 8px 36px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); }
.m-search input::placeholder { color: var(--muted); }
.m-search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; translate: 0 -50%; fill: none; stroke: var(--muted); stroke-width: 2; }

/* ---------- categories + items ---------- */
.m-main { padding-block: 8px 24px; }
.m-cat { padding-top: clamp(24px, 4vw, 40px); }
.m-cat-title { display: flex; align-items: baseline; gap: 10px; margin: 0 0 14px; font: 700 clamp(1.35rem, 3.4vw, 1.75rem)/1.15 var(--f-head); letter-spacing: -.02em; }
.m-cat-title small { font: 600 .85rem/1 var(--f-sans); color: var(--muted); letter-spacing: 0; }
.m-items { display: grid; gap: 12px; }
.m-item { position: relative; display: grid; grid-template-columns: 1fr; gap: 14px; padding: 14px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); }
.m-item.has-photo { grid-template-columns: 1fr clamp(84px, 22vw, 116px); }
.m-photo { order: 2; aspect-ratio: 1; border-radius: calc(var(--radius) * .7); overflow: hidden; background: var(--tint); }
.m-photo img { width: 100%; height: 100%; object-fit: cover; }
.m-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.m-line { display: flex; align-items: baseline; gap: 10px; }
.m-name { margin: 0; font: 700 1.06rem/1.3 var(--f-head); letter-spacing: -.01em; }
.m-leader { flex: 1; }
.m-price { margin: 0; flex: none; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.m-desc { margin: 0; color: var(--muted); font-size: .93rem; text-wrap: pretty; }
.m-facts { margin: 2px 0 0; color: var(--muted); font-size: .82rem; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.m-tags { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.m-tag { padding: 2px 9px; border-radius: 99px; background: var(--tint); color: var(--on-tint); font: 700 .74rem/1.6 var(--f-sans); letter-spacing: .02em; }
.m-alg { margin: 2px 0 0; font-size: .8rem; color: var(--muted); }
.m-alg b { color: var(--ink); font-weight: 650; }
.m-item.is-out { opacity: .62; }
.m-item.is-out .m-photo img { filter: grayscale(1); }
.m-soldout { padding: 2px 9px; border-radius: 99px; background: var(--ink); color: var(--bg); font: 700 .74rem/1.6 var(--f-sans); }
.m-empty { padding: 48px 0; text-align: center; color: var(--muted); }

/* family: list (rows) */
.fam-list .m-items { gap: 10px; }

/* family: cards (photo on top, 2-3 columns) */
.fam-cards .m-items { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.fam-cards .m-item { padding: 0; overflow: hidden; box-shadow: var(--shadow); align-content: start; }
.fam-cards .m-item.has-photo { grid-template-columns: 1fr; }
.fam-cards .m-photo { order: 0; aspect-ratio: 4 / 3; border-radius: 0; }
.fam-cards .m-info { padding: 14px 16px 16px; }

/* family: ruled (menu-board lines, two columns on wide screens) */
.fam-ruled .m-items { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 0 40px; }
.fam-ruled .m-item { background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 16px 0; }
.fam-ruled .m-item.has-photo { grid-template-columns: 1fr 72px; }
.fam-ruled .m-photo { border-radius: 50%; }

/* family: grid (photo-first tiles) */
.fam-grid .m-items { grid-template-columns: repeat(auto-fill, minmax(min(46%, 230px), 1fr)); gap: 14px; }
.fam-grid .m-item { padding: 0; overflow: hidden; gap: 0; align-content: start; }
.fam-grid .m-item.has-photo { grid-template-columns: 1fr; }
.fam-grid .m-photo { order: 0; aspect-ratio: 1; border-radius: 0; }
.fam-grid .m-info { padding: 12px; }
.fam-grid .m-line { flex-direction: column; gap: 2px; }
.fam-grid .m-name { font-size: 1rem; }
.fam-grid .m-desc { font-size: .85rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fam-grid .m-item:not(.has-photo) .m-info { padding: 16px; }

/* family: book (one centred column, dotted leaders) */
.fam-book { --wrap: 720px; }
.fam-book .m-cat-title { justify-content: center; text-align: center; flex-direction: column; align-items: center; gap: 4px; }
.fam-book .m-items { gap: 0; }
.fam-book .m-item { background: none; border: 0; border-radius: 0; padding: 12px 0; }
.fam-book .m-item.has-photo { grid-template-columns: 56px 1fr; }
.fam-book .m-photo { order: 0; border-radius: 50%; }
.fam-book .m-leader { border-bottom: 2px dotted var(--line); translate: 0 -5px; min-width: 24px; }
.fam-book .m-desc { font-style: italic; }

/* ---------- info block + footer ---------- */
.m-about { margin-top: 32px; padding-block: 28px; border-top: 1px solid var(--line); display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.m-about h2 { margin: 0 0 10px; font: 700 1.1rem/1.2 var(--f-head); }
.m-hours { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; font-size: .92rem; }
.m-hours dt { color: var(--muted); }
.m-hours dd { margin: 0; font-variant-numeric: tabular-nums; }
.m-hours .is-today { font-weight: 700; color: var(--ink); }
.m-contact { display: grid; gap: 8px; font-size: .95rem; }
.m-contact p { margin: 0; }
.m-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.m-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 8px 16px;
  border-radius: 99px; background: var(--accent); color: var(--on-accent); text-decoration: none; font-weight: 700; font-size: .92rem; border: 0; }
.m-btn.ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.m-foot { padding-block: 20px 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: .84rem; display: grid; gap: 6px; }
.m-foot p { margin: 0; }
.m-foot a { color: var(--ink); }
.m-made { margin-top: 10px !important; }
.m-made a { color: var(--muted); text-decoration: none; font-weight: 650; }

/* branch chooser (multi-branch businesses) */
.m-branches { display: grid; gap: 12px; padding-block: 32px; }
.m-branches a { display: block; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.m-branches b { display: block; font: 700 1.1rem/1.3 var(--f-head); }
.m-branches span { color: var(--muted); }

/* ---------- small screens ---------- */
@media (max-width: 700px) {
  .hero-split .m-hero-grid { grid-template-columns: 1fr; }
  .hero-split .m-cover { min-height: 0; aspect-ratio: 16 / 9; order: -1; }
  .hero-split .m-hero-in { padding-top: 24px; }
  .hero-split .m-top { top: 12px; }
  .m-hero-in { flex-direction: column; align-items: flex-start; }
  .hero-center .m-hero-in { align-items: center; }
  .m-nav-in { flex-wrap: wrap; }
  .m-search { flex: 1 1 100%; order: -1; }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .m-item { animation: m-in .35s ease-out backwards; }
  @keyframes m-in { from { opacity: 0; transform: translateY(6px); } }
  html { scroll-behavior: smooth; }
}

/* ---------- print (the printed price list uses /yazdir; this keeps a page print readable too) ---------- */
@media print {
  .m-nav, .m-top, .m-quick, .m-btns, .m-preview, .m-photo { display: none !important; }
  .m-hero { background: none; color: #000; }
  .m-item { break-inside: avoid; border: 0; padding: 6px 0; }
  body.m { background: #fff; color: #000; }
}

/* ---- Waiter call bar (table QR, Module 5) ---- */
body.has-callbar { padding-bottom: 92px; }
.m-callbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); }
.m-callbar-in { max-width: 720px; margin: 0 auto; display: grid; gap: 8px; }
.m-callbar-status { margin: 0; font: 650 .92rem/1.35 var(--f-sans); color: var(--ink); text-align: center; }
.m-callbar-status:empty { display: none; }
.m-callbar-btns { display: flex; gap: 8px; }
.m-callbar button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 14px;
  border-radius: min(var(--radius, 12px), 14px); border: 1.5px solid var(--accent); background: transparent; color: var(--accent);
  font: 700 .98rem/1.2 var(--f-sans); cursor: pointer; }
.m-callbar button[data-act="waiter"] { background: var(--accent); color: var(--on-accent); }
.m-callbar button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.m-callbar button:disabled { opacity: .6; cursor: progress; }
.m-callbar.is-open .m-callbar-status::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%;
  background: var(--accent); vertical-align: 1px; animation: m-pulse 1.4s ease-in-out infinite; }
.m-callbar .m-callbar-cancel { flex: 0 1 auto; border-color: var(--line); color: var(--muted); }
@keyframes m-pulse { 50% { opacity: .25; } }
@media print { .m-callbar { display: none; } }

/* ---- Scheduled categories (Module 6) ---- */
.m-sched { margin-left: auto; padding: 2px 9px; border-radius: 99px; background: var(--tint); color: var(--on-tint); font: 600 .74rem/1.6 var(--f-sans);
  font-style: normal; letter-spacing: 0; text-transform: none; white-space: nowrap; }
.m-later { margin: 8px 0 0; padding: 16px 18px; border: 1px dashed var(--line); border-radius: var(--radius, 12px); color: var(--muted); }
.m-later h2 { margin: 0 0 6px; font: 700 .95rem/1.3 var(--f-sans); color: var(--ink); }
.m-later ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: .92rem; }
.m-later b { color: var(--ink); font-weight: 650; }
