/* dublin.beer — one stylesheet, no build step.
   Colours are named after what's in the glass. */

:root {
  --stout: #1a120b;
  --stout-2: #2a1d12;
  --cream: #fbf6ec;
  --paper: #ffffff;
  --ink: #1f1a16;
  --muted: #6f655b;
  --line: #e8e0d3;
  --gold: #f2c14e;
  --amber: #d98a2b;
  --hop: #4f8a3a;
  --copper: #b5542b;
  --plum: #6d4c9f;
  --teal: #2f7f8f;
  --focus: #2f6fdf;

  --type-pub: var(--amber);
  --type-craft-bar: var(--hop);
  --type-brewery: var(--copper);
  --type-bottle-shop: var(--plum);
  --type-bar: var(--teal);

  --panel-w: 400px;
  --topbar-h: 58px;
  --radius: 10px;
  --shadow: 0 6px 24px rgba(26, 18, 11, .16);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--cream);
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--copper); }
a:hover { color: var(--stout); }

button { font: inherit; color: inherit; }

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

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--gold); color: var(--stout); padding: 8px 12px; border-radius: 6px; font-weight: 600;
}
.skip:focus { top: 8px; }

/* ---------- top bar ---------- */

.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 18px;
  padding: 0 16px;
  background: var(--stout);
  color: var(--cream);
  flex: 0 0 auto;
}

.brand {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--cream); text-decoration: none;
  font-weight: 800; font-size: 21px; letter-spacing: -.02em;
}
.brand:hover { color: #fff; }
.brand-mark { width: 30px; height: 30px; }
.brand-tld { color: var(--gold); }

.tagline {
  margin: 0; color: rgba(251, 246, 236, .72); font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.topnav { margin-left: auto; display: flex; gap: 6px; }
.topnav a {
  color: var(--cream); text-decoration: none; font-weight: 600; font-size: 14px;
  padding: 8px 10px; border-radius: 8px;
}
.topnav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  padding: 7px 12px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 14px;
  line-height: 1.2;
}
.btn:hover { border-color: var(--stout); }
.btn svg { width: 16px; height: 16px; }

.btn-toggle { display: none; margin-left: auto; background: var(--gold); border-color: var(--gold); color: var(--stout); }
.count-badge { font-weight: 700; opacity: .8; }

/* ---------- layout ---------- */

.app {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: var(--panel-w) minmax(0, 1fr);
  min-height: 0;
}

.panel {
  display: flex; flex-direction: column;
  min-height: 0;
  background: var(--paper);
  border-right: 1px solid var(--line);
}

.map-wrap { position: relative; min-height: 0; background: #e9e4da; }
#map { position: absolute; inset: 0; }

/* ---------- filters ---------- */

.filters { padding: 12px 14px 10px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }

.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; font: inherit; padding: 10px 12px 10px 36px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--cream); color: var(--ink);
}
.search input:focus { outline: none; border-color: var(--stout); background: #fff; box-shadow: 0 0 0 3px rgba(242, 193, 78, .4); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  --c: var(--muted);
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px 5px 8px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--c); background: var(--c); color: #fff; font-weight: 600; font-size: 13px;
  transition: background .12s, color .12s;
}
.chip::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1.5px rgba(0,0,0,.08) inset; }
.chip[aria-pressed="false"] { background: transparent; color: var(--ink); }
.chip[aria-pressed="false"]::before { background: var(--c); }
.chip.type-pub { --c: var(--type-pub); }
.chip.type-craft-bar { --c: var(--type-craft-bar); }
.chip.type-brewery { --c: var(--type-brewery); }
.chip.type-bottle-shop { --c: var(--type-bottle-shop); }
.chip.type-bar { --c: var(--type-bar); }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; }
.control { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; }
.control-label { font-weight: 600; }
.control select { font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.switch input { width: 18px; height: 18px; accent-color: var(--hop); margin: 0; }
.btn-near { margin-left: auto; padding: 6px 11px; }
.btn-near[aria-pressed="true"] { background: var(--stout); color: var(--cream); border-color: var(--stout); }

.status { margin: 10px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- list ---------- */

.list-wrap { flex: 1 1 auto; overflow: auto; min-height: 0; overscroll-behavior: contain; }
.list { list-style: none; margin: 0; padding: 6px 0; }
.item { border-bottom: 1px solid var(--line); }
.item-btn {
  display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 11px;
  width: 100%; text-align: left; padding: 10px 14px;
  background: none; border: 0; cursor: pointer;
}
.item-btn:hover { background: var(--cream); }
.item.selected .item-btn { background: #fff4d6; box-shadow: inset 3px 0 0 var(--gold); }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--muted)); box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0,0,0,.08); }
.dot.type-pub { --c: var(--type-pub); }
.dot.type-craft-bar { --c: var(--type-craft-bar); }
.dot.type-brewery { --c: var(--type-brewery); }
.dot.type-bottle-shop { --c: var(--type-bottle-shop); }
.dot.type-bar { --c: var(--type-bar); }
.item-main { min-width: 0; }
.item-name { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-meta { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-rating { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 14px; }
.item-rating.editorial { color: var(--copper); }
.item-rating.none { color: var(--muted); font-weight: 500; font-size: 12px; }
.star { color: var(--amber); }
.bf-mark { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--gold); margin-left: 6px; vertical-align: 1px; }
.list-empty { padding: 24px 16px; color: var(--muted); text-align: center; }

/* ---------- detail ---------- */

.detail { flex: 1 1 auto; overflow: auto; min-height: 0; padding: 14px 16px 24px; }
.detail .back { background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--copper); font-weight: 600; }
.detail .back:hover { color: var(--stout); text-decoration: underline; }
.detail h2 { margin: 8px 0 6px; font-size: 24px; line-height: 1.15; letter-spacing: -.01em; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--c, var(--muted)); color: #fff;
}
.badge.type-pub { --c: var(--type-pub); }
.badge.type-craft-bar { --c: var(--type-craft-bar); }
.badge.type-brewery { --c: var(--type-brewery); }
.badge.type-bottle-shop { --c: var(--type-bottle-shop); }
.badge.type-bar { --c: var(--type-bar); }
.badge.bf { background: var(--gold); color: var(--stout); }
.badge.unverified { background: var(--cream); color: var(--muted); border: 1px solid var(--line); }
.rating-block { margin: 0 0 12px; padding: 10px 12px; background: var(--cream); border-radius: var(--radius); }
.rating-line { margin: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.rating-big { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rating-src { font-size: 13px; color: var(--muted); }
.rating-sub { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.notes { margin: 0 0 12px; font-size: 15px; }
.facts { margin: 0 0 12px; display: grid; grid-template-columns: max-content 1fr; gap: 5px 12px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.tags { margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 5px; }
.tag { font-size: 12px; padding: 2px 8px; background: #f1ece2; border-radius: 6px; color: var(--muted); cursor: pointer; border: 0; }
.tag:hover { background: var(--gold); color: var(--stout); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.actions .btn { text-decoration: none; }
.actions .btn.primary { background: var(--stout); color: var(--cream); border-color: var(--stout); }
.detail .meta { font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; margin: 0; }

/* ---------- panel footer ---------- */

.panel-foot { flex: 0 0 auto; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); background: var(--paper); }
.panel-foot p { margin: 0; }

/* ---------- map markers ----------
   Venue pins are Google PinElements (coloured per type in app.js, gold border
   for beer-first). Clusters and the "you are here" dot are plain DOM. */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.cluster {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--stout); color: var(--gold);
  font-weight: 800; font-size: 13px;
  border: 3px solid rgba(242, 193, 78, .8);
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  cursor: pointer;
}
.cluster.big { width: 46px; height: 46px; font-size: 14px; }
.cluster.huge { width: 54px; height: 54px; font-size: 15px; }

.you {
  width: 16px; height: 16px; border-radius: 50%; background: var(--focus);
  border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(47, 111, 223, .25), 0 2px 6px rgba(0,0,0,.35);
}

/* ---------- map fallback ---------- */

.map-fallback {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(circle at 30% 30%, rgba(242,193,78,.25), transparent 45%),
    radial-gradient(circle at 70% 70%, rgba(181,84,43,.18), transparent 45%),
    #efe9dd;
}
.map-fallback[hidden] { display: none; }
.map-fallback-inner { max-width: 440px; background: #fff; padding: 20px 24px; border-radius: var(--radius); box-shadow: var(--shadow); }
.map-fallback-inner h2 { margin: 0 0 8px; font-size: 18px; }
.map-fallback-inner p { margin: 0; color: var(--muted); }
.map-fallback-inner code { background: var(--cream); padding: 1px 5px; border-radius: 4px; }

/* ---------- mobile: bottom sheet ---------- */

@media (max-width: 820px) {
  :root { --topbar-h: 52px; }
  .tagline, .topnav { display: none; }
  .btn-toggle { display: inline-flex; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .map-wrap { min-height: 0; }
  .panel {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: min(72dvh, 680px);
    border-right: 0; border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 30px rgba(0,0,0,.25);
    transform: translateY(100%);
    transition: transform .22s ease-out;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .panel.open { transform: none; }
  .panel::before {
    content: ""; display: block; width: 44px; height: 5px; border-radius: 3px;
    background: var(--line); margin: 8px auto 0;
  }
  .filters { padding-top: 6px; }
  .panel-foot { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .panel { transition: none; }
}

/* ---------- static pages (about, suggest, privacy, 404) ---------- */

.page { max-width: 720px; margin: 0 auto; padding: 32px 20px 64px; }
.page h1 { font-size: 34px; line-height: 1.1; letter-spacing: -.02em; margin: 0 0 16px; }
.page h2 { font-size: 22px; margin: 32px 0 10px; }
.page p, .page li { font-size: 16px; line-height: 1.6; }
.page .lede { font-size: 19px; color: var(--muted); }
.page form { display: grid; gap: 14px; margin-top: 20px; }
.page label { display: grid; gap: 5px; font-weight: 600; }
.page input, .page select, .page textarea {
  font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); width: 100%;
}
.page textarea { min-height: 120px; resize: vertical; }
.page .hint { font-weight: 400; font-size: 13px; color: var(--muted); }
.page .btn.primary { background: var(--stout); color: var(--cream); border-color: var(--stout); justify-self: start; padding: 10px 18px; }
.page .alert { padding: 12px 14px; border-radius: 8px; background: #fff1ee; border: 1px solid #f3c9bf; color: #7a2e12; }
.page .alert[hidden] { display: none; }
.hp { position: absolute; left: -9999px; top: -9999px; height: 0; overflow: hidden; }
.site-foot { padding: 20px; text-align: center; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); background: var(--paper); }
.site-foot p { margin: 4px 0; }
