/* ======================================================================
   Gretta — carta. Same palette and type as the homepage, laid out for
   reading on a phone at the table and for printing to A4.
   ====================================================================== */

:root {
  --cream: #ede2c7;
  --paper: #f4e6c2;
  --ink: #221a12;
  --ink-soft: #3d2e1f;
  --terracotta: #b84a2f;
  --ochre: #d4a84b;
  --forest: #2b3a2e;
  --cobalt: #1e3a7a;
  --accent: var(--forest);

  --serif: "EB Garamond", Georgia, serif;
  --display: "Playfair Display", "EB Garamond", Georgia, serif;
  --sans: "Inter Tight", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }

/* Paper grain, as on the homepage */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='5'/><feColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.07 0 0 0 0 0.04 0 0 0 0.25 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.5'/></svg>");
  mix-blend-mode: multiply;
  opacity: 0.3;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 48px; position: relative; z-index: 2; }

/* ---------- MASTHEAD ---------- */
.masthead {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 44px 24px 34px;
}
.masthead .back {
  position: absolute; top: 26px; left: 32px;
  font-family: var(--sans); font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-soft); text-decoration: none; opacity: 0.7;
}
.masthead .back:hover { opacity: 1; color: var(--accent); }
.wordmark { height: 62px; width: auto; margin: 0 auto 14px; }
.kicker {
  font-family: var(--sans); font-size: 10px;
  letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--ink-soft); opacity: 0.7;
}
.masthead .hours {
  font-family: var(--sans); font-size: 10px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--terracotta);
  margin-top: 8px;
}
.masthead .pdf {
  display: inline-block;
  margin-top: 16px;
  font-family: var(--sans); font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); text-decoration: none;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 8px 18px;
}
.masthead .pdf:hover { background: var(--accent); color: var(--cream); }

/* Language switcher — each language is its own URL, so these are plain links */
.masthead .langs {
  position: absolute; top: 24px; right: 32px;
  display: flex; gap: 4px;
}
.masthead .langs a {
  font-family: var(--sans); font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-soft); opacity: 0.55;
  text-decoration: none;
  padding: 4px 6px;
}
.masthead .langs a:hover { opacity: 1; color: var(--accent); }

/* ---------- TILE STRIP (homepage motif) ---------- */
.tile-strip {
  height: 26px;
  position: relative; z-index: 2;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  background:
    repeating-linear-gradient(90deg,
      var(--ochre) 0 14px, var(--paper) 14px 28px,
      var(--cobalt) 28px 42px, var(--paper) 42px 56px);
}

/* ---------- SECTIONS ---------- */
.sec { padding: 54px 0 8px; break-inside: auto; }
.sec-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(34,26,18,.28);
}
.sec-title {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(30px, 4.4vw, 54px);
  line-height: 1;
  letter-spacing: -0.02em;
}
.sec-num {
  font-family: var(--sans); font-size: 10px;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent); white-space: nowrap;
}
.sec-sub {
  font-family: var(--sans); font-size: 10px;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--terracotta);
  margin-top: 14px;
}

/* ---------- DISHES ---------- */
.dishes { list-style: none; margin-top: 10px; }
.dish {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 0 14px;
  padding: 15px 0 14px;
  border-bottom: 1px dashed rgba(34,26,18,.2);
  break-inside: avoid;
}
.dish:last-child { border-bottom: none; }

.num {
  font-family: var(--display);
  font-style: italic;
  font-size: 20px;
  line-height: 1;
  color: var(--terracotta);
  padding-top: 0.16em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.line {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 14px;
}
/* Name and its allergen codes travel together, price stays hard right. */
.head { display: inline; }
.name {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  line-height: 1.35;
}
.name + .allergens { margin-left: 0.7em; }
.price {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.note {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-top: 3px;
}
.desc {
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 62ch;
  margin-top: 4px;
}

/* ---------- ALLERGENS ----------
   Set as small letter-spaced codes in the allergen's own hue, darkened by
   build-menu.py until each clears 4.5:1 on white. Quieter than filled
   stickers, and sitting on the dish line is what fits Tapes on one page. */
.allergens { white-space: nowrap; }
.al {
  --al: #666;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--al);
  text-decoration: none;         /* <abbr> underlines by default */
  border: 0;
  cursor: help;
  white-space: nowrap;
}
.al + .al::before {
  content: "·";
  color: rgba(34,26,18,.32);
  letter-spacing: 0;
  margin: 0 0.3em 0 0.22em;
  font-weight: 400;
}

/* Wines: one note covers the whole list rather than repeating it per bottle */
.wine-note {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0.75;
  margin-top: 22px;
}

/* ---------- LEGEND ---------- */
.legend-block {
  margin-top: 40px;
  padding: 34px 0 60px;
  border-top: 2px solid var(--ink);
}
.legend {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px 26px;
  margin: 24px 0 30px;
}
.legend li {
  display: flex; align-items: baseline; gap: 8px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}
.legend .al { cursor: default; flex-shrink: 0; min-width: 2.1em; }
/* The brand colour survives in the legend as a small dot, so the printed
   icons on the wall chart still map to the codes on the dishes. */
.legend .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
  align-self: center;
  box-shadow: inset 0 0 0 1px rgba(34,26,18,.18);
}
.legend .al-name { color: var(--ink); }

.disclaimers { list-style: none; }
.disclaimers li {
  font-size: 14px;
  font-style: italic;
  color: var(--ink-soft);
  padding: 3px 0 3px 16px;
  position: relative;
  max-width: 80ch;
}
.disclaimers li::before {
  content: "·";
  position: absolute; left: 4px;
  color: var(--terracotta);
}
.vat {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0.75;
  margin-top: 22px;
}

/* Wine list: its own block after the allergen legend, own page in print */
.wines-block { padding-top: 8px; }
.wines-block .sec { padding-top: 34px; }

/* ---------- FOOTER ---------- */
.foot {
  position: relative; z-index: 2;
  background: var(--forest);
  color: rgba(237,226,199,.85);
  padding: 26px 48px;
  display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.foot a { color: inherit; text-decoration: none; }
.foot a:hover { color: var(--ochre); }

/* ---------- NARROW ---------- */
@media (max-width: 760px) {
  html, body { font-size: 16px; }
  .masthead .langs { position: static; justify-content: center; margin-bottom: 10px; }
  .wrap { padding: 0 20px; }
  .sec { padding: 38px 0 4px; }
  .dish { grid-template-columns: 1.9rem 1fr; gap: 0 10px; }
  .name { font-size: 18px; }
  .line { flex-wrap: wrap; gap: 2px 12px; }
  .masthead .back { position: static; display: block; margin-bottom: 18px; }
  .foot { padding: 22px 20px; }
}

/* ---------- PRINT (A4) ----------
   White paper, but the site's character kept: coloured tile strip, Playfair
   italic headings, terracotta numerals, ochre-green section marks. */
@media print {
  @page { size: A4; margin: 12mm 13mm 11mm; }
  html, body { background: #fff; font-size: 10pt; }
  body::before { display: none; }                 /* no grain on paper */
  .masthead .back, .masthead .pdf, .masthead .langs, .foot { display: none; }
  .wrap { max-width: none; padding: 0; }

  /* Compact masthead so all 19 tapes clear the first page */
  .masthead { padding: 0 0 4mm; }
  .wordmark { height: 34px; margin-bottom: 6px; }
  .kicker { font-size: 7pt; letter-spacing: 0.26em; }
  .masthead .hours { font-size: 7pt; margin-top: 2mm; }

  /* The site's azulejo strip, in colour, on white */
  .tile-strip {
    height: 5mm;
    border-top: 1px solid var(--ink);
    border-bottom: 1px solid var(--ink);
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .tile-strip + .wrap { margin-top: 0; }
  /* keep only the opening strip; the closing one floated mid-page */
  .tile-strip:last-of-type { display: none; }

  .sec { padding: 5mm 0 0; break-inside: avoid; }
  .sec:first-of-type { padding-top: 4mm; }
  .sec-head { break-after: avoid; padding-bottom: 2mm; }
  .sec-title { font-size: 17pt; }
  .sec-num { font-size: 6.5pt; letter-spacing: 0.2em; }
  .sec-sub { font-size: 6.5pt; margin-top: 2mm; }

  .dishes { margin-top: 1mm; }
  .dish { padding: 1.5mm 0; grid-template-columns: 1.6rem 1fr; gap: 0 8px; }
  .num { font-size: 11pt; padding-top: 0.1em; }
  .name { font-size: 10.5pt; line-height: 1.3; }
  .price { font-size: 8.5pt; }
  .note { font-size: 6.5pt; margin-top: 1px; }
  .desc { font-size: 8pt; max-width: none; margin-top: 1px; }
  .al { font-size: 7pt; letter-spacing: 0.1em;
        -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  .legend-block { break-before: auto; break-inside: avoid; margin-top: 6mm; padding: 5mm 0 0; }
  .wines-block { break-before: page; padding-top: 0; }
  .wines-block .sec { padding-top: 4mm; break-inside: avoid; }
  .legend { grid-template-columns: repeat(3, 1fr); gap: 2mm 6mm; margin: 4mm 0 5mm; }
  .legend li { font-size: 7.5pt; }
  .legend .dot { width: 7px; height: 7px;
                 -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .disclaimers li { font-size: 7.5pt; padding: 1px 0 1px 12px; }
  .vat { font-size: 6.5pt; margin-top: 4mm; }
  .wine-note { font-size: 6.5pt; margin-top: 3mm; }
}
