/* Site styles, modelled on the old Wix site. Colours and fonts live in :root — change them there. */
:root {
  --bg: #0d1117;          /* page background */
  --surface: #161b22;     /* panels, cards */
  --deep: #010409;        /* header, footer */
  --ink: #f0f6fc;         /* text */
  --muted: #8b949e;       /* secondary text */
  --line: #30363d;
  --accent: #ff0000;      /* Boréal red: headings, subtitles, rules */
  --accent-strong: #e50000; /* red behind white text (keeps 4.5:1 contrast) */
  --link: #ff5c5c;        /* red, lightened for links in body text */
  --radius: 10px;
  --radius-lg: 20px;
  --wrap: 78rem;
  --font-display: "Unbounded", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 1.0625rem/1.6 var(--font);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip; /* full-width photos use 100vw */
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; line-height: 1.15; hyphens: manual; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1rem; }

.skip {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--accent-strong); color: #fff;
  padding: 0.5rem 0.75rem; border-radius: var(--radius); z-index: 10;
}
.skip:focus { top: 0.5rem; }

/* Buttons: solid red pills */
.btn {
  display: inline-block;
  background: var(--accent-strong); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; line-height: 1.2;
  text-decoration: none; text-align: center;
  padding: 0.75rem 2.2rem; border-radius: 999px; border: 2px solid var(--accent-strong);
  transition: background-color 0.15s, color 0.15s;
}
.btn:hover { background: #fff; color: var(--accent-strong); border-color: #fff; }
.btn-lg { font-size: 1rem; padding: 0.8rem 2.6rem; }
.cta { margin: 1.5rem 0; }

/* Header: black bar, logo left, menu centred, white "Devenez membre" pill */
.site-header { background: var(--deep); position: sticky; top: 0; z-index: 5; }
.header-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 2rem;
  padding-top: 0.75rem; padding-bottom: 0.75rem;
}
.brand {
  display: flex; align-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 1.25rem;
  color: var(--ink); text-decoration: none;
}
.site-header .brand { margin-right: auto; }
.brand img { display: block; height: 64px; width: auto; }
.lang-switch {
  font-weight: 600; font-size: 0.85rem;
  padding: 0.25rem 0.7rem; border: 1px solid var(--line); border-radius: 999px;
  text-decoration: none; color: var(--muted);
}
.lang-switch:hover { border-color: var(--ink); color: var(--ink); }

.site-nav { display: flex; align-items: center; gap: 1rem 1.5rem; flex-wrap: wrap; width: 100%; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.6rem; }
.site-nav a:not(.btn) {
  color: var(--ink); text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: 0.9rem;
  padding: 0.3rem 0; text-underline-offset: 0.3em;
}
.site-nav a:not(.btn):hover, .site-nav a:not(.btn)[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }
.site-nav .btn {
  background: #fff; color: var(--accent-strong); border-color: #fff;
  text-transform: uppercase; font-weight: 800; font-size: 0.8rem; letter-spacing: 0.02em;
  padding: 0.6rem 1.6rem; margin-left: 1rem;
}
.site-nav .btn:hover, .site-nav .btn[aria-current="page"] { background: var(--accent-strong); color: #fff; border-color: var(--accent-strong); }

.nav-toggle {
  display: none;
  font: inherit; font-weight: 600; color: var(--ink);
  background: none; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.35rem 0.8rem; cursor: pointer;
}

@media (min-width: 72rem) {
  .site-nav { width: auto; order: 2; margin-right: auto; }
  .lang { order: 3; }
}

/* Mobile: collapse the menu behind the toggle, only when JS is running. */
@media (max-width: 71.99rem) {
  .header-inner { gap: 0.5rem 0.75rem; }
  .brand img { height: 48px; }
  .js .nav-toggle { display: inline-block; }
  .js .site-nav { display: none; }
  .js .site-nav.open { display: flex; flex-direction: column; align-items: flex-start; padding: 0.5rem 0 1rem; }
  .site-nav ul { flex-direction: column; align-items: flex-start; }
  .site-nav .btn { margin: 0.5rem 0 0; }
}

/* Banner at the top of each page */
main { flex: 1; }
.banner { position: relative; overflow: hidden; padding: 2.5rem 0 0.5rem; }
.banner h1 { margin: 0; font-size: clamp(1.55rem, 6.4vw, 3.2rem); }
.subtitle {
  margin: 0.5rem 0 0;
  font-family: var(--font-display); font-weight: 700; font-size: clamp(1rem, 2vw, 1.2rem); color: var(--link);
}
.banner-text { margin: 0.8rem 0 0; font-size: clamp(1.05rem, 2vw, 1.25rem); max-width: 34rem; }
.banner .cta { margin: 1.5rem 0 0; }

/* Photo banner (home): runners in black and white, text top left */
.banner.has-image { min-height: clamp(24rem, 33vw, 34rem); padding: 3.5rem 0; }
.banner .banner-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); }
.banner.has-image::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(1, 4, 9, 0.8) 0%, rgba(1, 4, 9, 0.45) 45%, rgba(1, 4, 9, 0) 75%);
}
.banner-inner { position: relative; z-index: 1; width: 100%; }
.banner.has-image h1 { max-width: 14ch; font-size: clamp(1.6rem, 7vw, 3.1rem); line-height: 1; text-transform: uppercase; }
@media (max-width: 47.99rem) {
  .banner.has-image::after { background: rgba(1, 4, 9, 0.62); }
}
.banner.has-image .subtitle { color: #fff; text-transform: uppercase; letter-spacing: 0.04em; font-size: 1rem; }

/* Page content */
.prose { padding-top: 1.5rem; padding-bottom: 4rem; }
.block { margin: 0 0 3rem; }
.block p, .block li { max-width: 70ch; }
.block-intro p { max-width: none; font-size: 1.15rem; }
.prose h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); margin: 0 0 0.9rem; }
.prose h3 { font-size: 1.1rem; margin: 1.5rem 0 0.2rem; }
.prose h3 + p, .prose h3 + ul { margin-top: 0.2rem; }
.kicker { margin: -0.5rem 0 1rem; color: var(--link); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li + li { margin-top: 0.25rem; }
.prose li::marker { color: var(--accent); }
.prose strong { font-weight: 700; }
.prose table { width: 100%; border-collapse: collapse; }
.prose .table-wrap { margin: 1rem 0; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 0.4rem 0.8rem 0.4rem 0; border-bottom: 1px solid var(--line); }
.prose th { color: var(--muted); font-size: 0.85rem; font-weight: 600; }

/* Image beside text: a section whose heading is followed by a photo (pages without blocks) */
.block.media { display: grid; gap: 2rem; align-items: start; }
.media-img { margin: 0; }
.media-img img { display: block; width: 100%; border-radius: var(--radius-lg); }
@media (min-width: 48rem) {
  .block.media { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
}

/* Full-width photo band */
.band { margin: 3rem 0; width: 100vw; margin-left: calc(50% - 50vw); grid-column: 1 / -1; }
.band img { display: block; width: 100%; max-height: 32rem; object-fit: cover; }

/* Tiles: a list where every item has a photo (locations, race photos, partner logos) */
.prose ul.tiles {
  list-style: none; padding: 0; margin: 1.5rem 0;
  display: grid; gap: 1.5rem 4rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
}
.prose ul.tiles li { margin: 0; max-width: none; color: var(--muted); font-size: 0.95rem; }
.tiles img { display: block; width: 100%; aspect-ratio: 455 / 291; object-fit: cover; border-radius: var(--radius); margin-top: 0.6rem; }
.tiles li > img:only-child { margin-top: 0; }

/* People: a list where every item starts in bold (name, then role in red) */
.prose ul.people { list-style: none; padding: 0; margin: 0; }
.people li { color: var(--link); font-family: var(--font-display); font-weight: 600; line-height: 1.3; }
.prose .people li + li { margin-top: 1.1rem; }
.people strong { display: block; color: var(--ink); text-transform: uppercase; font-weight: 800; }

/* Quotes: a single one is a pull quote, several in a row become cards */
.prose blockquote { margin: 1.5rem 0; padding: 0.25rem 1.25rem; border-left: 3px solid var(--accent); font-style: italic; }
.prose .quotes { columns: 3 18rem; column-gap: 1.25rem; margin: 1.5rem 0; }
.quotes blockquote {
  break-inside: avoid; margin: 0 0 1.25rem; padding: 1.5rem 1.6rem 1rem;
  background: var(--surface); border: 0; border-radius: var(--radius-lg);
  font-size: 0.95rem; line-height: 1.55;
}
.prose blockquote p { max-width: none; }
.prose blockquote p:last-child { font-style: normal; font-family: var(--font-display); font-weight: 800; font-size: 0.9rem; }
.block:has(.quotes) > h2 { text-align: center; }

/* ---------- Page builder blocks ---------- */
/* A page is a grid of blocks, six columns wide: full = 6, two thirds = 4, half = 3, third = 2.
   Below 48rem (phones) every block is full width; thirds pair up as halves until 60rem.
   Each block is a size container, so what's inside lays out by the block's own width. */
.prose.blocks {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 2.5rem 1.25rem; align-items: stretch;
}
.prose.blocks > .notice { grid-column: 1 / -1; margin: 0; }
.blk { grid-column: 1 / -1; min-width: 0; container-type: inline-size; }
.blk > :first-child { margin-top: 0; }
.blk > :last-child { margin-bottom: 0; }
@media (min-width: 48rem) {
  .w-half, .w-third, .w-two_thirds { grid-column: span 3; }
  .r-2 { grid-row: span 2; }
}
@media (min-width: 60rem) {
  .w-third { grid-column: span 2; }
  .w-two_thirds { grid-column: span 4; }
}
.s-panel { background: var(--surface); border-radius: var(--radius); padding: 1.75rem clamp(1rem, 3cqi, 1.75rem); }
.s-outline { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.5rem clamp(1rem, 3cqi, 2rem); }
.s-panel p, .s-outline p, .s-panel li, .s-outline li { max-width: none; }
@container (max-width: 26rem) {
  .blk h2 { font-size: 1.3rem; }
  .blk .cta .btn { display: block; }
  .blk ul.tiles { gap: 0.6rem; }
}

/* Text + photo */
.blk-media .media { display: grid; gap: 1.5rem 2.5rem; align-items: center; }
.blk-media .media-img img { display: block; width: 100%; height: auto; border-radius: var(--radius-lg); }
.shape-round .media-img img { aspect-ratio: 1; object-fit: cover; border-radius: 50%; max-width: 26rem; margin: 0 auto; }
@container (min-width: 40rem) {
  .media-left, .media-middle { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  .media-right { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .media-right .media-img { order: 2; }
}
@container (min-width: 56rem) {
  .media-middle { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem 3rem; }
  .media-middle .media-body { display: contents; }
  .media-middle .media-body > h2 { grid-column: 1; grid-row: 1 / span 6; font-size: clamp(1.7rem, 2.6cqi, 2.3rem); }
  .media-middle .media-body > .kicker { grid-column: 1; }
  .media-middle .media-img { grid-column: 2; grid-row: 1 / span 6; }
  .media-middle .media-body > :not(h2):not(.kicker) { grid-column: 3; margin: 0; }
}
/* Panel style on text + photo: the photo stays outside, the words sit in the panel. */
.blk-media.s-panel, .blk-media.s-outline { background: none; border: 0; padding: 0; }
.blk-media.s-panel .media, .blk-media.s-outline .media { align-items: stretch; gap: 1rem; }
.blk-media.s-panel .media-body { background: var(--surface); border-radius: var(--radius); padding: 1.75rem clamp(1rem, 3cqi, 1.75rem); }
.blk-media.s-outline .media-body { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.5rem clamp(1rem, 3cqi, 2rem); }
.blk-media.s-panel .media-img img, .blk-media.s-outline .media-img img { height: 100%; object-fit: cover; }
.blk-media.s-panel .media-body > .kicker, .blk-media.s-outline .media-body > .kicker { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; margin: -0.25rem 0 1rem; }
@container (min-width: 40rem) {
  .blk-media.s-panel .media, .blk-media.s-outline .media { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Columns / cards */
.prose ul.cols, .prose ul.gallery { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: 1.5rem 2.5rem; grid-template-columns: minmax(0, 1fr); }
.prose ul.cols li, .prose ul.gallery li { margin: 0; max-width: none; }
.cols h3 { margin: 0 0 0.25rem; font-size: 1.05rem; }
.cols li p { color: var(--muted); font-size: 0.95rem; margin: 0.25rem 0; max-width: none; }
.cols figure, .gallery figure { margin: 0; }
.cols figure img, .gallery figure img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); }
.cols li > figure:last-child { margin-top: 0.6rem; }
.cols-boxed li { background: var(--surface); border-radius: var(--radius); padding: 1rem; }
.gallery figcaption { color: var(--muted); font-size: 0.85rem; margin-top: 0.35rem; }
@container (min-width: 32rem) {
  .cols-2, .cols-3, .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@container (min-width: 50rem) {
  .cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}
.blk-columns + .blk-columns.w-full { border-top: 1px solid var(--line); padding-top: 2rem; margin-top: -0.5rem; }

/* Photo */
.blk-photo .photo { margin: 0; }
.blk-photo .photo img { display: block; width: 100%; border-radius: var(--radius-lg); }
.blk-photo .band { margin-top: 0.5rem; margin-bottom: 0.5rem; }
.blk-photo figcaption { color: var(--muted); font-size: 0.85rem; margin-top: 0.4rem; text-align: center; }

/* Testimonials */
.blk-testimonials > h2 { text-align: center; }
.prose blockquote .quote-name { font-style: normal; font-family: var(--font-display); font-weight: 800; font-size: 0.9rem; }

/* Sponsor logos on a light panel */
.prose ul.logo-wall {
  list-style: none; margin: 1.25rem 0 0; background: #f0f4f8; border-radius: var(--radius); padding: 1.25rem;
  display: grid; gap: 0.6rem; grid-template-columns: repeat(2, minmax(0, 1fr));
}
.logo-wall li { margin: 0; }
.logo-wall a { display: block; }
.logo-wall img {
  display: block; width: 100%; aspect-ratio: 314 / 131; object-fit: contain;
  background: #fff; border: 1px solid #2c3440; border-radius: 6px;
}
@container (min-width: 40rem) {
  .prose ul.logo-wall { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 1.75rem; }
}

/* People */
@container (min-width: 32rem) {
  .blk-people ul.people { columns: 2; column-gap: 2rem; }
  .blk-people .people li { break-inside: avoid; margin: 0 0 1.1rem; }
}

/* Buttons and call-to-action band */
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.cta-center { justify-content: center; }
.cta-band { background: var(--accent-strong); color: #fff; border-radius: var(--radius-lg); padding: 2rem clamp(1rem, 4cqi, 2.5rem); text-align: center; }
.cta-band h2 { color: #fff; margin: 0 0 0.5rem; }
.cta-band p { max-width: 48rem; margin-left: auto; margin-right: auto; }
.cta-band a:not(.btn) { color: #fff; }
.cta-band .btn-ghost { border-color: #fff; color: #fff; }
.cta-band .btn-ghost:hover { background: #fff; color: var(--accent-strong); }

/* Embeds (YouTube, Google Maps) */
.embed { border-radius: var(--radius); overflow: hidden; background: var(--surface); margin-top: 1rem; }
.embed[data-ratio="16x9"] { aspect-ratio: 16 / 9; }
.embed iframe { display: block; width: 100%; height: 100%; border: 0; }

/* Race page title, red and centred like the Wix site */
.page-races .banner { text-align: center; }
.page-races .banner h1 { color: var(--accent); }

/* "English version coming soon" and similar notices */
.notice {
  margin: 0 0 2rem; padding: 1rem 1.25rem;
  background: var(--surface); border: 1px dashed var(--accent); border-radius: var(--radius);
}
.notice p { margin: 0.2rem 0; }
.notice-title { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }

.not-found section + section { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--line); }

/* Footer: logo | copyright | round social icons */
.site-footer { background: var(--deep); color: var(--muted); font-size: 0.9rem; }
.site-footer a { color: var(--ink); }
.site-footer a:hover { color: var(--link); }
.footer-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 2rem;
  padding-top: 1.75rem; padding-bottom: 1.75rem;
}
.footer-brand img { height: 56px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 1rem; margin-top: 0.5rem !important; }
.footer-text { text-align: center; }
.footer-text p { margin: 0.2rem 0; }
.social { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; }
.social-icon {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; color: #fff;
}
.site-footer .social-icon:hover { color: #fff; opacity: 0.85; }
.social-icon svg { width: 1.45rem; height: 1.45rem; }
.social-strava { background: #fc4c02; }
.social-facebook { background: #1877f2; }
.social-instagram { background: #e1306c; }
@media (max-width: 47.99rem) {
  .footer-inner { flex-direction: column; }
}

/* Language chooser at "/" (fallback when the redirect doesn't run) */
.chooser main { padding: 4rem 1rem; text-align: center; }
.chooser-links { display: flex; justify-content: center; gap: 1rem; }

@media (max-width: 25rem) {
  .header-inner { gap: 0.5rem; }
  .site-header .brand img { height: 36px; }
  .lang-switch { padding: 0.2rem 0.55rem; }
  .nav-toggle { padding: 0.3rem 0.65rem; }
}

/* Draft preview builds only */
.preview-ribbon {
  position: sticky; top: 0; z-index: 30; margin: 0; padding: 0.4rem 1rem; text-align: center;
  background: #ffd700; color: #010409; font-weight: 700; font-size: 0.9rem;
}

/* Button styled as a link (footer "Cookies") */
.linklike {
  font: inherit; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 0.18em;
}
.linklike:hover { color: var(--link); }

/* Analytics consent banner */
.consent {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 20;
  max-width: 34rem; margin-left: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.25rem; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); font-size: 0.95rem;
}
.consent[hidden] { display: none; }
.consent p { margin: 0 0 0.75rem; }
.consent-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 !important; }
.consent .btn { padding: 0.55rem 1.4rem; font-size: 0.85rem; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--deep); border-color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
