/* Tairsheet sheet.css
   One template for every menu page. Styles the existing markup as-is.
   Mobile first (390px), no JS needed for the look.
   Adopted 2026-11-10 from the design package; fonts are self-hosted (OFL, see
   /fonts/*-OFL.txt), so the page makes no third-party requests.
   Bump SHEET_CSS_VERSION in src/menu/render-menu-page.ts when this file changes
   (a test enforces it). */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/fraunces-latin-v5.woff2") format("woff2-variations");
  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: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/inter-latin-v5.woff2") format("woff2-variations");
  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 {
  --paper: #faf6ef;          /* warm off-white page */
  --card: #fffdf9;
  --ink: #2a2420;            /* warm near-black */
  --muted: #7a6f66;
  --rule: #e8dfd2;
  --accent: #a4492a;         /* terracotta, used sparingly */
  --accent-soft: #f3e4d8;
  --check-blue: #2f5f9e;     /* owner paid; 6.0:1 on paper, deeper than X's blue */
  --check-pink: #b8336f;     /* fan donated; 5.2:1 on paper */
  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --text: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --pad: 1.25rem;
  --measure: 40rem;
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 3.25rem; }

body {
  margin: 0 auto;
  max-width: var(--measure);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern", "liga";
}

a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Hero (optional photo) ---------- */
img.hero {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--accent-soft);
  /* fades the photo into the page so the name can sit on paper, no wrapper needed */
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 62%, transparent 100%);
}
img.hero + .name-row { margin-top: -2.25rem; }

/* ---------- Business name ---------- */
.business-name {
  margin: 0;
  padding: 2.75rem var(--pad) 0;
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(2.6rem, 11vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
}
.business-name::before {          /* small eyebrow above the name */
  content: "Menu";
  display: block;
  margin-bottom: 0.6rem;
  font-family: var(--text);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
img.hero + .name-row .business-name { padding-top: 0; }

/* ---------- Name row: business name + check badge (grey, blue, pink) ---------- */
.name-row {
  position: relative;               /* anchors the badge popover */
  display: flex; flex-wrap: wrap;
  align-items: flex-end;            /* fallback */
  align-items: last baseline;       /* badge sits on the last line of the name */
  column-gap: 0.25rem; row-gap: 0.55rem;
  padding: 0 var(--pad);
}
.name-row .business-name { padding-left: 0; padding-right: 0.5rem; min-width: 0; }

.badge summary {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.28rem 0.65rem 0.28rem 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 9%, transparent);
  font-family: var(--text); font-size: 0.8rem; font-weight: 600; line-height: 1.2;
  letter-spacing: 0; white-space: nowrap;
  list-style: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.badge summary::-webkit-details-marker { display: none; }
.badge summary::marker { content: ""; }
.badge summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.badge-icon { width: 1.1em; height: 1.1em; flex: none; color: inherit; }
/* All three colors use the same filled check; only the color differs. */
.badge-blue summary { color: var(--check-blue); }
.badge-pink summary { color: var(--check-pink); }
.badge-grey summary { color: var(--muted); }

.badge-pop {
  position: absolute; z-index: 5;
  top: 100%; left: var(--pad); margin-top: 0.4rem;
  width: min(20rem, calc(100vw - 2.5rem));
  padding: 0.85rem 1rem;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 12px;
  box-shadow: 0 10px 28px -10px rgba(60, 35, 20, 0.28), 0 2px 6px rgba(60, 35, 20, 0.08);
  font-family: var(--text); font-size: 0.85rem; font-weight: 400; line-height: 1.45;
  letter-spacing: 0; text-transform: none; text-wrap: pretty;
}
.badge-pop p { margin: 0; }
.badge-pop p + p { margin-top: 0.55rem; }
.badge-cta a { color: var(--accent); font-weight: 600; }

/* ---------- Profile (website etc.) ---------- */
.profile { margin: 0.9rem 0 0; padding: 0 var(--pad); }
.profile p { margin: 0; font-size: 0.875rem; }
.profile-website a {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.profile-website a::before { content: "\2197"; color: var(--accent); }  /* north-east arrow */

/* ---------- Menu ---------- */
.menu { margin-top: 2rem; padding-bottom: 1rem; }

.menu-section { margin: 0 0 2.5rem; }

.menu-section-title {
  position: sticky; top: 0; z-index: 2;
  display: block;
  margin: 0;
  padding: 0.9rem var(--pad) 0.8rem calc(var(--pad) + 2rem);
  /* the short terracotta rule is a background layer so ::first-letter still works */
  background:
    linear-gradient(var(--accent), var(--accent)) var(--pad) 55% / 1.25rem 2px no-repeat,
    var(--paper);
  box-shadow: 0 1px 0 var(--rule);
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.menu-item-list { list-style: none; margin: 0; padding: 0 var(--pad); }

.menu-item {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 1rem;
  align-items: baseline;
  padding: 1.05rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 70%, transparent);
}
.menu-item:last-child { border-bottom: 0; }

.menu-item-name {
  grid-column: 1; grid-row: 1;
  margin: 0;
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: 1.125rem;
  line-height: 1.3;
  letter-spacing: -0.005em;
}

.menu-item-price {
  grid-column: 2; grid-row: 1;
  margin: 0;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--ink);
  white-space: nowrap;
}

.menu-item-description,
.menu-item > p:not(.menu-item-price) {
  grid-column: 1 / -1;
  margin: 0.3rem 0 0;
  max-width: 34em;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}

/* Size variants: a lone variant sits after the name; grouped variants list one
   labelled price per line in the price column. */
.variant {
  margin-left: 0.4rem;
  font-family: var(--text);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.menu-item-price .price-option { display: block; text-align: right; }
.menu-item-price .price-option + .price-option { margin-top: 0.2rem; }
.menu-item-price .variant { margin: 0 0.4rem 0 0; }

/* Dietary and allergen tags */
.menu-item-tags { font-size: 0.8rem; }

/* ---------- Footer ---------- */
.sheet-footer {
  margin-top: 1rem;
  padding: 2rem var(--pad) 3rem;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-size: 0.8125rem;
  color: var(--muted);
}
.share {
  appearance: none;
  display: inline-block;
  margin: 0 0 1.25rem;
  padding: 0.8rem 1.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: 600 0.95rem/1 var(--text);
  cursor: pointer;
}
.share:hover { background: var(--accent); }
.made-with { margin: 0 0 0.5rem; }
.legal { margin: 0; }
.legal a { color: var(--muted); }

/* ---------- Larger screens ---------- */
@media (min-width: 700px) {
  :root { --pad: 2rem; }
  body { padding-bottom: 2rem; }
  img.hero { margin-top: 1.5rem; aspect-ratio: 16 / 9; border-radius: 14px 14px 0 0; }
  .business-name { padding-top: 4rem; }
  .menu-item-name { font-size: 1.2rem; }
}


@media print {
  body { background: #fff; max-width: none; }
  img.hero, .share, .badge-pop { display: none; }
  .menu-section-title { position: static; background: none; }
  .menu-item { break-inside: avoid; }
}

/* Optional: credit line for the hero photo (placed right after img.hero) */
.hero-credit {
  margin: -1.6rem 0 0; padding: 0 var(--pad);
  position: relative; z-index: 1;
  text-align: right;
  font-size: 0.6875rem; color: var(--muted);
}
.hero-credit a { color: inherit; }
img.hero + .hero-credit + .name-row { margin-top: 0.5rem; }
img.hero + .hero-credit + .name-row .business-name { padding-top: 0; }
