/* Layout and components. Colours/type tokens are in theme.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font-family: var(--font); font-size: var(--fs-base); line-height: 1.45;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); }
a:visited { color: var(--link-visited); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 6px var(--focus-halo); }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .4em; }
p { margin: 0 0 .8em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--masthead); color: var(--ink); padding: .5em 1em; z-index: 10; }
.skip:focus { left: 8px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 12px; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- Top strip, masthead, nav ---- */
.topbar { background: var(--topbar); color: var(--topbar-ink); font-size: var(--fs-xs); }
.topbar .wrap { display: flex; justify-content: space-between; gap: 1em; padding-top: 4px; padding-bottom: 4px; flex-wrap: wrap; }
.topbar a { color: var(--topbar-ink); }
.masthead { background: var(--masthead); color: var(--masthead-ink); border-bottom: 1px solid var(--rule-strong); }
.masthead .wrap { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 8px; }
.logo { font-size: var(--fs-logo); font-weight: 700; color: var(--masthead-ink) !important; text-decoration: none; letter-spacing: -.02em; line-height: 1; }
.logo span { background: var(--masthead-ink); color: var(--masthead); padding: 0 .18em; margin-left: .08em; }
.tagline { font-size: var(--fs-sm); font-weight: 700; }

.page { background: var(--paper); padding-bottom: 24px; border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); }
.crumbs { font-size: var(--fs-xs); color: var(--muted); padding: 6px 0; border-bottom: 1px solid var(--rule); margin-bottom: 12px; }
.crumbs a { color: var(--muted); }

.layout { display: grid; grid-template-columns: 145px minmax(0, 1fr) 270px; grid-template-areas: "nav main side"; gap: 18px; }
.layout.no-side { grid-template-columns: 150px minmax(0, 1fr); grid-template-areas: "nav main"; }
.sectionnav { grid-area: nav; font-size: var(--fs-sm); }
main { grid-area: main; min-width: 0; }
.side { grid-area: side; min-width: 0; }

.sectionnav ul { list-style: none; margin: 0; padding: 0; }
.sectionnav > ul > li { border-bottom: 1px solid var(--rule); }
.sectionnav a { display: block; padding: 5px 6px; text-decoration: none; color: var(--ink); font-weight: 700; }
.sectionnav a:hover { background: var(--tint); text-decoration: underline; }
.sectionnav a[aria-current="page"] { background: var(--masthead); }
.sectionnav ul ul a { font-weight: 400; padding-left: 16px; color: var(--link); }
.sectionnav ul ul { padding-bottom: 4px; }
.sectionnav .navhead { background: var(--bar); color: var(--bar-ink); font-weight: 700; padding: 4px 6px; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; }

/* ---- Section bars & headings ---- */
.bar { background: var(--bar); color: var(--bar-ink); font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .05em;
  padding: 5px 8px; margin: 22px 0 10px; border-bottom: 3px solid var(--masthead); }
.bar a { color: var(--bar-ink); }
.bar .more { float: right; text-transform: none; letter-spacing: 0; font-weight: 400; }
main > .bar:first-child, .side > .bar:first-child { margin-top: 0; }
.subhead { font-size: var(--fs-md); border-bottom: 1px solid var(--rule-strong); padding-bottom: 3px; margin: 18px 0 8px; }
.pagetitle { font-size: var(--fs-xl); margin-bottom: 4px; }
.dateline { font-size: var(--fs-xs); color: var(--muted); margin-bottom: 10px; }

/* ---- Lead story ---- */
.lead { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.lead .kicker { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 2px; }
.lead .headline { font-size: var(--fs-xl); margin: 0 0 6px; }
.lead .headline a { color: var(--ink); text-decoration: none; }
.lead .headline a:hover { text-decoration: underline; }
.commentary { font-size: var(--fs-md); }
.commentary p:last-child { margin-bottom: 0; }

.scoreline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 3px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); margin: 8px 0; }
.scoreline div { padding: 6px 8px; border-left: 1px solid var(--rule); }
.scoreline div:first-child { border-left: 0; }
.scoreline dt { font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.scoreline dd { margin: 0; font-size: var(--fs-lg); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---- Photos ---- */
figure { margin: 0; }
.photo { position: relative; background: var(--tint); border: 1px solid var(--rule); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.ratio-16x9 { aspect-ratio: 16 / 9; }
.ratio-4x3 { aspect-ratio: 4 / 3; }
.ratio-3x4 { aspect-ratio: 3 / 4; }
.ratio-1x1 { aspect-ratio: 1 / 1; }
.placeholder { display: flex; align-items: center; justify-content: center; text-align: center; color: var(--muted);
  background: repeating-linear-gradient(135deg, #ececec 0 1px, transparent 1px 9px), var(--tint);
  font-size: var(--fs-sm); }
.placeholder span { background: var(--paper); border: 1px solid var(--rule); padding: 4px 10px; }
figcaption { font-size: var(--fs-xs); color: var(--muted); padding: 4px 0; border-bottom: 1px solid var(--rule); }
figcaption .credit { float: right; margin-left: 8px; }

/* ---- Stat boxes ---- */
.statgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--rule-strong); }
.statgrid > div { padding: 8px 10px; border-left: 1px solid var(--rule); }
.statgrid > div:first-child { border-left: 0; }
.statgrid .label { font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.statgrid .value { font-size: var(--fs-stat); white-space: nowrap; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.statgrid .sub { font-size: var(--fs-xs); color: var(--muted); }
.period { font-size: var(--fs-sm); margin: 6px 0 0; }

/* ---- Tables ---- */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: var(--fs-sm); }
caption { text-align: left; font-weight: 700; padding: 4px 0; }
th, td { padding: 5px 6px; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { border-bottom: 2px solid var(--rule-strong); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
tbody tr:nth-child(even) { background: var(--tint); }
td.r, th.r { text-align: right; }
.results td a { font-weight: 700; }
tr.month th { background: var(--paper); font-size: var(--fs-sm); border-bottom: 1px solid var(--rule-strong); padding-top: 14px; text-transform: none; }
.tag { display: inline-block; font-size: var(--fs-xs); font-weight: 700; padding: 0 4px; border: 1px solid currentColor; line-height: 1.4; }
.tag.run { color: var(--run); }
.tag.walk { color: var(--walk); }
.na { color: var(--muted); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; margin: 0; font-size: var(--fs-sm); }
dl.facts dt, dl.facts dd { padding: 5px 6px; border-bottom: 1px solid var(--rule); margin: 0; }
dl.facts dt { font-weight: 700; padding-right: 18px; }

/* ---- Charts ---- */
.chart { margin: 6px 0 4px; }
.chart svg { width: 100%; height: auto; display: block; font-family: var(--font); }
.chart .axis, .chart .lbl { fill: var(--muted); font-size: 11px; paint-order: stroke; stroke: var(--paper); stroke-width: 3px; stroke-linejoin: round; }
.chart .gridline { stroke: var(--grid); }
.chart .baseline { stroke: var(--rule-strong); }
.chart .s-run { fill: var(--run); }
.chart .s-walk { fill: var(--walk); }
.chart .l-run { stroke: var(--run); fill: none; stroke-width: 2; }
.chart .l-walk { stroke: var(--walk); fill: none; stroke-width: 2; }
.legend { display: flex; gap: 14px; font-size: var(--fs-xs); margin: 4px 0; flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 12px; vertical-align: -1px; margin-right: 4px; }
.legend .k-run { background: var(--run); }
.legend .k-walk { background: var(--walk); }
.legend .k-hollow { border: 2px solid var(--ink); background: var(--paper); border-radius: 50%; }
.chart-note { font-size: var(--fs-xs); color: var(--muted); margin: 2px 0 6px; }
details.data { font-size: var(--fs-sm); margin: 2px 0 12px; }
details.data summary { cursor: pointer; color: var(--link); font-size: var(--fs-xs); }
.empty { border: 1px dashed var(--rule); background: var(--tint); padding: 14px; font-size: var(--fs-sm); color: var(--muted); margin: 4px 0 12px; }
.empty strong { color: var(--ink); }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

/* ---- Sidebar ---- */
.sidebox { border: 1px solid var(--rule); border-top: 3px solid var(--rule-strong); background: var(--tint); padding: 8px 10px; margin-bottom: 14px; font-size: var(--fs-sm); }
.sidebox h2 { font-size: var(--fs-base); margin-bottom: 6px; }
.sidebox .big { font-size: var(--fs-lg); font-weight: 700; }
.form-guide { display: flex; gap: 3px; margin: 4px 0; flex-wrap: wrap; }
.form-guide a { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; color: #fff !important; text-decoration: none; font-weight: 700; font-size: var(--fs-sm); }
.form-guide .run { background: var(--run); }
.form-guide .walk { background: var(--walk); }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 4px 0; border-bottom: 1px solid var(--rule); }
ul.plain li:last-child { border-bottom: 0; }

/* ---- Notices ---- */
.notice { background: var(--notice); border: 1px solid var(--notice-rule); padding: 8px 10px; font-size: var(--fs-sm); margin: 0 0 12px; }
.fixture-banner { background: #111; color: var(--masthead); font-weight: 700; text-align: center; padding: 6px; font-size: var(--fs-sm); }

/* ---- Filters ---- */
.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; border-top: 3px solid var(--rule-strong); border-bottom: 1px solid var(--rule); background: var(--tint); padding: 10px; margin-bottom: 8px; }
.filters fieldset { border: 0; padding: 0; margin: 0; }
.filters legend, .filters label { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; display: block; margin-bottom: 3px; }
select, input, textarea, button { font: inherit; font-size: var(--fs-sm); }
select, input[type="date"], input[type="text"], input[type="password"], textarea {
  border: 1px solid #767676; background: var(--paper); color: var(--ink); padding: 5px 6px; border-radius: 0; }
button, .button { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); padding: 6px 12px; cursor: pointer; font-weight: 700; border-radius: 0; text-decoration: none; display: inline-block; }
button.secondary { background: var(--paper); color: var(--ink); }
button:disabled { opacity: .55; cursor: not-allowed; }
.filters .dates { display: flex; gap: 10px; }
.seg { display: inline-flex; border: 1px solid var(--ink); }
.seg label { margin: 0; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: var(--fs-sm); }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: block; padding: 5px 10px; cursor: pointer; border-left: 1px solid var(--ink); background: var(--paper); }
.seg label:first-child span { border-left: 0; }
.seg input:checked + span { background: var(--ink); color: var(--paper); font-weight: 700; }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 6px var(--focus-halo); position: relative; }
.count { font-size: var(--fs-sm); margin: 4px 0 6px; }
.tabs { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 3px solid var(--rule-strong); margin-bottom: 10px; font-size: var(--fs-sm); }
.tabs a { padding: 5px 12px; text-decoration: none; color: var(--ink); border: 1px solid var(--rule); border-bottom: 0; margin-right: 3px; background: var(--tint); font-weight: 700; }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---- Gallery ---- */
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.gallery .date { font-weight: 700; color: var(--ink); }

/* ---- Comments ---- */
.reactions { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.reactions button { background: var(--paper); color: var(--ink); font-weight: 400; }
.reactions button[aria-pressed="true"] { background: var(--masthead); font-weight: 700; }
.reactions .n { font-weight: 700; margin-left: 6px; font-variant-numeric: tabular-nums; }
.comment-list { list-style: none; padding: 0; margin: 0 0 12px; }
.comment-list li { border-bottom: 1px solid var(--rule); padding: 8px 0; }
.comment-list .who { font-weight: 700; }
.comment-list .when { font-size: var(--fs-xs); color: var(--muted); margin-left: 6px; }
.comment-list p { margin: 3px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-list .del { float: right; font-size: var(--fs-xs); padding: 2px 8px; background: var(--paper); color: var(--error); border-color: var(--error); }
.comment-form { display: grid; gap: 8px; max-width: 560px; background: var(--tint); border-top: 3px solid var(--rule-strong); padding: 10px; }
.comment-form label { font-weight: 700; font-size: var(--fs-sm); display: block; }
.comment-form input[type="text"], .comment-form textarea { width: 100%; }
.comment-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.status { font-size: var(--fs-sm); min-height: 1.2em; }
.status.err { color: var(--error); font-weight: 700; }

/* ---- Footer & misc ---- */
.pagetools { font-size: var(--fs-xs); margin: 16px 0 0; padding-top: 6px; border-top: 1px solid var(--rule); display: flex; gap: 14px; flex-wrap: wrap; }
.pagetools button { background: none; border: 0; color: var(--link); padding: 0; font-weight: 400; text-decoration: underline; font-size: var(--fs-xs); }
.prevnext { display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs-sm); margin: 16px 0; border-top: 1px solid var(--rule); padding-top: 8px; }
footer.site { font-size: var(--fs-xs); color: var(--muted); padding: 12px 0 30px; }
footer.site .wrap { border-top: 3px solid var(--masthead); padding-top: 8px; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .layout, .layout.no-side { grid-template-columns: minmax(0, 1fr); grid-template-areas: "nav" "main" "side"; gap: 12px; }
  .sectionnav .navhead, .sectionnav ul ul { display: none; }
  .sectionnav > ul { display: flex; flex-wrap: wrap; border-top: 1px solid var(--rule); }
  .sectionnav > ul > li { border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule); }
  .side { border-top: 3px solid var(--rule-strong); padding-top: 10px; }
}
@media (max-width: 640px) {
  :root { --fs-stat: 1.5rem; --fs-xl: 1.6rem; --fs-logo: 2.1rem; --fs-lg: 1.25rem; }
  .wrap { padding: 0 10px; }
  .page { border: 0; }
  .sectionnav > ul { display: grid; grid-template-columns: repeat(2, 1fr); }
  .sectionnav > ul > li:nth-child(2n) { border-right: 0; }
  .sectionnav > ul > li:last-child:nth-child(odd) { grid-column: span 2; border-right: 0; }
  .sectionnav a { padding: 8px; }
  .scoreline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scoreline div:nth-child(3) { border-left: 0; }
  .scoreline div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .statgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .statgrid > div:nth-child(3) { border-left: 0; }
  .statgrid > div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .cols-2, .gallery { grid-template-columns: minmax(0, 1fr); }
  .opt { display: none; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters .dates { display: flex; gap: 8px; }
  .filters .dates > div { flex: 1; }
  .filters input[type="date"] { width: 100%; }
  .tagline { display: none; }
  .topbar .updated { display: none; }
}
@media print {
  .topbar, .sectionnav, .side, .comments, .pagetools, .filters, .skip { display: none !important; }
  .layout { display: block; }
  body, .page { background: #fff; }
}
