:root {
  --mahogany: #2a120b;
  --mahogany-light: #4a2416;
  --green: #173d2d;
  --green-deep: #0e281d;
  --gilt: #d4a640;
  --gilt-light: #f2d67f;
  --brass: #b88a2e;
  --cream: #f7ecd2;
  --cream-deep: #eadbb6;
  --ink: #2a1a10;
  --muted: #6b5442;
  --slate: #1f2622;
  --chalk: #f3efe4;
  --claret: #7a1f2b;
  --rule: #cdb487;
  --tap: 48px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.5;
  background-color: var(--mahogany);
  background-image:
    linear-gradient(90deg, rgba(0, 0, 0, 0.28) 0 3px, transparent 3px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px),
    linear-gradient(180deg, #3b1a0f 0%, var(--mahogany) 60%, #1d0c07 100%);
  background-size: 120px 100%, 120px 100%, 100% 100%;
  background-position: 0 0, 4px 0, 0 0;
  padding-bottom: env(safe-area-inset-bottom);
}

a { color: var(--claret); }
a:hover { color: #561520; }

h1, h2, .pub-name {
  font-family: "Cinzel", Georgia, serif;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Fascia: the painted sign board over the door */
.fascia {
  background: linear-gradient(180deg, var(--green) 0%, var(--green-deep) 100%);
  border-bottom: 4px solid var(--gilt);
  box-shadow: 0 3px 0 #120804, 0 8px 18px rgba(0, 0, 0, 0.45);
  padding-top: env(safe-area-inset-top);
}

.fascia-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.6rem 0.75rem 0.7rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

.brand { display: block; line-height: 0; width: 100%; max-width: 340px; }
.brand img { display: block; width: 100%; height: auto; }

.fascia-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  width: 100%;
  max-width: 340px;
}

.fascia-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  color: var(--gilt-light);
  text-decoration: none;
  font-family: "Cinzel", Georgia, serif;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(212, 166, 64, 0.7);
  background: rgba(0, 0, 0, 0.18);
}

.fascia-nav a:hover,
.fascia-nav a:focus-visible { background: var(--gilt); color: var(--green-deep); }

.bar {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 0.75rem 1.5rem;
  display: grid;
  gap: 1rem;
}

/* Chalkboard: specials board in a wooden frame */
.chalkboard {
  position: relative;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.06), transparent 55%),
    radial-gradient(ellipse at 80% 90%, rgba(255, 255, 255, 0.04), transparent 50%),
    var(--slate);
  color: var(--chalk);
  border: 10px solid #5b3220;
  border-image: linear-gradient(135deg, #7a4529, #4a2416 45%, #6e3d22 70%, #3d1d11) 1;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.55), 0 6px 14px rgba(0, 0, 0, 0.45);
  padding: 1.2rem 1rem 1.1rem;
  text-align: center;
}

.chalkboard h1 {
  font-family: "Kalam", "Comic Sans MS", cursive;
  font-weight: 700;
  font-size: clamp(2rem, 9vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: 0;
  margin: 0.1rem 0 0.4rem;
  color: #fffdf6;
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.6);
}

.chalk-lede {
  font-family: "Kalam", "Comic Sans MS", cursive;
  font-size: 1.15rem;
  line-height: 1.35;
  color: #e7e2d4;
  margin: 0 auto 0.9rem;
  max-width: 30rem;
}

.chalk-count {
  font-family: "Kalam", "Comic Sans MS", cursive;
  color: var(--gilt-light);
  margin: 0.8rem 0 0;
  font-size: 1.05rem;
}

.chalk-form {
  display: grid;
  gap: 0.55rem;
  max-width: 34rem;
  margin: 0 auto;
}

.chalk-form input[type="search"],
.chalk-filters select {
  width: 100%;
  min-height: var(--tap);
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--cream);
  border: 2px solid #0e1210;
  border-radius: 0;
  padding: 0.6rem 0.75rem;
  -webkit-appearance: none;
  appearance: none;
}

.chalk-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  text-align: left;
}

.chalk-filters label {
  font-family: "Kalam", "Comic Sans MS", cursive;
  color: var(--chalk);
  font-size: 0.95rem;
}

.chalk-filters select {
  margin-top: 0.15rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 12px) 55%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2rem;
}

/* Buttons: pump clip and brass rail */
.btn-pump,
.btn-brass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0.55rem 1.1rem;
  font-family: "Cinzel", Georgia, serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  border-radius: 0;
  -webkit-tap-highlight-color: transparent;
}

.btn-pump {
  width: 100%;
  color: var(--gilt-light);
  background: linear-gradient(180deg, #8c2633, var(--claret) 55%, #5a1620);
  border: 2px solid var(--gilt);
  box-shadow: inset 0 0 0 2px #5a1620, 0 3px 0 #2a0c10;
}

.btn-pump:hover, .btn-pump:focus-visible { color: #fff4cc; background: linear-gradient(180deg, #9b2c3a, #84222f 55%, #64192a); }
.btn-pump:active { transform: translateY(2px); box-shadow: inset 0 0 0 2px #5a1620, 0 1px 0 #2a0c10; }

.btn-brass {
  color: #2a1a08;
  background: linear-gradient(180deg, #f1d78b, var(--gilt) 45%, var(--brass) 100%);
  border: 1px solid #6e4f17;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 3px 0 #4b350f;
}

.btn-brass:hover, .btn-brass:focus-visible { color: #1a0f04; filter: brightness(1.06); }
.btn-brass:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 1px 0 #4b350f; }

.chalkboard > .btn-brass {
  width: 100%;
  max-width: 34rem;
  margin: 0.55rem auto 0;
}

.near-note {
  font-family: "Kalam", "Comic Sans MS", cursive;
  color: #f5c8b8;
  margin: 0.4rem 0 0;
  min-height: 1.2em;
}

/* Menu card: printed card tucked in a brass holder */
.menu-card {
  background:
    linear-gradient(rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0)),
    var(--cream);
  border: 1px solid #b89a63;
  outline: 3px double var(--rule);
  outline-offset: -9px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
  padding: 1.2rem 1.15rem;
}

.menu-card h2 {
  text-align: center;
  font-size: 1.3rem;
  margin: 0.2rem 0 0.6rem;
  color: var(--green);
}

.menu-card dl { margin: 0; }
.menu-card dl > div {
  padding: 0.7rem 0;
  border-top: 1px dotted var(--rule);
}
.menu-card dt { font-weight: 700; color: var(--green); }
.menu-card dd { margin: 0.1rem 0 0; color: var(--muted); }

.prose h1 { font-size: clamp(1.6rem, 6vw, 2.2rem); color: var(--green); margin-top: 0.2rem; }
.prose p { max-width: 40rem; }

/* Results */
.chalkboard-compact { padding-top: 1rem; }

.results { display: grid; gap: 0.8rem; }

.results-title {
  margin: 0;
  font-size: 1.15rem;
  color: var(--gilt-light);
  text-align: center;
  letter-spacing: 0.06em;
}

.results-layout { display: grid; gap: 0.8rem; }

.results-map,
.pub-map {
  height: 15rem;
  border: 6px solid #5b3220;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
  background: var(--cream-deep);
}

.pub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--cream);
  border: 1px solid #b89a63;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
}

.pub-list li + li { border-top: 1px dotted var(--rule); }

.pub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 64px;
  padding: 0.7rem 0.9rem;
  color: var(--ink);
  text-decoration: none;
}

.pub-row:hover, .pub-row:focus-visible { background: #f1dfb6; color: var(--ink); }
.pub-list li.is-active .pub-row { background: #efd79e; }

.pub-row-text { display: grid; gap: 0.1rem; min-width: 0; }
.pub-name {
  font-size: 1.08rem;
  color: var(--green);
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.pub-meta { display: flex; flex-wrap: wrap; gap: 0 0.6rem; color: var(--muted); font-size: 0.92rem; }

/* Beer mat: round hygiene badge */
.beermat {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-family: "Cinzel", Georgia, serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff9ea;
  background: var(--muted);
  border: 3px double rgba(255, 249, 234, 0.85);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

.rating-5, .rating-4 { background: #2f6b3f; }
.rating-pass { background: #2f6b3f; font-size: 0.72rem; }
.rating-3 { background: #a87618; }
.rating-2, .rating-1, .rating-0, .rating-improvementrequired { background: #8e2a2a; }
.rating-awaitinginspection, .rating-exempt { font-size: 0.6rem; }

.empty-state {
  margin: 0;
  background: var(--cream);
  border: 1px solid #b89a63;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
}

.pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.6rem;
  color: var(--gilt-light);
  font-weight: 700;
  text-align: center;
}

/* Pub page: its own hanging sign */
.pub-page { display: grid; gap: 1rem; }

.pub-sign {
  text-align: center;
  background: linear-gradient(180deg, var(--green), var(--green-deep));
  border: 4px solid var(--gilt);
  outline: 6px solid #2b1a10;
  margin: 6px;
  padding: 1rem 0.9rem 1.1rem;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.5);
}

.pub-sign h1 {
  margin: 0;
  color: var(--gilt-light);
  font-size: clamp(1.6rem, 7.5vw, 2.8rem);
  line-height: 1.15;
  text-shadow: 0 2px 0 #071710;
  overflow-wrap: anywhere;
}

.pub-sign-place {
  margin: 0 0 0.3rem;
  color: #e9cf86;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.pub-address { margin: 0 0 0.9rem; text-align: center; }
.pub-address strong { display: block; color: var(--green); letter-spacing: 0.04em; }

.pub-actions { display: grid; gap: 0.5rem; margin-bottom: 0.6rem; }
.pub-actions .btn-pump, .pub-actions .btn-brass { width: 100%; }

.pub-facts dd { display: flex; align-items: center; gap: 0.6rem; overflow-wrap: anywhere; }

.source-note { margin: 0; color: #d9c29a; font-size: 0.88rem; text-align: center; }
.back-link { margin: 0; text-align: center; }
.back-link a { color: var(--gilt-light); }

.visually-hidden,
.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.visually-hidden-focusable:focus {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 2000;
  padding: 0.6rem 1rem;
  background: var(--gilt);
  color: var(--green-deep);
  font-weight: 700;
}

/* Breadcrumbs: chalked on the panelling */
.crumbs {
  font-size: 0.92rem;
  color: #d9c29a;
  overflow-wrap: anywhere;
}
.crumbs a { color: var(--gilt-light); }
.crumbs a:hover { color: #fff4cc; }

/* Area lists */
.area-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
}
.area-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-top: 1px dotted var(--rule);
}
.area-list a {
  flex: 1;
  display: block;
  padding: 0.7rem 0;
  min-height: var(--tap);
  color: var(--green);
  font-weight: 600;
  text-decoration: none;
}
.area-list a:hover { color: var(--claret); text-decoration: underline; }
.area-list span { color: var(--muted); font-size: 0.9rem; }

.card-more { margin: 0.9rem 0 0; text-align: center; }
.card-more .btn-brass { width: 100%; }

.nearby { display: grid; gap: 0.6rem; }

.prose h2 { font-size: 1.15rem; margin: 1.3rem 0 0.4rem; text-align: left; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.5rem; }
.prose code { color: var(--claret); background: var(--cream-deep); padding: 0 0.25rem; }
.prose-updated { color: var(--muted); font-size: 0.9rem; margin-top: -0.4rem; }

.leaflet-container { font-family: "Source Sans 3", sans-serif; }
.leaflet-popup-content a { color: var(--claret); font-weight: 700; }

/* Larger screens */
@media (min-width: 720px) {
  .fascia-inner {
    flex-direction: row;
    justify-content: space-between;
    padding: 0.7rem 1rem;
  }
  .brand { max-width: 360px; }
  .fascia-nav { width: auto; max-width: none; grid-template-columns: repeat(4, auto); }
  .fascia-nav a { padding: 0 1.1rem; }

  .bar { padding: 1.5rem 1rem 2rem; gap: 1.3rem; }
  .chalkboard { padding: 1.8rem 2rem 1.6rem; border-width: 14px; }

  .chalk-form {
    grid-template-columns: 1fr auto;
    align-items: end;
  }
  .chalk-form .chalk-filters { grid-column: 1 / -1; }
  .chalk-form .btn-pump { width: auto; min-width: 11rem; }
  .chalkboard-compact .chalk-form { grid-template-columns: 1fr 1fr; }
  .chalkboard-compact .chalk-form input[type="search"] { grid-column: 1 / -1; }
  .chalkboard-compact .chalk-form .chalk-filters { grid-column: 1 / 2; }
  .chalkboard-compact .chalk-form .btn-pump { width: 100%; }

  .menu-card { padding: 1.6rem 1.8rem; }
  .menu-card dl > div { display: grid; grid-template-columns: 12rem 1fr; gap: 1rem; }

  .pub-actions { grid-template-columns: repeat(3, 1fr); }

  .area-list { grid-template-columns: repeat(2, 1fr); column-gap: 2rem; }
  .card-more .btn-brass { width: auto; }
}

@media (min-width: 960px) {
  .results-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
  .results-map {
    order: 2;
    height: 34rem;
    position: sticky;
    top: 1rem;
  }
  .pub-list { order: 1; }
  .pub-map { height: 24rem; }
  .pub-page { max-width: 820px; width: 100%; margin: 0 auto; }
  .prose { max-width: 820px; width: 100%; margin: 0 auto; }
}

@media (min-width: 960px) {
  .area-list { grid-template-columns: repeat(3, 1fr); }
}

/* Admin */
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 1rem; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.admin-body { background: var(--cream-deep); background-image: none; }
.admin-bar { background: var(--green); border-bottom: 3px solid var(--gilt); }
.admin-bar-inner { display: flex; flex-wrap: wrap; gap: 1rem; padding: 0.8rem 0; }
.admin-bar a { color: var(--gilt-light); }
.admin-card, .admin-table { background: var(--cream); }
.admin-card {
  max-width: 28rem;
  margin: 2rem auto;
  padding: 1.2rem;
  border: 2px solid var(--ink);
}
.admin-card label { display: block; margin-top: 0.7rem; font-weight: 700; }
.admin-card input { width: 100%; min-height: var(--tap); padding: 0.55rem 0.7rem; margin-top: 0.2rem; border: 2px solid var(--ink); }
.admin-card button { margin-top: 1rem; width: 100%; }
.admin-error { color: var(--claret); font-weight: 700; }
.lede { color: var(--muted); font-size: 1.1rem; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { border-bottom: 1px solid var(--rule); padding: 0.45rem; text-align: left; vertical-align: top; }
.admin-pre { background: var(--slate); color: var(--chalk); padding: 0.8rem 1rem; overflow: auto; }
.log-list { padding-left: 1.1rem; }
.log-list span { color: var(--muted); }
