/* South Molton Strugglers – Trail Poster design */

@font-face { font-family: "Anton"; src: url("/fonts/anton-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/fonts/barlow-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/fonts/barlow-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/fonts/barlow-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/fonts/barlow-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  /* #E00000 keeps white text above 4.5:1; the logo red #FB0001 is only used without text */
  --red: #e00000;
  --red-text: #c40000;
  --ink: #111111;
  --ink-2: #2a2a2a;
  --paper: #ffffff;
  --muted: #555555;
  --line: #e2e2e2;
  --soft: #f5f5f3;
  --ok: #1d7a3a;
  --display: "Anton", Impact, sans-serif;
  --body: "Barlow", system-ui, sans-serif;
  --wrap: 1280px;
  --gutter: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); font-size: 18px; line-height: 1.5; color: var(--ink); background: var(--paper); }
img { max-width: 100%; height: auto; }
a { color: var(--red-text); }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; text-transform: uppercase; line-height: 1; letter-spacing: 0.01em; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin: 0 0 0.4em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin: 1.2em 0 0.5em; }
h3 { font-size: 1.5rem; margin: 1.2em 0 0.4em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.page { padding-top: 48px; padding-bottom: 80px; min-height: 50vh; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.kicker { margin: 0 0 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.95rem; color: var(--red-text); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--paper); padding: 8px 12px; }
.inline { display: inline; margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Buttons */
/* Every button has the same 2px border so dark and light buttons look the same size side by side */
.btn, button.btn { display: inline-block; font: 800 1rem/1.2 var(--body); text-transform: uppercase; letter-spacing: 0.04em; text-decoration: none; padding: 12px 22px; border-radius: 4px; border: 2px solid var(--ink); cursor: pointer; background: var(--ink); color: var(--paper); }
.btn:hover { color: var(--paper); background: #000; }
.btn-light { background: var(--paper); color: var(--ink); }
.btn-light:hover { background: var(--soft); color: var(--ink); }
.btn-red { background: var(--red); color: var(--paper); border-color: var(--red); }
.btn-red:hover { background: #b80000; border-color: #b80000; }
.btn-small { padding: 8px 14px; font-size: 0.85rem; }
.btn-dark { background: var(--ink); color: var(--paper) !important; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
.more { display: inline-block; margin-top: 20px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--red-text); }
.buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Header and navigation: design A, a full-width mega panel per section */
.site-header { background: var(--red); border-bottom: 3px solid var(--ink); color: var(--paper); position: relative; z-index: 5; }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; padding-bottom: 16px; }
.logo img { display: block; height: 64px; width: auto; }
.main-nav > ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; }
.main-nav > ul > li > a, .main-nav summary { color: var(--paper); text-decoration: none; font-weight: 800; font-size: 1.05rem; letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer; }
.main-nav > ul > li > a:not(.btn), .main-nav summary { display: inline-block; padding: 8px 0; border-bottom: 4px solid transparent; }
.main-nav > ul > li > a.btn { padding: 10px 20px; }
.main-nav a[aria-current="page"], .main-nav summary.current { border-bottom-color: rgba(255, 255, 255, 0.6); }
.main-nav details[open] > summary { border-bottom-color: var(--paper); }
.main-nav summary { list-style: none; }
.main-nav summary::-webkit-details-marker { display: none; }
.mega { position: absolute; left: 0; right: 0; top: 100%; background: var(--ink); border-bottom: 6px solid var(--red); border-top: 3px solid var(--ink); box-shadow: 0 24px 40px rgba(0, 0, 0, 0.35); }
.mega-inner { display: flex; flex-wrap: wrap; gap: 32px; padding-top: 36px; padding-bottom: 40px; }
.mega-lead { flex: 0 1 200px; display: flex; flex-direction: column; gap: 12px; padding-right: 32px; border-right: 1px solid #333; }
.mega-lead p { margin: 0; }
.mega-lead-title { font-family: var(--display); font-size: 2.6rem; line-height: 1; text-transform: uppercase; color: var(--paper); }
.mega-lead-text { color: #ccc; line-height: 1.45; }
.mega-lead .mega-all { margin-top: auto; padding-top: 8px; }
.mega-columns, .mega-tiles, .mega-calendar { flex: 999 1 440px; }
.mega-events { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.mega-events a { display: flex; align-items: center; gap: 16px; color: var(--paper); text-decoration: none; }
.mega-events a:hover .mega-link-title { text-decoration: underline; text-underline-offset: 4px; }
.mega-events .datebox { width: 48px; height: 48px; }
.mega-events .datebox .d { font-size: 20px; }
.mega-events .datebox .m { font-size: 11px; }
.mega-events .tag { margin-left: auto; background: #333; }
.mega-events .tag-red { background: var(--red); }
.mega-more { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 22px 0 0; }
.mega-columns { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 28px 24px; align-content: start; }
.mega-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.mega-heading { margin: 0 0 14px; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: #ff8a80; }
.mega-col a, .mega-tiles a { display: flex; flex-direction: column; gap: 3px; color: var(--paper); text-decoration: none; }
.mega-link-title { font-weight: 600; font-size: 1.1rem; }
.mega-link-detail { font-size: 0.85rem; color: #aaa; }
.mega-col a:hover .mega-link-title, .mega-col a[aria-current="page"] .mega-link-title { text-decoration: underline; text-underline-offset: 4px; }
.mega-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; align-content: start; }
.mega-tiles a { height: 100%; gap: 8px; background: #262626; border-left: 4px solid var(--red); border-radius: 4px; padding: 16px 18px; }
.mega-tiles a:hover, .mega-tiles a[aria-current="page"] { background: #303030; }
.mega-tiles .mega-link-title { font-size: 1.15rem; line-height: 1.25; }
.mega-side { flex: 0 1 260px; display: flex; flex-direction: column; gap: 16px; }
.mega-card { display: flex; flex-direction: column; gap: 6px; background: var(--red); color: var(--paper); border-radius: 6px; padding: 20px 22px; text-decoration: none; font-weight: 700; }
.mega-card:hover { background: #c40000; color: var(--paper); }
.mega-card-kicker { font-size: 0.8rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.mega-card-title { font-family: var(--display); font-size: 1.9rem; line-height: 1; text-transform: uppercase; }
.mega-all, .mega-more a { color: var(--paper); font-weight: 800; font-size: 0.9rem; letter-spacing: 0.08em; text-transform: uppercase; }
.menu-toggle { display: none; }
.menu-toggle summary { list-style: none; cursor: pointer; font-weight: 800; text-transform: uppercase; border: 2px solid var(--paper); padding: 10px 14px; border-radius: 4px; }
.menu-toggle summary::-webkit-details-marker { display: none; }
.menu-toggle .when-open, .menu-toggle[open] .when-closed { display: none; }
.menu-toggle[open] .when-open { display: inline; }
@media (max-width: 900px) {
  .logo img { height: 48px; }
  .menu-toggle { display: block; }
  .main-nav { display: none; width: calc(100% + 2 * var(--gutter)); margin: 16px calc(-1 * var(--gutter)) -16px; background: var(--ink); padding: 4px var(--gutter) 20px; }
  .main-nav.open { display: block; }
  .main-nav > ul { flex-direction: column; align-items: stretch; gap: 0; }
  .main-nav > ul > li { border-bottom: 1px solid #333; }
  .main-nav > ul > li:last-child { border-bottom: 0; padding-top: 18px; }
  .main-nav > ul > li > a:not(.btn), .main-nav summary { display: flex; justify-content: space-between; padding: 16px 0; border-bottom: 0; }
  .main-nav summary::after { content: "+"; }
  .main-nav details[open] > summary { color: #ff8a80; }
  .main-nav details[open] > summary::after { content: "\2212"; }
  .main-nav > ul > li > a.btn { display: block; text-align: center; background: var(--red); border-color: var(--red); }
  .mega { position: static; background: none; border: 0; box-shadow: none; }
  .mega-inner { padding: 0 0 18px; gap: 18px; }
  .mega-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; flex-basis: 100%; }
  .mega-col ul { gap: 9px; }
  .mega-heading { margin-bottom: 9px; color: #bbb; }
  .mega-link-title, .mega-tiles .mega-link-title { font-size: 1rem; }
  .mega-lead { order: 1; flex-basis: 100%; padding: 0; border: 0; }
  .mega-lead-title, .mega-lead-text { display: none; }
  .mega-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; flex-basis: 100%; }
  .mega-calendar { flex-basis: 100%; }
  .mega-tiles a { padding: 10px 12px; }
  .mega-side { display: none; }
}

/* Footer */
.site-footer { background: var(--red); border-top: 3px solid var(--ink); color: var(--paper); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; padding-top: 36px; padding-bottom: 36px; font-weight: 700; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; }
.site-footer a, .site-footer button.link { color: var(--paper); }

/* Homepage sections */
.band { padding: 72px 0; }
.band-red { background: var(--red); color: var(--paper); }
.band-ink { background: var(--ink); color: var(--paper); }
.band-white { background: var(--paper); color: var(--ink); }
.band-red a:not(.btn), .band-ink a:not(.btn) { color: var(--paper); }
.band-red h2, .band-ink h2 { color: var(--paper); }
.hero { display: flex; flex-wrap: wrap; gap: 40px; align-items: center; padding-top: 56px; padding-bottom: 72px; }
.hero-text { flex: 999 1 480px; min-width: 0; }
.hero h1 { font-size: clamp(3rem, 8vw, 7.5rem); line-height: 0.92; margin: 0; }
.hero .intro { font-size: clamp(1.2rem, 2.5vw, 1.5rem); font-weight: 600; max-width: 600px; margin: 24px 0 0; }
.hero .kicker { color: var(--paper); }
.photo { display: block; width: 100%; object-fit: cover; border: 6px solid var(--ink); border-radius: 6px; }
.hero .photo { flex: 1 1 380px; min-width: 0; height: clamp(280px, 40vw, 520px); transform: rotate(1.5deg); }
.tilt-left { transform: rotate(-1.5deg); }
.banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding-top: 28px; padding-bottom: 28px; }
.banner-text { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; font-size: 1.3rem; font-weight: 700; }
.banner img { height: 96px; width: auto; mix-blend-mode: lighten; } /* lighten: a logo's black background melts into the dark banner */
.banner .buttons { margin-top: 0; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 36px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 48px; align-items: center; }
.list-rows { list-style: none; margin: 0; padding: 0; }
.list-rows a, .list-rows .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 2px solid var(--ink); text-decoration: none; font-weight: 700; color: var(--ink); }
.list-rows a:hover { color: var(--red-text); }
.list-rows .date { color: var(--muted); font-weight: 600; white-space: nowrap; }
.datebox { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 64px; height: 64px; background: var(--red); color: var(--paper); border-radius: 4px; flex-shrink: 0; }
.datebox .d { font-family: var(--display); font-size: 26px; line-height: 1; }
.datebox .m { font-size: 13px; font-weight: 800; letter-spacing: 0.08em; }
.upcoming a { justify-content: flex-start; gap: 16px; padding: 12px 0; }
.gp-card { background: var(--red); border-radius: 6px; padding: 28px; color: var(--paper); }
.gp-card h2 { margin: 0 0 4px; color: var(--paper); }
.gp-card .row { color: var(--paper); border-bottom-color: rgba(255, 255, 255, 0.5); }
.gp-card .pos { margin-right: 12px; }
.gp-card .pts { font-family: var(--display); font-size: 1.6rem; }
.gp-card a { color: var(--paper); }
.join h2 { font-size: clamp(2.5rem, 6vw, 4.25rem); line-height: 0.95; margin: 0; }
.join .text { font-size: 1.3rem; font-weight: 600; }
.races { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.race-card { display: flex; flex-direction: column; background: var(--ink-2); border-radius: 6px; overflow: hidden; text-decoration: none; border-bottom: 8px solid var(--red); }
.race-card img { width: 100%; height: 200px; object-fit: cover; }
.race-card span { padding: 20px 22px; font-family: var(--display); font-size: 1.9rem; line-height: 1; text-transform: uppercase; color: var(--paper); }
.notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; padding-top: 28px; padding-bottom: 28px; font-size: 1.3rem; font-weight: 700; }
.notice strong { color: var(--red-text); text-transform: uppercase; }
.notice p { margin: 0; }
.band-notice { border-bottom: 3px solid var(--ink); }
.sponsors { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.sponsors a { display: flex; align-items: center; justify-content: center; height: 110px; padding: 14px 18px; border: 2px solid var(--line); border-radius: 6px; }
.sponsors img { max-width: 100%; max-height: 100%; object-fit: contain; }
.news-list article { padding: 18px 0; border-bottom: 2px solid var(--ink); }
.news-list h3 { margin: 0 0 6px; }

/* Content pages: imported HTML from the old site */
.content { max-width: 860px; }
.content img { border-radius: 4px; }
.content table { border-collapse: collapse; margin: 1em 0; }
.content td, .content th { border: 1px solid var(--line); padding: 6px 10px; vertical-align: top; }
.content .row { display: flex; flex-wrap: wrap; gap: 24px; }
.content .row > [class*="col-"] { flex: 1 1 240px; }
.content .img-responsive { max-width: 100%; height: auto; }
.content .pull-right { float: right; margin: 0 0 16px 16px; }
.content .pull-left { float: left; margin: 0 16px 16px 0; }
.content iframe { max-width: 100%; }
.content::after { content: ""; display: block; clear: both; }

/* Tables of results and standings */
.table-wrap { overflow-x: auto; margin: 1em 0 2em; }
table.data { border-collapse: collapse; width: 100%; font-size: 1rem; }
table.data th { text-align: left; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.85rem; border-bottom: 3px solid var(--ink); padding: 10px 12px; white-space: nowrap; }
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tbody tr:nth-child(even) { background: var(--soft); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.year-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 1em 0; }
.year-links a[aria-current] { font-weight: 800; color: var(--ink); text-decoration: none; }
.pager { display: flex; gap: 16px; margin-top: 24px; font-weight: 700; }
.event-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; font-weight: 700; margin-bottom: 24px; }
.tag { display: inline-block; background: var(--ink); color: var(--paper); font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; padding: 3px 8px; border-radius: 3px; }
.tag-red { background: var(--red); }

/* Forms */
form.stack { display: grid; gap: 18px; max-width: 640px; }
label { display: grid; gap: 6px; font-weight: 700; }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
input[type="text"], input[type="email"], input[type="date"], input[type="datetime-local"], input[type="number"], input[type="search"], input[type="tel"], input[type="url"], select, textarea {
  font: inherit; font-weight: 400; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 4px; background: var(--paper); color: var(--ink); width: 100%;
}
textarea { min-height: 140px; }
textarea.code { font-family: ui-monospace, monospace; font-size: 0.9rem; min-height: 360px; }
.hint { font-weight: 400; color: var(--muted); font-size: 0.95rem; }
.flash { padding: 14px 18px; border-radius: 4px; margin: 0 0 24px; font-weight: 700; border: 2px solid var(--ink); }
.flash-ok { background: #e5f4e4; }
.flash-error { background: #fbebeb; border-color: var(--red-text); }
.errors { color: var(--red-text); font-weight: 700; }
fieldset { border: 2px solid var(--line); border-radius: 6px; padding: 16px 18px; display: grid; gap: 14px; }
legend { font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; padding: 0 6px; }

/* Staff area */
.admin-nav { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 14px 0; margin-bottom: 28px; border-bottom: 3px solid var(--ink); font-weight: 800; text-transform: uppercase; font-size: 0.9rem; letter-spacing: 0.04em; }
.admin-nav a { text-decoration: none; color: var(--ink); }
.admin-nav a[aria-current] { color: var(--red-text); text-decoration: underline; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.toolbar form { display: flex; gap: 8px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { border: 2px solid var(--ink); border-radius: 6px; padding: 18px 20px; text-decoration: none; color: var(--ink); }
.card h3 { margin: 0 0 6px; }
a.card:hover { background: var(--soft); color: var(--ink); }
.hidden-section { opacity: 0.55; }

/* Staff editor */
.field { display: grid; gap: 6px; }
.field > .label { font-weight: 700; }
.editor { border: 2px solid var(--ink); border-radius: 4px; background: var(--paper); }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border-bottom: 2px solid var(--ink); background: var(--soft); position: sticky; top: 0; z-index: 2; }
.editor-toolbar button { font: 700 0.85rem/1 var(--body); padding: 7px 10px; border: 1px solid #bbb; border-radius: 3px; background: var(--paper); cursor: pointer; }
.editor-toolbar button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.editor-toolbar button:disabled { opacity: 0.4; cursor: default; }
.editor-area { padding: 12px 16px; max-width: none; }
.editor-area .ProseMirror { min-height: 280px; outline: none; }
.editor-area .ProseMirror table { border-collapse: collapse; }
.editor-area .ProseMirror td, .editor-area .ProseMirror th { border: 1px solid var(--line); padding: 6px 10px; min-width: 60px; }
.editor-area .ProseMirror .selectedCell { background: #e7f1fb; }
.editor-area .ProseMirror img.ProseMirror-selectednode { outline: 3px solid var(--red); }
.editor-block { border: 2px dashed var(--muted); border-radius: 4px; padding: 12px 14px; margin: 10px 0; color: var(--muted); font-weight: 700; background: var(--soft); }
.editor + textarea { border: 0; border-top: 2px solid var(--ink); }
