/* pivas (beer-feeder beta). Plain on purpose: one system typeface, black on white, hairline rules,
   no rounded corners, no shadows, no badges. Color only where it means something
   (cheaper, open/closed), the chart, and two accents: magenta (actions, selection) and an
   acid highlighter (savings, the wordmark). Light by default, whatever the OS theme;
   dark only via the header switch (user preference, 2026-10-22). */

:root {
  --bg: #fff;
  --ink: #111;
  --muted: #6b6b6b;
  --line: #e1e1e1;
  --hover: #f5f5f5;
  --good: #0b7a35;
  --bad: #b3261e;
  --accent: #d4007a; /* magenta: 5:1 on white, white text on it 5:1 */
  --on-accent: #fff;
  --acid: #d4ff2a; /* highlighter: always with --on-acid text */
  --on-acid: #111;
  --font: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  /* chart series: the reference categorical palette (validated, fixed order) */
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --s4: #eda100;
  --s5: #e87ba4;
  --s6: #008300;
  --s7: #6250d6;
  --s8: #e34948;
  --s-other: #a3a3a3;
  color-scheme: light;
}

/* dark: the header switch sets data-theme="dark" on <html> (remembered per browser) */
:root[data-theme='dark'] {
  --bg: #111;
  --ink: #ececec;
  --muted: #9a9a9a;
  --line: #2b2b2b;
  --hover: #1b1b1b;
  --good: #4cc27a;
  --bad: #ff7b6e;
  --accent: #ff4fb0;
  --on-accent: #111;
  --s1: #3987e5;
  --s2: #d95926;
  --s3: #199e70;
  --s4: #c98500;
  --s5: #d55181;
  --s6: #008300;
  --s7: #9085e9;
  --s8: #e66767;
  --s-other: #5c5c5c;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
/* site.js hides cards/panels with the hidden attribute; component display rules mustn't win */
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 var(--font);
}
a {
  color: inherit;
}
a:hover {
  color: var(--accent);
}
mark {
  color: var(--on-acid);
  background: var(--acid);
  padding: 0 3px;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
h1 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 6px;
}
h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 36px 0 0;
  padding-top: 8px;
  border-top: 2px solid var(--ink);
}
h1 .muted,
h2 .muted {
  font-weight: 400;
}
p {
  margin: 4px 0;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}
.num {
  font-variant-numeric: tabular-nums;
}
.is-open {
  color: var(--good);
}
.is-shut {
  color: var(--bad);
}
.error {
  color: var(--bad);
}

/* --- chrome ----------------------------------------------------------------------- */

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.brand .beta {
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
}
.top .search {
  flex: 1;
  max-width: 420px;
  margin-left: auto;
}
.top .search input {
  padding: 6px 10px;
  font-size: 15px;
}
.top nav {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 15px;
}
.top nav a {
  text-decoration: none;
}
.top nav a:hover {
  text-decoration: underline;
}
.is-home .top .search {
  display: none;
}
.is-home .top nav {
  margin-left: auto;
}
a.lang {
  text-decoration: none;
}
.lang,
.theme {
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  background: none;
  border: 1px solid var(--ink);
  padding: 2px 6px;
  cursor: pointer;
}
main {
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}
main[aria-busy='true'] {
  opacity: 0.5;
  transition: opacity 0.2s 0.15s;
}
footer {
  max-width: 860px;
  margin: 0 auto;
  padding: 16px 16px 32px;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
@media (max-width: 560px) {
  .top {
    flex-wrap: wrap;
    gap: 8px 16px;
  }
  .top .search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }
  .top nav {
    margin-left: auto;
  }
}

/* --- search ----------------------------------------------------------------------- */

.search {
  display: flex;
}
.search input {
  flex: 1;
  min-width: 0;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 10px 12px;
  -webkit-appearance: none;
  appearance: none;
}
.search input::placeholder {
  color: var(--muted);
}
.search button {
  font: inherit;
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 0;
  padding: 0 18px;
  cursor: pointer;
}
.hero {
  padding: 16px 0 4px;
}
.hero .search {
  margin-top: 16px;
}
.search.big input {
  font-size: 18px;
  padding: 12px 14px;
}
.page-title {
  margin-top: 8px;
}
.page-title + .search {
  margin: 12px 0 8px;
}
.section-hint {
  margin: 2px 0 6px;
  font-size: 13px;
}

/* --- tabs / filters: text, underlined when selected -------------------------------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 10px 0 4px;
}
.chip {
  font: inherit;
  font-size: 15px;
  color: var(--muted);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 2px 0;
  cursor: pointer;
  text-decoration: none;
}
.chip:hover {
  color: var(--ink);
}
.chip[aria-selected='true'] {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

/* --- images ------------------------------------------------------------------------ */

.label,
.logo {
  flex: none;
  width: 40px;
  height: 40px;
  object-fit: cover;
}
.label.big,
.logo.big {
  width: 88px;
  height: 88px;
}

/* --- rows: deals, venues, search results, where-to-get, menu ------------------------- */

.deals,
.venue-list,
.beer-list,
.where,
.menu {
  display: flex;
  flex-direction: column;
}
.deal,
.venue-card,
.beer-row,
.where-row,
.menu-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.deal:hover,
.venue-card:hover,
.beer-row:hover,
.where-row:hover,
.menu-row:hover {
  background: var(--hover);
}
.deal-beer,
.venue-text,
.beer-text,
.where-venue {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.deal-venue {
  flex: 0 0 170px;
}
.deal-price,
.where-price {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  white-space: nowrap;
}
.deal-saving {
  flex: 0 0 56px;
  text-align: right;
  font-weight: 700;
}
.cheapest {
  font-weight: 600;
}
.count,
.beer-side {
  flex: none;
  font-size: 13px;
  color: var(--muted);
}
.venue-text .muted {
  font-size: 14px;
}
.venue-card.is-closed .venue-text b {
  color: var(--muted);
}
.menu-prices {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  white-space: nowrap;
}
.tap-no {
  flex: 0 0 20px;
  font-size: 13px;
  color: var(--muted);
  text-align: right;
}
.more {
  margin-top: 10px;
  font-size: 15px;
}
@media (max-width: 560px) {
  .deal {
    flex-wrap: wrap;
  }
  .deal-beer {
    flex-basis: calc(100% - 52px - 110px);
  }
  .deal-venue {
    order: 5;
    flex-basis: 100%;
    padding-left: 52px;
    margin-top: -6px;
  }
  .deal-saving {
    display: none;
  }
}

/* --- beer & venue headers --------------------------------------------------------- */

.beer-head,
.venue-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 8px 0 0;
}
.links {
  font-size: 15px;
}
details.hours {
  margin-top: 10px;
  font-size: 15px;
}
details.hours summary {
  cursor: pointer;
}
details.hours dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0 16px;
  margin: 6px 0 0;
}
details.hours dt {
  color: var(--muted);
}
details.hours dd {
  margin: 0;
}

/* --- price chart ------------------------------------------------------------------ */

.price-chart {
  padding-top: 10px;
}
.chart-wrap {
  position: relative;
}
.chart-wrap svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  touch-action: pan-y;
  font-family: var(--font);
}
.chart-wrap .grid {
  stroke: var(--line);
}
.chart-wrap .axis {
  fill: var(--muted);
  font-size: 11px;
}
.chart-wrap .direct {
  fill: var(--ink);
  font-size: 11px;
}
.chart-wrap .line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.chart-wrap .mark {
  stroke: var(--bg);
  stroke-width: 2;
}
.chart-wrap .crosshair {
  stroke: var(--muted);
  stroke-dasharray: 3 3;
}
.chart-wrap .hit {
  fill: transparent;
  cursor: crosshair;
}
.chart-wrap .tip {
  position: absolute;
  top: 4px;
  background: var(--bg);
  border: 1px solid var(--ink);
  padding: 5px 8px;
  font-size: 12px;
  pointer-events: none;
  white-space: nowrap;
}
.chart-wrap .tip i,
.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  vertical-align: -1px;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
