/* Rugby Book: a match-day board, not a magazine.
   One family (Archivo) used through its width axis: wide for headings,
   narrow + heavy for scores, times and jersey numbers, normal for reading. */
:root {
  --green: #00553a; --green-2: #0a6b4a; --gold: #ffb612; --gold-ink: #8a5d00;
  --page: #f4f7f5; --panel: #ffffff; --ink: #0f2219; --muted: #55675e; --line: #d3ddd7;
  --loss: #c0392b; --win: #1d7a3e; --sa: #fff4d6;
  --font: "Archivo", "Segoe UI", system-ui, sans-serif;
  --wide: 125; --narrow: 62;
  --radius: 4px;
}
@media (prefers-color-scheme: dark) {
  :root { --page: #0c1a14; --panel: #12251c; --ink: #e9f0ec; --muted: #9fb2a8; --line: #24392f;
          --gold-ink: #ffb612; --sa: #2b2a12; --win: #6fd08f; --loss: #ff8a7a; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 17px/1.6 var(--font);
       font-variation-settings: "wdth" 100; }
a { color: inherit; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--green-2); }
@media (prefers-color-scheme: dark) { a:hover { color: var(--gold); } }
a:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* header: green with a gold scarf stripe */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 28px;
       padding: 14px max(16px, calc((100vw - 1120px) / 2)); background: var(--green); color: #fff;
       border-bottom: 5px solid var(--gold); box-shadow: inset 0 -9px 0 -5px var(--green); }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none;
         font-weight: 800; font-size: 1.45rem; letter-spacing: -.01em; font-variation-settings: "wdth" var(--wide); }
.brand:hover { color: var(--gold); }
.ball { width: 24px; height: 15px; border-radius: 50%; background: var(--gold); transform: rotate(-30deg);
        box-shadow: inset 0 0 0 2px var(--green); }
.top nav { display: flex; flex-wrap: wrap; gap: 2px 20px; font-weight: 600; font-size: .98rem; }
.top nav a { color: #fff; text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.top nav a:hover { color: var(--gold); border-bottom-color: var(--gold); }

main { max-width: 1120px; margin: 0 auto; padding: 28px 16px 56px; }
h1, h2, h3 { line-height: 1.08; letter-spacing: -.015em; margin: 0; }
h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); font-weight: 800; font-variation-settings: "wdth" var(--wide); margin: 6px 0 8px; }
h2 { font-size: 1.45rem; font-weight: 800; font-variation-settings: "wdth" 112; margin: 40px 0 14px; }
h3 { font-size: 1.05rem; font-weight: 700; margin: 22px 0 8px; color: var(--muted); }
.lede { color: var(--muted); margin: 0 0 14px; font-size: 1.08rem; max-width: 70ch; }
.meta { color: var(--muted); font-size: .93rem; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; padding: 0; list-style: none; }
.badge { display: inline-block; font-size: .82rem; font-weight: 600; padding: 3px 9px; border-radius: 99px;
         border: 1px solid var(--line); background: var(--panel); color: var(--muted); }
.badge.gold { background: var(--gold); border-color: var(--gold); color: #1d1600; }
h2 .badge { vertical-align: middle; margin-left: 8px; font-variation-settings: "wdth" 100; letter-spacing: 0; }

/* home */
.hero { display: grid; gap: 18px 40px; align-items: end; padding: 4px 0 8px; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.1fr 1fr; } }
.hero h1 { font-size: clamp(2.6rem, 8vw, 4.6rem); }
.search { position: relative; }
.search label { display: block; margin-bottom: 6px; }
.search input { width: 100%; font: 500 1.1rem var(--font); padding: 13px 16px; border: 2px solid var(--green);
                border-radius: var(--radius); background: var(--panel); color: var(--ink); }
#results { list-style: none; margin: 6px 0 0; padding: 0; border-radius: var(--radius); overflow: hidden; }
#results li a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; background: var(--panel);
                border-bottom: 1px solid var(--line); text-decoration: none; }
#results li a:hover { background: var(--green); color: #fff; }
#results .kind { color: var(--muted); font-size: .9rem; }
#results li a:hover .kind { color: var(--gold); }
#results .none { padding: 10px 14px; color: var(--muted); }

/* THE board: this week's games, scoreboard style */
.board { margin: 26px 0 8px; background: var(--green); color: #fff; border-radius: var(--radius); padding: 18px 20px 10px;
         border-top: 5px solid var(--gold); }
.board h2 { margin: 0 0 6px; color: #fff; }
.board .tz-note { margin: 0 0 4px; font-size: .85rem; color: rgba(255,255,255,.8); }
.board .day { margin: 14px 0 4px; font-size: .9rem; font-weight: 600; color: var(--gold); }
.board ol { list-style: none; margin: 0; padding: 0; }
.board li { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 4px 14px;
            padding: 9px 0; border-top: 1px solid rgba(255,255,255,.14); }
.board .home { text-align: right; font-weight: 700; }
.board .away { font-weight: 700; }
.board a { color: #fff; text-decoration-color: rgba(255,182,18,.6); }
.board .mid { min-width: 5.6rem; text-align: center; font-weight: 800; font-size: 1.5rem; line-height: 1;
              font-variation-settings: "wdth" var(--narrow); font-variant-numeric: tabular-nums;
              background: rgba(0,0,0,.28); padding: 7px 10px; border-radius: 3px; }
.board .mid.time { color: var(--gold); font-size: 1.25rem; }
.board .comp { grid-column: 1 / -1; text-align: center; font-size: .8rem; color: rgba(255,255,255,.7); margin-top: -2px; }
.board li.sa .mid { box-shadow: inset 0 -3px 0 var(--gold); }
.board .empty { color: rgba(255,255,255,.8); padding: 8px 0 12px; }
@media (max-width: 560px) { .board { padding: 14px 12px 8px; } .board .mid { min-width: 4.4rem; font-size: 1.25rem; } }

.ranks { display: flex; flex-wrap: wrap; gap: 4px 0; list-style: none; margin: 0; padding: 0; }
.ranks li { display: flex; align-items: baseline; gap: 8px; padding: 4px 18px 4px 0; margin-right: 18px;
            border-right: 1px solid var(--line); font-weight: 600; }
.ranks li:last-child { border-right: 0; }
.ranks .pos { font-weight: 800; font-size: 1.6rem; line-height: 1; font-variation-settings: "wdth" var(--narrow); color: var(--green-2); }
@media (prefers-color-scheme: dark) { .ranks .pos { color: var(--gold); } }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 18px; padding: 0; margin: 0; list-style: none; }
.card { display: flex; flex-direction: column; padding: 11px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.card strong { font-weight: 700; font-size: 1.08rem; }
.card span { color: var(--muted); font-size: .9rem; }
.card:hover strong { color: var(--green-2); text-decoration: underline; text-decoration-color: var(--gold); }
.card .badge { align-self: flex-start; margin-top: 6px; }

.cols { display: grid; gap: 0 40px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .cols { grid-template-columns: 3fr 2fr; } }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.list .when { color: var(--muted); font-size: .88rem; margin-right: 8px; font-variant-numeric: tabular-nums; }
.list p { margin: 3px 0 0; color: var(--muted); font-size: .93rem; }

/* team page */
.glance dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin: 0;
             background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--green); border-radius: var(--radius); }
.glance dl > div { padding: 12px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.glance dt { font-size: .85rem; color: var(--muted); }
.glance dd { margin: 2px 0 0; font-weight: 700; font-size: 1.15rem; }
.glance dd a { text-decoration-color: var(--gold); }
.glance dd .meta { display: block; font-weight: 400; font-size: .88rem; }

.sheet { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.sheet li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: baseline; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.sheet li:last-child { border-bottom: 0; }
.sheet .name { font-weight: 600; }
.sheet .info { grid-column: 1; color: var(--muted); font-size: .9rem; }
.sheet .tag { grid-column: 2; grid-row: 1; font-size: .8rem; font-weight: 600; color: var(--muted); }
.sheet .tag.frame { color: var(--gold-ink); }

.matchday .md-cols { display: grid; grid-template-columns: 1fr; gap: 0 28px; }
@media (min-width: 760px) { .matchday .md-cols { grid-template-columns: 3fr 2fr; } }
ul.md { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
ul.md li { display: flex; gap: 14px; align-items: baseline; padding: 7px 14px; border-bottom: 1px solid var(--line); font-weight: 600; }
ul.md li:last-child { border-bottom: 0; }
ul.md .no { display: inline-block; min-width: 2rem; text-align: right; font-weight: 800; font-size: 1.35rem; line-height: 1;
            font-variation-settings: "wdth" var(--narrow); color: var(--green-2); }
@media (prefers-color-scheme: dark) { ul.md .no { color: var(--gold); } }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 14px 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; font-weight: 600; }
.prose p, .prose ul { max-width: 68ch; }
.prose h2 { font-size: 1.25rem; margin: 30px 0 10px; }
.prose ul { padding-left: 22px; margin: 0 0 16px; }
.prose li { margin: 6px 0; }
.sources { font-size: .93rem; color: var(--muted); margin-top: 40px; }
.sources h2 { font-size: 1.05rem; }
.sources ul { padding-left: 18px; }
table.hist { border-collapse: collapse; width: 100%; max-width: 640px; }
table.hist th, table.hist td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); }

/* tables, rankings, fixtures */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 12px; }
table.standings, table.fixtures { border-collapse: collapse; width: 100%; background: var(--panel); border: 1px solid var(--line); }
table.standings { font-variant-numeric: tabular-nums; }
table.standings th, table.standings td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.standings th { font-size: .82rem; font-weight: 600; color: var(--muted); background: var(--page); }
table.standings .num { text-align: right; }
table.standings td.team { font-weight: 600; white-space: normal; }
table.standings td:last-child strong { font-weight: 800; font-size: 1.1rem; font-variation-settings: "wdth" var(--narrow); }
tr.sa td { background: var(--sa); }
.up { color: var(--win); font-weight: 700; } .down { color: var(--loss); font-weight: 700; } .same { color: var(--muted); }
details.more summary { cursor: pointer; font-weight: 700; margin: 10px 0 14px; color: var(--green-2); }
@media (prefers-color-scheme: dark) { details.more summary { color: var(--gold); } }
.jump { margin: 6px 0 0; }
.jump a { text-decoration: none; }
.jump .badge:hover { border-color: var(--green); color: var(--ink); }
.more-link { font-weight: 700; }
@media (max-width: 640px) { table.standings .wide { display: none; } table.standings th, table.standings td { padding: 7px 6px; } }

table.fixtures td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.fixtures td.when { width: 7.5rem; white-space: nowrap; font-weight: 800; font-variation-settings: "wdth" var(--narrow);
                         font-size: 1.1rem; color: var(--green-2); }
@media (prefers-color-scheme: dark) { table.fixtures td.when { color: var(--gold); } }
table.fixtures td.fixture { font-weight: 600; }
table.fixtures td.fixture strong { font-weight: 800; font-variation-settings: "wdth" var(--narrow); font-size: 1.1rem; padding: 0 4px; }
table.fixtures td.fixture .meta { display: block; font-weight: 400; }
@media (max-width: 640px) {
  table.fixtures td.when { width: auto; }
  table.fixtures td { display: block; border-bottom: 0; padding: 3px 12px; }
  table.fixtures tr { display: block; border-bottom: 1px solid var(--line); padding: 6px 0; }
}
.pools { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 28px; }
.callout { display: flex; flex-direction: column; gap: 2px; margin: 14px 0 8px; padding: 14px 18px; max-width: 68ch;
           background: var(--green); color: #fff; border-left: 6px solid var(--gold); border-radius: var(--radius); text-decoration: none; }
.callout strong { font-weight: 800; font-size: 1.2rem; font-variation-settings: "wdth" 112; }
.callout span { color: rgba(255,255,255,.85); }
.callout:hover { color: var(--gold); }

.foot { border-top: 5px solid var(--gold); background: var(--green); color: #fff; padding: 22px 16px 30px; text-align: center; font-size: .92rem; }
.foot p { max-width: 70ch; margin: 6px auto; }
.foot a { color: var(--gold); }
.feeds a.rssbtn { display: inline-block; margin: 6px 12px 6px 0; padding: 10px 14px; border-radius: var(--radius);
                  background: var(--gold); color: #1d1600; font-weight: 700; text-decoration: none; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media (min-width: 900px) { .board ol { display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; } }
/* fixtures: every day's table shares the same columns, so times, games and venues line up down the page */
table.fixtures { table-layout: fixed; }
table.fixtures td.when { width: 8.5rem; }
table.fixtures td.fixture { width: 55%; }
table.fixtures td { overflow-wrap: anywhere; }
@media (max-width: 640px) { table.fixtures { table-layout: auto; } table.fixtures td.when, table.fixtures td.fixture { width: auto; } }

.tz-note { font-size: .85rem; color: var(--muted, #5b6b63); }
.board .tz-note { color: rgba(255,255,255,.8); }

/* Feedback */
.foot .ask { font-weight: 600; font-size: 1rem; }
.feedback { display: grid; gap: 6px; max-width: 40rem; margin: 18px 0; }
.feedback label { font-weight: 600; margin-top: 10px; }
.feedback input, .feedback select, .feedback textarea { font: 400 1rem var(--font); color: var(--ink); background: var(--panel);
  border: 2px solid var(--line); border-radius: 6px; padding: 10px 12px; width: 100%; }
.feedback input:focus-visible, .feedback select:focus-visible, .feedback textarea:focus-visible,
.feedback button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-color: var(--green); }
.feedback textarea { resize: vertical; min-height: 9rem; }
.feedback button { justify-self: start; margin-top: 14px; font: 700 1rem var(--font); background: var(--green); color: #fff;
  border: 0; border-radius: 6px; padding: 12px 22px; cursor: pointer; }
.feedback button:hover { background: var(--gold); color: var(--ink); }
.feedback .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Calendar feeds */
.cal-link { margin: 10px 0 18px; }
.cal-link > a { font-weight: 700; }
.cals { list-style: none; padding: 0; margin: 0 0 24px; }
.cals li { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cals .meta { grid-column: 1 / -1; font-size: .8rem; overflow-wrap: anywhere; }
.cal-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { display: inline-block; font-weight: 700; font-size: .9rem; background: var(--green); color: #fff; text-decoration: none;
  border-radius: 6px; padding: 7px 14px; }
.btn:hover { background: var(--gold); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--green); box-shadow: inset 0 0 0 2px var(--green); }
@media (max-width: 560px) { .cals li { grid-template-columns: 1fr; } }
@media (prefers-color-scheme: dark) { .btn.ghost { color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); } }

.meta.warn { color: var(--gold-ink); font-weight: 600; }
