/* ==========================================================================
   Fulgas Fringale — site styles, built on the Logo & brand guide v2.1

   Colour     koningsblauw #1B3B9C and peach #F3B48F only, in the approved pairs
              peach on koningsblauw (main) and koningsblauw on peach.
   Type       Albert Sans for everything that is not the logo. Headings uppercase and
              tracked wide, body text in sentence case.
   Logo       one-line signature wordmark (header), badge (jersey),
              FF icon in colour (footer),
              F and FF icons (favicon, menu, placeholders). The logo files already carry
              their clear space (one x-height) inside them, so they are never cropped.
   Pictures   photos and video are shown as they are, in their own colours.

   To restyle the whole site, change the variables in :root below.
   ========================================================================== */

@font-face {
  font-family: "Albert Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/albert-sans-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Albert Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/albert-sans-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Brand colours (brand guide v2.1) */
  --blue: #1b3b9c;
  --peach: #f3b48f;

  /* Layout */
  --gutter: clamp(1.25rem, 5vw, 5rem);
  --header-h: 4.5rem;

  /* Hero video, both set from content.js: an even koningsblauw veil (0 = none, 1 = solid),
     and a koningsblauw shade rising from the bottom behind the caption (0 = none) */
  --hero-tint: 0;
  --hero-shade: 0.5;

  /* The one-line logo file has 4.55% clear space left and right built in.
     A logo box of 109.97% of a column puts the ink exactly on the column edges. */
  --word-box: 1.0997;
  --word-pull: -0.0455;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--blue);
}

body {
  margin: 0;
  background: var(--peach);
  color: var(--blue);
  font-family: "Albert Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: var(--blue);
  color: var(--peach);
}

/* The hidden attribute always wins, also on elements that set their own display */
[hidden] {
  display: none !important;
}

img,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 0.07em;
}

p {
  margin: 0 0 1em;
}
p:last-child {
  margin-bottom: 0;
}

:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

/* Left and right page edge. Respects the notch on phones held sideways. */
.pad {
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 30;
  padding: 0.7rem 1rem;
  background: var(--peach);
  color: var(--blue);
}
.skip:focus {
  top: 1rem;
}

/* Small uppercase text, tracked wide (brand guide: GRAVEL · GENT) */
.caps {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Header: koningsblauw bar, peach one-line logo top left
   -------------------------------------------------------------------------- */

.top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: var(--header-h);
  background: var(--blue);
  color: var(--peach);
}

/* Minimum size of the one-line logo on screen: 216 px wide (brand guide) */
.top__logo {
  --w: clamp(13.5rem, 16vw, 15.5rem);
  position: relative;
  z-index: 2;
  display: block;
  flex: none;
  width: var(--w);
  margin-left: calc(var(--w) * var(--word-pull));
}
.top__logo img {
  width: 100%;
  height: auto;
}

.top__nav ul {
  display: flex;
  gap: clamp(1rem, 2vw, 2rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.top__nav a,
.top__back {
  display: block;
  padding-block: 0.75rem;
  text-decoration: none;
}
@media (hover: hover) {
  .top__nav a:hover,
  .top__back:hover {
    text-decoration: underline;
  }
}

.top__toggle {
  position: relative;
  z-index: 2;
  display: none;
  min-width: 2.75rem;
  min-height: 2.75rem;
  margin: 0 -0.25rem 0 0;
  padding: 0 0.25rem;
  border: 0;
  background: none;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
}

@media (max-width: 66.99rem) {
  .top__toggle {
    display: block;
  }
  .top__nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: none;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
    background: var(--blue);
    padding: var(--header-h) max(var(--gutter), env(safe-area-inset-right)) 2rem max(var(--gutter), env(safe-area-inset-left));
  }
  .top.is-open .top__nav {
    display: flex;
  }
  .top__nav ul {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }
  .top__nav a {
    padding-block: 0.35rem;
    font-size: clamp(1.5rem, 6.5vw, 2.5rem);
    font-weight: 600;
    letter-spacing: 0.1em;
    line-height: 1.15;
  }
  /* the FF monogram closes the menu sheet */
  .top__nav::after {
    content: "";
    display: block;
    flex: none;
    width: 4.5rem;
    height: 4.5rem;
    margin-top: 2.5rem;
    background: url("../logo/icon-ff-peach.svg") left center / contain no-repeat;
  }
}
@media (max-width: 66.99rem) and (max-height: 30rem) {
  .top__nav a {
    font-size: 1.25rem;
  }
  .top__nav::after {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Picture frames: photos and video fill their frame, in their own colours
   -------------------------------------------------------------------------- */

.frame {
  position: relative;
  overflow: hidden;
  background: var(--blue);
}
.frame__pic {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   Hero: the video full screen, nothing on top of it but a small caption and
   the pause button, on a soft koningsblauw shade at the bottom
   (hero.shade in content.js, 0 = off).
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100vh;
  min-height: 100svh;
  padding-top: var(--header-h);
  overflow: hidden;
  background: var(--blue);
  color: var(--peach);
}

.hero__media {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}
.hero__media .frame__pic {
  transition: opacity 1.2s ease;
}
.hero__video {
  opacity: 0;
}
.hero.has-video .hero__video {
  opacity: 1;
}
/* optional: a flat koningsblauw veil over the whole video (hero.tint, 0 = off) */
.hero__media::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  background: var(--blue);
  opacity: var(--hero-tint);
  pointer-events: none;
}
/* legibility of the caption: koningsblauw shade rising from the bottom (hero.shade, 0 = off) */
.hero__media::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  height: 30%;
  background: linear-gradient(to top, var(--blue), rgba(27, 59, 156, 0));
  opacity: var(--hero-shade);
  pointer-events: none;
}
/* until the video or still is there: plain koningsblauw */
.hero__media:not(.is-loaded)::before,
.hero__media:not(.is-loaded)::after {
  display: none;
}

.hero__over {
  position: relative;
  z-index: 2;
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
}

.hero__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.75rem;
}
.hero__foot p {
  margin: 0;
}
.hero__pause {
  min-height: 2.75rem;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 0.3em;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Sections, each in one approved colour pair
   -------------------------------------------------------------------------- */

.sec {
  --bg: var(--peach);
  --fg: var(--blue);
  --head: var(--blue);
  --line: rgba(27, 59, 156, 0.3);
  --hover-bg: var(--blue);
  --hover-fg: var(--peach);
  background: var(--bg);
  color: var(--fg);
  scroll-margin-top: var(--header-h);
}
.sec--peach {
  --bg: var(--peach);
  --fg: var(--blue);
  --head: var(--blue);
  --line: rgba(27, 59, 156, 0.3);
  --hover-bg: var(--blue);
  --hover-fg: var(--peach);
}
.sec--blue {
  --bg: var(--blue);
  --fg: var(--peach);
  --head: var(--peach);
  --line: rgba(243, 180, 143, 0.35);
  --hover-bg: var(--peach);
  --hover-fg: var(--blue);
}

/* Headings: uppercase, tracked wide (brand guide) */
.title {
  margin: 0 0 clamp(1.25rem, 2.4vw, 2rem);
  color: var(--head);
  font-size: clamp(1.3rem, 0.95rem + 1.5vw, 2.25rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.15;
  text-transform: uppercase;
  text-wrap: balance;
}

/* Statements: sentence case, large and tight */
.lead {
  max-width: 19em;
  margin: 0;
  color: var(--head);
  font-size: clamp(1.4rem, 1rem + 1.6vw, 2.25rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.16;
  text-wrap: pretty;
}
.lead--xl {
  max-width: 15em;
  font-size: clamp(1.75rem, 1rem + 3vw, 3.75rem);
  letter-spacing: -0.025em;
  line-height: 1.06;
}

.prose {
  max-width: 34em;
}
.lead + .prose {
  margin-top: 1.5rem;
}

/* Text on one side, picture on the other. Add split--flip to put the picture left. */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.split__text {
  padding-top: clamp(3rem, 8vw, 7rem);
  padding-bottom: clamp(3rem, 8vw, 7rem);
}
.split__media {
  order: -1;
  min-height: 68vw;
  margin: 0;
}
.split--nophoto .split__media {
  display: none;
}
/* until the photo is there: the F icon on koningsblauw */
.split__media:not(.is-loaded):not(.split__media--logo) {
  background: var(--blue) url("../logo/icon-f-peach.svg") center / min(32%, 9rem) auto no-repeat;
}
.split__media .frame__pic {
  opacity: 0;
  transition: opacity 0.7s ease;
}
.split__media.is-loaded .frame__pic {
  opacity: 1;
}

/* Jersey: the badge (stacked logo on a koningsblauw square) on peach */
.split__media--logo {
  display: grid;
  place-items: center;
  padding: clamp(2rem, 6vw, 5rem);
  background: var(--peach);
}
.split__logo {
  width: min(100%, 24rem);
  height: auto;
}

@media (min-width: 46rem) {
  .split:not(.split--nophoto) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: min(92vh, 56rem);
  }
  .split__text {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .split__media {
    order: 0;
    min-height: 0;
  }
  .split--flip .split__media {
    order: -1;
  }
  /* The column next to a picture keeps the page edge on its outer side only */
  .split:not(.split--flip):not(.split--nophoto) .split__text {
    padding-right: clamp(2rem, 5vw, 5rem);
  }
  .split--flip:not(.split--nophoto) .split__text {
    padding-left: clamp(2rem, 5vw, 5rem);
  }
}

/* Full-width sections (rides, events, sponsors) */
.sec__head {
  padding-top: clamp(3.5rem, 8vw, 7rem);
  padding-bottom: clamp(1.5rem, 2.5vw, 2.25rem);
}
.sec__body {
  padding-bottom: clamp(3.5rem, 8vw, 7rem);
}
.sec__foot {
  height: clamp(3.5rem, 8vw, 7rem);
}

/* --------------------------------------------------------------------------
   Rows: rides, events and the join links.
   A row that is a link flips to the opposite colour pair on hover, focus and tap.
   -------------------------------------------------------------------------- */

.rows {
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--line);
}

.row {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) minmax(0, 15rem) auto;
  align-items: baseline;
  gap: 0.4rem clamp(1.25rem, 3vw, 2.5rem);
  padding-top: clamp(1.25rem, 2.4vw, 1.9rem);
  padding-bottom: clamp(1.25rem, 2.4vw, 1.9rem);
  border-top: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
a.row {
  transition: background-color 0.15s ease, color 0.15s ease;
}
a.row:focus-visible,
a.row:active {
  background: var(--hover-bg);
  color: var(--hover-fg);
  outline: none;
}
@media (hover: hover) {
  a.row:hover {
    background: var(--hover-bg);
    color: var(--hover-fg);
  }
}

.row__date {
  display: block;
}
.row__day {
  display: block;
  font-size: clamp(2rem, 1.5rem + 1.6vw, 2.9rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
}
/* A range of days ("6–13") is set a little smaller so it stays on one line */
.row__day--range {
  font-size: clamp(1.35rem, 1rem + 1.1vw, 2rem);
  line-height: 1.4;
}
.row__month {
  display: block;
  margin-top: 0.45rem;
}

.row__title {
  display: block;
  font-size: clamp(1.2rem, 1.05rem + 0.8vw, 1.65rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.row__desc {
  display: block;
  max-width: 34em;
  margin-top: 0.4rem;
}
.row__meta {
  display: block;
  font-size: 0.9375rem;
  line-height: 1.45;
}
.row__cta {
  justify-self: end;
  text-decoration: underline;
  text-underline-offset: 0.3em;
  white-space: nowrap;
}

/* Join links sit inside the text column: label above, address below */
.rows--links {
  margin: clamp(1.75rem, 3vw, 2.5rem) -1rem 0;
}
.row--link {
  grid-template-columns: minmax(0, 1fr);
  gap: 0.2rem;
  padding-left: 1rem;
  padding-right: 1rem;
}
.row--link .row__meta {
  font-size: 1rem;
  overflow-wrap: anywhere;
}

@media (max-width: 54rem) {
  .row {
    grid-template-columns: 5.5rem minmax(0, 1fr);
  }
  .row > :nth-child(n + 3) {
    grid-column: 2;
  }
  .row__cta {
    justify-self: start;
    margin-top: 0.35rem;
  }
  .row--link {
    grid-template-columns: minmax(0, 1fr);
  }
  .row--link > :nth-child(n) {
    grid-column: 1;
  }
}

.note {
  margin: 0;
  padding-top: 1.25rem;
  font-size: 0.9375rem;
}

/* --------------------------------------------------------------------------
   Sponsors
   -------------------------------------------------------------------------- */

.sponsors {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  margin: 0 0 clamp(2.5rem, 6vw, 4.5rem);
  padding: 0;
  list-style: none;
}
.sponsors a {
  display: block;
  font-weight: 600;
  text-decoration: none;
}
.sponsors img {
  width: 100%;
  max-height: 5rem;
  object-fit: contain;
  object-position: left center;
}

.biglink {
  display: inline-block;
  margin-top: 0.5rem;
  padding-block: 0.5rem;
  color: var(--head);
  font-size: clamp(1rem, 4.6vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.16em;
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   Footer: koningsblauw banner with the practical links
   -------------------------------------------------------------------------- */

.foot {
  background: var(--blue);
  color: var(--peach);
  font-size: 0.875rem;
}
.foot__icon {
  display: block;
  flex: none;
  width: clamp(4rem, 6vw, 5rem);
}
.foot__icon img {
  width: 100%;
  height: auto;
}
.foot__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2.5rem;
  padding-top: clamp(1.75rem, 4vw, 2.75rem);
  padding-bottom: max(clamp(1.75rem, 4vw, 2.75rem), env(safe-area-inset-bottom));
}
.foot__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.foot__links a {
  display: block;
  padding-block: 0.6rem;
}
.foot a {
  text-decoration: none;
}
@media (hover: hover) {
  .foot__links a:hover {
    text-decoration: underline;
  }
}
.foot p {
  margin: 0;
}

/* --------------------------------------------------------------------------
   Plain pages (cookie policy, 404, Strava setup)
   -------------------------------------------------------------------------- */

.page-plain main {
  min-height: 80vh;
  padding-top: calc(var(--header-h) + clamp(2.5rem, 7vw, 5rem));
  padding-bottom: clamp(3.5rem, 8vw, 7rem);
}
.page-plain .prose h2 {
  margin: 2.2em 0 0.5em;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.3;
}
.page-plain .prose h2:first-child {
  margin-top: 0;
}
.page-plain .title {
  color: var(--blue);
}

/* 404: koningsblauw page with the F icon */
.page-blue {
  --head: var(--peach);
  background: var(--blue);
  color: var(--peach);
}
.page-blue main {
  min-height: 100vh;
  min-height: 100svh;
}
.page-blue .title,
.page-blue .lead {
  color: var(--peach);
}
.page-blue__mark {
  width: min(42vmin, 18rem);
  height: auto;
  margin-top: clamp(2.5rem, 8vh, 5rem);
}

.fallback {
  padding-top: 8rem;
  padding-bottom: 4rem;
}

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