/* Allergen guide (/allergens, or the homepage of an allergen-only site) */
:root {
  --al-ok: #2E6B3E;
  --al-may: #8A5A00;
  --al-no: #A3261E;
  --al-ask: #6B6560;
  --al-line: color-mix(in srgb, var(--ink) 14%, transparent);
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Allergen-only sites without a logo file show the name */
.logo-word { font-family: var(--display); font-size: 22px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink); text-decoration: none; line-height: 1.2; }
.footer-word { margin: 0; font-family: var(--display); font-size: 20px; letter-spacing: 0.14em; text-transform: uppercase; }

.al-head { padding-bottom: 28px; }
.al-head h1 { font-size: clamp(36px, 6vw, 56px); }

/* ---------- The bar: what you avoid, search, view ---------- */
.al-bar { position: sticky; top: 0; z-index: 5; background: var(--cream); border-block: 1px solid var(--al-line); }
.al-bar-in { padding-block: 14px; }
.al-pick { display: flex; align-items: flex-start; gap: 10px 16px; }
.al-pick-label { flex: none; padding-top: 9px; font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.al-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.al-chip {
  min-height: 40px; padding: 0 14px; border: 1.5px solid color-mix(in srgb, var(--ink) 28%, transparent); border-radius: 999px;
  background: transparent; color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
}
.al-chip:hover { border-color: var(--ink); }
.al-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.al-chip[aria-pressed="true"]::before { content: "✕ "; font-size: 12px; }
.al-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.al-search input {
  width: 220px; max-width: 100%; min-height: 40px; padding: 0 12px; border: 1.5px solid color-mix(in srgb, var(--ink) 28%, transparent);
  border-radius: 2px; background: #fff; color: var(--ink); font: inherit; font-size: 15px;
}
.al-hide { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.al-hide input { width: 18px; height: 18px; accent-color: var(--ink); }
.al-views { display: inline-flex; border: 1.5px solid color-mix(in srgb, var(--ink) 28%, transparent); border-radius: 2px; overflow: hidden; }
.al-views button { min-height: 36px; padding: 0 14px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.al-views button[aria-pressed="true"] { background: var(--ink); color: var(--cream); }
.al-clear { flex: none; align-self: center; }
.al-clear, .al-print { padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.al-views { display: none; }
.is-ready .al-views { display: inline-flex; }

/* ---------- Menus and the summary ---------- */
.al-body { padding-block: 24px 72px; }
.al-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin-bottom: 18px; }
.al-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.al-tabs button {
  min-height: 44px; padding: 0 18px; border: 1.5px solid color-mix(in srgb, var(--ink) 25%, transparent); border-radius: 2px;
  background: transparent; color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.al-tabs button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.al-summary { margin: 0 0 20px; font-size: 15px; color: var(--muted); min-height: 1.6em; }
.has-pick .al-summary { color: var(--ink); font-weight: 500; }
.al-print-title { display: none; }
.al-none { padding: 24px 0; color: var(--muted); }

/* ---------- Status marks ---------- */
.al-mark {
  flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--al-line); font-size: 13px; font-weight: 700; line-height: 1; color: transparent;
}
.is-ok .al-mark { background: var(--al-ok); border-color: var(--al-ok); color: #fff; }
.is-ok .al-mark::before { content: "✓"; }
.is-may .al-mark { background: #FFF3D6; border-color: var(--al-may); color: var(--al-may); }
.is-may .al-mark::before { content: "!"; }
.is-no .al-mark { background: var(--al-no); border-color: var(--al-no); color: #fff; }
.is-no .al-mark::before { content: "✕"; }
.is-ask .al-mark { border-style: dashed; border-color: var(--al-ask); color: var(--al-ask); }
.is-ask .al-mark::before { content: "?"; }

/* Before a pick, only the dishes to ask about carry a mark */
.al:not(.has-pick) .al-item:not(.is-ask) .al-mark { visibility: hidden; }

/* ---------- List view (phones, or by choice) ---------- */
.al-sec-name { margin: 28px 0 6px; font-family: var(--display); font-size: 24px; font-weight: 400; }
.al-sec:first-child .al-sec-name { margin-top: 0; }
.al-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); column-gap: 32px; }
.al-list .al-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--al-line); }
.al-text { display: flex; flex-direction: column; min-width: 0; }
.al-name { font-weight: 600; }
.al-detail { font-size: 14px; color: var(--muted); }
.is-ok .al-detail { color: var(--al-ok); }
.is-may .al-detail { color: var(--al-may); }
.is-no .al-detail { color: var(--al-no); }
.has-pick .al-list .is-no .al-name { color: color-mix(in srgb, var(--ink) 55%, transparent); }

/* ---------- Table view (wide screens, or by choice) ---------- */
.al-grid-wrap { overflow-x: auto; border: 1px solid var(--al-line); background: #fff; }
.al-grid-wrap:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.al-grid { width: 100%; border-collapse: collapse; font-size: 14px; }
.al-grid th, .al-grid td { border-bottom: 1px solid var(--al-line); }
.al-grid thead th { position: sticky; top: 0; background: #fff; vertical-align: bottom; }
.al-corner { text-align: left; padding: 10px 14px; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.al-col { width: 44px; min-width: 40px; padding: 10px 0 8px; font-weight: 600; }
.al-col span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: 13px; }
.al-grid-sec th { padding: 16px 14px 6px; text-align: left; font-family: var(--display); font-size: 19px; font-weight: 400; background: color-mix(in srgb, var(--cream) 60%, #fff); }
.al-dish { position: sticky; left: 0; z-index: 1; min-width: 200px; padding: 8px 14px; text-align: left; font-weight: 600; background: #fff; }
.al-dish .al-mark { width: 20px; height: 20px; margin-right: 10px; font-size: 11px; vertical-align: -4px; }
.al-grid td { text-align: center; padding: 8px 0; }
.al-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--ink); vertical-align: middle; }
.al-dot-may { background: linear-gradient(90deg, var(--al-may) 50%, transparent 50%); box-shadow: inset 0 0 0 1.5px var(--al-may); }
.al-ask-cell { color: var(--al-ask); font-style: italic; text-align: left !important; padding-left: 14px !important; }
.al-grid .is-picked { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.al-grid thead .is-picked { background: var(--ink); color: var(--cream); }
.al-grid td.is-picked .al-dot:not(.al-dot-may) { background: var(--al-no); width: 13px; height: 13px; }
.al-grid tr.is-no .al-dish { color: var(--al-no); }
.al-grid tr.is-ok .al-dish { color: var(--al-ok); }
.al-grid tbody tr.al-item:hover th, .al-grid tbody tr.al-item:hover td { background-color: color-mix(in srgb, var(--cream) 50%, #fff); }

/* Which view shows: phones get the list, wide screens the table, unless the guest picks */
.al-as-grid { display: none; }
@media (min-width: 900px) {
  .al[data-view="auto"] .al-as-list, .al:not(.is-ready) .al-as-list { display: none; }
  .al[data-view="auto"] .al-as-grid, .al:not(.is-ready) .al-as-grid { display: block; }
}
.al[data-view="list"] .al-as-list { display: block; }
.al[data-view="list"] .al-as-grid { display: none; }
.al[data-view="grid"] .al-as-list { display: none; }
.al[data-view="grid"] .al-as-grid { display: block; }

/* ---------- Legend and note ---------- */
.al-foot { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--al-line); display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.al-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 24px; font-size: 14px; }
.al-legend li { display: inline-flex; align-items: center; gap: 8px; }
.al-key { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; font-weight: 700; }
.al-key-ok { background: var(--al-ok); }
.al-key-ok::before { content: "✓"; color: #fff; }
.al-key-may { background: #FFF3D6; border: 1.5px solid var(--al-may); color: var(--al-may); }
.al-key-no { background: var(--al-no); color: #fff; }
.al-key-ask { border: 1.5px dashed var(--al-ask); color: var(--al-ask); }
.al-note { margin: 0; font-size: 15px; line-height: 1.6; }

@media (max-width: 640px) {
  .al-bar-in { padding-block: 10px 12px; }
  .al-pick { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
  .al-pick-label { padding-top: 0; }
  .al-chips { grid-column: 1 / -1; grid-row: 2; }
  .al-clear { grid-column: 2; grid-row: 1; }
  .al-chip { min-height: 38px; padding: 0 12px; font-size: 13.5px; flex: none; }
  /* Keep the sticky bar to one row of chips on phones: they scroll sideways */
  .al-chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: -24px; padding-inline: 24px; scrollbar-width: none; }
  .al-chips::-webkit-scrollbar { display: none; }
  .al-tools { width: 100%; }
  .al-search { flex: 1 1 100%; }
  .al-search input { width: 100%; }
  /* The table needs room: phones get the list */
  .is-ready .al-views { display: none; }
  .al[data-view] .al-as-list { display: block; }
  .al[data-view] .al-as-grid { display: none; }
}

/* ---------- Print: every menu as a table on paper ---------- */
@media print {
  @page { size: letter landscape; margin: 0.4in; }
  body { background: #fff; }
  .site-header, .site-footer, .preview-bar, .announce, .al-bar, .al-row, .al-summary, .al-head, .cookie-notice, .al-print, .al-head .lead-dark, .al-none { display: none !important; }
  .al-head { padding-block: 0 10px; }
  .al-head h1 { font-size: 22pt; }
  .al-menu[hidden] { display: block !important; }
  .al-as-list { display: none !important; }
  .al-as-grid { display: block !important; }
  .al-print-title { display: block; max-width: none; margin: 0 0 6px; font-size: 15pt; }
  .al-menu + .al-menu { break-before: page; }
  .al-grid-wrap { overflow: visible; border: 0; }
  .al-grid { font-size: 8.5pt; }
  .al-dish { position: static; min-width: 0; padding: 2px 8px; }
  .al-grid thead th { position: static; }
  .al-grid td { padding: 2px 0; }
  .al-grid-sec th { padding: 6px 8px 2px; font-size: 11pt; }
  .al-col { padding: 4px 0; }
  .al-dot { width: 8px; height: 8px; }
  .al-grid tr { break-inside: avoid; }
  .al-grid .is-picked, .al-grid thead .is-picked { background: none; color: inherit; }
  .al-mark { display: none; }
  .al-body { padding: 0; }
  .al-foot { margin-top: 12px; padding-top: 8px; font-size: 8.5pt; max-width: none; }
  .al-legend li:first-child, .al-key { display: none; }
  .al-dot, .al-dot-may { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
