@font-face {
  font-family: "Montserrat";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/montserrat-bold.woff2") format("woff2");
}

:root {
  --navy: #023363;
  --navy-dark: #021f3d;
  --red: #9e3a2f;
  --steel: #a9c3ce;
  --gray: #6e7781;
  --bg: #f6f8fa;
  --surface: #ffffff;
  --text: #16212e;

  /* Merch artwork (misty forest on the towel and tubes) */
  --fog: #e4eeea;
  --teal: #62999e;
  --teal-light: #a3cbc9;
  --pine: #2e5763;

  --line: #dbe3e8;
  --radius: 6px;
  --gutter: 16px;
  --heading: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.6 var(--body);
  overflow-wrap: break-word;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

h1,
h2,
h3 {
  font-family: var(--heading);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
  margin: 0 0 0.6em;
}

h1 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
}

h2 {
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
}

h3 {
  font-size: 1.15rem;
}

a {
  color: var(--navy);
}

a:hover {
  color: var(--navy-dark);
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.narrow {
  max-width: 760px;
}

.page {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.muted {
  color: var(--gray);
}

.lead {
  font-size: 1.15rem;
  color: var(--gray);
}

/* Header */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.brand img {
  height: 52px;
  width: auto;
}

.main-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-nav a {
  display: block;
  padding: 0.4rem 0;
  font-family: var(--heading);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.main-nav a:hover {
  border-bottom-color: var(--teal-light);
}

.main-nav a.is-active {
  border-bottom-color: var(--red);
}

/* Footer */

/* Treeline cut out of the merch artwork; its bottom edge is solid --pine */
.site-footer::before {
  content: "";
  display: block;
  height: clamp(70px, 14vw, 200px);
  margin-top: 2rem;
  background: url("../img/treeline.webp") center bottom / cover no-repeat;
}

.site-footer__body {
  background: var(--pine);
  color: var(--teal-light);
  padding: 0.5rem 0 2rem;
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0.2rem 0;
}

.site-footer strong {
  color: #fff;
  font-family: var(--heading);
}

.site-footer a {
  color: #fff;
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social a {
  display: inline-flex;
  padding: 0.3rem;
  margin: -0.3rem;
}

.social a:hover {
  color: var(--teal-light);
}

.social svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.social svg.social__filled {
  fill: currentColor;
  stroke: none;
}

/* Hero */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--fog);
}

.hero__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
}

/* Light wash at the top only: the artwork needs little, a photo keeps the logo area calm */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(228 238 234 / 0.55), rgb(228 238 234 / 0) 70%);
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 380px;
  padding-top: 2.5rem;
  padding-bottom: 3rem;
  text-align: center;
}

.hero__logo {
  margin: 0;
}

.hero__logo img {
  width: min(260px, 62vw);
  filter: drop-shadow(0 6px 18px rgb(46 87 99 / 0.35));
}

/* Pill keeps the claim legible on both the artwork and a dark photo */
.hero__claim {
  margin-top: 1.25rem;
  padding: 0.35rem 1.1rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.82);
  font-family: var(--heading);
  font-size: clamp(1rem, 3vw, 1.25rem);
  color: var(--navy);
}

.hero__claim p {
  margin: 0;
}

/* 404: the merch landscape with a fog veil so the text reads */

.lost {
  background:
    linear-gradient(180deg, rgb(228 238 234 / 0.9), rgb(228 238 234 / 0.55)),
    url("../img/krajina.webp") center 35% / cover no-repeat,
    var(--fog);
}

.lost__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding-top: 3rem;
  padding-bottom: 3rem;
  text-align: center;
}

.lost__code {
  margin: 0;
  font-family: var(--heading);
  font-size: clamp(4.5rem, 18vw, 8rem);
  line-height: 1;
  color: var(--pine);
}

.lost__text {
  max-width: 32rem;
  margin: 0 auto;
  font-size: 1.1rem;
}

/* Longer labels than the hero, so let them wrap on phones */
.lost__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.5rem 0 0;
}

/* Sections */

.section {
  padding: 2.5rem 0;
}

.section--tint {
  background: var(--fog);
}

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin-bottom: 1rem;
}

.section__head h2 {
  margin: 0;
}

.button {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  background: var(--navy);
  color: #fff;
  font-family: var(--heading);
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  background: var(--navy-dark);
  color: #fff;
}

.button--ghost {
  background: rgb(255 255 255 / 0.7);
  color: var(--navy);
  box-shadow: inset 0 0 0 2px var(--navy);
}

.button--ghost:hover {
  background: var(--navy);
}

/* Equal-width columns, so the gap between the buttons sits on the logo's axis */
.hero__actions {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0.75rem;
  margin: 1.5rem 0 0;
}

.hero__actions .button {
  text-align: center;
}

/* Home: numbers band */

/* The tube pattern under a pine veil, so it reads as texture */
.stats {
  background:
    linear-gradient(rgb(46 87 99 / 0.88), rgb(46 87 99 / 0.88)),
    url("../img/utr-pattern.webp") center / 700px auto,
    var(--pine);
  color: #fff;
}

.stats__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin: 0 auto;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  list-style: none;
  text-align: center;
}

.stats__list strong {
  display: block;
  font-family: var(--heading);
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  line-height: 1.1;
}

.stats__list span {
  color: var(--teal-light);
  font-size: 0.85rem;
}

/* Home: about */

.about {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

.about__text .rich {
  font-size: 1.05rem;
}

.about__image {
  margin: 0;
}

.about__image img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgb(2 31 61 / 0.15);
}

/* Home: what we do */

.pillars {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pillar {
  padding: 1.25rem 1.25rem 1.4rem;
  background: var(--surface);
  border-top: 3px solid var(--teal);
  border-radius: var(--radius);
}

.pillar h3 {
  margin-bottom: 0.4rem;
}

.pillar p {
  margin: 0;
}

/* Home: latest photos */

.photo-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.photo-strip img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  transition: opacity 0.15s;
}

.photo-strip a:hover img {
  opacity: 0.85;
}

/* Cards */

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgb(2 31 61 / 0.08);
  overflow: hidden;
}

.card__link {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.card__img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.card__img--empty {
  background: var(--teal-light);
}

.card__body {
  padding: 1rem 1.1rem 1.25rem;
}

.card__body p {
  margin: 0;
  color: var(--text);
}

.card__meta {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--gray);
  font-size: 0.875rem;
}

.card__title {
  margin-bottom: 0.4rem;
}

.card__link:hover .card__title {
  text-decoration: underline;
}

.pager {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
}

/* Events list */

.tag {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  background: var(--fog);
  color: var(--navy);
  font-family: var(--heading);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.tag--race {
  background: var(--red);
  color: #fff;
}

.event-list {
  margin-top: 2.5rem;
}

.event-list__month {
  margin-top: 1.5rem;
  color: var(--gray);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.event-items {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.6rem;
}

.event-item a {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border-left: 4px solid var(--navy);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
}

.event-item a:hover .event-item__title {
  text-decoration: underline;
}

.event-item__date {
  color: var(--gray);
  font-size: 0.9rem;
}

.event-item .tag {
  justify-self: start;
}

.event-item__title {
  font-family: var(--heading);
  color: var(--navy);
  font-size: 1.05rem;
}

.event-item__meta {
  color: var(--gray);
  font-size: 0.9rem;
}

.archive {
  margin-top: 2.5rem;
}

.archive summary {
  cursor: pointer;
  margin-bottom: 1rem;
  font-family: var(--heading);
  font-weight: 700;
  color: var(--navy);
}

.archive .event-item a {
  border-left-color: var(--steel);
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4rem 1.25rem;
  margin: 0 0 2rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-radius: var(--radius);
}

.facts dt {
  color: var(--gray);
}

.facts dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Month calendar: hidden on small screens, the list below covers them */

.cal {
  display: none;
}

.cal__head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.cal__title {
  margin: 0;
  min-width: 11ch;
  text-align: center;
}

.cal__nav {
  font-size: 1.4rem;
  text-decoration: none;
  line-height: 1;
}

.cal__today {
  margin-left: auto;
  font-size: 0.9rem;
}

.cal__grid {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  background: var(--surface);
}

.cal__grid th {
  padding: 0.4rem;
  color: var(--gray);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

.cal__grid td {
  height: 6.5rem;
  padding: 0.25rem;
  vertical-align: top;
  border: 1px solid var(--line);
}

.cal__grid td.is-out {
  background: var(--bg);
}

.cal__grid td.is-out .cal__day {
  color: var(--gray);
  opacity: 0.6;
}

.cal__day {
  display: inline-block;
  min-width: 1.6rem;
  margin-bottom: 0.2rem;
  padding: 0 0.25rem;
  font-size: 0.85rem;
  text-align: center;
  border-radius: 3px;
}

.is-today .cal__day {
  background: var(--navy);
  color: #fff;
  font-weight: 700;
}

.cal__event {
  display: block;
  margin-top: 2px;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  background: var(--navy);
  color: #fff;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}

.cal__event--race {
  background: var(--red);
}

/* Hover card; a sibling of the link because .cal__event clips overflow for the ellipsis */

.cal__ev {
  position: relative;
}

.tip {
  display: none;
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  width: max-content;
  min-width: 180px;
  max-width: 260px;
  padding: 0.6rem 0.8rem 0.7rem;
  background: var(--surface);
  color: var(--text);
  border-left: 3px solid var(--navy);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgb(2 31 61 / 0.18), 0 1px 3px rgb(2 31 61 / 0.12);
  font-size: 0.85rem;
  line-height: 1.4;
  text-align: left;
  pointer-events: none;
}

.tip::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 14px;
  border: 6px solid transparent;
  border-top: 0;
  border-bottom-color: var(--surface);
}

.tip--race {
  border-left-color: var(--red);
}

.cal__ev:hover .tip,
.cal__ev:focus-within .tip {
  display: grid;
  gap: 0.15rem;
}

.tip .tag {
  justify-self: start;
  margin-bottom: 0.25rem;
}

.tip__title {
  font-family: var(--heading);
  font-size: 0.95rem;
  color: var(--navy);
}

.tip__meta {
  color: var(--gray);
}

/* Right-hand columns open leftwards so the card stays on screen */
.cal__grid td:nth-child(n + 5) .tip {
  left: auto;
  right: 0;
}

.cal__grid td:nth-child(n + 5) .tip::before {
  left: auto;
  right: 14px;
}

.cal__event:hover {
  color: #fff;
  filter: brightness(1.2);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--gray);
  font-size: 0.875rem;
}

.legend__swatch {
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  margin-right: 0.4rem;
  border-radius: 2px;
  background: var(--navy);
  vertical-align: -0.1rem;
}

.legend__swatch--race {
  background: var(--red);
}

/* View switch: both views are desktop-only, phones get the list */

.view-switch {
  display: none;
  margin-bottom: 1rem;
  border: 1px solid var(--navy);
  border-radius: var(--radius);
  overflow: hidden;
}

.view-switch a {
  padding: 0.3rem 1rem;
  font-family: var(--heading);
  font-size: 0.85rem;
  text-decoration: none;
}

.view-switch a.is-active {
  background: var(--navy);
  color: #fff;
}

/* Year view: twelve month grids */

.cal__months {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  margin-top: 1rem;
}

.cal__month h3 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
}

.cal__month h3 a {
  text-decoration: none;
}

.cal__month .cal__grid th {
  padding: 0.15rem;
  font-size: 0.65rem;
}

.cal__month .cal__grid td {
  height: 2.6rem;
  padding: 1px 2px;
}

.cal__month .cal__day {
  min-width: 0;
  margin: 0;
  padding: 0 0.2rem;
  font-size: 0.7rem;
  line-height: 1.3;
}

.cal__month .cal__event {
  margin-top: 1px;
  padding: 0 0.2rem;
  font-size: 0.65rem;
  line-height: 1.35;
  border-radius: 2px;
}

/* Sponsors */

.sponsors__intro {
  max-width: 44rem;
}

.sponsors {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.sponsor__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.5rem;
  background: var(--surface);
  border-top: 3px solid var(--teal);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgb(2 31 61 / 0.08);
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.15s;
}

.sponsor__link:hover {
  box-shadow: 0 8px 24px rgb(2 31 61 / 0.14);
}

.sponsor__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  margin-bottom: 1rem;
}

.sponsor__logo img {
  max-height: 140px;
  width: auto;
}

.sponsor__name {
  font-family: var(--heading);
  font-size: 1.6rem;
  color: var(--navy);
}

.sponsor__text {
  margin-bottom: 1rem;
}

.sponsor__url {
  margin-top: auto;
  font-family: var(--heading);
  font-size: 0.9rem;
  color: var(--navy);
}

/* Gallery */

.photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.photos img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
}

.photos__caption {
  margin: 0.3rem 0 0;
  color: var(--gray);
  font-size: 0.85rem;
}

/* Rich text */

.rich > * + * {
  margin-top: 1rem;
}

.rich h2 {
  margin-top: 2rem;
}

.figure {
  margin: 1.5rem 0;
}

.figure img {
  border-radius: var(--radius);
}

.figure figcaption {
  margin-top: 0.4rem;
  color: var(--gray);
  font-size: 0.9rem;
}

.map {
  margin: 1.5rem 0;
}

.map iframe {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 0;
  border-radius: var(--radius);
  background: var(--fog);
}

.map figcaption {
  margin-top: 0.4rem;
  color: var(--gray);
  font-size: 0.9rem;
}

.embed iframe {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 0;
}

@media (min-width: 700px) {
  .cal {
    display: block;
  }

  .view-switch {
    display: inline-flex;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .event-item a {
    grid-template-columns: 13rem auto 1fr;
    align-items: baseline;
    column-gap: 1rem;
  }

  .event-item__meta {
    grid-column: 3;
  }

  .hero__inner {
    min-height: 460px;
  }

  .stats__list {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
  }

  .about--with-image {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }

  .pillars {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .sponsors {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .photo-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .photos {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

@media (min-width: 1000px) {
  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cal__months {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
