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

/* Load-bearing. Cards below set `display: flex`, which beats the browser's
   own `[hidden] { display: none }` — so filtering set the attribute and
   nothing visibly changed. Any rule that sets display must be outranked here. */
[hidden] { display: none !important; }

body {
  margin: 0;
  border-top: 6px solid var(--accent);
  background: var(--page);
  color: var(--ink);
  font: 400 1.0625rem/1.62 Poppins, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* The Parent Reading Rule: anything explaining a decision gets room. */
p { max-width: 68ch; }

a { color: var(--action); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ---------------------------------------------------------------- header */
/* Top and bottom only. The shorthand `padding: 28px 0 20px` was zeroing the
   side padding .wrap gives every other section, so on a phone the logo and nav
   sat flush against the screen edge while the content below was inset. */
.masthead { padding-top: 28px; padding-bottom: 20px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand svg { flex: none; }
.wordmark { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 600; line-height: 1; }
.wordmark .w-activity { color: var(--light-teal); font-weight: 500; }
.wordmark .w-trove { color: var(--action); }
.tagline { margin: 10px 0 0; color: var(--muted); font-size: 1rem; }

nav.top { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 0 20px; }
nav.top a { font-weight: 500; padding: 6px 0; min-height: 44px; display: inline-flex; align-items: center; }
nav.top a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -4px 0 var(--accent); }

/* Four links do not fit one row at 375px, and the wrap left "Add an activity"
   alone on a ragged second line. Two even columns read as a deliberate menu. */
@media (max-width: 480px) {
  nav.top { display: grid; grid-template-columns: auto auto; justify-content: start; gap: 0 28px; }
}

/* ----------------------------------------------------------------- bands */
.band { background: var(--band); padding: 28px 0; margin: 24px 0; }
.band--quiet { background: var(--tint); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 600; line-height: 1.1; margin: 0 0 6px;
     color: var(--action); }
h2 { font-size: .875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
     color: var(--muted); margin: 0 0 16px; }
h3 { font-size: clamp(1.1rem, 2vw, 1.3rem); font-weight: 600; line-height: 1.18; margin: 0 0 4px; }

/* ------------------------------------------------------------- this week */
.daygroup { margin-bottom: 20px; }
.daygroup:last-child { margin-bottom: 0; }
.daylabel { font-size: .8125rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
            color: var(--ink); margin-bottom: 8px; }
.agenda { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.agenda li { background: var(--page); border-left: 5px solid var(--accent); border-radius: 0; }
.agenda a { display: block; padding: 14px 16px; min-height: 44px; }
.agenda a:hover { text-decoration: none; background: var(--tint); }
/* The title and the details were running together into one sentence —
   "Frontier Climbing: 1st and 3rd Fridays Frontier Climbing · 1:00 PM…".
   Separate lines, and the eye finds the activity name immediately. */
.agenda strong { display: block; margin-bottom: 2px; }
.agenda .meta { display: block; color: var(--muted); font-size: .9375rem; }

/* Keep a long agenda row readable rather than stretched to the full 1180px. */
.agenda a > * { max-width: 70ch; }

/* ----------------------------------------------------------------- cards */
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; margin: 0; padding: 0; list-style: none; }
.card {
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}
.card--link { padding: 0; }
.card--link > a { display: block; padding: 18px 18px 10px; }
.card--link > a:hover { text-decoration: none; }
.card h3 { margin: 0 0 6px; }
.card h3 a { color: var(--ink); }

/* The lines of a card are one block of information, not separate paragraphs.
   A flex gap plus default <p> margins was stacking two gaps between every line
   and leaving the cards looking half empty. */
.card p { margin: 0; line-height: 1.45; }
.card .where, .card .when, .card .who,
.card .checked { color: var(--muted); font-size: .9375rem; }
.card .when + .when, .card .who, .card .where { margin-top: 1px; }
.card .desc { font-size: .9375rem; }

.card .contact {
  font-size: .9375rem; padding: 0 18px 16px;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px;
}
.card .contact .sep { color: var(--border); }
.card .tags { margin-top: 7px; }
.card .onrequest { margin: 8px 18px 16px; }

/* ------------------------------------------------------- collapsed sections */
.section { border: 1px solid var(--border); border-radius: 14px; background: var(--page);
           margin-bottom: 10px; overflow: hidden; }
.section > summary {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; min-height: 60px;
  font: 600 1.0625rem/1.2 Poppins, Arial, sans-serif;
  color: var(--ink); cursor: pointer; list-style: none;
}
.section > summary::-webkit-details-marker { display: none; }
.section > summary:hover { background: var(--tint); }
.section-icon { display: inline-flex; color: var(--dark-teal); flex: none; }
.section-name { flex: 1; }
.section-count {
  font: 600 .875rem/1 Poppins, Arial, sans-serif;
  background: var(--chip); color: var(--on-sand);
  border-radius: 999px; padding: 6px 12px; flex: none;
}
/* A chevron that turns, so open/closed is readable without colour. */
.section > summary::after {
  content: ''; flex: none; width: 9px; height: 9px; margin-left: 2px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translate(-2px, -2px);
}
.section[open] > summary::after { transform: rotate(225deg) translate(-2px, -2px); }
.section[open] > summary { border-bottom: 1px solid var(--border); }
.section > .grid { padding: 16px 18px 18px; }

.cat-icon { vertical-align: -3px; }
h1 .cat-icon { color: var(--dark-teal); margin-right: 4px; }

.h1-places { margin-top: 8px; }

/* ----------------------------------------------------------------- chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.chip {
  font: 600 .875rem/1.2 Poppins, Arial, sans-serif;
  letter-spacing: .02em;
  background: var(--page);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 16px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.chip:hover { background: var(--tint); }
.chip { background: var(--chip); border-color: var(--chip); color: var(--on-sand); }
.chip:hover { background: #cfb6a5; }
.chip[aria-pressed="true"] { background: var(--action); border-color: var(--action); color: #fff; }
.chip .n { color: var(--on-sand); font-weight: 500; }
.chip[aria-pressed="true"] .n { color: #fff; }

/* Static labels, not controls — a chip shape without the affordance. */
.tag {
  font: 600 .8125rem/1.2 Poppins, Arial, sans-serif;
  background: var(--chip); color: var(--on-sand);
  border-radius: 999px; padding: 5px 11px; display: inline-block;
}
.tag--model { background: var(--tint); border: 1px solid var(--border); color: var(--ink); }
.tag--hs { background: var(--accent); color: var(--on-yolk); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ----------------------------------------------------------- on_request */
.onrequest {
  background: var(--tint);
  border: 1px solid var(--border);
  border-left: 3px solid var(--light-teal);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: .9375rem;
}

/* --------------------------------------------------------------- search */

/* One row: the thing on the left, the search pushed right. Wraps to two rows on
   a phone, where the search then takes the full width — a 280px box squeezed
   beside six chips is unusable with a thumb. */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 10px 16px; margin: 0 0 16px;
}
.toolbar > .chips,
.toolbar > .count { margin: 0; flex: 1 1 auto; min-width: 0; }
.toolbar > .search { margin: 0; flex: 0 1 300px; margin-left: auto; }
.toolbar > .search input { max-width: none; }

@media (max-width: 640px) {
  .toolbar > .search { flex: 1 1 100%; margin-left: 0; }
}

/* Visible to a screen reader, not to the eye. The inputs carry a placeholder,
   which is a hint and not a label — it vanishes the moment someone types. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.search { margin: 0 0 18px; }
.search input {
  width: 100%; max-width: 420px;
  font: 400 1rem/1.4 Poppins, Arial, sans-serif;
  color: var(--ink); background: var(--page);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 13px 14px; min-height: 48px;
}
.search input:focus { border-color: var(--action); }

.count { color: var(--muted); font-size: .9375rem; margin: 0 0 14px; }
.empty { color: var(--muted); }

/* -------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 1rem/1 Poppins, Arial, sans-serif;
  background: var(--action); color: var(--page);
  border: 0; border-radius: 8px; padding: 14px 22px; min-height: 48px;
  cursor: pointer;
}
.btn:hover { background: var(--ink); text-decoration: none; }
.btn--quiet { background: var(--tint); color: var(--action); border: 1px solid var(--border); }
.btn--quiet:hover { background: var(--page); }

/* --------------------------------------------------------------- footer */
footer { background: var(--action); color: #fff; margin-top: 36px; padding: 24px 0 40px; }
footer .links { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 6px 0; }
footer .links a { color: #fff; min-height: 44px; display: inline-flex; align-items: center; }
footer .stat { color: var(--sky); font-size: .9375rem; }

/* ------------------------------------------------------- get-notified nudge */
/* A quiet line closing the "this week" band, not a block of its own: the
   weekly email IS this list, so the offer sits where the list ends. */
.notify {
  margin: 18px 0 0; padding-top: 16px; border-top: 1px solid rgba(0, 102, 130, .25);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; color: var(--ink);
}
.notify strong { font-weight: 600; }
.notify a { color: var(--action); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }

/* -------------------------------------------------------- calendar dropdown */
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.caldrop { position: relative; }
.caldrop > summary { list-style: none; cursor: pointer; }
.caldrop > summary::-webkit-details-marker { display: none; }
.caldrop > summary::after {
  content: ''; width: 7px; height: 7px; margin-left: 10px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
}
.caldrop[open] > summary::after { transform: rotate(225deg) translate(-2px, -2px); }
.caldrop-menu {
  list-style: none; margin: 8px 0 0; padding: 6px;
  background: var(--page); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow-soft);
  min-width: 220px; max-width: 320px;
}
.caldrop-menu a {
  display: block; padding: 12px 14px; min-height: 44px;
  border-radius: 6px; font-weight: 500; color: var(--ink);
  display: flex; align-items: center;
}
.caldrop-menu a:hover { background: var(--tint); text-decoration: none; color: var(--action); }
.caldrop-note {
  font-size: .8125rem; color: var(--muted); line-height: 1.4;
  padding: 8px 14px 4px; border-top: 1px solid var(--border); margin-top: 4px;
}

/* On a wide screen the menu floats over the page rather than shoving it down.
   The note lives INSIDE the menu: positioned separately it landed on top of the
   footer, because an absolutely-positioned sibling has no idea how tall the
   menu above it turned out to be. */
@media (min-width: 641px) {
  .caldrop[open] > .caldrop-menu { position: absolute; z-index: 5; top: 100%; left: 0; }
}

/* ------------------------------------------------------------ embedded form */
.formwrap {
  background: var(--tint);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  margin: 20px 0;
  max-width: 640px;
}
.formwrap iframe { display: block; }


/* --------------------------------------------------------------- notice */
.preview-banner {
  background: var(--accent); color: var(--ink);
  padding: 12px 0; font-size: .9375rem; font-weight: 500;
}

/* ----------------------------------------------------------- wide screens */
@media (min-width: 641px) {
  .masthead { padding-top: 36px; padding-bottom: 24px; display: flex; align-items: flex-end;
              justify-content: space-between; gap: 24px; flex-wrap: wrap; }
  nav.top { margin: 0; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .split { display: grid; grid-template-columns: 3fr 2fr; gap: 32px; align-items: start; }
}
@media (min-width: 981px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .chip, .agenda a { transition: background-color .15s ease; }
}
