/* styles.css — shared by every page of www.thecapeann.com (built by scripts/build.js from site/template.html and site/_pages/). */

/* Fonts, served from our own site (Oct 5, for speed: no extra connections to Google). Latin subset from Google Fonts;
   SIL Open Font License, see /fonts/OFL-*.txt. File names carry the font version, so they are cached for a year. */
@font-face { font-family: 'Barlow'; font-style: italic; font-weight: 400; font-display: swap; src: url(/fonts/barlow-400i-v13.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/barlow-400-v13.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/barlow-500-v13.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/barlow-600-v13.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/barlow-condensed-600-v13.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/barlow-condensed-700-v13.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Libre Caslon Display'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/libre-caslon-display-400-v18.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #f4efe4;
  --surface: #fffdf8;
  --surface-2: #ebe4d4;
  --ink: #1c2a33;
  --ink-2: #3f4c58;
  --muted: #5c6570;   /* Granite, darkened a touch for small text (owner, Oct 1: 4.5:1 on cream) */
  --line: #d9d1c1;
  --line-strong: #bfb5a2;
  --accent: #1f4e79;
  --accent-ink: #f4efe4;
  --accent-soft: #dbe6f2;
  --motif: #b23a2b;
  --aud-family: #1a9a6c;
  --free-ink: #127552;
  --aud-general: #3f73c4;
  --aud-adult: #c2552e;
  --aud-senior: #7d57c7;
  --shadow: 0 1px 2px rgba(28, 42, 51, .06), 0 4px 16px rgba(28, 42, 51, .06);
  --serif: "Libre Caslon Display", "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --body: "Barlow", "Segoe UI", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1a24;
    --surface: #172532;
    --surface-2: #1f3040;
    --ink: #eef0ee;
    --ink-2: #c3cbd3;
    --muted: #94a0ac;
    --line: #2b3d4d;
    --line-strong: #3f5468;
    --accent: #8ab8e8;
    --accent-ink: #0f1a24;
    --accent-soft: #1c3550;
    --motif: #e3735f;
    --aud-family: #1f9d72;
    --free-ink: #4cc596;
    --aud-general: #5a8ee0;
    --aud-adult: #d86a44;
    --aud-senior: #a78ce6;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1a24;
  --surface: #172532;
  --surface-2: #1f3040;
  --ink: #eef0ee;
  --ink-2: #c3cbd3;
  --muted: #94a0ac;
  --line: #2b3d4d;
  --line-strong: #3f5468;
  --accent: #8ab8e8;
  --accent-ink: #0f1a24;
  --accent-soft: #1c3550;
  --motif: #e3735f;
  --aud-family: #1f9d72;
  --free-ink: #4cc596;
  --aud-general: #5a8ee0;
  --aud-adult: #d86a44;
  --aud-senior: #a78ce6;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.wrap { max-width: 1180px; margin: 0 auto; padding-inline: 20px; padding-block: 14px 48px; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 480px) { .wrap { padding-inline: 16px; } }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; }
h2 { font-family: var(--serif); font-weight: 400; }
.eyebrow { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; color: var(--muted); }

/* ---------- Header ---------- */
/* Compact header (owner, Sept 28): logo and town names on one row, then the section tabs */
header.top { display: grid; gap: 2px; }
.brandrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 18px; }
.brandrow .eyebrow { font-size: 12px; text-align: right; flex: 1 1 320px; line-height: 1.4; }
header.top .brand { margin: 0; line-height: 0; }
header.top .brand a { display: inline-block; }
.logo-svg { display: block; width: min(230px, 100%); height: auto; color: var(--ink); }
/* each page's own heading (the logo is not the h1), with its counts on the same line */
h1.sect-h { font-family: var(--serif); font-weight: 400; font-size: clamp(22px, 2.6vw, 27px); line-height: 1.15; letter-spacing: 0; color: var(--ink); margin: 0; text-wrap: balance; }
.section-intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 20px; }
.section-intro .intro-text { display: contents; }
.section-intro h1 { grid-column: 1; grid-row: 1; }
.section-intro .facts { grid-column: 2; grid-row: 1; justify-content: flex-end; }
.wrap > header.top + .section-intro { margin-top: -6px; }
.section-intro p { grid-column: 1 / -1; grid-row: 2; margin: 0; color: var(--muted); font-size: 14px; }
.facts { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 13px; color: var(--ink-2); }
.facts b { font-family: var(--display); font-size: 18px; font-weight: 600; color: var(--ink); margin-right: 3px; }
/* Section switcher: Events | Places to Eat & Drink | Tides & Weather */
.sections { display: flex; gap: 2px; border-bottom: 1px solid var(--line-strong); margin-top: 2px; overflow-x: auto; scrollbar-width: none; }
.sections a { font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: .02em; text-transform: uppercase; color: var(--ink-2); text-decoration: none; padding: 6px 12px 7px; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.sections a:hover { color: var(--ink); border-bottom-color: var(--line-strong); }
.sections a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
/* Email signup button (owner, Sept 28): filled pill at the end of the tab row on wide screens ("Sign up for our free
   Thursday email"); at 900 px and under a two-line button beside the logo ("Sign up for our / Thursday email") */
.email-cta { display: inline-flex; align-items: center; gap: 7px; font-family: var(--body); font-weight: 600; font-size: 14px; color: var(--accent-ink); background: var(--accent); text-decoration: none; white-space: nowrap; border: 1px solid var(--accent); border-radius: 999px; padding: 5px 14px; line-height: 1.2; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.email-cta:hover { filter: brightness(1.12); }
.email-cta[aria-current="page"] { background: transparent; color: var(--accent); box-shadow: none; }
.sections a.email-cta { margin: 0 0 6px auto; align-self: center; font-family: var(--body); font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--accent-ink); padding: 5px 14px; border: 1px solid var(--accent); }
.sections a.email-cta[aria-current="page"] { color: var(--accent); }
.email-cta.on-phone { display: none; }
/* town list in the header; on phones just "Cape Ann & neighboring towns" (owner, Sept 28) */
.eyebrow .ey-short { display: none; }
@media (max-width: 600px) { .eyebrow .ey-full { display: none; } .eyebrow .ey-short { display: inline; } }
.email-cta.on-phone span { text-align: left; }
/* "Report a problem" (site/_partials/report.html): a quiet link, and a small dialog */
.flaglink { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.flaglink:hover { color: var(--motif); }
.flagdlg { border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); color: var(--ink); padding: 0; width: min(440px, calc(100vw - 32px)); box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
.flagdlg::backdrop { background: rgba(15, 26, 36, .45); }
.flagform { display: grid; gap: 12px; padding: 18px 18px 14px; }
.flagform h2 { margin: 0; font: 400 24px var(--serif); }
.flagwhat { margin: -6px 0 0; font-weight: 600; font-size: 15px; color: var(--ink-2); }
.flagform fieldset { border: 0; padding: 0; margin: 0; }
.flagform legend { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.flagboxes { display: grid; gap: 7px; }
.flagboxes label { display: flex; gap: 8px; align-items: flex-start; font-size: 15px; cursor: pointer; line-height: 1.25; }
.flagboxes input { accent-color: var(--accent); width: 17px; height: 17px; flex: none; margin: 1px 0 0; }
.flagnote { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.flagnote textarea { font: inherit; font-size: 15px; color: var(--ink); background: var(--bg); border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; resize: vertical; }
.flagbtns { display: flex; gap: 10px; }
.flagsend { border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-ink); padding: 9px 16px; font: 600 15px var(--body); cursor: pointer; }
.flagsend[disabled] { opacity: .6; }
.flagcancel { border: 1px solid var(--line-strong); border-radius: 8px; background: transparent; color: var(--ink); padding: 9px 14px; font: 500 15px var(--body); cursor: pointer; }
.flagmsg:empty { display: none; }
.flagmsg { font-size: 14px; }
.flagmsg.ok { background: var(--accent-soft); border-radius: 8px; padding: 9px 12px; }
.flagmsg.err { color: var(--motif); }
.flagfine { margin: 0; font-size: 12px; color: var(--muted); }
.flagdlg .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
/* Quick Thursday-email signup box on town, event, weekend and guide pages (site/_partials/signup.html) */
.signup-box { position: relative; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; padding: 16px 18px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 380px); gap: 8px 22px; align-items: center; }
.signup-box h2 { font: 400 22px/1.2 var(--serif); margin: 0 0 3px; }
.signup-box p { margin: 0; color: var(--ink-2); font-size: 14px; }
.sb-form { display: flex; gap: 8px; }
.sb-form[hidden] { display: none; }
.sb-form input[type=email] { flex: 1 1 auto; min-width: 0; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); color: var(--ink); padding: 9px 11px; font-size: 16px; }
.sb-form button { border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-ink); padding: 9px 16px; font: 600 15px var(--body); cursor: pointer; white-space: nowrap; }
.sb-form button[disabled] { opacity: .6; cursor: default; }
.sb-msg { grid-column: 1 / -1; font-size: 14px; }
.sb-msg:empty { display: none; }
.sb-msg.ok { background: var(--accent-soft); color: var(--ink); border-radius: 8px; padding: 10px 12px; }
.sb-msg.err { color: var(--motif); }
.signup-box .sb-more { grid-column: 1 / -1; font-size: 13px; }
.signup-box .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 700px) { .signup-box { grid-template-columns: minmax(0, 1fr); padding: 14px; } }
@media (max-width: 1100px) { .email-cta .xl { display: none; } }
@media (max-width: 900px) {
  .brandrow .eyebrow { order: -1; text-align: left; flex-basis: 100%; }
  .email-cta.on-phone { display: inline-flex; margin-left: auto; border-radius: 10px; padding: 5px 12px; line-height: 1.15; }
  .sections a.email-cta.on-wide { display: none; }
}
@media (max-width: 600px) {
  .brandrow .eyebrow { font-size: 10.5px; letter-spacing: .05em; }
  .brandrow .long { display: none; }
  .email-cta.on-phone { font-size: 13px; padding: 4px 10px; }
  .logo-svg { width: 175px; }
  .section-intro { grid-template-columns: minmax(0, 1fr); }
  .section-intro .facts { grid-column: 1; grid-row: 2; justify-content: flex-start; }
  .section-intro p { grid-row: 3; }
}
@media (max-width: 480px) { .sections a { font-size: 15px; padding-inline: 8px; } }
/* three sections: on narrow screens "Places to Eat & Drink" shortens to "Eat & Drink" */
@media (max-width: 600px) { .sections .long { display: none; } .sections a { padding-inline: 8px; } }
@media (max-width: 400px) { .logo-svg { width: 158px; } .brandrow { column-gap: 10px; } .email-cta.on-phone { font-size: 12px; padding: 4px 9px; } .email-cta.on-phone svg { display: none; } }
@media (max-width: 400px) { .sections { gap: 0; } .sections a { font-size: 14.5px; padding-inline: 6px; letter-spacing: 0; } }

/* ---------- Highlights ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head h2 { font-size: 28px; letter-spacing: 0; }
.section-head p { margin: 0; color: var(--muted); font-size: 14px; }
/* ---------- Filters ---------- */
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 14px; display: grid; gap: 12px; }
.frow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.search { flex: 1 1 240px; min-width: 0; position: relative; }
.search input { width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); padding: 8px 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-strong); background: transparent; border-radius: 999px; padding: 4px 12px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip .n { opacity: .7; margin-left: 4px; font-size: 12px; }
.chip-sep { width: 1px; align-self: stretch; background: var(--line); margin-inline: 2px; }
.daterow { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-end; }
.dates { display: flex; gap: 8px; flex-wrap: wrap; }
.dates label { display: grid; gap: 2px; font-size: 12px; color: var(--muted); font-weight: 500; }
.dates input { border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); padding: 5px 8px; font-size: 14px; color: var(--ink); min-width: 0; }
.selects { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.selects label { display: grid; gap: 2px; font-size: 12px; color: var(--muted); font-weight: 500; }
.selects select { border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); padding: 6px 8px; font-size: 14px; color: var(--ink); min-width: 0; }
.fbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; justify-content: space-between; }
.toggles { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; }
.toggles label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.toggles input { accent-color: var(--accent); width: 16px; height: 16px; }
.count { font-size: 14px; color: var(--ink-2); }
.count b { color: var(--ink); }
.linkbtn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 2px; font-size: 14px; }
/* the "More filters" toggle only (a direct child of .filters); dropdowns nested inside keep their own summary */
.filters > details > summary { cursor: pointer; font-size: 14px; color: var(--accent); list-style: none; }
.filters > details > summary::-webkit-details-marker { display: none; }
@media (min-width: 760px) { .filters > details > summary { display: none; } .filters > details > .selects { display: grid; } }
/* Phone filter folds (owner, Sept 28; site/_partials/folds.html opens/closes them): under 760 px the town chips, the
   date picks and Eat & Drink's place types collapse into dropdown rows "Towns · All towns ▾", and "More filters" is an
   outlined button with a count of the filters in use. Wider screens show the chips as before (summaries hidden). */
@media (max-width: 759px) {
  .filters { gap: 10px; }
  .filters > details.fold > summary, .filters > details#more > summary { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); font-size: 15px; color: var(--ink); list-style: none; cursor: pointer; }
  .filters > details.fold > summary::after, .filters > details#more > summary::after { content: "▾"; margin-left: auto; padding-left: 4px; color: var(--muted); flex: none; }
  .filters > details.fold[open] > summary::after, .filters > details#more[open] > summary::after { content: "▴"; }
  .filters > details.fold[open] > summary { border-color: var(--accent); }
  .fold-lbl { font: 600 13px var(--display); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); flex: none; }
  .fold-val { flex: 1; min-width: 0; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
  .filters > details.fold > .chips, .filters > details.fold > .daterow { margin-top: 10px; }
  .filters > details#more > summary { border: 1.5px solid var(--accent); color: var(--accent); font-weight: 600; gap: 8px; }
  .filters > details#more[open] > summary { background: var(--accent-soft); }
  .more-n { background: var(--accent); color: var(--accent-ink); border-radius: 999px; font-size: 12px; font-weight: 700; padding: 1px 8px; }
  .more-n[hidden] { display: none; }
  .filters > details#more > .selects { margin-top: 10px; }
}

.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }

/* ---------- Tabs ---------- */
.tabs { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 9px; padding: 3px; background: var(--surface); gap: 3px; }
.tab { border: 0; background: transparent; padding: 6px 14px; border-radius: 6px; cursor: pointer; font-weight: 500; white-space: nowrap; position: relative; }
.tab:hover:not([aria-selected="true"]) { background: var(--surface-2); }
/* thin divider between tabs, hidden next to the selected one */
.tab + .tab::before { content: ""; position: absolute; left: -2px; top: 22%; bottom: 22%; width: 1px; background: var(--line-strong); }
.tab[aria-selected="true"]::before, .tab[aria-selected="true"] + .tab::before, .tab:hover::before, .tab:hover + .tab::before { opacity: 0; }
@media (max-width: 400px) { .tab { padding: 6px 10px; } }
.tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }

/* ---------- Table ---------- */
/* results scroll inside their box; the column header row stays put */
.tablewrap { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: auto; max-height: min(72vh, 820px); overscroll-behavior: contain; }
table.ev thead th { position: sticky; top: 0; z-index: 2; }
table.ev { width: 100%; border-collapse: collapse; }
table.ev th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); padding: 0; white-space: nowrap; }
table.ev th button { all: unset; cursor: pointer; display: flex; align-items: center; gap: 4px; padding: 9px 12px; width: 100%; box-sizing: border-box; }
table.ev th button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
table.ev th .arr { font-size: 10px; opacity: .35; }
table.ev th[aria-sort] .arr { opacity: 1; color: var(--accent); }
table.ev td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
tr.row { cursor: pointer; }
tr.row:hover td { background: var(--surface-2); }
tr.row[aria-expanded="true"] td { background: var(--surface-2); border-bottom-color: transparent; }
.c-date { white-space: nowrap; width: 112px; }
.c-date .dd { font-family: var(--display); font-weight: 600; font-size: 16px; text-transform: uppercase; letter-spacing: .02em; }
.c-date .dw:not(:empty)::after { content: ", "; }
.vtown { display: none; }
.c-date .more { font-size: 12px; color: var(--muted); }
.c-title .tt { font-weight: 600; line-height: 1.3; }
.c-title .vv { color: var(--muted); font-size: 13px; margin-top: 2px; }
.star { color: var(--motif); font-size: 12px; font-weight: 600; margin-left: 6px; white-space: nowrap; }
.c-town { white-space: nowrap; }
.nearby { font-size: 11px; color: var(--muted); display: block; }
.cat { display: inline-block; font-size: 12px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 1px 8px; white-space: nowrap; color: var(--ink-2); }
.aud { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 13px; }
.aud .est { color: var(--muted); font-size: 11px; }
.price.free { font-weight: 600; color: var(--free-ink); }
.price.na { color: var(--muted); }
.c-time { color: var(--ink-2); font-size: 13px; min-width: 96px; max-width: 150px; }
tr.detail td { background: var(--surface-2); padding: 4px 12px 16px; }
.det { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px 28px; max-width: 1000px; }
@media (max-width: 760px) { .det { grid-template-columns: minmax(0, 1fr); } }
.det p { margin: 0 0 8px; max-width: 68ch; }
.det .note { border-left: 3px solid var(--motif); padding-left: 10px; color: var(--ink-2); font-size: 14px; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.datelist { display: flex; flex-wrap: wrap; gap: 4px; }
.datelist span { background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; font-size: 12px; }
.golink { display: inline-block; margin-top: 4px; font-weight: 600; }
.also { font-size: 13px; color: var(--muted); margin-top: 6px; }
.also a { margin-right: 8px; }
.sched { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* Mobile: table rows become cards */
@media (max-width: 760px) {
  table.ev thead { display: none; }
  table.ev, table.ev tbody { display: block; }
  tr.row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 2px 12px; padding: 12px; border-bottom: 1px solid var(--line); }
  tr.row td { display: block; padding: 0; border: 0; background: none !important; }
  tr.row .c-date { grid-row: 1 / span 4; width: auto; white-space: normal; }
  tr.row .c-date .dw { display: block; font-size: 13px; color: var(--muted); }
  tr.row .c-date .dw::after { content: none; }
  tr.row .c-date .dm { display: block; line-height: 1.1; }
  .vtown { display: inline; }
  tr.row .c-town, tr.row .c-cat, tr.row .c-aud, tr.row .c-price, tr.row .c-time { font-size: 13px; }
  tr.row .c-town { display: none; }
  tr.row .c-cat { display: none; }
  tr.row .c-time { display: none; }
  .mob-meta { display: flex !important; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; }
  tr.detail { display: block; }
  tr.detail td { display: block; padding: 12px; }
  tr.row[aria-expanded="true"] { background: var(--surface-2); }
}
.mob-meta { display: none; }

/* ---------- By town ---------- */
.towns { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 16px; align-items: start; }
@media (max-width: 400px) { .towns { grid-template-columns: minmax(0, 1fr); } }
.town { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.town-h { padding: 12px 14px; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.town-h h3 { font-size: 24px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.town-h h3 small { font-family: var(--body); font-size: 13px; font-weight: 500; color: var(--muted); text-transform: none; letter-spacing: 0; }
.mini { display: flex; gap: 2px; height: 6px; }
.mini i { display: block; height: 100%; }
.mini i:first-child { border-radius: 3px 0 0 3px; } .mini i:last-child { border-radius: 0 3px 3px 0; } .mini i:only-child { border-radius: 3px; }
.town ul { list-style: none; margin: 0; padding: 0; max-height: 440px; overflow-y: auto; overscroll-behavior: contain; }
.town li { border-bottom: 1px solid var(--line); }
.town li:last-child { border-bottom: 0; }
.town li button { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 10px; padding: 9px 14px; width: 100%; cursor: pointer; }
.town li button:hover { background: var(--surface-2); }
.town li button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.town .td { font-family: var(--display); font-weight: 600; font-size: 14px; text-transform: uppercase; line-height: 1.2; }
.town .td small { display: block; font-family: var(--body); font-weight: 400; text-transform: none; color: var(--muted); font-size: 12px; }
.town .tn { font-weight: 600; font-size: 14px; line-height: 1.3; }
.town .tm { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: center; margin-top: 2px; }
.town .tdesc { padding: 0 14px 12px 82px; font-size: 13px; color: var(--ink-2); }
.town .tdesc p { margin: 0 0 6px; }

/* ---------- Map ---------- */
.star-ink { color: var(--motif); }
.mapwrap { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
#map { height: min(68vh, 640px); min-height: 360px; background: var(--surface-2); }
.mapnote { margin: 8px 2px 0; font-size: 13px; color: var(--muted); }
#map .leaflet-popup-content-wrapper, #map .leaflet-popup-tip { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
#map .leaflet-popup-content { margin: 12px 14px; font: 14px/1.4 var(--body); }
#map .leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
#map .leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 85%, transparent); color: var(--muted); }
#map .leaflet-control-attribution a { color: var(--accent); }
#map .leaflet-bar a { background: var(--surface); color: var(--ink); border-bottom-color: var(--line); }
.pop h4 { margin: 0 0 2px; font: 600 16px/1.2 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.pop .pv { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.pop ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 240px; overflow: auto; }
.pop li { display: grid; gap: 1px; }
.pop .pd { font-size: 12px; color: var(--ink-2); }
.pop a { font-weight: 600; }
.pop .pmore { font-size: 12px; color: var(--muted); margin-top: 6px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); } }
:root[data-theme="dark"] #map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); }

/* ---------- Ongoing + footer ---------- */
.ongoing { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 10px; max-height: 440px; overflow-y: auto; overscroll-behavior: contain; padding: 2px 6px 2px 2px; align-content: start; }
.og { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 3px; font-size: 14px; }
.og .t { font-weight: 600; line-height: 1.3; }
.og .m { color: var(--muted); font-size: 13px; }
.og a { font-size: 13px; }
footer.site { border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: baseline; justify-content: space-between; font-size: 14px; color: var(--muted); }
footer.site nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
footer.site nav a { color: var(--ink-2); }
footer.site nav.townlinks { flex-basis: 100%; gap: 4px 12px; font-size: 13px; }
footer.site nav.townlinks span:first-child { color: var(--muted); }
/* Text pages: About, Privacy, Terms */
.page { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: clamp(18px, 3vw, 32px); display: grid; gap: 12px; }
.page h2 { font-size: 30px; }
.page h3 { font-family: var(--body); font-size: 17px; font-weight: 600; margin-top: 10px; }
.page p, .page li { max-width: 78ch; margin: 0; }
.page ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.page .updated { color: var(--muted); font-size: 13px; }
.page .srcs { padding-left: 0; }
.srcs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 6px 24px; margin: 0; padding: 0; list-style: none; }
.srcs li { border-bottom: 1px dotted var(--line-strong); padding: 4px 0; }
.method { display: grid; gap: 6px; max-width: 80ch; }
.about { display: grid; gap: 8px; max-width: 80ch; }
.about p { margin: 0; }
.method p { margin: 0; }
@media (prefers-reduced-motion: no-preference) { .mini i { transition: width .25s ease, background-color .25s ease; } }

/* Expanded-row actions: organizer link, calendar, directions, share (added Sept 28) */
.actrow { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; margin-top: 6px; }
.actrow .golink { margin-top: 0; }
.act { font: inherit; font-size: 13px; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.act:hover { color: var(--ink); }
.share-msg { font-size: 12px; color: var(--muted); min-height: 1em; margin-top: 2px; word-break: break-all; }
