/* Nearby theme. Sea, sand and gorse. */

/* Geist's @font-face rules come from js/dist/fonts.css (Fontsource, bundled with bun). */

:root {
  --bg: #f6f3ec;
  --surface: #ffffff;
  --surface-2: #efeae0;
  --text: #17201f;
  --muted: #5a6562;
  --border: #e2dccf;
  --accent: #0e5a6b;
  --accent-strong: #0a4553;
  --accent-soft: #e1eef0;
  --on-accent: #ffffff;
  --gorse: #f2b31c;
  --gorse-soft: #fcefc9;
  --red: #cf142b; /* the Manx flag's red, for the brand's pin and ".im" */
  --shadow: 0 1px 2px rgb(23 32 31 / .05), 0 4px 16px rgb(23 32 31 / .06);
  --radius: 14px;
  --radius-sm: 8px;
  --wrap: 72rem;
  --font-body: "Geist Variable", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-display: var(--font-body);
  color-scheme: light;
}

/* Dark mode, chosen with the header's toggle (static/js/theme.js). The site is light unless the visitor picks it. */
:root[data-theme="dark"] {
  --bg: #0f1719;
  --surface: #162125;
  --surface-2: #1c292e;
  --text: #e7eeec;
  --muted: #9fb1ae;
  --border: #273539;
  --accent: #6cc6d6;
  --accent-strong: #93d7e3;
  --accent-soft: #183740;
  --on-accent: #0b1d22;
  --gorse: #f2c14e;
  --gorse-soft: #3a3220;
  --red: #ff6b75;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 4px 16px rgb(0 0 0 / .25);
  color-scheme: dark;
}

/* Base */

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

main { flex: 1; padding-block: 2rem 4rem; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 1rem; }
@media (min-width: 40rem) { .wrap { padding-inline: 1.5rem; } }

a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-strong); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--gorse); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.5rem + 2.2vw, 3rem); margin: .25rem 0 1rem; }
h2 { font-size: clamp(1.4rem, 1.2rem + .8vw, 1.8rem); margin: 2.5rem 0 1rem; }
h3 { font-size: 1.2rem; margin: 1.5rem 0 .5rem; }
p { margin: 0 0 1rem; }
img { max-width: 100%; height: auto; }
code { font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; overflow-wrap: anywhere; }

.icon { flex: none; vertical-align: -.15em; }
.meta { color: var(--muted); font-size: .9rem; }
.small { font-size: .85rem; }
.empty { color: var(--muted); font-style: italic; }
.prose { max-width: 42rem; }
.prose > :first-child { margin-top: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip-link { position: absolute; left: 1rem; top: -3rem; z-index: 2000; padding: .5rem 1rem; background: var(--surface); border-radius: var(--radius-sm); }
.skip-link:focus { top: 1rem; }

.icon-text { display: inline-flex; align-items: center; gap: .35rem; }

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1100; /* above the map's markers and controls */
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem; padding-block: .7rem; }
.site-header nav { display: flex; flex-wrap: wrap; gap: .25rem; margin-inline-end: -.6rem; }
.site-header nav a {
  padding: .35rem .7rem;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
}
.site-header nav a:hover { color: var(--text); background: var(--surface-2); }
.site-header nav a[aria-current] { color: var(--accent); background: var(--accent-soft); }

.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--text); text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; letter-spacing: -.01em; }
.brand:hover { color: var(--text); }
.brand-tld { color: var(--red); }

.site-header .wrap > nav { margin-inline: auto 0; }
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-inline: -.5rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--text); background: var(--surface-2); }
.theme-toggle .icon { width: 1.15rem; height: 1.15rem; }
/* Shows the mode it switches to: the moon while light, the sun while dark. */
.theme-toggle span { display: inline-flex; }
.theme-toggle .icon-sun, [data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: inline-flex; }
/* Keeps the brand, links and toggle on one line on a phone. */
@media (max-width: 30rem) {
  .site-header .wrap { column-gap: .5rem; }
  .site-header nav { gap: 0; }
  .site-header nav a { padding-inline: .5rem; }
  .brand { gap: .4rem; }
}
.logo-pin { fill: var(--red); }

/* Footer */

.site-footer { border-top: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-size: .95rem; }
.site-footer .wrap { display: grid; gap: 1rem 2rem; padding-block: 2.5rem; }
@media (min-width: 40rem) { .site-footer .wrap { grid-template-columns: 1fr auto; } }
.site-footer p { margin: .5rem 0 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; align-content: start; }
.site-footer ul a { color: var(--text); text-decoration: none; }
.site-footer ul a:hover { color: var(--accent); text-decoration: underline; }
.site-footer .small { grid-column: 1 / -1; padding-top: 1rem; border-top: 1px solid var(--border); }
.site-footer .small a { color: inherit; }

/* Page furniture */

.page-head { margin-bottom: 1.5rem; }
.page-head > :last-child { margin-bottom: 0; }
.page-head p:not(.meta) { max-width: 42rem; font-size: 1.1rem; }
.breadcrumb { margin: 0; color: var(--muted); font-size: .9rem; }
.breadcrumb a { color: inherit; }
.breadcrumb a:hover { color: var(--accent); }

.eyebrow { margin: 0; color: var(--accent); font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .6rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  transition: background-color .15s, color .15s;
}
.button:hover { background: var(--accent-soft); color: var(--accent-strong); }
.button-primary { background: var(--accent); color: var(--on-accent); }
.button-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.card > h2:first-child { margin-top: 0; font-size: 1.25rem; }
.card > :last-child { margin-bottom: 0; }


.notice { padding: .6rem 1rem; border-radius: var(--radius-sm); background: var(--gorse-soft); }

.split { display: grid; gap: 1.5rem; align-items: start; margin-block: 1.5rem; }
@media (min-width: 52rem) { .split { grid-template-columns: minmax(0, 1fr) 22rem; } }

.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 1rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }

/* Home */

.hero {
  position: relative;
  margin: -.5rem 0 1rem;
  padding: clamp(1.5rem, 4vw, 3.5rem);
  border-radius: calc(var(--radius) * 1.5);
  background: linear-gradient(160deg, var(--accent-soft), var(--surface) 70%);
  border: 1px solid var(--border);
  overflow: hidden;
}
.hero h1 { max-width: 20ch; margin-top: .5rem; }
.hero .lead { max-width: 38rem; font-size: 1.15rem; color: var(--muted); }
.hero .search { max-width: 38rem; margin-top: 1.5rem; }
.hero .search-status, .hero .results { max-width: 38rem; }
.hero-links { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.25rem 0 .5rem; }
.hero-links a, .map-links a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .85rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: .95rem;
  font-weight: 500;
  text-decoration: none;
}
.hero-links a:hover, .map-links a:hover { border-color: var(--accent); color: var(--accent); }
.hero-links .icon, .map-links .icon { color: var(--accent); }

.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; margin: 2.75rem 0 1rem; }
.section-head h2 { margin: 0; }
.section-head a { display: inline-flex; align-items: center; gap: .3rem; font-weight: 600; text-decoration: none; }
.section-head a:hover { text-decoration: underline; }

/* Events */

.event-list { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 1rem; }
@media (min-width: 46rem) { .event-list { grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); } }

.event-card {
  position: relative;
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.event-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); transform: translateY(-1px); }
.event-card h3 { margin: 0 0 .3rem; font-size: 1.2rem; }
.event-card h3 a { color: var(--text); text-decoration: none; }
/* The title's link covers the whole card, so the card is clickable; the venue link sits above it. */
.event-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.event-card:hover h3 a { color: var(--accent); text-decoration: underline; }
.event-card:has(h3 a:focus-visible) { outline: 3px solid var(--gorse); outline-offset: 2px; }
.event-card h3 a:focus-visible { outline: none; }
.event-card .meta { display: flex; flex-wrap: wrap; gap: .15rem 1rem; margin: 0; }
.event-card .meta a { position: relative; z-index: 1; color: inherit; }
.event-card .meta a:hover { color: var(--accent); }
.event-card-body { min-width: 0; }
.event-card-summary { margin: .5rem 0 0; font-size: .95rem; }
.event-dates { margin: 1rem 0; }
.event-dates summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.event-dates ul { max-height: 20rem; overflow-y: auto; margin: .5rem 0 0; padding-left: 1.25rem; font-size: .95rem; }

.date-tile {
  flex: none;
  display: grid;
  justify-items: center;
  align-content: start;
  width: 4rem;
  padding: .4rem 0 .5rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  line-height: 1.1;
  text-align: center;
  border-top: 4px solid var(--gorse);
  align-self: flex-start;
}
.date-tile .dow, .date-tile .mon { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.date-tile .day { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; color: var(--text); }

.past { opacity: .75; }
.past .date-tile { background: var(--surface-2); color: var(--muted); border-top-color: var(--border); }

.event-head { display: flex; align-items: center; gap: 1rem; margin-top: .5rem; }
.event-head h1 { margin: 0; }
.event-head .date-tile { width: 4.5rem; }

.facts dl { display: grid; gap: .25rem; margin: 0 0 1.25rem; }
.facts dt { display: flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.facts dt .icon { color: var(--accent); }
.facts dd { margin: 0 0 .75rem; }
.facts .button { width: 100%; }
.facts .button + .button { margin-top: .5rem; }

/* Events: list or calendar (static/js/calendar.js) */

.view-switch, .cal-modes { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.view-switch { margin-bottom: 1rem; }
.view-switch[hidden], .calendar[hidden], .events-list-view[hidden], .event-filters[hidden], .event-card[hidden] { display: none; }
.event-filters { margin-bottom: .6rem; }
.filter-status { min-height: 1.4em; margin: 0 0 1rem; }
.view-switch button, .cal-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .9rem; border: 0; border-radius: 999px; background: none;
  color: var(--muted); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
}
.view-switch button:hover, .cal-btn:hover { color: var(--accent); background: var(--accent-soft); }
.view-switch button[aria-pressed="true"], .cal-modes .cal-btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

.calendar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.cal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
.cal-nav-group { display: flex; align-items: center; gap: .25rem; }
.cal-nav-group .cal-btn:first-child { border: 1px solid var(--border); margin-right: .25rem; }
.cal-nav-group .cal-btn:disabled { opacity: .5; cursor: default; background: none; color: var(--muted); }
.cal-nav { width: 2.1rem; height: 2.1rem; padding: 0; justify-content: center; font-size: 1.4rem; line-height: 1; }
.cal-title { flex: 1; margin: 0; font-size: 1.25rem; white-space: nowrap; }
.cal-modes { background: var(--surface-2); }
@media (max-width: 34rem) { .cal-title { order: -1; flex-basis: 100%; } }

.cal-body { overflow-x: auto; }
.cal-event { display: flex; align-items: center; gap: .3rem; min-width: 0; overflow: hidden; color: var(--text); font-size: .78rem; line-height: 1.3; text-decoration: none; white-space: nowrap; }
.cal-event:hover { color: var(--text); }
.cal-event-name { overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.cal-event-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-event.is-past { opacity: .6; }
.cal-bar-event { margin: 1px 3px; padding: 0 .45rem; border-radius: 5px; background: var(--accent); color: var(--on-accent); }
.cal-bar-event:hover { background: var(--accent-strong); color: var(--on-accent); }
.cal-bar-event.cont-before { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal-bar-event.cont-after { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
/* A series on consecutive days, or anything over more than a week (calendar.js): a softer bar, so exhibitions stay in
   the background of the month. */
.cal-run { border-left: 3px solid var(--accent); background: var(--accent-soft); color: var(--text); }
.cal-run.cont-before { border-left: 0; }
.cal-run:hover { background: color-mix(in srgb, var(--accent) 22%, var(--accent-soft)); color: var(--text); }
.cal-dot-event { margin: 1px 3px; padding: 0 .3rem; border-radius: 5px; }
.cal-dot-event::before { content: ""; flex: none; width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); }
.cal-dot-event:hover { background: var(--surface-2); }

/* Month */
.cal-month { min-width: 21rem; }
.cal-dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.cal-dow div { padding: .35rem 0; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-align: center; text-transform: uppercase; }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: 2rem repeat(4, 1.4rem) minmax(.5rem, 1fr); min-height: 8.5rem; }
.cal-week + .cal-week { border-top: 1px solid var(--border); }
.cal-cell { grid-row: 1 / -1; }
.cal-cell + .cal-cell, .cal-daynum + .cal-cell { border-left: 1px solid var(--border); }
.cal-cell.is-other { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.cal-daynum, .cal-more {
  grid-row: 1; justify-self: center; align-self: center; z-index: 1;
  min-width: 1.75rem; height: 1.75rem; padding: 0 .35rem; border: 0; border-radius: 999px; background: none;
  color: var(--text); font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer;
}
.cal-cell.is-other + .cal-daynum { color: var(--muted); }
.cal-daynum:hover, .cal-more:hover { background: var(--surface-2); }
.cal-daynum.is-today { background: var(--accent); color: var(--on-accent); }
.cal-more { justify-self: start; height: auto; margin: 1px 3px; padding: 0 .3rem; border-radius: 5px; color: var(--muted); font-size: .76rem; text-align: left; white-space: nowrap; }
.cal-week .cal-event { z-index: 1; }
@media (max-width: 40rem) {
  .cal-week { grid-template-rows: 2rem repeat(4, 1.2rem) minmax(.5rem, 1fr); min-height: 7rem; }
  .cal-week .cal-event-time { display: none; }
  .cal-week .cal-event { font-size: .68rem; }
  .cal-dot-event::before { display: none; }
  .cal-dot-event { background: var(--accent-soft); }
  .cal-more { font-size: .68rem; }
  .cal-more-word { display: none; }
  /* The events are too small to tap on a phone, so a tap anywhere in a day falls through to its cell and opens
     the day (calendar.js), which lists them at full size. The day buttons still take keyboard focus. */
  .cal-month { min-width: 0; }
  .cal-cell { cursor: pointer; }
  .cal-week .cal-event, .cal-daynum, .cal-more { pointer-events: none; }
}

/* Week and day */
.cal-time { --gutter: 3.5rem; --hour: 48px; }
.cal-days-7 { min-width: 44rem; }
.cal-time-head, .cal-allday, .cal-hours { display: grid; grid-template-columns: var(--gutter) repeat(var(--days), minmax(0, 1fr)); }
.cal-time-head { border-bottom: 1px solid var(--border); }
.cal-colhead { display: grid; justify-items: center; gap: .1rem; padding: .4rem 0; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; }
.cal-colhead:hover .cal-colhead-num { background: var(--surface-2); }
.cal-colhead-dow { color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.cal-colhead-num { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; font-size: 1.35rem; font-weight: 600; }
.cal-colhead.is-today .cal-colhead-dow { color: var(--accent); }
.cal-colhead.is-today .cal-colhead-num { background: var(--accent); color: var(--on-accent); }
.cal-allday { grid-auto-rows: 1.45rem; padding: .25rem 0; border-bottom: 1px solid var(--border); max-height: 9rem; overflow-y: auto; }
.cal-allday-label { grid-row: 1; grid-column: 1; align-self: center; padding-right: .5rem; color: var(--muted); font-size: .65rem; text-align: right; }
.cal-scroll { height: min(36rem, 70vh); overflow-y: auto; }
.cal-hours { height: calc(24 * var(--hour)); }
.cal-gutter { position: relative; }
.cal-hour { position: absolute; right: .5rem; translate: 0 -50%; color: var(--muted); font-size: .7rem; font-variant-numeric: tabular-nums; }
.cal-col {
  position: relative; border-left: 1px solid var(--border);
  background: repeating-linear-gradient(to bottom, transparent 0 calc(var(--hour) - 1px), var(--border) calc(var(--hour) - 1px) var(--hour));
}
.cal-col.is-today { background-color: color-mix(in srgb, var(--accent-soft) 40%, transparent); }
.cal-block {
  position: absolute; flex-direction: column; align-items: stretch; gap: 0; padding: .15rem .4rem;
  border-radius: 6px; border-left: 3px solid var(--accent); background: var(--accent-soft); white-space: normal;
  box-shadow: 0 0 0 1px var(--surface);
}
.cal-block:hover { background: color-mix(in srgb, var(--accent) 22%, var(--accent-soft)); z-index: 2; }
.cal-block .cal-event-name { white-space: nowrap; }
/* No finish time given: drawn an hour long, fading out at the bottom. */
.cal-block.is-end-unknown { -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent); mask-image: linear-gradient(to bottom, #000 60%, transparent); }
.cal-block .cal-event-venue { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.cal-block.is-short { flex-direction: row; gap: .35rem; }
.cal-block.is-short .cal-event-venue { display: none; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 3; pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.venue-note { display: block; color: var(--muted); font-size: .9rem; }
.business-photo { max-width: 42rem; margin: 0 0 1.5rem; }
.business-photo img { display: block; width: 100%; max-height: 26rem; object-fit: cover; border-radius: var(--radius); background: var(--surface-2); }
.business-photo figcaption { margin-top: .4rem; color: var(--muted); font-size: .8rem; }
.end-unknown { color: var(--muted); }


/* Map (MapLibre's own stylesheet loads after this one, so its overrides are scoped to .map) */

.map { height: clamp(260px, 45vw, 420px); margin: 1.5rem 0; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); z-index: 0; background: var(--surface-2); }
.map.maplibregl-map { font-family: var(--font-body); }
/* Fullscreen (the control under the zoom buttons), or filling the window where fullscreen isn't available. */
.map:fullscreen, .map.maplibregl-pseudo-fullscreen { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.map .maplibregl-popup-content { background: var(--surface); color: var(--text); border-radius: var(--radius-sm); font-size: .95rem; padding: .6rem 1.75rem .6rem .85rem; }
.map .maplibregl-popup-content a { font-weight: 600; color: var(--accent); }
.map .maplibregl-popup-close-button { color: var(--muted); font-size: 1.1rem; width: 1.5rem; height: 1.5rem; }
.map .maplibregl-popup-anchor-top .maplibregl-popup-tip,
.map .maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.map .maplibregl-popup-anchor-top-right .maplibregl-popup-tip { border-bottom-color: var(--surface); }
.map .maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
.map .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.map .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip { border-top-color: var(--surface); }
.map .maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--surface); }
.map .maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--surface); }
.map-links { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .5rem 0 0; }
.map-links a { padding: .25rem .7rem; font-size: .85rem; }
.map-links-label { color: var(--muted); font-size: .9rem; }
.map-pin { width: 26px; height: 34px; cursor: pointer; }
.map-pin span {
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 50% 50% 50% 0;
  background: var(--accent);
  border: 3px solid var(--surface);
  box-shadow: 0 2px 6px rgb(0 0 0 / .35);
  transform: rotate(-45deg);
  transform-origin: center;
}
.map-pin span::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--gorse); }
/* The type-of-place icon sits upright in the pin's head, in place of the dot. */
.map-pin:has(.icon) span::after { content: none; }
.map-pin .icon { position: absolute; top: 6px; left: 6px; width: 14px; height: 14px; color: var(--on-accent); pointer-events: none; }

/* Opening hours and business details */

.hours { width: 100%; border-collapse: collapse; }
.hours th, .hours td { padding: .35rem .5rem; border-bottom: 1px solid var(--border); }
.hours th { text-align: left; font-weight: 500; white-space: nowrap; }
.hours td { text-align: right; font-variant-numeric: tabular-nums; }
.hours tr:last-child th, .hours tr:last-child td { border-bottom: 0; }
.hours tr.closed td { color: var(--muted); }
.hours tr.today { background: var(--gorse-soft); }
.hours tr.today th { font-weight: 700; }
.hours tr.today th::after { content: " · today"; color: var(--muted); font-weight: 500; font-size: .85em; }
.card .hours + .meta { margin-top: .75rem; }

/* A map pin's popup (js/map.js): the name, then whether it's open and the week's hours when it has them. */
.map-popup-name { display: block; }
.map-popup { max-height: calc(clamp(260px, 45vw, 420px) - 100px); overflow-y: auto; }
.map:fullscreen .map-popup, .map.maplibregl-pseudo-fullscreen .map-popup { max-height: calc(100dvh - 100px); }
.map-status, .hours-status { margin: .3rem 0 .4rem; font-size: .85rem; font-weight: 600; }
.map-status.is-open, .hours-status.is-open { color: var(--accent); }
.map-status.is-closed, .hours-status.is-closed { color: var(--muted); }
.map .map-hours { font-size: .85rem; }
.map .map-hours th, .map .map-hours td { padding: .15rem .4rem; }
.map .map-hours tr.today th::after { content: none; }
.map .map-hours + .meta { margin: .4rem 0 0; font-size: .8rem; }

.details { display: grid; grid-template-columns: max-content 1fr; gap: .6rem 1.25rem; margin: 0; }
.details dt { display: flex; align-items: center; align-self: start; gap: .4rem; color: var(--muted); }
.details dt .icon { color: var(--accent); }
.details dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 30rem) {
  .details { grid-template-columns: 1fr; gap: 0; }
  .details dd { margin-bottom: .6rem; }
}

/* Search */

.search-field { position: relative; }
.search-field .icon { position: absolute; left: 1.1rem; top: 50%; translate: 0 -50%; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%;
  padding: .9rem 1rem .9rem 3rem;
  font: inherit;
  font-size: 1.05rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 0; border-color: var(--accent); }
.search-status { margin: .6rem 0 0 .2rem; min-height: 1.4em; }

/* Filters: a row of pills, each a native <select> laid invisibly over its label (.filter-pill-text), so phones
   keep their own pickers. Set pills are filled in. On narrow screens the row scrolls sideways rather than wrapping,
   bleeding to the screen's edges; the padding leaves room for the focus ring. */
.search-filters { margin: .75rem 0 0; padding: 0; border: 0; min-width: 0; }
.filter-pills { display: flex; align-items: center; gap: .4rem; padding: 3px; margin: -3px; overflow-x: auto; scrollbar-width: none; }
.filter-pills::-webkit-scrollbar { display: none; }
@media (max-width: 40rem) { .filter-pills { margin-inline: -1rem; padding-inline: 1rem; } }
@media (min-width: 40rem) { .filter-pills { flex-wrap: wrap; overflow: visible; } }
.filter-pill {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .4rem .85rem .4rem .95rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: border-color .15s, background-color .15s;
}
.filter-pill[hidden] { display: none; }
/* All, Places or Events: a segmented switch of radio buttons at the start of the row. */
.scope-switch { flex: none; display: inline-flex; padding: 3px; gap: 2px; margin-inline-end: .2rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); }
.scope-switch label { position: relative; }
.scope-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.scope-switch span { display: inline-flex; align-items: center; height: 100%; padding: .25rem .8rem; border-radius: 999px; color: var(--muted); font-size: .9rem; font-weight: 600; }
.scope-switch label:hover span { color: var(--accent); }
.scope-switch input:checked + span { color: var(--on-accent); background: var(--accent); }
.scope-switch input:focus-visible + span { outline: 3px solid var(--gorse); outline-offset: 1px; }
/* The chevron. */
.filter-pill::after { content: ""; width: .38rem; height: .38rem; border: solid currentColor; border-width: 0 1.5px 1.5px 0; rotate: 45deg; translate: 0 -.12rem; opacity: .55; }
.filter-pill:hover { border-color: var(--accent); }
.filter-pill:focus-within { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
.filter-pill.is-set { color: var(--accent-strong); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); font-weight: 600; }
.filter-count { display: inline-grid; place-items: center; min-width: 1.3rem; height: 1.3rem; margin-inline-start: .1rem; padding: 0 .35rem; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: .75rem; font-variant-numeric: tabular-nums; }
.filter-pill select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font: inherit; font-size: 16px; cursor: pointer; }
.filter-clear {
  flex: none;
  padding: .4rem .5rem;
  color: var(--accent);
  background: none;
  border: 0;
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
}
.filter-clear:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: .18em; }
.filter-clear[hidden] { display: none; }
.filter-chips { margin: .6rem 0 0; }
.filter-chips[hidden] { display: none; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .55rem .3rem .75rem;
  font: inherit;
  font-size: .85rem;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 999px;
  cursor: pointer;
}
.filter-chip::after { content: "×"; font-size: 1.1em; line-height: 1; color: var(--muted); }
.filter-chip:hover, .filter-chip:focus-visible { border-color: var(--accent); }
.filter-chip:hover::after, .filter-chip:focus-visible::after { color: var(--accent); }
.filter-chip:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 0; }

.results, .business-list {
  padding: 0;
  margin: .5rem 0 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.business-list, .results ul { list-style: none; padding: 0; margin: 0; }
.results section + section { border-top: 1px solid var(--border); }
.results-heading {
  margin: 0;
  padding: .6rem 1.1rem .2rem;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.results li, .business-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0 1rem;
  padding: .65rem 1.1rem;
  border-top: 1px solid var(--border);
}
.results li:first-child, .business-list li:first-child { border-top: 0; }
.results li:hover, .business-list li:hover { background: var(--surface-2); }
.results a, .business-list a { font-weight: 600; text-decoration: none; }
.results a:hover, .business-list a:hover { text-decoration: underline; }

/* Category picker */

.category-picker { columns: 2 26rem; column-gap: 1rem; }
.category-picker section { break-inside: avoid; margin-bottom: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem 1.25rem; box-shadow: var(--shadow); }
.category-picker h3 { margin: 0 0 .75rem; font-size: 1.15rem; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0; }
.chips a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: .9rem;
  text-decoration: none;
}
.chips a:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.chips .count { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.category-picker details { margin-top: .75rem; }
.category-picker summary { cursor: pointer; color: var(--accent); font-size: .9rem; font-weight: 600; margin-bottom: .5rem; }

/* Touch screens: controls at least 44px (2.75rem) high, so they're easy to tap. Links in running text get a taller
   hit area from padding that a negative margin takes back out of the layout. */
@media (pointer: coarse) {
  .theme-toggle { width: 2.75rem; height: 2.75rem; margin-inline: -.75rem; } /* same footprint, so the header still fits */
  .site-header nav a { min-height: 2.75rem; display: inline-flex; align-items: center; }
  .view-switch button, .cal-btn, .hero-links a, .map-links a, .filter-pill, .filter-clear, .filter-chip, .scope-switch span { min-height: 2.75rem; }
  .cal-nav { width: 2.75rem; height: 2.75rem; }
  .cal-allday { grid-auto-rows: 2.25rem; max-height: 11.5rem; }
  .cal-allday .cal-event { margin-block: 2px; }
  .event-card .meta a { display: inline-block; padding-block: .6rem; margin-block: -.6rem; }
  .map .maplibregl-ctrl-group button { width: 2.75rem; height: 2.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
