/* Worcester RFC News Archive — styles
   Brand colours live in :root so they're easy to change. */
:root {
  --navy: #021C36;
  --navy-2: #063c66;
  --amber: #FFA300;
  --amber-hover: #ffb733;
  --cyan: #5DE0E6;
  --white: #ffffff;
  --mist: #eef4f6;
  --ink: #10263a;
  --muted: #355168;
  --line: #cbd8df;
  --line-strong: #9fb4c0;
  --radius: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Titillium Web", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--mist);
  line-height: 1.5;
}
html.no-scroll, html.no-scroll body { overflow: hidden; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }

/* Focus: navy ring for light backgrounds + cyan halo for dark ones */
:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--cyan);
  border-radius: 6px;
}
main:focus, .story-title:focus { outline: none; box-shadow: none; }

.skip-link {
  position: absolute; left: 12px; top: -80px; z-index: 100;
  background: var(--amber); color: var(--navy); font-weight: 700;
  padding: 10px 16px; border-radius: 999px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.shell { width: 100%; max-width: 1320px; margin: 0 auto; padding-inline: 20px; }
@media (min-width: 640px) { .shell { padding-inline: 32px; } }

/* ---------- Header ---------- */
.site-header { background: var(--navy); color: var(--white); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 16px; }
.brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.brand-logo { width: 48px; height: 48px; object-fit: contain; flex: none; }
.brand-kicker { color: var(--cyan); font-weight: 700; font-size: 14px; letter-spacing: .12rem; text-transform: uppercase; }
.brand-title { font-weight: 900; font-size: 26px; line-height: 1; }
@media (min-width: 640px) {
  .brand-logo { width: 56px; height: 56px; }
  .brand-kicker { font-size: 16px; }
  .brand-title { font-size: 32px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 10px 18px;
  font-weight: 700; font-size: 16px; line-height: 1.2; text-decoration: none;
  transition: background .2s ease, transform .2s ease;
  flex: none;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-amber { background: var(--amber); color: var(--navy); box-shadow: 0 10px 20px -8px rgba(0,0,0,.45); }
.btn-amber:hover { background: var(--amber-hover); }
.btn-ghost { background: rgba(255,255,255,.12); color: var(--white); padding: 8px 14px; font-size: 15px; }
.btn-ghost:hover { background: rgba(255,255,255,.22); }
@media (max-width: 420px) { #share-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } #share-button { padding: 12px; } }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--navy); }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-shade { position: relative; background: linear-gradient(90deg, rgba(2,28,54,.97), rgba(2,28,54,.78), rgba(2,28,54,.35)); }
.hero-inner { padding-block: 56px; color: var(--white); }
@media (min-width: 640px) { .hero-inner { padding-block: 80px; } }
.eyebrow { color: var(--cyan); font-weight: 700; font-size: 15px; letter-spacing: .12rem; text-transform: uppercase; }
.eyebrow-dark { color: var(--navy); }
.hero-heading { margin-top: 12px; max-width: 48rem; font-weight: 900; font-size: clamp(26px, 3.2vw, 36px); line-height: 1.1; }
.hero-copy { margin-top: 18px; max-width: 42rem; font-size: 18px; }

/* ---------- Content ---------- */
.content { padding-block: 32px 56px; }
@media (min-width: 640px) { .content { padding-block: 48px 72px; } }

.crumbs ol { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 700; color: var(--navy); }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--muted); font-weight: 400; }
.crumbs a { text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.crumbs a:hover { text-decoration-color: var(--navy); }

.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: 0 1px 2px rgba(2,28,54,.06); }
@media (min-width: 640px) { .panel { padding: 28px; } }
.panel-top { display: flex; flex-direction: column; gap: 20px; }
@media (min-width: 1024px) { .panel-top { flex-direction: row; align-items: flex-end; justify-content: space-between; } }
.panel-heading { margin-top: 4px; font-weight: 900; font-size: 26px; color: var(--navy); line-height: 1.15; }
.panel-copy { margin-top: 8px; max-width: 42rem; color: var(--muted); }

.search { width: 100%; }
@media (min-width: 1024px) { .search { max-width: 380px; } }
.search label { display: block; margin-bottom: 8px; font-weight: 700; color: var(--navy); }
.search-field { position: relative; }
.search-field svg { position: absolute; left: 13px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--navy); pointer-events: none; }
.search input {
  width: 100%; padding: 12px 12px 12px 40px; border: 1px solid var(--line-strong); border-radius: 12px;
  font: inherit; font-size: 16px; color: var(--navy); background: var(--white);
}
.search input::placeholder { color: #5b7385; }

.panel-filter { margin-top: 28px; padding-top: 24px; border-top: 1px solid #d7e1e6; }
.filter-heading { margin-bottom: 12px; font-size: 17px; font-weight: 700; letter-spacing: .08rem; text-transform: uppercase; color: var(--navy); }
.season-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  border: 1px solid var(--line-strong); background: var(--white); color: var(--navy);
  border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 700;
  transition: transform .2s ease, background .2s ease;
}
.pill:hover { transform: translateY(-2px); border-color: var(--navy); }
.pill.is-active { background: var(--amber); border-color: var(--amber); }

/* ---------- Header nav ---------- */
.header-actions { display: flex; align-items: center; gap: 10px; }
.nav-link { color: var(--white); font-weight: 700; text-decoration: underline; text-decoration-color: var(--cyan); text-decoration-thickness: 2px; text-underline-offset: 4px; padding: 6px 4px; }
.nav-link:hover { text-decoration-color: var(--amber); }
@media (max-width: 560px) { .nav-link { display: none; } }

.filter-group + .filter-group { margin-top: 18px; }
.filter-label { margin-bottom: 8px; font-size: 14px; font-weight: 700; color: var(--muted); }

/* ---------- Story grid ---------- */
.browser { margin-top: 36px; }
.result-summary { margin-bottom: 20px; font-weight: 700; color: var(--navy); }
.story-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .story-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .story-grid { grid-template-columns: repeat(3, 1fr); } }
.story-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(2,28,54,.06);
  transition: transform .2s ease, box-shadow .2s ease;
}
.story-card:hover, .story-card:focus-within { transform: translateY(-3px); box-shadow: 0 14px 30px -14px rgba(2,28,54,.4); }
.story-card:has(.story-link:focus-visible) { outline: 3px solid var(--navy); outline-offset: 2px; box-shadow: 0 0 0 7px var(--cyan); }
.card-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--navy); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media.art-0 { background: linear-gradient(135deg, #021c36 0%, #063c66 54%, #5de0e6 55%, #ffa300 56%, #ffa300 100%); }
.card-media.art-1 { background: linear-gradient(135deg, #0a2b4c 0%, #021c36 56%, #ffa300 57%, #ffa300 76%, #5de0e6 77%); }
.card-media.art-2 { background: linear-gradient(135deg, #ffa300 0%, #ffa300 18%, #021c36 19%, #021c36 74%, #5de0e6 75%); }
.cat-pill {
  position: absolute; left: 16px; bottom: 14px; background: rgba(255,255,255,.94); color: var(--navy);
  border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase;
}
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px 22px; flex: 1; }
.card-date { font-size: 14px; font-weight: 700; color: var(--muted); }
.card-title { font-size: 21px; font-weight: 900; line-height: 1.2; color: var(--navy); }
.story-link { text-decoration: none; }
.story-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.story-link:focus-visible { outline: none; box-shadow: none; }
.card-excerpt { color: var(--muted); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.more-wrap { display: flex; justify-content: center; margin-top: 28px; }
.btn-navy { background: var(--navy); color: var(--white); }
.btn-navy:hover { background: var(--navy-2); }
.empty-state {
  border: 1px dashed var(--line-strong); background: var(--white); border-radius: var(--radius);
  padding: 48px 24px; text-align: center; font-weight: 700; color: var(--navy);
}

/* ---------- Story page ---------- */
.story { margin-top: 36px; }
.story-shell { max-width: 820px; margin: 0 auto; }
.story-head { background: var(--navy); color: var(--white); border-radius: var(--radius); padding: 24px; }
@media (min-width: 640px) { .story-head { padding: 32px; } }
.story-head .btn-ghost { margin-bottom: 20px; }
.story-title { margin-top: 8px; font-size: clamp(28px, 4vw, 40px); font-weight: 900; line-height: 1.12; }
.story-meta { margin-top: 10px; font-size: 17px; color: #d6e4ec; }
.story-lead { margin: 24px 0 0; }
.story-lead img { width: 100%; height: auto; border-radius: var(--radius); background: #d7e1e6; }
.story-body { margin-top: 28px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; font-size: 18px; line-height: 1.65; color: var(--ink); overflow-wrap: anywhere; }
@media (min-width: 640px) { .story-body { padding: 36px 40px; } }
.story-body > * + * { margin-top: 1em; }
.story-body h3 { font-size: 24px; font-weight: 900; line-height: 1.2; color: var(--navy); margin-top: 1.4em; }
.story-body h4 { font-size: 20px; font-weight: 700; color: var(--navy); margin-top: 1.2em; }
.story-body a { color: var(--navy); font-weight: 600; text-decoration-color: var(--amber); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.story-body ul, .story-body ol { padding-left: 1.4em; }
.story-body li + li { margin-top: .35em; }
.story-body blockquote { margin-left: 0; padding: 4px 0 4px 18px; border-left: 4px solid var(--amber); color: var(--muted); }
.story-body hr { border: 0; border-top: 1px solid var(--line); margin: 1.6em 0; }
.story-body figure { margin: 1.4em 0; }
.story-body figure img { width: 100%; height: auto; border-radius: 12px; background: #d7e1e6; }
.story-body figure.embed iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; background: #000; }
.story-body figure.embed iframe[src*="vocaroo"] { aspect-ratio: auto; height: 90px; background: transparent; }
.story-body .table-wrap { overflow-x: auto; }
.story-body table { border-collapse: collapse; width: 100%; font-size: 16px; }
.story-body td, .story-body th { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.story-body .no-text { color: var(--muted); font-style: italic; }
.story-original { margin-top: 20px; }
.story-original a { font-weight: 700; color: var(--navy); text-decoration-color: var(--amber); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.story-nav { display: grid; gap: 12px; margin-top: 28px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .story-nav { grid-template-columns: 1fr 1fr; } }
.story-nav a {
  display: block; background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px;
  text-decoration: none; color: var(--navy); transition: border-color .2s ease;
}
.story-nav a:hover { border-color: var(--navy); }
.story-nav .dir { display: block; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.story-nav .t { display: block; font-weight: 900; line-height: 1.25; margin-top: 2px; }
.story-nav .next { text-align: right; }
@media (min-width: 640px) { .story-nav .next:only-child { grid-column: 2; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: var(--white); font-size: 14px; }
.site-footer .shell { padding-block: 28px; }


/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 60; transform: translate(-50%, 18px);
  background: var(--navy); color: var(--white); font-weight: 700; padding: 12px 20px; border-radius: 999px;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,.3); opacity: 0; pointer-events: none; transition: .25s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .story-card:hover, .story-card:focus-within, .pill:hover { transform: none; }
}
