/* Beermap Zürich: a Swiss shelf label on a printed menu.
   One memorable thing, the price tag (punched hole, hard print shadow, stamped on when it changes);
   everything around it stays plain: ink rules instead of boxed cards, one display face for names.
   Mobile first: phone styles are the default, the desktop two-column layout starts at 900px.

   Sections: tokens and base · top bar and question · item picker · filters and search · answer and chart ·
   list · map, preview and view toggle · place sheet · breakpoints · reduced motion */

/* ---- Tokens and base --------------------------------------------------------------------------- */

:root {
  --paper: #ffffff;
  --ink: #14213d;          /* deep navy ink */
  --blue: #0b5cad;         /* Zurich tram blue: everything you can act on */
  --sticker: #ffd23f;      /* price-sticker yellow: means "among the cheapest fifth", nothing else */
  --muted: #4b5468;
  --line: #d8dde5;
  --wash: #f3f5f8;
  --wash-strong: #e9edf3;
  --leader: #9aa3b2;
  --open: #1d6b3a;         /* 5.9:1 on white; always paired with the words "Open until" */

  --display: "Bricolage Grotesque", "Archivo", system-ui, sans-serif;
  --wide: 112%;
  --condensed: 68%;
  --print: 3px 3px 0 var(--ink);          /* the one shadow: offset print, never blurred */
  --print-small: 2px 2px 0 var(--ink);

  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --panel: 440px;          /* desktop list column */

  /* layers: map 0, sticky question 10, map overlays 15, view toggle 20, sheet 40, tooltip 50 */
  --z-sticky: 10; --z-overlay: 15; --z-toggle: 20; --z-sheet: 40; --z-tip: 50;

  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
html.locked, html.locked body { overflow: hidden; }   /* while the place sheet or the phone map is open */

button, select, input { font: inherit; color: inherit; }
button { touch-action: manipulation; }
a { color: var(--blue); text-underline-offset: 3px; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

/* names and headings use the display face */
.question, .wordmark, .sheet-bar-name, .place-name, .row-name, .elsewhere-name, .preview-name, .answer-where,
.hero-item, .group-head h4, .picker-heading h2, .picker-option strong {
  font-family: var(--display); font-stretch: 100%; font-optical-sizing: auto;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: var(--z-tip);
  padding: 10px 14px; border-radius: 8px;
  background: var(--ink); color: var(--paper); font-weight: 650; text-decoration: none;
}
.skip-link:focus { top: 8px; }

.icon { width: 20px; height: 20px; fill: currentColor; flex: none; }

.link-button {
  display: inline-flex; align-items: center; min-height: 44px;
  border: 0; background: none; padding: 8px 0;
  color: var(--blue); font-weight: 600; font-size: 15px; white-space: nowrap;
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.icon-button {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; flex: none;
  border: 0; border-radius: 999px; background: none; color: var(--ink);
  cursor: pointer;
}
.icon-button .icon { width: 22px; height: 22px; }
.empty { color: var(--muted); margin: 0; padding: 12px 0; }
.empty .link-button { margin-right: 14px; }
.empty-actions { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; }
.is-open { color: var(--open); }

/* ---- Top bar and question ----------------------------------------------------------------------- */

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px var(--gutter) 0;
  min-height: 52px;
}
/* wordmark: a little tag with a punched hole */
.wordmark { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 800; letter-spacing: -0.03em; }
.mark {
  position: relative; width: 22px; height: 16px; border-radius: 3px 6px 6px 3px;
  background: var(--sticker); border: 1.5px solid var(--ink); box-shadow: var(--print-small); transform: rotate(-6deg);
}
.mark::after {
  content: ""; position: absolute; left: 3px; top: 4px; width: 4px; height: 4px; border-radius: 50%;
  background: var(--paper); border: 1.5px solid var(--ink);
}
.city { margin-left: 4px; font-family: "Archivo", system-ui, sans-serif; font-weight: 450; color: var(--muted); }

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.bar-button {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 14px;
  border: 2px solid var(--ink); border-radius: 999px;
  background: var(--paper); color: var(--blue); box-shadow: var(--print-small);
  font-size: 15px; font-weight: 650;
  cursor: pointer;
}
.bar-button[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: var(--paper); }
.bar-button:active { transform: translate(2px, 2px); box-shadow: none; }
.bar-button.icon-only { width: 44px; padding: 0; justify-content: center; }
.bar-button.icon-only .icon { width: 22px; height: 22px; }
.bar-button.icon-only[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.question-bar {
  position: sticky; top: 0; z-index: var(--z-sticky);
  padding: 8px var(--gutter) 14px;
  background: var(--paper);
  transition: padding 150ms;
}
.question {
  margin: 0;
  font-size: 26px; line-height: 1.1;
  font-weight: 750; letter-spacing: -0.03em;
  text-wrap: balance;
}

/* The headline opens a compact chooser instead of a long native select; the item gets a highlighter stripe. */
.picker { position: relative; display: inline-block; max-width: 100%; }
.picker > button {
  border: 0; border-radius: 0;
  background: linear-gradient(transparent 62%, var(--sticker) 62% 94%, transparent 94%); color: var(--ink);
  font-weight: 800; font-stretch: var(--wide); letter-spacing: -0.015em;
  max-width: 100%; padding: 2px 26px 2px 0; text-align: left;
  cursor: pointer;
}
.picker::after {        /* caret */
  content: ""; position: absolute; right: 4px; top: 50%;
  width: 8px; height: 8px;
  border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

/* ---- Item picker ---------------------------------------------------------------------------------- */

html.picker-open, html.picker-open body { overflow: hidden; }
.item-picker {
  width: min(560px, calc(100% - 32px)); max-width: none;
  max-height: min(760px, calc(100dvh - 48px)); padding: 0;
  border: 2px solid var(--ink); border-radius: 20px;
  color: var(--ink); background: var(--paper);
  box-shadow: 6px 6px 0 var(--ink);
}
.item-picker[open] { display: flex; flex-direction: column; }
.item-picker::backdrop { background: #14213d70; backdrop-filter: blur(3px); }
.picker-header { flex: none; padding: 20px 20px 12px; border-bottom: 1px solid var(--line); }
.picker-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.picker-heading h2 { margin: 0; font-size: 22px; letter-spacing: -.025em; }
.picker-heading h2:focus { outline: none; }
.picker-close {
  flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: var(--wash); color: var(--muted); font-size: 28px; line-height: 1; cursor: pointer;
}
#picker-search {
  display: block; width: 100%; min-height: 48px; padding: 10px 14px;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper); font-size: 16px;
}
#picker-search::placeholder { color: var(--muted); }
.picker-groups { display: flex; gap: 4px; margin-top: 14px; padding: 4px; border-radius: 12px; background: var(--wash); }
.picker-groups button {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px; border: 0; border-radius: 9px; background: transparent;
  color: var(--muted); font-weight: 700; cursor: pointer;
}
.picker-groups button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.picker-groups span { font-size: 12px; font-weight: 500; opacity: .8; }
.picker-options { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 20px; }
.picker-options h3 { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.picker-options section + section { margin-top: 18px; }
.picker-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.picker-option {
  display: flex; align-items: center; gap: 10px; min-height: 76px; padding: 12px;
  border: 2px solid var(--line); border-radius: 12px; background: var(--paper);
  text-align: left; cursor: pointer;
}
.picker-option > .icon { width: 24px; height: 24px; color: var(--muted); }
.picker-option-copy { flex: 1; min-width: 0; }
.picker-option strong { display: block; font-size: 15px; line-height: 1.25; font-weight: 650; }
.picker-option small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.picker-option[aria-pressed="true"] { border-color: var(--ink); background: var(--sticker); box-shadow: var(--print-small); }
.picker-option[aria-pressed="true"] > .icon, .picker-option[aria-pressed="true"] strong,
.picker-option[aria-pressed="true"] .picker-selected { color: var(--ink); }
.picker-selected { display: block; color: var(--blue); font-size: 11px; font-weight: 650; margin-top: 3px; }
.picker-footnote { flex: none; margin: 0; padding: 12px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

/* ---- Filters and search ----------------------------------------------------------------------------- */

.controls { display: grid; gap: 8px; padding: 4px var(--gutter) 12px; border-bottom: 2px solid var(--ink); }

.search-row { padding: 2px 0 6px; }
#search {
  width: 100%; min-height: 44px; padding: 0 18px;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--paper); box-shadow: var(--print-small);
  font-size: 16px;
}
#search::placeholder { color: var(--muted); }

/* filters stay on one row you can swipe, instead of wrapping into three */
.chip-row {
  display: flex; flex-wrap: nowrap; align-items: center; gap: 8px;
  overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter);
  margin: 0 calc(var(--gutter) * -1); padding: 4px var(--gutter) 8px;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip-row > * { flex: none; scroll-snap-align: start; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 14px;
  border: 2px solid var(--ink); border-radius: 999px;
  background: var(--paper);
  font-size: 15px; font-weight: 600; white-space: nowrap;
  cursor: pointer;
}
.chip .icon { width: 18px; height: 18px; }
.chip[aria-pressed="true"], .chip-select.is-set {
  background: var(--ink); border-color: var(--ink); color: var(--paper); box-shadow: 2px 2px 0 var(--sticker);
}
.chip:active { transform: scale(0.98); }
.chip:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.chip-clear { border-style: dashed; color: var(--blue); }
.chip-clear .icon { width: 16px; height: 16px; }

/* A dropdown dressed as a chip: one chip instead of a row of five, native picker on phones. */
.chip-select { position: relative; padding: 0; }
.chip-select select {
  appearance: none; border: 0; background: transparent; color: inherit;
  min-height: 40px; padding: 0 32px 0 14px;      /* + the chip's 2 px border = 44, like the other chips */
  font-weight: 600; font-size: 15px; cursor: pointer;
}
.chip-select select:focus-visible { outline: none; }
.chip-select:has(select:focus-visible) { outline: 3px solid var(--blue); outline-offset: 3px; border-color: var(--ink); }
.chip-select select option { color: var(--ink); }
.chip-select::after {
  content: ""; position: absolute; right: 13px; top: 50%;
  width: 6px; height: 6px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}

.status { margin: 0; font-size: 14px; color: var(--muted); }
.status:empty { display: none; }

/* ---- Answer and price chart ----------------------------------------------------------------------- */

.summary { padding: 16px var(--gutter) 4px; }

.answer { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; }
.answer:empty { display: none; }
.answer-where { font-size: 18px; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; align-self: end; text-wrap: balance; }
.answer-what { color: var(--muted); font-size: 15px; align-self: start; }
.answer-scope { grid-column: 1 / -1; margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.answer-where button { all: unset; cursor: pointer; color: var(--ink); border-bottom: 2px solid var(--line); }
.answer-where button:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* the price tag */
.sticker {
  grid-row: span 2;
  position: relative; display: inline-block;
  padding: 4px 12px 2px 26px; border: 2px solid var(--ink); border-radius: 6px 14px 14px 6px;
  background: var(--sticker); box-shadow: var(--print);
  transform: rotate(-2.5deg); transform-origin: 20% 60%;
  font-size: 58px; line-height: 1;
  font-weight: 800; font-stretch: var(--condensed); letter-spacing: -0.02em;
}
.sticker::before {     /* the punched hole */
  content: ""; position: absolute; left: 8px; top: 50%; width: 8px; height: 8px; margin-top: -4px;
  border-radius: 50%; background: var(--paper); border: 2px solid var(--ink);
}
.sticker.is-selected { background: var(--ink); color: var(--paper); box-shadow: 3px 3px 0 var(--sticker); }
.sticker.is-selected::before { border-color: var(--paper); background: var(--ink); box-shadow: 0 0 0 2px var(--paper) inset; }
@keyframes stamp {
  0% { transform: rotate(-9deg) scale(1.28); opacity: 0; } 55% { opacity: 1; }
  100% { transform: rotate(-2.5deg) scale(1); }
}
.answer .sticker, .place-hero .sticker { animation: stamp 320ms cubic-bezier(.2, .9, .3, 1.2) both; }

.dist { position: relative; margin: 18px 0 0; padding-top: 4px; }
.dist:empty { display: none; }
.dist svg { display: block; width: 100%; height: auto; overflow: visible; }
.dist text { font-family: var(--display); font-size: 11.5px; font-weight: 600; fill: var(--ink); font-variant-numeric: tabular-nums; }
.dist .marker-label { font-weight: 800; }
/* caption and chart toggle share a line */
.dist figcaption {
  display: flex; align-items: baseline; justify-content: space-between; gap: 4px 12px;
  margin-top: 4px; font-size: 14px; color: var(--muted);
}
.dist figcaption > span { flex: 1; min-width: 0; }
.dist-toggle {
  display: none; flex: none; margin: 0; padding: 0; min-height: 44px; border: 0; background: none;
  color: var(--blue); font-weight: 650; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.dist-tip {
  position: absolute; z-index: var(--z-tip);
  transform: translate(-50%, calc(-100% - 6px));
  padding: 4px 8px; border-radius: 6px;
  background: var(--ink); color: var(--paper);
  font-size: 13px; white-space: nowrap; pointer-events: none;
}

/* ---- List: a menu card, cheapest first --------------------------------------------------------- */

.list { padding: 12px var(--gutter) calc(96px + var(--safe-bottom)); }   /* room for the view toggle */
.list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.list-title { margin: 0; font-size: 15px; font-weight: 600; color: var(--muted); }

.results { list-style: none; margin: 6px 0 0; padding: 0; }
.results > li + li { border-top: 1px solid var(--line); }
.row {
  display: grid; grid-template-columns: minmax(0, auto) 1fr auto; column-gap: 8px; align-items: start;
  width: calc(100% + 16px); margin: 0 -8px;
  min-height: 56px; padding: 10px 8px;
  border: 0; border-radius: 10px;
  background: none; text-align: left;
  cursor: pointer;
}
.results > li > .row { padding-top: 14px; padding-bottom: 14px; border-radius: 0; }
.results > li:first-child > .row { border-radius: 10px 10px 0 0; }
.row:active { transform: scale(0.98); }
.row[aria-current="true"], .row.is-hover { background: var(--wash); box-shadow: inset 3px 0 0 var(--blue); }
.row-name { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the dotted leader sits on the name's baseline, even when the price column is taller */
.leader { align-self: start; min-width: 16px; margin-top: 18px; border-bottom: 2px dotted var(--leader); }
.row-sub {
  grid-column: 1 / -1; align-self: start; display: flex; flex-wrap: wrap; gap: 2px 12px;
  margin-top: 2px; font-size: 14px; color: var(--muted);
}
.row-sub .what { flex: 1 1 100%; order: 2; color: var(--ink); }
.row-sub .context-tag { flex: none; order: 1; align-self: center; margin: 0 2px 0 0; }
.row-sub > span:not(.what):not(.context-tag) { order: 3; }
/* closed places recede; open ones get a green dot */
.row-sub .is-open::before, .row-sub .is-shut::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%;
  background: currentColor; vertical-align: 1px;
}
.row.is-closed .row-name, .row.is-closed .row-sub, .row.is-closed .delta { opacity: .62; }
.row.is-closed .price-col .price { opacity: .8; }

/* prices: every row has the same box, right-aligned, with the gap to the cheapest under it */
.price {
  font-size: 19px; font-weight: 750; font-stretch: var(--condensed);
  font-variant-numeric: tabular-nums; line-height: 1.2;
  padding: 0 5px; border-radius: 3px 6px 6px 3px;
}
.price.tier-0 { background: var(--sticker); border: 1.5px solid var(--ink); padding: 0 6px; }
.price-col { display: flex; flex-direction: column; align-items: flex-end; align-self: start; }
.row .price { min-width: 64px; text-align: right; border: 1.5px solid transparent; }
.row .price.tier-0 { border-color: var(--ink); }
.delta { margin: 1px 7px 0 0; font-size: 12.5px; line-height: 1.2; color: var(--muted); font-variant-numeric: tabular-nums; }

/* A chain: one row, its other branches open up underneath. */
.chain { position: relative; }
.branches-toggle {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px;
  margin: -8px 0 10px; padding: 6px 10px 6px 0; border: 0; background: none;
  color: var(--blue); font-size: 14px; font-weight: 650; cursor: pointer;
}
.branches-toggle .icon { width: 14px; height: 14px; transition: transform 150ms; }
.branches-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.branches { list-style: none; margin: 0 0 6px 10px; padding: 0 0 0 10px; border-left: 2px solid var(--line); }
.branches > li + li { border-top: 1px dotted var(--line); }
.row.branch { min-height: 44px; padding-top: 7px; padding-bottom: 7px; }
.row.branch .row-name { font-weight: 550; }

.small-note { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.small-note .link-button { padding: 0; font-size: 14px; }
.more-button {
  display: block; width: 100%; min-height: 48px; margin-top: 12px;
  border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); box-shadow: var(--print-small);
  font-weight: 650; cursor: pointer;
}
.colophon { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.colophon p { margin: 0 0 6px; max-width: 62ch; }

/* ---- Map, preview card, view toggle (phone) --------------------------------------------------------- */

.map-wrap { display: none; position: relative; }
#map { position: absolute; inset: 0; }

.app[data-view="map"] { display: flex; flex-direction: column; height: 100dvh; }
.app[data-view="map"] .content { display: none; }
.app[data-view="map"] .map-wrap { display: block; flex: 1; }
.app[data-view="map"] .question-bar { position: static; }

.view-toggle {
  position: fixed; left: 50%; bottom: calc(16px + var(--safe-bottom)); z-index: var(--z-toggle);
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border: 0; border-radius: 12px;
  background: var(--ink); color: var(--paper); box-shadow: 3px 3px 0 var(--sticker);
  font-weight: 700; font-size: 16px;
  cursor: pointer;
}
.view-toggle:active { transform: translateX(-50%) scale(0.97); }

.preview {
  position: absolute; left: 12px; right: 12px; bottom: calc(76px + var(--safe-bottom)); z-index: var(--z-overlay);
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center;
  padding: 12px; border: 2px solid var(--ink); border-radius: 14px;
  background: var(--paper); box-shadow: var(--print);
}
.preview .price { grid-row: span 2; font-size: 26px; padding: 2px 8px; border: 1.5px solid var(--ink); }
.preview .price.tier-0 { border-color: var(--sticker); }
.preview-name { font-weight: 700; line-height: 1.2; }
.preview-sub { grid-column: 2; font-size: 14px; color: var(--muted); }
.preview-open {
  grid-column: 1 / -1; min-height: 44px; margin-top: 6px; border: 0; border-radius: 10px;
  background: var(--blue); color: var(--paper); font-weight: 700; cursor: pointer;
}

.here-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--blue); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--blue); }
.maplibregl-ctrl-attrib { font-family: "Archivo", sans-serif; font-size: 11px; }

/* ---- Place sheet ---------------------------------------------------------------------------------- */

.sheet {
  position: fixed; inset: 0; z-index: var(--z-sheet);
  display: flex; flex-direction: column;
  background: var(--paper);
  animation: sheet-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
.sheet-bar {
  display: flex; align-items: center; gap: 4px;
  min-height: 56px; padding: 6px 6px 6px 4px;
  border-bottom: 1px solid var(--line);
}
.back-button {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  min-height: 44px; padding: 0 12px 0 10px;
  border: 0; border-radius: 999px; background: none;
  color: var(--blue); font-weight: 650; font-size: 15px; cursor: pointer;
}
.back-button .icon { width: 20px; height: 20px; }
/* The place's name moves up here once its header has scrolled away. */
.sheet-bar-name {
  flex: 1; min-width: 0; text-align: center;
  font-weight: 750;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  opacity: 0; transition: opacity 150ms;
}
.sheet.name-in-bar .sheet-bar-name { opacity: 1; }
.sheet-bar #sheet-share { margin-left: auto; }
.sheet-body {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 18px var(--gutter) calc(32px + var(--safe-bottom));
}

/* Whose sheet this is, before any price: name, kind of place, website, address with directions. */
.place-head { padding-bottom: 12px; margin-bottom: 14px; border-bottom: 2px solid var(--ink); }
.place-name { margin: 0; font-size: 32px; line-height: 1.02; font-weight: 800; letter-spacing: -0.035em; overflow-wrap: anywhere; }
.place-name:focus { outline: none; }
.place-meta { margin: 6px 0 0; font-size: 15px; color: var(--muted); }
.place-meta .text-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 12px 4px; margin: -12px 0 -12px 6px;      /* a 44 px target in a line of text */
  font-weight: 600; font-size: 14px;
}
.place-meta .text-link .icon { width: 14px; height: 14px; }
.place-address {
  display: flex; align-items: center; gap: 6px; min-height: 36px; margin: 2px 0 0;
  font-size: 15px; color: var(--ink); text-decoration: none;
}
.place-address .icon { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--muted); }
.place-address > span:first-of-type { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.place-address .go {
  display: inline-flex; align-items: center; gap: 4px; margin-left: auto; padding-left: 10px;
  color: var(--blue); font-weight: 650; font-size: 14px; white-space: nowrap;
}
.place-address .go .icon { width: 15px; height: 15px; margin: 0; color: var(--blue); }

.place-hero { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-items: center; }
.hero-item { font-size: 18px; font-weight: 700; line-height: 1.2; align-self: end; }
.hero-item:last-child { grid-row: span 2; align-self: center; }   /* nothing to say under it */
.hero-what { color: var(--muted); font-size: 15px; align-self: start; }

/* the "cheapest" line is a badge */
.compare.is-best {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 12px 0 0; padding: 6px 14px 6px 10px;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--sticker); color: var(--ink);
  font-size: 15px; font-weight: 700;
}
.compare.is-best .icon { width: 18px; height: 18px; color: var(--ink); }

/* A cheaper place elsewhere: a separate card, set off from this place's price. */
.elsewhere {
  display: grid; grid-template-columns: auto 1fr auto; gap: 2px 10px; align-items: center;
  width: 100%; margin-top: 16px; padding: 10px 12px;
  border: 2px solid var(--ink); border-radius: 12px; background: var(--paper); box-shadow: var(--print);
  color: var(--ink); text-align: left; cursor: pointer;
}
.elsewhere-label { grid-column: 1 / -1; font-size: 13px; font-weight: 650; color: var(--muted); }
.elsewhere .price { grid-row: span 2; font-size: 22px; }
.elsewhere-name { font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.elsewhere-sub { grid-column: 2; font-size: 14px; color: var(--muted); }
.elsewhere > .icon { grid-column: 3; grid-row: 2 / span 2; width: 20px; height: 20px; color: var(--blue); }

.sheet-body .dist { margin-top: 10px; }
.facts { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.fact { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; }
.fact .icon { margin-top: 1px; color: var(--muted); }

/* the menu: ruled sections, one per item, rather than a stack of identical boxes */
.menu-group { margin-top: 16px; padding: 12px 0 6px; border-top: 2px solid var(--ink); }
.menu-group.is-current { border-top-width: 5px; }
.group-head { display: flex; align-items: center; gap: 8px; }
.group-head h4 { flex: 1; display: flex; align-items: center; gap: 8px; margin: 0; font-size: 18px; font-weight: 750; letter-spacing: -0.02em; }
.menu-group.is-current .group-head h4 { font-size: 20px; }
.group-head .icon { width: 22px; height: 22px; }
.group-note { margin: 0 0 2px 30px; font-size: 13px; color: var(--muted); }
.cheap-badge {
  padding: 0 7px; border: 1.5px solid var(--ink); border-radius: 3px 6px 6px 3px; background: var(--sticker);
  font-size: 12px; font-weight: 700; white-space: nowrap;
}

/* menu rows: a hairline between dishes; names may take three lines */
.menu { list-style: none; margin: 6px 0 0; padding: 0; }
.menu li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 14px; padding: 9px 0; }
.menu li + li { border-top: 1px solid var(--line); }
.menu .what {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  font-weight: 550; overflow-wrap: anywhere; text-wrap: pretty;
}
.menu .price { align-self: start; }
.menu .note { grid-column: 1 / -1; font-size: 14px; color: var(--muted); }
.context-tag {
  display: inline-block; margin-right: 6px; padding: 0 6px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--wash); color: var(--ink); font-size: 12px; font-weight: 650;
}
.group-more {
  display: block; min-height: 44px; margin: 6px 0 4px; padding: 8px 0; border: 0; background: none;
  color: var(--blue); font-weight: 650; font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
/* "where this place stands" under the other items, and the way to the citywide ranking */
.compare-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px;
  margin: 6px 0 2px; padding: 10px 12px; border: 0; border-radius: 8px; background: var(--wash);
  font-size: 14px; color: var(--ink); text-align: left; cursor: pointer;
}
.compare-row .go { display: inline-flex; align-items: center; gap: 2px; flex: none; color: var(--blue); font-weight: 650; }
.compare-row .go .icon { width: 14px; height: 14px; }

.sources { margin: 24px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 15px; }
.sources a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-weight: 600; }
.sources .icon { flex: none; width: 16px; height: 16px; }
.more-sources { margin-top: 4px; font-size: 14px; color: var(--muted); }
.more-sources summary, .hours summary {
  min-height: 36px; display: flex; align-items: center; cursor: pointer; color: var(--blue); font-weight: 600;
}
.more-sources .sources { margin: 0 0 0 14px; font-size: 14px; }
.caveat { margin: 12px 0 0; font-size: 14px; color: var(--muted); max-width: 60ch; }
.hours { margin-top: 12px; font-size: 14px; color: var(--muted); }

/* ---- Hover (pointer devices only) --------------------------------------------------------------- */

@media (hover: hover) {
  .row:hover, .icon-button:hover, .back-button:hover { background: var(--wash); }
  .picker-option:hover { border-color: var(--blue); background: var(--wash); }
  .picker-close:hover { background: var(--line); }
  .elsewhere:hover { border-color: var(--blue); }
  .compare-row:hover { background: var(--wash-strong); }
  .place-address:hover > span:first-of-type { text-decoration-color: var(--blue); }
}

/* ---- Breakpoints ------------------------------------------------------------------------------------ */

@media (max-width: 359px) { .picker-grid { grid-template-columns: 1fr; } }

@media (max-width: 599px) {   /* the item picker becomes a bottom sheet */
  .item-picker { width: 100%; margin: auto 0 0; max-height: calc(100dvh - 24px); border-radius: 20px 20px 0 0; }
  .picker-header { padding: 14px 16px 12px; }
  .picker-options { padding: 14px 16px; }
  .picker-footnote { padding: 12px 16px calc(12px + var(--safe-bottom)); }
  .picker-option { gap: 8px; padding: 10px; }
}

@media (min-width: 480px) {
  .sticker { font-size: 72px; }
}

/* Phones */
@media (max-width: 899px) {
  /* once the list scrolls or the map is up, the question shrinks to "Cheapest Beer ▾" */
  html.compact .question-bar, .app[data-view="map"] .question-bar { padding-top: 6px; padding-bottom: 6px; }
  html.compact .question, .app[data-view="map"] .question { font-size: 19px; }
  html.compact .q-long, .app[data-view="map"] .q-long { display: none; }
  html.compact .q-cheapest, .app[data-view="map"] .q-cheapest { text-transform: capitalize; }
  html.compact .question-bar { box-shadow: 0 1px 0 var(--line); }

  /* map view: question and "Near me" share one row, filters below, and the map gets the rest */
  html .app[data-view="map"] {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto 1fr;
    grid-template-areas: "question top" "controls controls" "map map";
  }
  .app[data-view="map"] .topbar { grid-area: top; min-height: 0; padding: 6px var(--gutter) 0 0; }
  .app[data-view="map"] .wordmark { display: none; }
  .app[data-view="map"] .question-bar { grid-area: question; align-self: center; }
  .app[data-view="map"] .controls { grid-area: controls; padding-bottom: 8px; }
  .app[data-view="map"] .map-wrap { grid-area: map; }

  /* the price chart is folded until asked for; its colour key only shows with it */
  .dist-toggle { display: block; }
  .dist.collapsed { margin-top: 10px; }
  .dist.collapsed svg, .dist.collapsed .chart-key { display: none; }
}

/* Desktop: list column left, map pinned right; the sheet replaces the list column */
@media (min-width: 900px) {
  .app {
    display: grid;
    grid-template-columns: var(--panel) 1fr;
    grid-template-rows: auto auto auto 1fr;
    grid-template-areas: "top map" "question map" "controls map" "content map";
    min-height: 100dvh;
  }
  .app[data-view="map"] { display: grid; height: auto; }
  .app[data-view="map"] .content { display: block; }
  .app[data-view="map"] .question-bar { position: sticky; }
  .topbar { grid-area: top; padding: 16px 28px 6px; }   /* room below for the buttons' offset shadow */
  /* "Near me" is the main action in the sidebar: filled and larger until it is switched on */
  #locate { min-height: 48px; padding: 0 20px; font-size: 16px; background: var(--blue); border-color: var(--blue); color: var(--paper); }
  #locate .icon { width: 20px; height: 20px; }
  #locate[aria-pressed="true"] { background: var(--paper); color: var(--blue); border-color: var(--blue); }
  .question-bar { grid-area: question; padding: 10px 28px 14px; }
  .controls { grid-area: controls; padding: 4px 28px 14px; }
  .chip-row { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
  .search-row { padding-top: 0; }
  .content { grid-area: content; }
  .summary { padding: 18px 28px 4px; }
  .list { padding: 12px 28px 28px; }
  .map-wrap, .app[data-view="map"] .map-wrap {
    display: block; grid-area: map; grid-row: 1 / -1;
    position: sticky; top: 0; align-self: start; height: 100dvh;
    border-left: 1px solid var(--line);
  }
  .view-toggle, .preview { display: none !important; }
  .sheet { right: auto; width: var(--panel); border-right: 1px solid var(--line); }
  .sheet-body { padding: 20px 28px 32px; }
  .sticker { font-size: 76px; }
}

/* ---- Reduced motion ----------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .sheet, .answer .sticker, .place-hero .sticker { animation: none; }
  .chip:active, .bar-button:active, .row:active { transform: none; }
  .view-toggle:active { transform: translateX(-50%); }
  .question-bar, .sheet-bar-name, .branches-toggle .icon { transition: none; }
}

/* ---- About page ------------------------------------------------------------------------------------ */

.about { max-width: 680px; margin: 0 auto; padding: 16px var(--gutter) 56px; }
.about .back-button { margin: 0 0 18px -10px; text-decoration: none; }
.about .place-name { margin-bottom: 14px; }
.about-lead { font-size: 18px; line-height: 1.5; }
.about h2 { margin: 32px 0 8px; padding-top: 12px; border-top: 2px solid var(--ink); font-family: var(--display); font-size: 20px; letter-spacing: -0.02em; }
.about p, .about li { max-width: 62ch; line-height: 1.55; }
.about ul { padding-left: 20px; }
.about li + li { margin-top: 6px; }

/* ---- Pages for search engines: cheapest/, de/, places/ (written by beermap/pages.py) ---------------- */

.page-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 680px; min-height: 60px; margin: 0 auto; padding: 8px var(--gutter) 0;
}
.page-top .wordmark { color: var(--ink); text-decoration: none; }
a.bar-button { text-decoration: none; }
.page { padding-top: 18px; padding-bottom: 24px; }
.page-hero { margin: 6px 0 20px; }
.page-hero .sticker { font-size: 46px; }
.page-hero .hero-item a { color: var(--ink); text-decoration-color: var(--line); }

.about .price-list { margin: 0; padding: 0; list-style: none; }
.about .price-list li { display: grid; grid-template-columns: 2em 1fr auto; gap: 0 10px; align-items: baseline;
  max-width: none; margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.about ul.price-list li { grid-template-columns: 1fr auto; }
.price-rank { color: var(--muted); font-weight: 650; font-variant-numeric: tabular-nums; }
.price-place { display: flex; flex-direction: column; min-width: 0; }
.price-place > a { font-family: var(--display); font-size: 17px; font-weight: 750; color: var(--ink); text-decoration-color: var(--line); }
.price-where, .price-what { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.price-tag {
  padding: 1px 8px 0; border: 1.5px solid transparent; border-radius: 4px 9px 9px 4px;
  font-family: var(--display); font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.price-tag.is-cheap { background: var(--sticker); border-color: var(--ink); box-shadow: var(--print-small); }
.about h2 + .price-where { display: block; margin-top: -4px; }
.about .menu-list li { padding: 7px 0; }
.menu-list .price-what { font-size: 15px; color: var(--ink); }
.menu-list .price-tag { font-size: 17px; }

.item-links, .about .item-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.about .item-links li + li { margin-top: 0; }
.item-links a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 13px;
  border: 1.5px solid var(--line); border-radius: 999px;
  color: var(--ink); font-size: 15px; font-weight: 600; text-decoration: none;
}
.item-links a:hover { border-color: var(--ink); }
.item-links a[aria-current="page"] { border-color: var(--ink); background: var(--wash-strong); }
.about .place-index { columns: 2 220px; column-gap: 24px; padding: 0; list-style: none; }
.about .place-index li { margin: 0; padding: 4px 0; break-inside: avoid; }
.place-index .price-where { display: block; }
.page-foot { padding-top: 0; font-size: 14px; color: var(--muted); }
.page-foot p { padding-top: 14px; border-top: 1px solid var(--line); }

/* the map page: links to those pages under the list */
.page-links { margin-top: 22px; font-size: 14px; color: var(--muted); }
.page-links h2 { margin: 0; font-family: var(--display); font-size: 16px; color: var(--ink); }
.page-links .item-links a { min-height: 36px; font-size: 14px; }
.page-links p { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 12px 0 0; }
