/* ============================================================================
 *  The public digital menu (menu.php) and, at the end, the printable
 *  table-tent sheet (admin/menu.php?print=tents), which loads only this file.
 *
 *  Quiet Counter: white canvas, hairline rows, Inter, one action colour.
 *  The shop's colours arrive inline on <html> as --main / --accent /
 *  --on-main / --accent-ink; text on --main always uses --on-main, and
 *  --accent-ink is the only shop colour used as text on white (it is
 *  guaranteed readable). Everything else is neutral from tokens.css, with
 *  fallbacks so this file stands on its own.
 * ==========================================================================*/

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

/* Rows below are flex/grid, which would beat the browser's own [hidden]. */
[hidden]{ display: none !important; }

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

@media (prefers-reduced-motion: no-preference){
  html{ scroll-behavior: smooth; }
}

.menu-body{
  --m-w: 680px;                                   /* the reading column */
  --m-line: var(--line, #E4E4EA);
  --m-line-strong: var(--line-strong, #CFCFD9);
  --m-text: var(--text, #1A1523);
  --m-muted: var(--text-muted, #5E5A6B);
  --m-field: var(--field-border, #8E8B9C);
  --m-hover: var(--surface-3, #EEEEF3);
  --m-ok: var(--ok, #177245);
  --m-bad: var(--danger, #B42318);
  --m-bad-bg: var(--danger-bg, #FEECEB);
  --m-focus: var(--accent-ink, #5B2BD9);

  margin: 0;
  background: #fff;
  color: var(--m-text);
  font-family: var(--font-body, 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.menu-body img{ max-width: 100%; display: block; }
:where(.menu-body) :where(h1, h2, h3, p){ margin: 0; }

.menu-body :where(a, button, input):focus-visible{
  outline: 2px solid var(--m-focus); outline-offset: 2px;
}

/* ----------------------------------------------------------------- head --- */
/* White, with the shop's colour as one thin rule on top: identity without a
   coloured panel, and it works for any colour a shop picks. */
.menu-head{
  border-top: 4px solid var(--main);
  padding: calc(20px + env(safe-area-inset-top)) 16px 16px;
}
.menu-head-in, .menu-note{ max-width: var(--m-w); margin-inline: auto; }
.menu-head-in{ display: flex; align-items: center; gap: 12px; }
.menu-logo{
  flex: none; width: 48px; height: 48px;
  border-radius: 12px; border: 1px solid var(--m-line);
  background: #fff; object-fit: cover;
}
.menu-id{ min-width: 0; }
.menu-head h1{
  font-size: 1.25rem; line-height: 1.25; font-weight: 700; letter-spacing: -.015em;
  overflow-wrap: anywhere;
}
.menu-sub{ font-size: .875rem; color: var(--m-muted); }
.menu-note{ margin-top: 12px; font-size: .875rem; color: var(--m-muted); }

/* ------------------------------------------------------- the sticky bar --- */
/* Search + section chips ride together. With scripting off (no search) and
   one section (no chips) the bar is empty and must leave no trace. */
.menu-bar{
  position: sticky; top: 0; z-index: 10;
  background: #fff;
  border-bottom: 1px solid var(--m-line);
}
.no-js .menu-bar:not(:has(.menu-chips)){ display: none; }

/* Hidden until a script has run: a search box that cannot search is worse
   than none. */
.menu-search{ display: none; }
.js .menu-search{
  display: block; position: relative;
  max-width: calc(var(--m-w) + 32px); margin-inline: auto;
  padding: 12px 16px;
}
.js .menu-search:has(+ .menu-chips:not([hidden])){ padding-bottom: 4px; }
.menu-search-ico{
  position: absolute; left: 30px; top: 50%; translate: 0 -50%;
  fill: none; stroke: var(--m-muted); stroke-width: 2; stroke-linecap: round;
  pointer-events: none;
}
.js .menu-search:has(+ .menu-chips:not([hidden])) .menu-search-ico{ top: calc(50% + 4px); }
.menu-search input{
  display: block; width: 100%; min-height: 44px;
  padding: 10px 14px 10px 42px;
  border: 1px solid var(--m-field); border-radius: 10px;
  background: #fff; color: var(--m-text);
  font: inherit; font-size: 1rem;                 /* 16px: smaller zooms iOS in */
  -webkit-appearance: none; appearance: none;
}
.menu-search input::placeholder{ color: var(--m-muted); opacity: 1; }
.menu-search input:focus-visible{ outline-offset: 0; border-color: var(--m-focus); }

/* Scrolls sideways rather than wrapping; the outer padding lines the first
   chip up with the reading column on a wide screen. */
.menu-chips{
  position: relative;                             /* offsetParent for the spy */
  display: flex; gap: 8px; overflow-x: auto;
  padding: 4px max(16px, calc((100% - var(--m-w)) / 2)) 12px;
  scrollbar-width: none;
}
@media (prefers-reduced-motion: no-preference){ .menu-chips{ scroll-behavior: smooth; } }
.menu-chips::-webkit-scrollbar{ display: none; }
.no-js .menu-chips{ padding-top: 12px; }
.menu-chips a{
  position: relative; flex: none;
  display: inline-flex; align-items: center;
  min-height: 36px; padding: 0 14px;
  border: 1px solid var(--m-line-strong); border-radius: 999px;
  background: #fff; color: var(--m-text); text-decoration: none;
  font-size: .875rem; font-weight: 550; white-space: nowrap;
}
.menu-chips a::after{ content: ''; position: absolute; inset: -4px 0; }   /* 44px for the thumb */
@media (hover: hover){ .menu-chips a:hover{ background: var(--m-hover); } }
.menu-chips a[aria-current]{
  background: var(--main); border-color: var(--main); color: var(--on-main);
}
.menu-chips a:focus-visible{ outline-offset: -2px; }

/* ----------------------------------------------------------------- body --- */
.menu-wrap{ max-width: calc(var(--m-w) + 32px); margin: 0 auto; padding: 0 16px 24px; }

.menu-section{ padding-top: 28px; scroll-margin-top: 118px; }
.menu-section h2{ font-size: 1.125rem; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; }
.menu-secsub{ margin-top: 2px; font-size: .875rem; color: var(--m-muted); }

.menu-list{ list-style: none; margin: 8px 0 0; padding: 0; }

/* ------------------------------------------------------------- the item --- */
/* A row between hairlines: text on the left, the photo (when there is one)
   on the right, price and heart on one line at the foot of the text. */
.menu-item{
  display: flex; gap: 16px; align-items: flex-start;
  padding: 16px 0 10px;
  border-top: 1px solid var(--m-line);
}
.mi-body{ flex: 1 1 auto; min-width: 0; }

.mi-name{
  font-size: 1rem; line-height: 1.35; font-weight: 600; letter-spacing: -.005em;
  overflow-wrap: anywhere;
}
.mi-desc{ margin-top: 4px; font-size: .875rem; line-height: 1.45; color: var(--m-muted); }

.mi-pic{
  flex: none; width: 88px; height: 88px; margin-bottom: 6px;
  border-radius: 12px; object-fit: cover;
  background: var(--m-hover);
}
@media (min-width: 720px){ .mi-pic{ width: 104px; height: 104px; } }

/* Veg / non-veg: the square-with-a-dot convention everybody here already
   reads, beside the name because it is what many people scan for. */
.mi-diet{
  display: inline-block; vertical-align: -1px; position: relative;
  width: 14px; height: 14px; margin-right: 6px;
  border: 1.5px solid currentColor; border-radius: 3px;
}
.mi-diet::after{
  content: ''; position: absolute; inset: 2.5px;
  border-radius: 50%; background: currentColor;
}
.mi-diet.is-veg{    color: #177245; }
.mi-diet.is-nonveg{ color: #B42318; }

/* Price, sold-out, quantity and heart on one line, 44px tall for the heart. */
.mi-meta{
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px;
  min-height: 44px; margin-top: 4px;
}
.mi-price{ font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Sizes: when an item is priced by option, this list is the price, so it
   takes the price's place in the meta row with the heart beside it. */
.mi-opts{
  flex: 1 1 200px; max-width: 360px;
  list-style: none; margin: 0; padding: 0; font-size: .875rem;
}
.mi-meta:has(.mi-opts) .mi-fav{ align-self: flex-end; }
.mi-opts li{
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 5px 0;
}
.mi-opts li + li{ border-top: 1px solid var(--m-line); }
.mo-name{ min-width: 0; color: var(--m-muted); }
.mo-price{ flex: none; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Tags: one quiet style; colour only where it carries meaning. */
.mi-tags{ display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mi-tag{
  display: inline-flex; align-items: center;
  min-height: 22px; padding: 0 8px;
  border: 1px solid var(--m-line); border-radius: 6px;
  font-size: .75rem; font-weight: 550; line-height: 1.2; color: var(--m-muted);
  white-space: nowrap;
}
.mi-tag.is-popular{ color: var(--accent-ink, #8A5A00); border-color: color-mix(in srgb, var(--accent-ink, #8A5A00) 35%, #fff); }
.mi-tag.is-spice{ color: var(--m-bad); }
.mi-tag.is-diet{ color: var(--m-ok); }
.mi-tag.is-allergen{ color: var(--m-bad); border-color: color-mix(in srgb, #B42318 40%, #fff); }
.mi-tag.is-soldout{ color: var(--m-bad); background: var(--m-bad-bg); border-color: transparent; font-weight: 650; }

/* Sold out stays on the page, faded and labelled; the heart keeps full
   strength because a sold-out favourite is still a favourite. */
.menu-item.is-out :is(.mi-name, .mi-desc, .mi-price, .mi-opts, .mi-tags, .mi-pic){ opacity: .5; }

/* ------------------------------------------------------------ the heart --- */
.mi-fav{ display: none; }
.js .mi-fav{
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; margin: 0 -10px 0 auto; padding: 0;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer;
  color: var(--text-soft, #6E6B7D);
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover){ .js .mi-fav:hover{ background: var(--m-hover); } }
.mi-heart{
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round;
  transition: transform .12s ease;
}
.mi-fav:active .mi-heart{ transform: scale(1.15); }
.js .mi-fav.is-on{ color: #D92D20; }
.mi-fav.is-on .mi-heart{ fill: currentColor; }

/* -------------------------------------------------------------- empty ----- */
.menu-empty{
  margin: 48px auto; max-width: 32ch; text-align: center; color: var(--m-muted);
}

/* ---------------------------------------------------------- order ahead --- */
/* Only drawn for a signed-in customer of a shop with ordering on. */
.menu-order-note{
  margin-top: 16px; padding: 12px 14px;
  border: 1px solid var(--m-line); border-left: 3px solid var(--m-line-strong);
  border-radius: 10px; font-size: .9375rem;
}
.menu-order-note.is-ok{ border-left-color: var(--m-ok); }
.menu-order-note.is-err{ border-left-color: var(--m-bad); color: var(--m-bad); }

.mi-qty{ display: inline-flex; align-items: center; gap: 8px; font-size: .875rem; color: var(--m-muted); }
.mi-qty input{
  width: 64px; min-height: 44px; padding: 0 6px;
  border: 1px solid var(--m-field); border-radius: 8px;
  background: #fff; color: var(--m-text);
  font: inherit; font-size: 1rem; text-align: center;
}

.menu-order-extra{ margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--m-line); }
.menu-order-extra label{ display: block; margin-bottom: 6px; font-size: .875rem; font-weight: 600; }
.menu-order-extra label span{ font-weight: 400; color: var(--m-muted); }
.menu-order-extra input{
  display: block; width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--m-field); border-radius: 10px;
  background: #fff; color: var(--m-text); font: inherit; font-size: 1rem;
}

/* The one action on the page, pinned to the thumb. */
.menu-order-bar{
  position: sticky; bottom: 0; z-index: 5;
  display: flex; flex-direction: column; gap: 8px;
  margin: 16px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid var(--m-line);
}
.menu-order-bar p{ font-size: .8125rem; color: var(--m-muted); }
.menu-order-btn{
  min-height: 48px; padding: 0 20px;
  border: 0; border-radius: 10px;
  background: var(--main); color: var(--on-main);
  font: inherit; font-weight: 650; cursor: pointer;
}
.menu-order-btn:focus-visible{ outline-offset: 3px; }
@media (min-width: 600px){
  .menu-order-bar{ flex-direction: row; align-items: center; justify-content: space-between; margin-inline: 0; padding-inline: 0; }
}

/* ----------------------------------------------------------------- foot --- */
.menu-foot{
  max-width: calc(var(--m-w) + 32px); margin: 0 auto;
  padding: 24px 16px calc(32px + env(safe-area-inset-bottom));
}
.menu-foot p{ padding-top: 20px; border-top: 1px solid var(--m-line); font-size: .8125rem; color: var(--m-muted); }

/* ---------------------------------------------------------------- wider --- */
@media (min-width: 720px){
  .menu-head{ padding-top: 32px; padding-bottom: 20px; }
  .menu-head h1{ font-size: 1.5rem; }
  .menu-logo{ width: 56px; height: 56px; }
}

/* ============================================================================
 *  THE PRINTABLE SHEET  —  admin/menu.php?print=tents
 *
 *  One A4 page carrying the same QR at three sizes: a folding table tent for
 *  the middle of a table, two counter cards, and three small stickers for the
 *  edge of a table or the back of a bill folder.
 *
 *  Everything is in millimetres, because the output is paper. Black on white
 *  and no photographs, because the printer this comes out of belongs to a
 *  small shop and toner is money. The dashed rules are cut and fold lines.
 * ==========================================================================*/

.tent-body{
  margin: 0; background: var(--bg, #f4f4f5);
  color: #111; font-family: var(--font-body, system-ui, -apple-system, 'Segoe UI', sans-serif);
}

/* The instructions above the paper — screen only. */
.tent-bar{
  max-width: 210mm; margin: 0 auto; padding: 20px 16px;
  color: var(--text, #111);
}
.tent-bar h1{ margin: 0; font-size: 1.35rem; }
.tent-bar p{ margin: 8px 0 0; font-size: .9rem; color: var(--text-muted, #555); max-width: 68ch; }
.tent-bar .tent-acts{ display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.tent-bar a, .tent-bar button{
  font: inherit; font-size: .9rem; font-weight: 650; cursor: pointer;
  padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line, #d4d4d8); background: transparent;
  color: var(--text, #111); text-decoration: none;
}
.tent-bar button{ background: var(--main, #16323f); color: var(--on-main, #fff); border-color: transparent; }

.tent-sheet{
  width: 210mm; min-height: 297mm; margin: 0 auto 40px;
  padding: 10mm; background: #fff; color: #111;
  box-shadow: 0 2px 24px rgb(0 0 0 / 14%);
}
.tent-row{ display: flex; gap: 6mm; justify-content: center; margin-bottom: 6mm; }
.tent-row:last-child{ margin-bottom: 0; }

.tent{
  border: 1px dashed #9a9a9a; border-radius: 2mm;
  background: #fff; text-align: center;
  break-inside: avoid; page-break-inside: avoid;
}
.tent-face{ padding: 5mm 4mm; }

/* The big one folds down the middle and stands up, so the upper half is
   printed upside down — folded, both sides read the right way round. */
.tent-lg{ width: 190mm; }
.tent-lg .is-flip{ transform: rotate(180deg); }
.tent-fold{
  border-top: 1px dashed #9a9a9a;
  font-size: 7pt; letter-spacing: .18em; text-transform: uppercase; color: #777;
  padding: 1mm 0;
}
.tent-md{ width: 92mm; }
.tent-sm{ width: 58mm; }
.tent-sm .tent-face{ padding: 3mm 2mm; }

.tent-shop{ font-size: 13pt; font-weight: 700; line-height: 1.2; }
.tent-lg .tent-shop{ font-size: 17pt; }
.tent-sm .tent-shop{ font-size: 10pt; }

.tent-kicker{
  font-size: 7.5pt; letter-spacing: .2em; text-transform: uppercase;
  color: #555; margin-top: 1mm;
}
.tent-qr{ display: flex; justify-content: center; margin: 3mm 0 2mm; }
.tent-qr canvas, .tent-qr img{ width: 30mm; height: 30mm; }
.tent-lg .tent-qr canvas, .tent-lg .tent-qr img{ width: 34mm; height: 34mm; }
.tent-sm .tent-qr canvas, .tent-sm .tent-qr img{ width: 26mm; height: 26mm; }

.tent-call{ font-size: 9.5pt; font-weight: 700; }
.tent-sm .tent-call{ font-size: 8pt; }
.tent-url{
  font-size: 7pt; color: #555; margin-top: 1mm;
  word-break: break-all; line-height: 1.3;
}
.tent-sm .tent-url{ display: none; }   /* 26mm of QR and a URL is a smudge */

.tent-fallback{
  padding: 6mm; font-size: 9pt; color: #8c1d18;
}

@media print{
  @page{ size: A4; margin: 0; }
  .tent-body{ background: #fff; }
  .no-print{ display: none !important; }
  .tent-sheet{
    width: auto; min-height: 0; margin: 0; padding: 8mm;
    box-shadow: none;
  }
  .tent{ border-color: #bbb; }
}

/* A phone looking at the sheet before printing: let the paper scroll sideways
   rather than squashing millimetres into something that will not match the
   print. */
@media (max-width: 230mm){
  .tent-sheet{ margin-left: 0; margin-right: 0; }
  body.tent-body{ overflow-x: auto; }
}
