/* Layout: club noticeboard. Green masthead band, one big "next run" card, then the
   receding hareline as rows led by large condensed date numerals. */
:root {
  --paper: #f2f5ef;      /* page ground, faint green bias */
  --card: #ffffff;
  --ink: #142312;
  --muted: #586754;
  --line: #d3dccd;
  --green: #1a5c00;      /* club green from the current site */
  --green-ink: #ffffff;  /* text on the green band */
  --band: #1a5c00;
  --band-soft: #2c7410;
  --chalk: #e7f2df;      /* trail-mark flour on the band */
  --tile-head: #4a1780;  /* header of the run tiles, same in light and dark */
  --amber: #8a4f00;      /* "hare wanted" */
  --amber-bg: #fbecd2;
  --focus: #e09a1d;

  /* Apple devices have Apple SD Gothic Neo; everyone else gets the Gothic A1 web font. */
  --font-display: "Apple SD Gothic Neo", "Gothic A1", "Segoe UI", system-ui, sans-serif;
  --font-body: "Apple SD Gothic Neo", "Gothic A1", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d150c; --card: #141f12; --ink: #e5eedf; --muted: #9daf97; --line: #26351f;
    --green: #8fd068; --green-ink: #f3f8ef; --band: #133f05; --band-soft: #1d5409; --chalk: #d5e8c8;
    --amber: #f2b85a; --amber-bg: #3a2908; --focus: #f2b85a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d150c; --card: #141f12; --ink: #e5eedf; --muted: #9daf97; --line: #26351f;
  --green: #8fd068; --green-ink: #f3f8ef; --band: #133f05; --band-soft: #1d5409; --chalk: #d5e8c8;
  --amber: #f2b85a; --amber-bg: #3a2908; --focus: #f2b85a;
  color-scheme: dark;
}

/* ---------- page chrome (standalone site only) ---------- */
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.55 var(--font-body);
}
a { color: var(--green); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.wrap {
  max-width: 60rem;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.mast { background: var(--band); color: var(--green-ink); position: relative; overflow: hidden; }
.mast .wrap { padding-block: 1.25rem 2.25rem; position: relative; }
.mast__nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; align-items: baseline; justify-content: space-between; }
.mast__brand { display: inline-flex; align-items: center; gap: 0.6rem; font: 800 1.35rem/1 var(--font-display); letter-spacing: 0.04em; text-transform: uppercase; color: inherit; text-decoration: none; }
.mast__logo { width: 2.5rem; height: 2.5rem; object-fit: contain; flex: none; }
.mast__logo--roundel {
  display: grid; place-items: center; border-radius: 50%;
  border: 2px solid var(--chalk); color: var(--chalk);
  font: 800 0.85rem/1 var(--font-display); letter-spacing: 0.04em;
}
.mast__links { display: flex; gap: 1.1rem; list-style: none; margin: 0; padding: 0; }
.mast__links a { color: inherit; text-decoration: none; opacity: 0.85; font-weight: 700; font-size: 0.95rem; }
.mast__links a:hover, .mast__links a[aria-current="page"] { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.mast__title {
  margin: 2rem 0 0.4rem;
  font: 800 clamp(1.76rem, 8vw, 4.48rem)/0.98 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  text-wrap: balance;
}
.mast--home .mast__title { font-size: clamp(2.08rem, 7.2vw, 4.32rem); }
.mast__sub { margin: 0; font-size: 1.05rem; color: var(--chalk); max-width: 40rem; }
.mast__sub strong { color: var(--green-ink); }
/* Hash trail marks: a chalk "on" arrow running across the band */
.mast__trail { position: absolute; right: max(16px, env(safe-area-inset-right, 0px)); bottom: 0.9rem; width: min(46%, 22rem); height: 3rem; color: var(--chalk); opacity: 0.55; pointer-events: none; }

main.wrap { padding-block: 0 3rem; }
.bh-loading { padding-top: 2rem; }
/* The first card on a page overlaps the green band */
.page > [data-hareline]:first-child .bh > :first-child { margin-top: -1.25rem; }
.page-note { margin: 2rem 0 0; color: var(--muted); max-width: 44rem; }

/* Run statistics */
.run-stats { display: grid; gap: 1rem; }
.run-stats__toolbar { display: grid; gap: 0.35rem; max-width: 24rem; }
.run-stats__toolbar label { font-weight: 700; }
.run-stats__toolbar input { width: 100%; min-height: 2.75rem; padding: 0.55rem 0.75rem; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font: inherit; }
.run-stats__status { margin: 0; color: var(--muted); }
.run-stats__table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.run-stats__table { width: 100%; border-collapse: collapse; text-align: left; }
.run-stats__table th, .run-stats__table td { padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); }
.run-stats__table thead { background: var(--band); color: var(--green-ink); }
.run-stats__table thead th { white-space: nowrap; }
.run-stats__table thead button { padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 700; cursor: pointer; }
.run-stats__table thead th[aria-sort="ascending"] button::after { content: " ↑"; }
.run-stats__table thead th[aria-sort="descending"] button::after { content: " ↓"; }
.run-stats__table tbody th { font-weight: 700; }
.run-stats__table tbody td { font-variant-numeric: tabular-nums; text-align: right; }
.run-stats__table thead th:not(:first-child) { text-align: right; }
.run-stats__table tbody tr:last-child > * { border-bottom: 0; }
.run-stats__table tbody tr:hover { background: color-mix(in srgb, var(--green) 6%, var(--card)); }

/* About page */
main.page--about { padding-top: 2.5rem; }
.about { display: grid; gap: 3rem; }
.prose { max-width: 40rem; display: grid; gap: 1rem; }
.prose p { margin: 0; }
.lede { font-size: 1.25rem; line-height: 1.45; font-weight: 700; }
.crew__head { border-bottom: 2px solid var(--ink); padding-bottom: 0.5rem; margin-bottom: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; justify-content: space-between; align-items: baseline; }
.crew__title { margin: 0; font: 800 1.9rem/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.03em; }
.crew__sub { margin: 0; color: var(--muted); }
.crew__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); gap: 1.75rem 1.25rem; }
.crew__card { display: grid; gap: 0.75rem; align-content: start; min-width: 0; }
.crew__photo {
  width: 100%; max-width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; display: block;
  border-radius: var(--r); background: var(--line);
}
.crew__photo--blank {
  display: grid; place-items: center;
  background: var(--band); color: var(--chalk);
  font: 800 3.4rem/1 var(--font-display); letter-spacing: 0.04em;
  background-image: radial-gradient(circle at 50% 50%, transparent 0 34%, color-mix(in srgb, var(--chalk) 18%, transparent) 34% 35%, transparent 35%);
}
.crew__text { display: grid; gap: 0.15rem; }
.crew__role { margin: 0; font: 700 0.78rem/1.2 var(--font-body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--green); }
.crew__name { margin: 0; font: 800 1.45rem/1.1 var(--font-display); text-transform: uppercase; letter-spacing: 0.02em; }
.crew__name.is-blank { color: var(--muted); font: italic 400 1rem/1.4 var(--font-body); text-transform: none; letter-spacing: 0; }
.crew__about { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.95rem; }
.crew__empty { color: var(--muted); }

.info { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; margin-top: 2.5rem; }
.info__item { border-top: 2px solid var(--ink); padding-top: 0.75rem; min-width: 0; }
.info__item h3 { margin: 0 0 0.35rem; font: 700 1.15rem/1.2 var(--font-display); text-transform: uppercase; letter-spacing: 0.05em; }
.info__item p { margin: 0; color: var(--muted); }
.info__item a { font-weight: 700; }

.foot { border-top: 1px solid var(--line); margin-top: 3rem; }
.foot .wrap { padding-block: 1.25rem 2rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between; color: var(--muted); font-size: 0.9rem; }
.foot p { margin: 0; }
.foot nav a { color: var(--muted); }
.foot__motto { font: 700 1rem/1.2 var(--font-display); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink); }

.bh { display: grid; gap: 2rem; font-family: var(--font-body); color: var(--ink); }
.bh * { box-sizing: border-box; }

.bh-eyebrow, .bh-label {
  margin: 0;
  font: 700 0.78rem/1.2 var(--font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.bh-next {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 10px 30px -18px rgba(10, 40, 0, 0.45);
  display: grid;
  grid-template-columns: minmax(8.5rem, 11rem) 1fr;
  overflow: hidden;
  position: relative;
}
.bh-next__date {
  background: var(--tile-head);
  color: var(--green-ink);
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 1.5rem 1rem;
  text-align: center;
  font-family: var(--font-display);
  text-transform: uppercase;
}
.bh-next__when { font: 700 0.8rem/1 var(--font-body); letter-spacing: 0.12em; background: var(--chalk); color: var(--band); padding: 0.3rem 0.55rem; border-radius: 999px; margin-bottom: 0.75rem; }
.bh-next__day { font-weight: 700; font-size: 1.4rem; letter-spacing: 0.1em; line-height: 1; }
.bh-next__num { font-weight: 800; font-size: 4.4rem; line-height: 1.05; font-variant-numeric: tabular-nums; }
.bh-next__mon { font-weight: 700; font-size: 1.6rem; letter-spacing: 0.08em; line-height: 1; }
.bh-next__time { margin-top: 0.6rem; font: 700 1rem/1 var(--font-body); letter-spacing: 0.02em; color: var(--chalk); }

.bh-next__body { padding: 1.5rem 1.6rem 1.6rem; display: grid; gap: 0.55rem; align-content: start; min-width: 0; }
.bh-next__venue { margin: 0; font: 800 clamp(1.5rem, 4vw, 2rem)/1.1 var(--font-display); text-transform: uppercase; letter-spacing: 0.01em; text-wrap: balance; }
.bh-next__addr, .bh-next__notes { margin: 0; color: var(--muted); }
.bh-next__notes { color: var(--ink); }
.bh-next__hares { display: flex; flex-wrap: wrap; gap: 0.4rem 0.75rem; align-items: baseline; margin-top: 0.35rem; }
.bh-next__hares .bh-hares { font-size: 1.15rem; font-weight: 700; }

.bh-hares, .bh-row__hares { display: inline-flex; flex-wrap: wrap; gap: 0.15rem 0.4rem; align-items: baseline; }
.bh-hare { font-weight: 700; }
.bh-amp { color: var(--muted); font-weight: 400; }
.bh-tba { color: var(--muted); font-style: italic; text-transform: none; font-family: var(--font-body); font-weight: 400; font-size: 0.72em; letter-spacing: 0; }

.bh-chip { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px; font: 700 0.8rem/1.2 var(--font-body); letter-spacing: 0.04em; }
.bh-chip--wanted { background: var(--amber-bg); color: var(--amber); border: 1px dashed currentColor; text-decoration: none; }
.bh-chip--wanted:hover { text-decoration: underline; }
.bh-chip--pending { background: var(--amber-bg); color: var(--amber); border: 1px solid currentColor; }

.bh-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.6rem; }
.bh-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.6rem; padding: 0.5rem 1rem;
  border-radius: 8px; border: 1.5px solid var(--green);
  background: transparent; color: var(--green);
  font: 700 0.95rem/1 var(--font-body); text-decoration: none; cursor: pointer;
}
.bh-btn:hover { background: color-mix(in srgb, var(--green) 10%, transparent); }
.bh-btn--primary { background: var(--green); color: var(--card); }
.bh-btn--primary:hover { background: color-mix(in srgb, var(--green) 85%, var(--ink)); }

/* Home: next two runs side by side, date as a strip across the top of each card */
.bh-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1.25rem; align-items: stretch; }
.bh-pair .bh-next { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
.bh-pair .bh-next__date { grid-template-columns: repeat(4, auto); justify-content: start; justify-items: start; align-items: baseline; gap: 0 0.55rem; padding: 1rem 1.4rem; text-align: left; }
.bh-pair .bh-next__when { grid-column: 1 / -1; margin-bottom: 0.5rem; }
.bh-pair .bh-next__num { font-size: 3.4rem; }
.bh-pair .bh-next__time { grid-column: auto; margin-top: 0; margin-left: 0.4rem; }
.bh-pair .bh-next__body { padding: 1.25rem 1.4rem 1.4rem; }
.bh-pair__secondary { display: grid; place-items: end center; transform: scale(0.9); transform-origin: bottom center; }
.bh-pair__secondary .bh-next { background: color-mix(in srgb, var(--card) 85%, var(--ink)); }
.bh-more { margin: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; }

/* Home: front-page announcements */
.bh-notices { display: grid; gap: 0.75rem; }
.bh-notices__title { margin: 0; font: 800 1.7rem/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.03em; border-bottom: 2px solid var(--ink); padding-bottom: 0.5rem; }
.bh-notices__list { list-style: none; margin: 0; padding: 0; display: grid; }
.bh-notice { padding: 0.9rem 0 0.9rem 2rem; border-bottom: 1px solid var(--line); position: relative; display: grid; gap: 0.3rem; }
/* trail-mark dot: the chalk blob hashers follow */
.bh-notice::before { content: ""; position: absolute; left: 0.35rem; top: 1.25rem; width: 0.7rem; height: 0.7rem; border-radius: 50%; border: 2px solid var(--green); }
.bh-notice__text { margin: 0; font-size: 1.05rem; max-width: 46rem; overflow-wrap: anywhere; }
.bh-notice__text a { color: var(--green); font-weight: 700; }
.bh-notice__meta { margin: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; align-items: baseline; font-size: 0.9rem; }
.bh-notice__link { color: var(--green); font-weight: 700; }
.bh-notice__until { color: var(--muted); font-size: 70%; font-variant-numeric: tabular-nums; }

.bh-list__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.25rem 1rem; border-bottom: 2px solid var(--ink); padding-bottom: 0.5rem; }
.bh-list__title { margin: 0; font: 800 1.7rem/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.03em; }
.bh-list__count { margin: 0; color: var(--muted); font-size: 0.9rem; }

.bh-rows { list-style: none; margin: 0; padding: 0; }
.bh-row {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr) minmax(0, 15rem);
  gap: 0.25rem 1.25rem;
  align-items: start;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.bh-row__date { display: grid; justify-items: center; font-family: var(--font-display); text-transform: uppercase; color: var(--green); line-height: 0.9; }
.bh-row__num { font-weight: 800; font-size: 2.6rem; font-variant-numeric: tabular-nums; }
.bh-row__mon { font-weight: 700; font-size: 1rem; letter-spacing: 0.1em; }
.bh-row__main { min-width: 0; }
.bh-row__meta { margin: 0; font-size: 0.82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.bh-row__venue { margin: 0.1rem 0 0; font: 700 1.35rem/1.15 var(--font-display); text-transform: uppercase; letter-spacing: 0.02em; }
.bh-row__venue a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 3px; }
.bh-row__venue a:hover { text-decoration-color: currentColor; }
.bh-row__addr, .bh-row__notes { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.92rem; }
.bh-row__hares { justify-content: flex-end; padding-top: 1.1rem; text-align: right; }
.bh-row.is-wanted .bh-row__date { color: var(--muted); }

.bh-venue-notes { margin: 0.25rem 0 0; font-size: 0.92rem; }
.bh-venue-notes summary { cursor: pointer; color: var(--muted); font-weight: 600; width: fit-content; }
.bh-venue-notes p { margin: 0.25rem 0 0; color: var(--ink); }
.bh-past summary { cursor: pointer; font-weight: 700; color: var(--muted); }
.bh-past .bh-rows { margin-top: 0.5rem; opacity: 0.8; }

.bh-cal {
  display: grid; gap: 0.9rem;
  padding: 1.25rem 1.4rem;
  border: 1.5px dashed var(--green);
  border-radius: var(--r);
}
.bh-cal__title { margin: 0; font: 800 1.35rem/1.1 var(--font-display); text-transform: uppercase; letter-spacing: 0.03em; }
.bh-cal__text { margin: 0.3rem 0 0; color: var(--muted); max-width: 40rem; }
.bh-cal__row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.bh-cal__url {
  flex: 1 1 16rem; min-width: 0;
  font: 0.85rem/1.4 var(--font-mono);
  background: var(--paper); border: 1px solid var(--line); border-radius: 6px;
  padding: 0.6rem 0.75rem; overflow-wrap: anywhere;
}
.bh-select { user-select: all; }

.bh-empty, .bh-source { margin: 0; color: var(--muted); }
.bh-source { font-size: 0.82rem; }

@media (max-width: 640px) {
  .mast__trail { display: none; }
  .bh-next { grid-template-columns: minmax(0, 1fr); }
  .bh-pair .bh-next__num { font-size: clamp(2.6rem, 13vw, 3.4rem); }
  .bh-pair .bh-next__time { margin-left: 0; }
  .bh-next__date { grid-template-columns: auto auto auto; justify-content: start; justify-items: start; align-items: baseline; gap: 0 0.5rem; padding: 1rem 1.25rem; text-align: left; }
  .bh-next__when { grid-column: 1 / -1; justify-self: start; margin-bottom: 0.5rem; }
  .bh-next__num { font-size: 3.2rem; }
  .bh-next__time { grid-column: 1 / -1; margin-top: 0.35rem; }
  .bh-next__body { padding: 1.25rem; }
  .bh-row { grid-template-columns: 3.4rem minmax(0, 1fr); }
  .bh-row__num { font-size: 2.2rem; }
  .bh-row__hares { grid-column: 2; justify-content: flex-start; padding-top: 0.35rem; text-align: left; }
}
@media (prefers-reduced-motion: no-preference) {
  .bh-next { animation: bh-rise 0.5s ease-out both; }
  @keyframes bh-rise { from { transform: translateY(8px); } to { transform: none; } }
}
