/* Sydney Flying Squadron. One stylesheet, no framework.
   Palette: the Ensign system with the Foy accent, per the approved colour
   direction "Navy Hull, Coloured Sails" (28 Aug 2026). Every colour is a
   named token so a later dark theme is a token remap, not a redesign.
   Zoning: emblem red = racing and action; brass = venue and heritage;
   navy holds the structure. Red never sits directly on navy (keyline rule),
   and the life-ring cyan is identity only, never text or links. */
:root {
  /* canvas + surfaces */
  --canvas: #F5F3EB;
  --canvas-2: #DFDCCE;
  --card: #FFFFFF;
  /* structure */
  --navy: #141A44;      /* bands: header, footer, hero overlay */
  --navy-2: #263177;    /* the logo navy, headings + interactive structure */
  --ink: #090C21;       /* body text */
  --slate: #3B4059;     /* supporting text */
  --bone-dim: #A6ADCC;  /* muted text on navy bands */
  --bone-2: #D5D9EC;    /* supporting text over photo overlays */
  /* venue + heritage */
  --brass: #C9A55C;
  --brass-ink: #7A5A16; /* brass for text on pale grounds */
  /* action (the Foy accent) */
  --emblem: #B01B26;
  --emblem-ink: #8E1420; /* emblem for text on pale grounds */
  --lion: #EAD036;       /* dark-ground highlight only */
  /* identity only, never text or links */
  --ring: #00A8E8;
  /* course maps: the harbour, and starboard green beside emblem red for port */
  --map-water: #CFE2EC;
  --map-land: #EDEADF;
  --map-shore: #87A3B5;
  --stbd: #1F6E48;
  --buoy: #EBC33C;
  --laid: #D9661F;
  /* type */
  --display: "Cinzel", "Trajan Pro", "Palatino Linotype", Georgia, serif;
  --sans: "Montserrat", "Gotham", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --maxw: 68rem;
}
@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url("/assets/fonts/cinzel-latin-600-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.125rem; /* 18px body, per the readability pass */
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.6;
}
img { max-width: 100%; height: auto; }
a { color: var(--emblem-ink); }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--navy-2); outline-offset: 2px; }
.site-header a:focus-visible, .site-footer a:focus-visible, .hero a:focus-visible,
.site-header button:focus-visible { outline-color: var(--brass); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.skip { position: absolute; left: -999px; top: 0; background: var(--navy); color: var(--canvas); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 0; }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; color: var(--navy); line-height: 1.2; letter-spacing: .015em; text-wrap: balance; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; margin: 0 0 .5rem; }
h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); }

/* Header: navy band, brass rule */
.site-header { background: var(--navy); color: var(--canvas); border-bottom: 3px solid var(--brass); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem; padding-top: .8rem; padding-bottom: .8rem; }
.brand { text-decoration: none; color: var(--canvas); display: flex; align-items: center; gap: .75rem; }
/* The flag is 20:19; height sets the size, width follows */
.brand-mark { display: block; flex: none; height: 3rem; width: auto; }
.brand-text { display: block; min-width: 0; }
.brand-name { display: block; font-family: var(--display); font-weight: 600; font-size: 1.3rem; letter-spacing: .06em; }
.brand-tag { display: block; font-size: .72rem; color: var(--bone-dim); letter-spacing: .04em; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .1rem; }
.site-nav > ul > li { position: relative; }
.site-nav a { color: var(--canvas); text-decoration: none; padding: .55rem .7rem; display: block; font-size: .9rem; font-weight: 500; letter-spacing: .02em; }
.site-nav a:hover { background: var(--navy-2); }
.site-nav li ul { display: none; position: absolute; left: 0; top: 100%; background: var(--navy-2); min-width: 13rem; z-index: 5; padding: .3rem 0; }
.site-nav li:hover ul, .site-nav li:focus-within ul { display: block; }
.site-nav li ul a { padding: .45rem .9rem; font-size: .85rem; }
/* Red on navy only inside a bone keyline, per the contrast rules */
.nav-cta a { background: var(--emblem); color: var(--canvas); font-weight: 600; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(245, 243, 235, .55); }
.nav-cta a:hover { background: var(--emblem-ink); }
.nav-toggle { display: none; }

/* Hero: photography does the contrast work over a navy gradient.
   --focus is a per-image focal point so the crop keeps its subject
   on phones and wide screens alike. */
.hero { position: relative; background: var(--navy); color: var(--canvas); overflow: hidden; }
.hero img { width: 100%; height: min(56vh, 30rem); object-fit: cover; object-position: var(--focus, 50% 45%); display: block; }
.hero-text { position: absolute; inset: auto 0 0 0; padding: 2.5rem 0 1.5rem; background: linear-gradient(180deg, rgba(20, 26, 68, 0), rgba(20, 26, 68, .88)); }
.hero-text h1 { color: var(--canvas); margin: 0; }
.hero-text p { margin: .3rem 0 0; max-width: 46rem; color: var(--bone-2); }
.hero-credit { position: absolute; top: .5rem; right: .8rem; font-size: .7rem; color: var(--bone-dim); }
/* On phones the standfirst outgrows the overlay, so the text drops into a
   solid navy band below the photo and the crop keeps its subject clear. */
@media (max-width: 700px) {
  .hero img { height: clamp(13rem, 58vw, 20rem); }
  .hero-text { position: static; background: var(--navy); padding: 1.1rem 0 1.4rem; }
}

/* Breadcrumbs: quiet wayfinding under the header, above the page title */
.crumbs { font-size: .78rem; letter-spacing: .02em; padding-top: .9rem; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.crumbs li + li::before { content: "\203A"; color: var(--bone-dim); padding: 0 .45rem; }
.crumbs a { color: var(--slate); text-decoration-color: var(--canvas-2); }
.crumbs a:hover { color: var(--emblem-ink); }
.crumbs span { color: var(--slate); }
.crumbs span[aria-current] { color: var(--ink); font-weight: 600; }

/* Slots and cards */
/* 15rem puts four slots on one row at the page's full width */
.slots { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin: 1.5rem 0; }
.slot { background: var(--card); border: 1px solid var(--canvas-2); padding: 1rem 1.1rem; }
.slot h2 { margin: 0 0 .5rem; font-size: 1.05rem; }
.slot p { margin: .3rem 0; font-size: .95rem; }
/* The home's six slots: three to a row at full width, never wider than the phone */
.slots-home { grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr)); }
.tile-wind { font-size: 1.5rem; color: var(--navy); font-variant-numeric: tabular-nums; margin-right: .35rem; }
.tile-arrow { width: 1.1rem; height: 1.1rem; fill: var(--navy-2); vertical-align: -.15rem; }
/* The forecast tile: a small table, figures right-aligned under a quiet header; no gusts on narrow phones */
.tile-forecast { width: auto; margin: .3rem 0; font-variant-numeric: tabular-nums; }
.tile-forecast th, .tile-forecast td { border: 0; background: none; padding: .05rem .6rem .05rem 0; text-align: right; }
.tile-forecast th { font-size: .78rem; letter-spacing: 0; text-transform: none; }
.tile-forecast .tile-hour { font-weight: 600; color: var(--navy-2); text-align: left; }
@media (max-width: 350px) { .tile-gust { display: none; } }
.tile-note { font-size: .82rem; color: var(--slate); }
.cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); padding: 0; list-style: none; }
.card { border: 1px solid var(--canvas-2); overflow: hidden; background: var(--card); display: flex; flex-direction: column; }
.card img { height: 10rem; object-fit: cover; object-position: var(--focus, 50% 45%); width: 100%; }
.card-body { padding: .9rem 1rem 1.1rem; }
.card h3 { margin: 0 0 .3rem; font-size: 1rem; color: var(--navy-2); }
.card p { margin: 0; font-size: .9rem; color: var(--slate); }
/* Colour zoning on cards: red signals racing and action, brass signals
   venue and heritage. Applied by zone, or per card with these classes. */
.card-sail, .zone-sail .cards .card { border-top: 3px solid var(--emblem); }
.card-venue, .card-heritage, .zone-venue .cards .card, .zone-heritage .cards .card { border-top: 3px solid var(--brass); }

/* Vertical only: .section shares elements with .wrap, whose side padding
   must survive (the shorthand zeroed it and phones lost their margins). */
.section { padding-block: 2rem; }
.section-alt { background: var(--card); border-top: 1px solid var(--canvas-2); border-bottom: 1px solid var(--canvas-2); }
article.prose, .prose { max-width: 46rem; }
/* A legacy page may open with a small archival portrait beside its first text. A float stranded single lines, so it is a two column lead: the portrait, then the text as an anonymous flex item, the rest full width beneath. */
.prose .portrait-wrap { display: flex; align-items: flex-start; gap: 1.5rem; }
.prose .portrait-wrap > img { flex: none; max-width: 11.875rem; }
/* Below this width the portrait leaves too little measure to read beside it,
   so it becomes a block above the text. */
@media (max-width: 560px) {
  .prose .portrait-wrap { display: block; }
  .prose .portrait-wrap > img { display: block; margin-bottom: 1rem; }
}
.prose h2, .prose h3 { clear: both; }
/* Relative so hidden screen-reader labels in a wide table stay inside the
   scroll box instead of widening the page on a phone. */
.table-scroll { overflow-x: auto; position: relative; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; background: var(--card); }
td, th { border: 1px solid var(--canvas-2); padding: .45rem .6rem; text-align: left; vertical-align: top; }
th { background: var(--canvas); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--slate); }

.meta-line { color: var(--slate); font-size: .9rem; margin: 0 0 1rem; }
.badge { display: inline-block; background: var(--navy-2); color: var(--card); font-size: .72rem; padding: .15rem .5rem; border-radius: 2px; text-transform: uppercase; letter-spacing: .05em; }
a.badge { text-decoration: none; }
a.badge:hover { background: var(--navy); }
.badge-sample { background: var(--emblem); color: var(--canvas); }
.notice { border-left: 3px solid var(--emblem); background: var(--card); border-top: 1px solid var(--canvas-2); border-right: 1px solid var(--canvas-2); border-bottom: 1px solid var(--canvas-2); padding: .8rem 1rem; margin: 1rem 0; }
.notice-quiet { border-left-color: var(--slate); }
.archival { border-left: 3px solid var(--slate); background: var(--card); border-top: 1px solid var(--canvas-2); border-right: 1px solid var(--canvas-2); border-bottom: 1px solid var(--canvas-2); padding: .8rem 1rem; margin: 1rem 0; color: var(--slate); }

.doc-download { display: flex; gap: .8rem; align-items: center; border: 1px solid var(--canvas-2); padding: .8rem 1rem; margin: 1rem 0; background: var(--card); }
.doc-download a { font-weight: 600; }
.doc-kind { font-size: .8rem; color: var(--slate); }

.vh { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Membership comparison */
.compare { min-width: 34rem; }
.compare thead th { background: var(--navy); color: var(--canvas); font-family: var(--display); font-weight: 600; font-size: 1rem; text-transform: none; letter-spacing: .02em; padding: .7rem .8rem; }
.compare thead th:first-child { background: var(--card); }
.compare .compare-fee { display: block; font-family: var(--sans); font-weight: 600; font-size: .78rem; color: var(--brass); letter-spacing: .04em; margin-top: .15rem; }
.compare tbody th { font-weight: 400; font-size: .92rem; text-transform: none; letter-spacing: 0; color: var(--ink); }
/* keep the row labels in view while the tick columns scroll on phones */
.compare tbody th, .compare thead th:first-child { position: sticky; left: 0; background: var(--canvas); z-index: 1; }
.compare td { text-align: center; vertical-align: middle; }
.compare td.inc { color: var(--navy-2); font-weight: 700; font-size: 1.05rem; }
.compare td.exc { color: var(--slate); font-size: .82rem; }
.compare td.join-cell a { font-weight: 600; }

.price-set { display: flex; gap: 1rem; flex-wrap: wrap; align-items: baseline; }
.price { font-size: 1.15rem; font-weight: 700; color: var(--navy); }
.price small { font-weight: 400; color: var(--slate); }
.saving { color: var(--emblem-ink); font-weight: 600; }

/* Red is reserved for calls to action; the quiet button is structural navy */
.btn { display: inline-block; background: var(--emblem); color: var(--canvas); text-decoration: none; padding: .6rem 1.2rem; border-radius: 2px; font-weight: 600; border: 0; font-size: 1rem; cursor: pointer; }
.btn:hover { background: var(--emblem-ink); }
.btn-quiet { background: var(--navy-2); }
.btn-quiet:hover { background: var(--navy); }

form.club-form { max-width: 32rem; margin-bottom: 1.5rem; }
form.club-form button { margin-top: .6rem; }
form.club-form label { display: block; font-weight: 600; margin: .9rem 0 .2rem; }
form.club-form input[type=text], form.club-form input[type=email], form.club-form textarea, form.club-form select {
  width: 100%; padding: .55rem .6rem; border: 1px solid var(--slate); border-radius: 2px; font: inherit; background: var(--card); color: var(--ink);
}
form.club-form .consent { display: flex; gap: .6rem; align-items: flex-start; margin: .8rem 0; font-weight: 400; }
form.club-form .consent input { margin-top: .3rem; }
.collection-notice { font-size: .85rem; color: var(--slate); border: 1px solid var(--canvas-2); background: var(--card); border-radius: 2px; padding: .7rem .9rem; margin: 1rem 0; }

/* Boat profile lead: portrait originals crop to a calm landscape window
   centred on the sail insignia; landscape originals render untouched. */
.boat-lead { width: 100%; max-height: 34rem; object-fit: cover; object-position: var(--focus, 50% 45%); }

.boat-specs dt { font-weight: 700; color: var(--navy); }
.boat-specs dd { margin: 0 0 .6rem; }
.boat-specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0 1.5rem; }
.not-recorded { color: var(--slate); font-style: italic; }
.handicap-note { color: var(--slate); font-size: .85em; }
.handicap-why { display: block; color: var(--slate); font-size: .85em; line-height: 1.4; margin-top: .15rem; }
.start-time { display: block; }
/* A phone has no room for the calendar's Course column beside the other
   three, so there the course reads under the race name instead. */
.race-course { display: none; }
@media (max-width: 560px) {
  .race-calendar .course-col { display: none; }
  .race-course { display: block; color: var(--slate); font-size: .9em; line-height: 1.4; }
}
/* On the narrowest phones these tables overrun by a few pixels, clipping the
   handicap table's Change heading and the calendar's start times, so the
   cells give up some side padding there. */
@media (max-width: 350px) {
  .handicap-changes td, .handicap-changes th, .race-calendar td, .race-calendar th, .season-races td, .season-races th { padding-inline: .35rem; }
}
/* A phone has no room for the season table's Entrants column beside the
   other three, so there the entrants read under the race name. */
.race-entrants { display: none; }
@media (max-width: 560px) {
  .season-races .entrants-col { display: none; }
  .race-entrants { display: block; color: var(--slate); font-size: .9em; line-height: 1.4; }
}

.hours-table td, .hours-table th { border: 0; border-bottom: 1px solid var(--canvas-2); padding: .3rem .4rem; }

/* Zoning: in-page links follow the zone's accent. Buttons stay emblem,
   because red is the action colour everywhere. */
.zone-venue main a:not(.btn):not(.badge), .zone-heritage main a:not(.btn):not(.badge) { color: var(--brass-ink); }
.zone-venue .notice, .zone-heritage .notice { border-left-color: var(--brass); }

/* Race day guides: race flags, scratch start, handicaps, points.
   Written phone first, because they are read on the water and on the
   pontoon; wider screens only add columns. Red stays the racing accent. */
.guide h2 { margin-top: 2.2rem; }
.guide-lede { font-size: 1.2rem; max-width: 40rem; margin: 0 0 1rem; }
.guide-nav ul { list-style: none; margin: 0 0 1.2rem; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.guide-nav a { display: block; white-space: nowrap; padding: .45rem .8rem; border: 1px solid var(--canvas-2); border-radius: 999px; background: var(--card); color: var(--navy-2); text-decoration: none; font-size: .9rem; font-weight: 600; }
.guide-nav a:hover { border-color: var(--navy-2); }
.guide-nav a[aria-current] { background: var(--navy-2); border-color: var(--navy-2); color: var(--card); }
.flag { display: block; height: auto; max-width: none; filter: drop-shadow(0 1px 1px rgba(9, 12, 33, .18)); }
.horn { display: inline-block; background: var(--navy-2); color: var(--card); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: .1rem .45rem; border-radius: 2px; margin-right: .3rem; vertical-align: .1em; }
.guide-tip { font-size: 1.05rem; }
.guide-tip p, .notice p { margin: .2rem 0; }
.guide-more { max-width: 46rem; margin: 1rem 0; border: 1px solid var(--canvas-2); background: var(--card); padding: .7rem 1rem; }
.guide-more summary { cursor: pointer; font-weight: 600; color: var(--navy-2); min-height: 1.5rem; }
.guide-source { max-width: 46rem; margin-top: 2rem; }

/* Race flags: a grid to identify what is flying, then one row per signal */
.signal-index { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .6rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.signal-index a { display: flex; flex-direction: column; gap: .6rem; height: 100%; padding: .75rem; background: var(--card); border: 1px solid var(--canvas-2); border-top: 3px solid var(--emblem); text-decoration: none; color: var(--ink); }
.signal-index a:hover { border-color: var(--navy-2); }
.signal-index-flags { display: flex; }
/* names sit on one line across a row, however tall each hoist is */
.signal-index-name { margin-top: auto; font-size: .9rem; font-weight: 600; line-height: 1.3; color: var(--navy-2); }
.signals { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.signal { display: grid; grid-template-columns: 5rem 1fr; gap: 1rem; align-items: start; background: var(--card); border: 1px solid var(--canvas-2); padding: 1rem; scroll-margin-top: 1rem; }
.signal:target { outline: 3px solid var(--emblem); outline-offset: -1px; }
.signal-flags { min-width: 0; }
/* A hoist: flags flown together, top to bottom, on a line for the mast */
.hoist { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; width: max-content; max-width: 100%; padding: .25rem 0; border-left: 2px solid var(--slate); }
.hoist .flag { max-width: 100%; }
.hoist-lowering { display: flex; align-items: center; gap: .3rem; max-width: 100%; }
.hoist-lowering .flag { opacity: .45; min-width: 0; }
.hoist-arrow { font-weight: 700; color: var(--emblem-ink); line-height: 1; }
.signal-text h3 { margin: 0 0 .3rem; font-size: 1.1rem; }
.signal-text p { margin: .25rem 0; }
.signal-flown { color: var(--slate); font-size: .95rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* Scratch start: a countdown, one row per signal */
.countdown-steps { list-style: none; padding: 0; margin: 1.5rem 0; max-width: 46rem; }
.countdown-step { display: grid; grid-template-columns: 4.5rem 1fr; grid-template-areas: "when what" "when flags"; gap: .3rem 1rem; padding: 1rem 0; border-top: 1px solid var(--canvas-2); }
.countdown-when { grid-area: when; text-align: center; background: var(--navy); color: var(--canvas); padding: .5rem .25rem; align-self: start; }
.countdown-min { display: block; font-family: var(--display); font-size: 1.9rem; font-weight: 700; line-height: 1; }
.countdown-min small { font-family: var(--sans); font-size: .8rem; font-weight: 600; }
.countdown-time { display: block; font-size: .8rem; color: var(--bone-dim); font-variant-numeric: tabular-nums; margin-top: .3rem; }
.is-start .countdown-when { background: var(--emblem); }
.is-start .countdown-time { color: var(--canvas); }
.countdown-what { grid-area: what; }
.countdown-what h2 { margin: 0 0 .2rem; font-size: 1.15rem; font-weight: 700; letter-spacing: 0; }
.countdown-what p { margin: .2rem 0; }
.countdown-flags { grid-area: flags; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; min-height: 2rem; }
.countdown-clear { font-size: .85rem; color: var(--slate); font-style: italic; }

/* Handicaps */
.stat-row { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: .6rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-row li { background: var(--card); border: 1px solid var(--canvas-2); border-top: 3px solid var(--emblem); padding: .75rem .85rem; }
.stat { display: block; font-family: var(--display); font-size: 2rem; font-weight: 700; color: var(--navy); line-height: 1.1; }
.stat-label { display: block; font-size: .85rem; line-height: 1.35; color: var(--slate); }
.stat-label strong { color: var(--ink); }
.rule-list { list-style: none; padding: 0; margin: 1rem 0; max-width: 46rem; display: grid; gap: .5rem; }
.rule-list li { display: grid; grid-template-columns: 3.2rem 1fr; gap: .8rem; align-items: start; background: var(--card); border: 1px solid var(--canvas-2); padding: .75rem .85rem; }
.delta { display: inline-block; min-width: 2.6rem; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; padding: .2rem .3rem; border-radius: 2px; background: var(--canvas); color: var(--slate); }
.delta-down { background: var(--navy-2); color: var(--card); }
.delta-up { background: var(--emblem); color: var(--card); }
.delta-sm { min-width: 0; font-size: .75rem; padding: .05rem .3rem; margin-left: .2rem; }
.examples { display: grid; gap: 1rem; }
.example { background: var(--card); border: 1px solid var(--canvas-2); padding: 1rem; min-width: 0; }
.example h3 { margin: 0 0 .3rem; font-size: 1.05rem; }
.example > p { margin: 0 0 .7rem; font-size: .95rem; color: var(--slate); }
.example-table { font-size: .88rem; }
.example-table th, .example-table td { padding: .4rem .45rem; }
.example-table tbody th { font-size: .88rem; letter-spacing: 0; text-transform: none; color: var(--ink); background: var(--card); font-weight: 600; }
.example-table td:nth-child(2), .example-table td:nth-child(3) { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Points */
.points-grid { display: grid; gap: 1rem; max-width: 46rem; }
.points-grid h3 { margin: 0 0 .5rem; font-size: 1rem; }
.points { margin: 0; background: var(--card); border: 1px solid var(--canvas-2); }
.points div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .55rem .85rem; }
.points div + div { border-top: 1px solid var(--canvas-2); }
.points dt { font-weight: 600; }
.points dd { margin: 0; white-space: nowrap; color: var(--slate); font-size: .9rem; }
.pts { font-family: var(--display); font-size: 1.5rem; font-weight: 700; color: var(--navy); margin-right: .15rem; }
.points abbr { text-decoration: none; }
.points-expand { display: block; font-weight: 400; font-size: .85rem; color: var(--slate); }
.tie-steps { max-width: 46rem; padding-left: 1.4rem; }
.tie-steps li { margin: .5rem 0; }

/* Handicap start: the start boat's board, a countdown with the seconds
   hidden, and the fleet against the numbers they start on. The navy panel
   holds no red, per the keyline rule; the play button sits on white. */
.hs { max-width: 40rem; margin: 1rem 0; }
.hs-stage { background: var(--card); border: 1px solid var(--canvas-2); margin-bottom: 1.5rem; }
.hs-panel { background: var(--navy); color: var(--canvas); display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: center; padding: 1rem; }
.hs-startboat { display: flex; flex-direction: column; align-items: center; gap: .35rem; }
/* the halyard the board hangs from */
.hs-startboat::before { content: ""; width: 2px; height: .7rem; background: var(--bone-dim); margin-bottom: -.35rem; }
.hs-window { position: relative; width: 5.5rem; height: 5.5rem; overflow: hidden; border: 1px dashed rgba(166, 173, 204, .45); }
.hs-board { position: absolute; inset: 0; display: grid; place-items: center; background: #FFF; color: var(--ink); border: 3px solid var(--ink); font-family: var(--sans); font-weight: 800; font-size: 2.9rem; line-height: 1; font-variant-numeric: tabular-nums; transition: transform .32s ease-in, opacity .32s ease-in; }
.hs-board.is-down { transform: translateY(115%); opacity: .2; }
.hs-board.is-below { transform: translateY(115%); transition: none; }
.hs-window-label, .hs-label { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--bone-dim); }
.hs-readout { min-width: 0; }
.hs-line { margin: 0 0 .5rem; display: flex; flex-direction: column; }
.hs-time { font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.hs-count { font-weight: 800; font-size: 2.1rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hs-secs { color: var(--bone-dim); }
.hs-hooter { display: inline-block; margin-top: .5rem; background: var(--brass); color: var(--navy); font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: .15rem .5rem; border-radius: 2px; }
.hs-hooter[hidden] { display: none; }
.hs-now { margin: 0; padding: .85rem 1rem; min-height: 4.6rem; font-size: .98rem; border-bottom: 1px solid var(--canvas-2); }
.hs-now-insignia { width: 1.5rem; height: 1.5rem; vertical-align: -.4rem; margin-right: .25rem; }
.hs-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; padding: .85rem 1rem; }
.hs-controls button { padding: .65rem .3rem; font-size: .9rem; white-space: nowrap; }
/* On the narrowest phones four buttons in a row clip Restart, so they go two
   by two, keeping the page order for keyboard users. */
@media (max-width: 350px) {
  .hs-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.hs-btn { background: var(--card); color: var(--navy-2); border: 1px solid var(--navy-2); border-radius: 2px; font: inherit; font-weight: 600; cursor: pointer; }
.hs-btn:hover { background: var(--canvas); }
.hs-fleet-heading { font-size: 1rem; margin: 0 0 .5rem; }
.hs-fleet { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.hs-boat { display: grid; grid-template-columns: 2.6rem 2.5rem 1fr; gap: .75rem; align-items: center; background: var(--card); border: 1px solid var(--canvas-2); border-left: 4px solid var(--canvas-2); padding: .5rem .75rem; transition: background-color .3s, border-color .3s; }
/* the number styled as a small board, so the boat reads against its board */
.hs-num { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; background: #FFF; border: 2px solid var(--ink); font-weight: 800; font-size: 1.15rem; font-variant-numeric: tabular-nums; transition: opacity .3s; }
.hs-insignia { width: 2.5rem; height: 2.5rem; transition: transform .45s ease-out; }
.hs-boat-text { min-width: 0; }
.hs-boat-text a { font-weight: 600; }
.hs-status { display: block; font-size: .85rem; color: var(--slate); }
.hs-boat.is-up { border-left-color: var(--emblem); background: var(--canvas); }
.hs-boat.is-up .hs-status { color: var(--emblem-ink); font-weight: 600; }
.hs-boat.is-started { border-left-color: var(--navy-2); }
.hs-boat.is-started .hs-num { opacity: .35; }
.hs-boat.is-started .hs-insignia { transform: translateX(.5rem); }
.hs-boat.is-started .hs-status { color: var(--navy-2); font-weight: 600; }
.hs-sequence { list-style: none; padding: 0; margin: .6rem 0 0; }
.hs-seq-row { display: grid; grid-template-columns: 3.2rem 1fr; gap: .25rem .8rem; padding: .4rem 0; border-top: 1px solid var(--canvas-2); font-size: .92rem; }
.hs-seq-time { font-weight: 600; color: var(--navy-2); font-variant-numeric: tabular-nums; }
.hs-seq-starts { grid-column: 2; display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-weight: 600; }
.hs-seq-starts img { width: 1.5rem; height: 1.5rem; vertical-align: -.4rem; }
@media (prefers-reduced-motion: reduce) {
  .hs-board, .hs-boat, .hs-num, .hs-insignia { transition: none; }
}

/* Cinzel draws 1 like a capital I, so every figure a sailor must read sets in the sans */
.stat, .pts, .countdown-min, .countdown-what h2 { font-family: var(--sans); }

@media (min-width: 600px) {
  .signal-index { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
  .signal { grid-template-columns: 8rem 1fr; }
  .stat-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .points-grid { grid-template-columns: 1fr 1fr; }
  .countdown-step { grid-template-columns: 5.5rem 1fr 11rem; grid-template-areas: "when what flags"; }
  .countdown-flags { justify-content: flex-end; }
}
@media (min-width: 900px) {
  .examples { grid-template-columns: 1fr 1fr; }
}
@media print {
  .guide-nav { display: none; }
  .signal, .example, .countdown-step { break-inside: avoid; }
  .guide-more { border: 0; padding: 0; }
}

/* Course maps: SVG from lib/racing/course-map.js, in metres. Starboard is a green triangle, port a red square: the buoyage cone and can, and rule 33's shapes, on the map and in the list. */
.map { display: block; width: 100%; height: auto; font-family: var(--sans); border: 1px solid var(--canvas-2); fill: var(--ink); }
.map-land { fill: var(--map-land); }
.map-water { fill: var(--map-water); stroke: var(--map-shore); stroke-width: .75px; }
.crs, .end-line, .end-lead, .map-bar { fill: none; stroke: var(--navy); }
.crs { stroke: var(--navy-2); stroke-linecap: round; }
.crs-arrow { fill: var(--navy-2); stroke: #FFF; }
.mk-as, .mk-pole, .mk-flag, .map-bar { stroke: var(--ink); }
.mk-as { fill: var(--buoy); }
.mk-flag { fill: var(--laid); }
.mk-navy { fill: #FFF; stroke: var(--navy-2); }
.bd rect, .bd path { fill: var(--slate); stroke: #FFF; }
.bd text { fill: #FFF; }
.bd text, .lbl { font-weight: 700; }
/* list badges share the map colours, so they come first */
.leg-badge { justify-self: start; display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; padding: 0 .3rem; border-radius: 999px; background: var(--slate); color: #FFF; font-size: .78rem; font-weight: 700; }
.bd-stbd path, .leg-stbd { fill: var(--stbd); background: var(--stbd); }
.bd-port rect, .leg-port { fill: var(--emblem); background: var(--emblem); }
.bd-end rect, .leg-end { fill: var(--navy); background: var(--navy); }
.lbl { paint-order: stroke; stroke: #FFF; }
.lbl-isl { font-style: italic; font-weight: 600; fill: var(--slate); }
.map-furn rect { fill: #FFF; fill-opacity: .85; }
.course-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr)); padding: 0; margin: 1rem 0; list-style: none; }
.course-card { background: var(--card); border: 1px solid var(--canvas-2); border-top: 3px solid var(--emblem); padding: .9rem 1rem 1rem; }
.course-card h3 { margin: 0 0 .2rem; font-size: 1.1rem; }
.course-card .meta-line { margin: 0; }
/* the map runs to the card's edges, so a phone loses none of its width */
.course-card .map { margin-inline: -1rem; width: calc(100% + 2rem); border-inline: 0; }
.course-map { margin: .75rem 0 0; max-width: 34rem; }
.course-map figcaption, .leg-note, .map-credit { font-size: .82rem; color: var(--slate); }
.map-credit { margin: 0 0 2rem; }
.course-legs { list-style: none; padding: 0; margin: .75rem 0; font-size: .92rem; display: grid; gap: .35rem; }
.course-legs li { display: grid; grid-template-columns: 2.2rem 1fr; gap: .5rem; }
.leg-port, .leg-end { border-radius: 3px; }
.leg-stbd { width: 1.8rem; padding: 0 0 .15rem; border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); align-items: end; line-height: 1; }
.map-key { list-style: none; padding: 0; margin: 1rem 0; display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; font-size: .85rem; color: var(--slate); }
.map-key li { display: flex; align-items: center; gap: .4rem; }
.map-key svg { width: 1.5rem; height: 1.5rem; }
.map-key .map-key-wide { width: 2.5rem; }
@media print {
  .course-card, .course-map { break-inside: avoid; }
}

/* Footer: navy band, brass rule */
.footer-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); padding-top: 2rem; padding-bottom: 1rem; }
.site-footer { background: var(--navy); color: var(--bone-dim); margin-top: 3rem; font-size: .92rem; border-top: 3px solid var(--brass); }
.site-footer h2 { color: var(--brass); font-family: var(--sans); font-size: .78rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; margin: 0 0 .6rem; }
.site-footer a { color: var(--canvas); text-decoration-color: rgba(245, 243, 235, .35); }
.site-footer p { margin: .25rem 0; }
.site-footer strong { color: var(--canvas); font-weight: 600; }
/* Icon links get a 44px tap target; the negative margin lines the first
   icon up with the text above it. */
.site-footer .social-links { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; margin: .5rem 0 0 -.625rem; }
.social-links a { display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; }
.social-links a:hover { color: var(--brass); }
.social-links svg { display: block; }
.footnote { border-top: 1px solid rgba(245, 243, 235, .18); padding-top: .8rem; padding-bottom: 1.2rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; font-size: .82rem; color: var(--bone-dim); }

.countdown { font-variant-numeric: tabular-nums; font-size: 1.2rem; color: var(--navy-2); font-weight: 700; }

/* Pagefind search UI wears the tokens */
#search {
  --pagefind-ui-primary: var(--navy-2);
  --pagefind-ui-text: var(--ink);
  --pagefind-ui-background: var(--card);
  --pagefind-ui-border: var(--canvas-2);
  --pagefind-ui-tag: var(--canvas-2);
  --pagefind-ui-border-radius: 2px;
  --pagefind-ui-font: var(--sans);
}

.pagination { display: flex; gap: .5rem; flex-wrap: wrap; list-style: none; padding: 0; margin: 2rem 0; }
.pagination a { padding: .35rem .7rem; border: 1px solid var(--canvas-2); background: var(--card); border-radius: 2px; text-decoration: none; }
.pagination .current { padding: .35rem .7rem; background: var(--navy-2); color: var(--card); border-radius: 2px; }

@media (max-width: 800px) {
  .site-nav > ul { flex-direction: column; width: 100%; display: none; }
  .site-nav.open > ul { display: flex; }
  .site-nav li ul { position: static; display: block; padding-left: 1rem; background: transparent; }
  .nav-toggle { display: block; background: transparent; border: 1px solid var(--canvas); color: var(--canvas); padding: .4rem .9rem; border-radius: 2px; font: inherit; }
  .header-row { align-items: flex-start; }
}
/* On phones the flag and the full-size name will not share a line, so both
   step down a size to keep the name beside the flag */
@media (max-width: 560px) {
  .brand { gap: .6rem; }
  .brand-mark { height: 2.25rem; }
  .brand-name { font-size: 1.1rem; }
  .brand-tag { font-size: .68rem; }
}
@media print {
  .site-header, .site-footer, .nav-toggle { display: none; }
}
