/* Vancouver Community: an early-web bulletin board.
   Boxed panels, dense link lists, underlined links, Georgia headings, Verdana text. */

:root {
  --bg: #f6f4ee;
  --surface: #fffefb;
  --panel-head: #ebe6d9;
  --line: #d9d3c4;
  --line-soft: #e9e4d8;

  --ink: #2b2925;
  --ink-2: #4d4943;
  --ink-muted: #6b665d;

  --masthead: #2f4a3a;
  --masthead-deep: #263d30;
  --link: #2a5a85;
  --link-visited: #4f4f86;
  --link-hover: #1c3f5f;
  --success: #3f6e3e;
  --error: #b23a48;
  --overlay: rgba(43, 41, 37, 0.45);

  --hover-bg: #faf7ef;      /* hovered rows and cards, open ad boxes */
  --target-bg: #fbf3d5;     /* the card a #link points at */
  --field-border: #8a8370;  /* inputs, cream button edges, dropdown edges (3:1 on white) */
  --success-line: #b9cdb8;  /* Free badge border */
  /* Bevel edges: green buttons use light/dark, cream buttons use cream/field-border. */
  --bevel-light: #5f7d6c;
  --bevel-dark: #142219;
  --bevel-cream: #fffdf6;
  /* Dialogs, toasts and dropdowns: the same hard 2px offset as panels, a little darker. */
  --shadow-overlay: 2px 2px 0 rgba(43, 41, 37, 0.35);

  --serif: Georgia, 'Times New Roman', serif;
  --sans: Verdana, Geneva, sans-serif;
  --frame: 980px;
  --gutter: 16px;     /* page edge on phones */
  --panel-pad: 14px; /* every panel's inner left/right padding */

  /* Type scale: four sizes only. */
  /* In rem, so the reader's browser text-size setting is respected
     (12 / 14 / 17 / 28px at the default 16px). */
  --fs-sm: 0.75rem;     /* counts, notes, badges, breadcrumbs, dates */
  --fs-base: 0.875rem;  /* everything you read */
  --fs-lg: 1.0625rem;   /* group names, section headings */
  --fs-xl: 1.75rem;     /* page titles */

  /* 2px checkerboard, the GIF-era way to soften a line. */
  --dither: repeating-conic-gradient(#b9b19c 0 25%, transparent 0 50%);
}

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

html { scroll-padding-top: 16px; background: var(--surface); }
body {
  font-family: var(--sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  overflow-wrap: break-word;
}
body.modal-open { overflow: hidden; }
body.is-navigating { cursor: progress; }
[aria-busy="true"] { cursor: progress; }
::placeholder { color: var(--ink-muted); opacity: 1; }
/* Script moves focus to these after a page swap or a sent form (tabindex="-1").
   They aren't controls, so no ring. */
h1[tabindex="-1"]:focus, .edit-success-message:focus, .verify-toast-thanks:focus { outline: none; }

/* Full-page navigations crossfade (the meta tag in head.njk is the older opt-in). */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}

a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
a:visited { color: var(--link-visited); }
a:hover { color: var(--link-hover); }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; line-height: 1.25; color: var(--ink); text-wrap: balance; }

:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
/* The default blue ring vanishes on the green masthead (1.3:1); cream is 8.8:1 there. */
.masthead :focus-visible { outline-color: var(--bg); }

button { font-family: inherit; font-size: inherit; cursor: pointer; }

.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  z-index: 2000;
  background: var(--surface);
  color: var(--link);
  border: 1px solid var(--line);
  padding: 6px 12px;
}
.skip-link:focus { top: 8px; }

.frame { max-width: var(--frame); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Masthead and tabs ---------- */
.masthead { background: var(--masthead); color: #fff; }
/* The logo's scene, stretched along the bottom edge: stepped mountains and evergreens. */
.masthead::after {
  content: "";
  display: block;
  height: 24px;
  background: url("/treeline.svg") repeat-x left bottom / 384px 24px;
  image-rendering: pixelated;
}
/* Order in the bar: wordmark, then (inner pages) search, then Surprise me.
   The homepage hides the search and shows the tagline instead. */
.masthead-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  margin-right: auto;
  font-family: var(--serif);
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  text-decoration: none;
}
.wordmark:visited, .wordmark:hover { color: #fff; }
.wordmark-mark { width: 32px; height: 32px; flex: none; margin-right: 10px; image-rendering: pixelated; }
.wordmark-soft { color: #b9cbbf; margin-left: 0.25em; }
.wordmark-small .wordmark-soft { color: #5a7566; }
/* Right side of the masthead: what this is, how big it is, and Surprise me. */
.masthead-side { display: flex; align-items: center; gap: 20px; }
.masthead-tag { color: #b9cbbf; font-size: var(--fs-sm); white-space: nowrap; }
/* Surprise me is a quiet underlined link-button, so it doesn't compete with Search. */
.masthead-surprise {
  flex: none;
  padding: 6px 0;
  font-size: var(--fs-base);
  color: var(--bg);
  background: none;
  border: none;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.masthead-surprise:hover { color: #fff; text-decoration-thickness: 2px; }
.masthead-surprise:active { transform: translate(1px, 1px); }
/* Below 900px the tagline would wrap into a block; keep just the wordmark and Surprise me. */
@media (max-width: 899px) { .masthead-tag { display: none; } }
.tab-short { display: none; }

.tabs { background: var(--surface); border-bottom: 1px solid var(--line); }
.tabs-inner {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab {
  display: block;
  padding: 10px 0 8px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--link);
  font-size: var(--fs-base);
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.tab:visited { color: var(--link); }
.tab:hover { color: var(--link-hover); }
/* .tabs-inner scrolls sideways, which clips an outside ring: draw it inside. */
.tab:focus-visible { outline-offset: -2px; }
/* aria-current is "page" on the tab's own page and "true" anywhere inside its section. */
.tab[aria-current], .tabs-more-btn.is-current {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  border-bottom-color: var(--masthead);
}

/* ---------- Key/value tables (.details) ---------- */
.details { border-collapse: collapse; margin: 8px 0 4px; }
.details th, .details td { padding: 4px 0; text-align: left; vertical-align: baseline; }
.details th { padding-right: 16px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.details td { color: var(--ink-2); }
.details tr + tr th, .details tr + tr td { border-top: 1px solid var(--line-soft); }

/* ---------- Page layout ---------- */
.page { padding-top: 20px; padding-bottom: 32px; }
.columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  align-items: start;
}
.col-side { display: flex; flex-direction: column; gap: 16px; }
.col-main .panel + .panel { margin-top: 16px; }
/* Below 900px a 280px sidebar squeezes the listings; stack the columns instead. */
@media (max-width: 899px) {
  .columns { grid-template-columns: minmax(0, 1fr); }
}

.breadcrumbs { font-size: var(--fs-sm); color: var(--ink-muted); margin-bottom: 12px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; list-style: none; }
/* The separator is decoration: the empty alt text after the slash keeps screen readers quiet. */
.breadcrumbs li + li::before {
  content: "\203A";
  content: "\203A" / "";
  padding: 0 6px;
}
.breadcrumb-current { color: var(--ink-2); }

/* Title, lede and guide link sit 8px apart; 16px separates them from the panels. */
.page-title { font-size: var(--fs-xl); margin-bottom: 8px; }
.page-lede { font-size: var(--fs-base); color: var(--ink-2); margin-bottom: 16px; }
.page-lede:has(+ .page-guide) { margin-bottom: 8px; }
.page-guide { margin-bottom: 16px; }
.page-guide a { font-weight: 700; }

.link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-button:hover:not(:disabled) { color: var(--link-hover); }
.link-button[aria-pressed="true"] { font-weight: 700; }

/* ---------- Buttons ---------- */
/* Cream bevel: secondary buttons (search, sponsor, sister site, verify). */
.search-btn,
.verify-btn,
.sponsor a.sponsor-btn, .sponsor a.sponsor-btn:visited, .sponsor span.sponsor-btn,
.mutuals-promo a.mutuals-promo-btn, .mutuals-promo a.mutuals-promo-btn:visited {
  display: inline-block;
  padding: 6px 12px;
  font-family: var(--sans);
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--ink);
  background: var(--panel-head);
  border: 1px solid;
  border-color: var(--bevel-cream) var(--field-border) var(--field-border) var(--bevel-cream);
  border-radius: 2px;
  box-shadow: 1px 1px 0 var(--ink-muted);
  text-decoration: none;
  cursor: pointer;
}
.search-btn:hover:not(:disabled),
.verify-btn:hover:not(:disabled),
.sponsor a.sponsor-btn:hover,
.mutuals-promo a.mutuals-promo-btn:hover { color: var(--ink); background: var(--hover-bg); }

/* Green bevel: the main action on a page or form. */
.form-submit, .newsletter-btn, .verify-btn.verify-btn-send, .surprise-go,
.search-btn.search-btn-primary,
.group-modal a.group-modal-visit, .group-modal a.group-modal-visit:visited {
  display: inline-block;
  padding: 6px 12px;
  font-family: var(--sans);
  font-size: var(--fs-base);
  font-weight: 700;
  color: #fff;
  background: var(--masthead);
  border: 1px solid;
  border-color: var(--bevel-light) var(--bevel-dark) var(--bevel-dark) var(--bevel-light);
  border-radius: 2px;
  box-shadow: 1px 1px 0 var(--bevel-dark);
  text-decoration: none;
  cursor: pointer;
}
.form-submit:hover:not(:disabled), .newsletter-btn:hover:not(:disabled),
.verify-btn.verify-btn-send:hover:not(:disabled), .surprise-go:hover,
.search-btn.search-btn-primary:hover:not(:disabled),
.group-modal a.group-modal-visit:hover { color: #fff; background: var(--masthead-deep); }
.surprise-go:visited { color: #fff; }

/* Pressed: every bevelled button sinks 1px into its shadow. */
.search-btn:active:not(:disabled), .verify-btn:active:not(:disabled),
.sponsor a.sponsor-btn:active, .mutuals-promo a.mutuals-promo-btn:active,
.form-submit:active:not(:disabled), .newsletter-btn:active:not(:disabled), .surprise-go:active,
.group-modal a.group-modal-visit:active {
  transform: translate(1px, 1px);
  box-shadow: none;
}
/* Disabled, or busy sending (aria-disabled keeps the button focusable): faded, no hover. */
.search-btn:disabled, .verify-btn:disabled,
.form-submit:disabled, .newsletter-btn:disabled { opacity: 0.5; cursor: default; }
.form-submit[aria-disabled="true"], .newsletter-btn[aria-disabled="true"],
.form-submit[aria-disabled="true"]:hover, .newsletter-btn[aria-disabled="true"]:hover {
  opacity: 0.5;
  background: var(--masthead);
  cursor: progress;
}
.form-submit[aria-disabled="true"]:active, .newsletter-btn[aria-disabled="true"]:active {
  transform: none;
  box-shadow: 1px 1px 0 var(--bevel-dark);
}
.search-btn[aria-busy="true"], .verify-btn[aria-busy="true"],
.form-submit[aria-busy="true"], .newsletter-btn[aria-busy="true"] { cursor: progress; }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); box-shadow: 2px 2px 0 var(--line); }
.panel-title {
  font-family: var(--sans);
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--masthead);
  background: var(--panel-head);
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--bevel-cream);
  padding: 6px var(--panel-pad);
}
.panel-body { padding: 10px var(--panel-pad); }
.panel-body > p + p, .panel-body > p + form, .panel-body > form + * { margin-top: 8px; }
.panel-note { font-size: var(--fs-sm); color: var(--ink-muted); }
.panel-links { font-size: var(--fs-base); margin-top: 10px; }

.link-list { list-style: none; }
.link-list li { padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.link-list li:first-child { padding-top: 0; }
.link-list li:last-child { border-bottom: none; padding-bottom: 0; }
.link-list-note { display: block; font-size: var(--fs-sm); color: var(--ink-muted); }
.link-list-tight li { padding: 4px 0; border-bottom: none; }

.count { color: var(--ink-muted); font-size: var(--fs-sm); }

/* ---------- Homepage directory ---------- */
.search { display: flex; gap: 6px; max-width: 520px; margin-bottom: 6px; }
.search .search-input { flex: 1; min-width: 0; max-width: none; }
.search-btn { flex: none; }
.search-popular { font-size: var(--fs-sm); color: var(--ink-muted); margin-bottom: 16px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}
.note-photo { float: left; width: 56px; height: 56px; object-fit: cover; margin: 2px 10px 4px 0; border: 1px solid var(--line); image-rendering: auto; }
.note::after { content: ""; display: block; clear: both; }
.search-input {
  width: 100%;
  max-width: 480px;
  padding: 6px 8px;
  font-family: var(--sans);
  font-size: var(--fs-base);
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--field-border);
  border-radius: 2px;
}

/* Sections sit in a grid, not CSS columns, so opening one "+N more" only
   grows its own row instead of reflowing every section. */
.directory {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  column-gap: 24px;
  align-items: start;
}
.directory-group { padding-bottom: 14px; min-width: 0; }
/* The 2px dither under section headings (and under "New lists"). */
.directory-heading, .directory-new {
  background: var(--dither) left bottom / 4px 2px repeat-x;
}
.directory-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-base);
  padding-bottom: 4px;
  margin-bottom: 4px;
}
.pixel-icon { width: 16px; height: 16px; flex: none; image-rendering: pixelated; }
.directory-list { list-style: none; }
.directory-list li { padding: 2px 0; }

/* ---------- Homepage directory: "+N more" and "Just added" ---------- */
/* The <summary> reads as a plain underlined link; the native toggle keeps it keyboard-accessible. */
.directory-more > summary {
  display: inline-block;
  padding: 2px 0;
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  list-style: none;
}
.directory-more > summary::-webkit-details-marker { display: none; }
.directory-more > summary::marker { content: ""; }
.directory-more > summary:hover { color: var(--link-hover); }
.directory-more-open,
.directory-more[open] .directory-more-closed { display: none; }
.directory-more[open] .directory-more-open { display: inline; }

.directory-new {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
}
.directory-new-title { font-size: var(--fs-base); }
.directory-new-list { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; }

.search-results { margin-bottom: 16px; }
.search-results-grid { background: var(--surface); border: 1px solid var(--line); }
.search-result-card {
  display: block;
  padding: 12px var(--panel-pad);
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
}
.search-result-card:last-child { border-bottom: none; }
.search-result-card:hover { background: var(--hover-bg); }
.search-result-card:hover .search-result-name { color: var(--link-hover); }
.search-result-name { display: block; text-decoration: underline; text-underline-offset: 2px; }
.search-result-desc { display: block; font-size: var(--fs-base); color: var(--ink-2); }
.search-result-cat { display: block; font-size: var(--fs-sm); color: var(--ink-muted); }
.search-empty { padding: 10px var(--panel-pad); background: var(--surface); border: 1px solid var(--line); }
/* Clickable cards sink to the title-bar colour while pressed. */
.search-result-card:active, .start-group-card:active,
.group-card:has(.group-card-link):active { background: var(--panel-head); }

/* ---------- Category entries ---------- */
.category-entries { padding: 0; }
.category-entries > p, .category-entries > ul, .category-entries > h3 { padding: 0 var(--panel-pad); }
.category-entries > p { margin: 10px 0; }
.category-entries hr { border: none; border-top: 1px solid var(--line); margin: 0; }
.category-entries > ul { margin: 0 0 10px 20px; }
/* List footer: share, suggest an edit, view count. */
.category-entries > .panel-body > :first-child { margin-top: 0; }

/* A note from me inside a list (e.g. runclubs.ca on Run Clubs): the same dashed box as an open ad slot. */
.category-banner {
  margin: 12px var(--panel-pad);
  padding: 10px 12px;
  background: var(--hover-bg);
  border: 1px dashed #b9b19c;
  font-size: var(--fs-base);
}

.group-card {
  position: relative;
  padding: 14px var(--panel-pad);
  border-bottom: 1px solid var(--line-soft);
}
.group-card:hover { background: var(--hover-bg); }
.group-card-header { display: flex; align-items: baseline; gap: 8px; }
.group-card h3 { flex: 1; min-width: 0; font-family: var(--serif); font-size: var(--fs-lg); font-weight: 700; color: var(--ink); }
.group-card h3 a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.group-card:hover h3 a { color: var(--link-hover); }
.group-card-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; margin-top: 2px; color: var(--ink-2); }
.group-card-when { font-weight: 700; color: var(--ink); }
.group-card-where, .group-card-size { color: var(--ink-2); }
.group-card-sep { color: var(--ink-muted); }
.group-card-badge {
  font-size: var(--fs-sm);
  color: var(--success);
  border: 1px solid var(--success-line);
  padding: 0 4px;
  line-height: 1.5;
}
.group-card-desc { color: var(--ink-2); line-height: 1.6; margin-top: 4px; }
.group-card-note { margin-top: 4px; font-size: var(--fs-sm); color: var(--ink-muted); }
/* The card a #link points at: a yellow wash plus a 2px rule, so it doesn't rely on colour alone. */
.group-card:target, .group-card.is-target { background: var(--target-bg); outline: 2px solid var(--masthead); outline-offset: -2px; }

/* Group card: When and Cost tags, and the Share link.
   Tags are plain boxes like the Free badge, in ink colours.
   Share sits at the right end of the name row, in muted ink so the name stays the link people see. */
.group-card-tag {
  font-size: var(--fs-sm);
  color: var(--ink-2);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 0 4px;
  line-height: 1.5;
}
.group-card-share, .group-card-share:visited {
  flex: none;
  font-size: var(--fs-sm);
  white-space: nowrap;
  color: var(--ink-muted);
}
.group-card-share:hover, .group-card-share:visited:hover { color: var(--link-hover); }

/* Section headings inside a category file (e.g. "Venues & Resources").
   Same side padding as the cards, so the heading lines up with the names under it. */
.category-entries > h2 {
  font-family: var(--sans);
  font-size: var(--fs-base);
  background: var(--panel-head);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 6px var(--panel-pad);
  margin-top: -1px;
}

/* ---------- Shared content pieces ---------- */
.prose { line-height: 1.7; }
.prose > * + * { margin-top: 12px; }
.prose h2 { font-size: var(--fs-lg); margin-top: 24px; }
.prose h3 { font-size: var(--fs-base); margin-top: 20px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose h2 .anchor { display: none; }
.category-entries h2 .anchor { display: none; }
.profile-photo { display: block; width: 120px; border: 1px solid var(--line); margin-bottom: 8px; }

/* ---------- Forms ---------- */
.form { max-width: 620px; }
.edit-modal .form { padding: 12px var(--panel-pad) 14px; }
.form-field { margin-bottom: 12px; }
.form-note { font-size: var(--fs-sm); color: var(--ink-muted); margin-bottom: 10px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-label { display: block; font-size: var(--fs-base); font-weight: 700; margin-bottom: 4px; }
.form-input, .newsletter-input, .verify-detail-input {
  width: 100%;
  padding: 6px 8px;
  font-family: var(--sans);
  font-size: var(--fs-base);
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--field-border);
  border-radius: 2px;
}
textarea.form-input { resize: vertical; }
.form-status { display: inline-block; margin-left: 8px; font-size: var(--fs-base); color: var(--ink-muted); }
.form-status.success { color: var(--success); }
.form-status.error { color: var(--error); }

.newsletter-form { display: flex; gap: 6px; }
.newsletter-input { flex: 1; min-width: 0; }
.newsletter-status { display: block; font-size: var(--fs-sm); color: var(--ink-muted); }
.newsletter-status:empty { display: none; }
.newsletter-status.success { color: var(--success); }
.newsletter-status.error { color: var(--error); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--dither) left top / 4px 2px repeat-x, var(--surface);
  padding: 20px 0 28px;
  font-size: var(--fs-base);
  color: var(--ink-muted);
}
.wordmark-small { font-size: var(--fs-lg); color: var(--masthead); }
.wordmark-small:visited, .wordmark-small:hover { color: var(--masthead); }
.site-footer-line { margin: 4px 0 10px; }
.site-footer-links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 10px; }

/* The hit counter: an old-web odometer, one boxed digit per place. */
.hit-counter { margin-top: 8px; font-size: var(--fs-sm); }
.odometer { display: inline-flex; gap: 1px; margin-left: 4px; vertical-align: middle; }
.odometer span {
  display: inline-block;
  min-width: 13px;
  padding: 1px 2px;
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: var(--fs-base);
  line-height: 1.2;
  text-align: center;
  color: #e4a84b;
  background: #1e2f25;
  border: 1px solid;
  border-color: #000 #4d6b5b #4d6b5b #000;
}

/* ---------- Dialog close buttons (edit, surprise, group detail) ---------- */
.edit-modal-close, .surprise-close, .group-modal-close {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: var(--fs-lg);
  line-height: 1;
  color: var(--ink-muted);
  background: none;
  border: none;
}
.edit-modal-close:hover, .surprise-close:hover, .group-modal-close:hover { color: var(--ink); background: var(--hover-bg); }
.edit-modal-close:focus-visible, .surprise-close:focus-visible, .group-modal-close:focus-visible { outline-offset: -2px; }

/* ---------- Edit modal ---------- */
.edit-modal { display: none; position: fixed; inset: 0; background: var(--overlay); z-index: 1000; overflow: auto; }
.edit-modal-inner {
  position: relative;
  max-width: 520px;
  margin: 64px auto;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-overlay);
}
.edit-modal-title {
  font-family: var(--sans);
  font-size: var(--fs-base);
  color: var(--masthead);
  background: var(--panel-head);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  min-height: 36px; /* the close button's height, so the x sits centred in the bar */
  padding: 6px 40px 6px var(--panel-pad);
}
.edit-modal-desc { padding: 10px var(--panel-pad) 0; color: var(--ink-2); }
.edit-success-message { color: var(--success); font-weight: 700; margin-bottom: 8px; }

/* ---------- Surprise modal ---------- */
.surprise-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--overlay);
  opacity: 0;
  transition: opacity 0.15s;
}
.surprise-modal.visible { opacity: 1; }
.surprise-modal-inner {
  position: relative;
  max-width: 380px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-overlay);
  padding: 16px;
}
.surprise-label { font-size: var(--fs-sm); color: var(--ink-muted); padding-right: 24px; }
.surprise-name { font-family: var(--serif); font-size: var(--fs-lg); font-weight: 700; margin: 2px 0 6px; }
.surprise-desc { color: var(--ink-2); }
.surprise-cat { font-size: var(--fs-sm); color: var(--ink-muted); margin-top: 6px; }
.surprise-actions { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.surprise-again { padding: 6px 0; background: none; border: none; color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.surprise-again:hover { color: var(--link-hover); }

/* ---------- Verify toast ---------- */
.verify-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 900;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.verify-toast.visible { opacity: 1; transform: none; pointer-events: auto; }
.verify-toast-inner {
  max-width: 340px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-overlay);
  padding: 12px;
}
.verify-toast-question { margin-bottom: 10px; }
.verify-toast-subtitle { font-size: var(--fs-sm); color: var(--ink-muted); margin-bottom: 10px; }
.verify-toast-actions, .verify-toast-detail { display: flex; gap: 6px; align-items: center; }
/* .verify-btn takes the cream bevel (see Buttons); Send takes the green one. */
.verify-btn.verify-btn-dismiss {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  font-size: var(--fs-lg);
  font-weight: 400;
  color: var(--ink-muted);
  background: none;
  border: none;
  box-shadow: none;
}
.verify-btn.verify-btn-dismiss:hover { color: var(--ink); background: var(--hover-bg); }
.verify-btn.verify-btn-dismiss:active { transform: none; }
.verify-toast-thanks { color: var(--success); font-weight: 700; }
.verify-toast-funnel { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-soft); font-size: var(--fs-base); }

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  :root { --panel-pad: var(--gutter); --fs-xl: 1.5rem; }
  .masthead-inner { min-height: 52px; gap: 10px; }
  .wordmark { font-size: var(--fs-lg); }
  /* Every tab fits: shorter labels, and Blog and About move under "More".
     The row may wrap on the narrowest phones rather than run off the edge. */
  .tabs-inner { flex-wrap: wrap; gap: 0 18px; overflow: visible; }
  .tab-wide-only, .tab-long { display: none; }
  .tab-short { display: inline; }
  .tab { padding: 8px 0 6px; }

  /* Roomier tap targets for list links (about 32px rows instead of 22px). */
  .directory-list li, .link-list-tight li { padding: 0; }
  .directory-more > summary { padding: 6px 0; }
  .directory-list a, .directory-new-list a, .link-list-tight a, .link-list a, .site-footer-links a,
  .search-popular a, .post-toc a, .sponsor-open-link { display: inline-block; padding: 6px 0; }
  /* Links inside running text: vertical padding on an inline box grows the tap area
     without moving the lines around it. */
  .breadcrumbs a, .panel-links a, .page-guide a, .group-card-where a { padding-top: 6px; padding-bottom: 6px; }
  /* Buttons are inline blocks, so a negative margin takes the padding back out of the layout. */
  .link-button { padding: 6px 0; margin: -6px 0; }
  .mutuals-promo-compact .mutuals-promo-link { padding: 6px 0; }
  .group-card-share { padding: 6px 0; }

  /* Panels run edge to edge in both columns to give text the full width. */
  .col-main .panel, .col-main > .mutuals-promo,
  .col-side .panel, .col-side > .mutuals-promo {
    margin-left: calc(-1 * var(--gutter));
    margin-right: calc(-1 * var(--gutter));
    border-left: none;
    border-right: none;
  }
  .search-input { max-width: none; }
  /* 16px text in fields stops iOS Safari zooming the page on focus
     (the one place type leaves the four-size scale). */
  .search-input, .form-input, .newsletter-input, .verify-detail-input { font-size: 1rem; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 389px) {
  .masthead .wordmark-mark { display: none; }
}
@media (max-width: 339px) {
  .masthead .wordmark-soft { display: none; }
}

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

/* =====================================================================
   Components from main: promos, sponsor slots, the group detail modal,
   blog contents, and the older page templates (free, neighbourhoods,
   newsletter, advertise). They reuse the panel look so every page
   reads the same.
   ===================================================================== */

/* ---------- mutuals promo (copy in _data/mutuals.js) ---------- */
.mutuals-promo {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 2px 2px 0 var(--line);
}
.col-main > .mutuals-promo { margin-top: 16px; }
.mutuals-promo-label {
  font-family: var(--sans);
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--masthead);
  background: var(--panel-head);
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--bevel-cream);
  padding: 6px var(--panel-pad);
  margin: 0;
}
.mutuals-promo-main { padding: 12px var(--panel-pad) 0; }
/* A small lockup in mutuals' own brand: the four-dot mark and lowercase wordmark. */
.mutuals-promo-brand { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: var(--fs-base); color: #3d312c; margin-bottom: 6px; }
.mutuals-promo-brand a { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; }
.mutuals-promo-brand a:hover .mutuals-promo-wordmark { text-decoration: underline; text-underline-offset: 2px; }
.mutuals-mark { width: 16px; height: 16px; fill: #3d312c; flex: none; }
.mutuals-promo-tld { font-weight: 400; color: var(--ink-muted); margin-left: -6px; }
.mutuals-promo .mutuals-promo-heading { font-size: var(--fs-lg); margin: 0 0 6px; }
.mutuals-promo-body { color: var(--ink-2); margin-bottom: 6px; }
.mutuals-promo-steps { margin: 0 0 4px; padding-left: 20px; color: var(--ink-2); }
.mutuals-promo-steps li { padding: 2px 0; }
.mutuals-promo-steps li::marker { font-weight: 700; color: var(--masthead); }
.mutuals-promo-action { padding: 8px var(--panel-pad) 12px; }
/* The button takes the cream bevel (see Buttons): the sister site is a secondary action. */
.mutuals-promo-price { font-size: var(--fs-sm); color: var(--ink-muted); margin-top: 6px; }
/* compact variant: the label (inside the paragraph) becomes the title bar */
.mutuals-promo-compact { padding-bottom: 12px; }
.mutuals-promo-compact .mutuals-promo-text { margin: 0; padding: 0 var(--panel-pad); color: var(--ink-2); }
.mutuals-promo-compact .mutuals-promo-label { display: block; margin: 0 calc(-1 * var(--panel-pad)) 8px; }
.mutuals-promo-compact .mutuals-promo-link { display: inline-block; margin: 6px var(--panel-pad) 0; }
.col-main > .mutuals-promo-compact { margin-top: 16px; }

/* ---------- banner ads (partial: banner.njk) ---------- */
.banner { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.banner-label { line-height: 1; }
.banner-link { display: block; border: 1px solid var(--line); box-shadow: 2px 2px 0 var(--line); line-height: 0; }
.banner-link:hover { border-color: var(--field-border); }
.banner-link:focus-visible { outline-offset: 2px; }
.banner img { display: block; width: 100%; height: auto; }
.banner-wide { margin: 12px 0; }
.category-entries > .banner-wide { margin: 0; padding: 12px var(--panel-pad); border-bottom: 1px solid var(--line-soft); }
.banner-wide .banner-link { width: 100%; max-width: 600px; }
.banner-box .banner-link { width: 100%; max-width: 300px; }

/* ---------- sponsor slots (partial: sponsor-card.njk) ---------- */
.sponsor-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sponsor-tag {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink-muted);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0 4px;
  line-height: 1.5;
}
.sponsor-name { font-family: var(--serif); font-size: var(--fs-lg); font-weight: 700; line-height: 1.3; }
.sponsor-where { font-size: var(--fs-sm); color: var(--ink-muted); }
.sponsor-desc { color: var(--ink-2); margin-top: 4px; }
/* The button takes the cream bevel (see Buttons): clearly a button, but quieter than green. */
.sponsor .sponsor-btn { margin-top: 10px; }
/* Open slot: a dashed "your ad here" box, like a classified waiting to be filled */
.sponsor-open-box { border: 1px dashed #b9b19c; background: var(--hover-bg); padding: 10px 12px; }
.sponsor-open .sponsor-name { color: var(--ink-2); }
.sponsor-open-link { display: inline-block; margin-top: 6px; }
.col-main > .sponsor, .col-main .sponsor + .panel, .page-content > .sponsor, .start-here-content > .sponsor { margin-bottom: 16px; }
.page-sponsor { max-width: var(--frame); margin: 0 auto 32px; padding: 0 var(--gutter); }
.page-sponsor .sponsor { max-width: 640px; }

/* ---------- group detail modal (built in main.js) ---------- */
.group-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.group-modal.visible { opacity: 1; pointer-events: auto; }
.group-modal-inner {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-overlay);
  padding: 14px var(--panel-pad) 16px;
}
/* The dialog itself takes focus on open (tabindex="-1"); its controls keep their rings. */
.group-modal:focus { outline: none; }
/* .group-modal-close: see "Dialog close buttons". */
.group-modal-cat { font-size: var(--fs-sm); }
.group-modal-name { font-size: var(--fs-lg); margin: 4px 0 6px; padding-right: 32px; }
.group-modal-badge {
  display: inline-block;
  font-size: var(--fs-sm);
  color: var(--success);
  border: 1px solid var(--success-line);
  padding: 0 4px;
  margin-bottom: 6px;
}
.group-modal-badge:empty { display: none; }
.group-modal-desc { color: var(--ink-2); }
.group-modal-where { font-size: var(--fs-sm); color: var(--ink-muted); margin-top: 6px; }
.group-modal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; }
/* .group-modal-visit takes the green bevel (see Buttons). */
[data-group] { cursor: pointer; }

/* ---------- blog: "On this page" ---------- */
.post-toc ol { list-style: decimal; padding-left: calc(var(--panel-pad) + 18px); }
.post-toc li { padding: 2px 0; }
.post-toc[hidden] { display: none; }

/* ---------- older page templates (free, neighbourhoods, newsletter, advertise) ---------- */
.cat-hero, .start-hero-wrap, .prose-hero-wrap { max-width: var(--frame); margin: 0 auto; padding: 20px var(--gutter) 0; }
.cat-hero .start-hero-wrap, .cat-hero .prose-hero-wrap { padding: 0; }
.cat-title { font-size: var(--fs-xl); margin-bottom: 8px; }
.cat-desc { color: var(--ink-2); margin-bottom: 4px; }
.page-content, .start-here-content { max-width: var(--frame); margin: 16px auto 32px; padding: 0 var(--gutter); }
.prose-content { line-height: 1.7; }
.prose-content > * + * { margin-top: 12px; }
.prose-content h2 { font-size: var(--fs-lg); margin-top: 24px; }
.prose-content ul, .prose-content ol { padding-left: 22px; }
.prose-content h2 .anchor { display: none; }

.start-section, .related-cats {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 2px 2px 0 var(--line);
  margin-bottom: 16px;
}
.start-section-title, .hp-section-title {
  font-family: var(--sans);
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--masthead);
  background: var(--panel-head);
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--bevel-cream);
  padding: 6px var(--panel-pad);
}
.start-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); padding: 4px 0; }
.start-group-card { display: block; padding: 8px var(--panel-pad); text-decoration: none; }
.start-group-card:hover { background: var(--hover-bg); }
.start-group-card:hover .start-group-name { color: var(--link-hover); }
.start-group-name { display: block; text-decoration: underline; text-underline-offset: 2px; }
.start-group-desc { display: block; font-size: var(--fs-sm); color: var(--ink-muted); }
.start-browse-more { margin: 4px 0 0; }
.start-browse-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 4px; }

.hood-cat { margin-top: 20px; }
.hood-group-list { list-style: none; padding: 0; }
.hood-group-list li { padding: 3px 0; }
.hood-other { margin-top: 20px; color: var(--ink-muted); }

.newsletter-page-signup {
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 2px 2px 0 var(--line);
  padding: 12px var(--panel-pad);
}
.newsletter-page-note { font-size: var(--fs-sm); color: var(--ink-muted); }

/* ---------- advertise page: each offer is a panel ---------- */
.advertise-stats { margin-top: 10px; }
.advertise-tier .panel-body > * + * { margin-top: 10px; }
.advertise-price { font-family: var(--serif); font-size: var(--fs-lg); font-weight: 700; }
.advertise-price span { font-family: var(--sans); font-size: var(--fs-sm); font-weight: 400; color: var(--ink-muted); margin-left: 4px; }
/* Examples of each placement, at the size they show on the site. */
.advertise-figure figcaption { margin-top: 6px; max-width: 600px; }
.advertise-figure .sponsor { max-width: 380px; }
/* The example card sits inside a panel: keep its own border on phones. */
.advertise-figure .panel { margin-left: 0; margin-right: 0; border: 1px solid var(--line); }
.advertise-banner-demo {
  display: flex; justify-content: center; align-items: center;
  width: 100%;
  border: 1px dashed #b9b19c; background: #faf7ef; color: var(--ink-muted);
  font-family: var(--serif); font-weight: 700;
}
.advertise-banner-wide { max-width: 600px; aspect-ratio: 4 / 1; }
.advertise-banner-box { max-width: 300px; aspect-ratio: 6 / 5; }
/* Same cream bevel as the sponsor card's button. */
a.advertise-cta, a.advertise-cta:visited {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 12px;
  font-weight: 700;
  color: var(--ink);
  background: #ebe6d9;
  border: 1px solid;
  border-color: #fffdf6 #8a8370 #8a8370 #fffdf6;
  border-radius: 2px;
  box-shadow: 1px 1px 0 #6b665d;
  text-decoration: none;
}
a.advertise-cta:hover { background: #f3efe4; }
a.advertise-cta:active { transform: translate(1px, 1px); box-shadow: none; }
.prose-content .panel-title, .prose .panel-title { margin-top: 0; }

/* =====================================================================
   Site-wide search and the "More" tab (partial: topbar.njk, JS: main.js)
   ===================================================================== */

/* ---------- masthead search: every page but the homepage ---------- */
/* On inner pages the search takes the tagline's place, before Surprise me;
   its placeholder carries the group count. */
.masthead-search { position: relative; flex: 0 1 300px; min-width: 0; }
.homepage .masthead-search { display: none; }
body:not(.homepage) .masthead-tag { display: none; }
.masthead-search-form { display: flex; gap: 6px; }
.masthead-search-input { flex: 1; min-width: 0; max-width: none; }
.masthead-search-btn { flex: none; }

/* The results drop down under the box, over the page. */
.masthead-search-panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 60;
  width: min(440px, calc(100vw - 2 * var(--gutter)));
  max-height: min(70vh, 560px);
  overflow-y: auto;
  color: var(--ink);
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--field-border);
  box-shadow: var(--shadow-overlay);
}
.masthead-search-panel[hidden] { display: none; }
.masthead-search-panel .search-results-grid,
.masthead-search-panel .search-empty { border: none; }
/* Undo the masthead's cream focus ring: the panel is cream too. Inset so the
   scrolling panel can't clip it. */
.masthead-search-panel :focus-visible { outline-color: var(--link); outline-offset: -3px; }

/* ---------- "Show all N" (homepage and masthead results) ---------- */
.search-more {
  display: block;
  width: 100%;
  padding: 10px var(--panel-pad);
  text-align: left;
  font-weight: 700;
  color: var(--link);
  background: var(--panel-head);
  border: none;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.search-more:hover { color: var(--link-hover); }
.search-more:focus-visible { outline-offset: -3px; }

/* ---------- "More" tab: Blog and About on phones ---------- */
.tabs-more { display: none; position: relative; }
.tabs-more-btn { line-height: inherit; }
/* Open: plain ink with a grey rule, so it reads as pressed but not as the current section. */
.tabs-more-btn[aria-expanded="true"] { color: var(--ink); text-decoration: none; border-bottom-color: var(--field-border); }
.tabs-more-btn.is-current[aria-expanded="true"] { border-bottom-color: var(--masthead); }
.tabs-more-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 50;
  min-width: 140px;
  list-style: none;
  padding: 4px 0;
  background: var(--surface);
  border: 1px solid var(--field-border);
  box-shadow: var(--shadow-overlay);
}
.tabs-more-menu[hidden] { display: none; }
.tabs-more-menu a { display: block; padding: 8px var(--panel-pad); }
.tabs-more-menu a[aria-current] { color: var(--ink); font-weight: 700; text-decoration: none; }

@media (max-width: 760px) {
  /* The search gets its own row under the wordmark and Surprise me. */
  .masthead-inner { flex-wrap: wrap; row-gap: 8px; }
  body:not(.homepage) .masthead-inner { padding-top: 8px; padding-bottom: 10px; }
  /* order moves it under the first row; in the DOM (and Tab order) it still comes before Surprise me. */
  .masthead-search { flex: 1 1 100%; order: 1; }
  .masthead-search-panel { left: 0; right: 0; width: auto; max-height: 60vh; }

  .tabs-more { display: block; }
}
@media (max-width: 389px) {
  .tabs-inner { column-gap: 14px; }
}

/* ==========================================================================
   Motion. A bulletin board you can touch: cards are paper, pins press in,
   the hit counter rolls. Feedback 100–150ms, state 200–300ms, the Surprise
   pin ~450ms. Easing decelerates, never bounces. Spatial movement lives in
   the no-preference block; reduced motion keeps colour and opacity changes.
   ========================================================================== */
:root { --ease-out: cubic-bezier(0.16, 1, 0.3, 1); }

/* Browser surfaces carry the palette too */
::selection { background: var(--target-bg); color: var(--ink); }
html { scrollbar-color: var(--field-border) var(--bg); }
input, textarea { caret-color: var(--masthead); }

/* Links: the underline thickens instead of jumping colour alone */
a, .link-button, .surprise-again, .tab {
  transition: color 0.12s, text-decoration-color 0.12s, text-decoration-thickness 0.12s;
}
.group-card h3 a { transition: color 0.12s, text-decoration-thickness 0.12s, text-underline-offset 0.15s var(--ease-out); }
.group-card:hover h3 a { text-decoration-thickness: 2px; text-underline-offset: 4px; }
.group-card { transition: background-color 0.15s; }
.group-card:active { background: var(--panel-head); }

/* Copied / sent: the label turns green as it changes */
.is-flashed { color: var(--success) !important; }

/* Success messages arrive instead of appearing */
.form-status.success, .newsletter-status.success, .edit-success, .verify-toast-thanks {
  animation: vc-arrive 0.25s var(--ease-out) both;
}
@keyframes vc-arrive { from { opacity: 0; } to { opacity: 1; } }

/* Hit counter: each digit is a strip of 0–9 that rolls up to its value */
.odometer span.odo-digit { position: relative; overflow: hidden; height: calc(1.2em + 4px); }
.odometer .odo-strip { display: block; min-width: 0; padding: 0; border: 0; background: none; }
.odo-strip i { display: block; font-style: normal; height: 1.2em; }
.odometer.is-rolled .odo-strip { transform: translateY(calc(var(--d) * -1.2em)); }

@media (prefers-reduced-motion: no-preference) {
  /* Surprise me: the group lands like an index card pinned to the board */
  .surprise-modal-inner { animation: vc-pin-drop 0.45s var(--ease-out) both; transform-origin: 50% 0; }
  .surprise-modal-inner::before {
    content: "";
    position: absolute;
    top: -7px;
    left: 50%;
    width: 14px;
    height: 14px;
    margin-left: -7px;
    border-radius: 50%;
    background: #b23a48;
    box-shadow: inset -2px -2px 0 rgba(0, 0, 0, 0.25), 1px 2px 0 var(--line);
    animation: vc-pin-press 0.2s 0.32s var(--ease-out) both;
  }
  .surprise-modal.no-fade { transition: none; }
  @keyframes vc-pin-drop {
    from { opacity: 0; transform: translateY(-24px) rotate(-4deg); }
    70% { opacity: 1; }
    to { opacity: 1; transform: none; }
  }
  @keyframes vc-pin-press {
    from { opacity: 0; transform: scale(1.8) translateY(-6px); }
    to { opacity: 1; transform: none; }
  }

  /* Arriving from a shared link: a highlighter sweeps across the card */
  .group-card:target, .group-card.is-target {
    background-color: var(--surface);
    background-image: linear-gradient(var(--target-bg), var(--target-bg));
    background-repeat: no-repeat;
    animation: vc-highlight 0.7s 0.15s var(--ease-out) both;
  }
  @keyframes vc-highlight { from { background-size: 0% 100%; } to { background-size: 100% 100%; } }

  /* "+N more" slides open where the browser can animate to auto height */
  .directory-more { interpolate-size: allow-keywords; }
  .directory-more::details-content {
    block-size: 0;
    overflow: hidden;
    transition: block-size 0.25s var(--ease-out), content-visibility 0.25s allow-discrete;
  }
  .directory-more[open]::details-content { block-size: auto; }

  /* Search: results settle in once, when the list first opens */
  .search-results-grid.is-fresh .search-result-card { animation: vc-settle 0.22s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 22ms); }
  @keyframes vc-settle { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

  /* Tabs: the underline grows in from the left on hover */
  .tab { position: relative; }
  .tab:not([aria-current])::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background: var(--link-hover);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s var(--ease-out);
  }
  .tab:not([aria-current]):hover::after { transform: scaleX(1); }

  /* Copied label pops in */
  .is-flashed { display: inline-block; animation: vc-pop 0.18s var(--ease-out); }
  @keyframes vc-pop { from { transform: scale(0.92); } to { transform: none; } }

  /* Hit counter roll, staggered from the left like a real drum */
  .odo-strip { transition: transform 1.1s var(--ease-out); transition-delay: calc(var(--n) * 70ms); }
}
