/* Shared race-page layouts. Content and dates belong to each race's HTML/config. */
.race-page {
  --ice: #dafbfe;
  --section-width: 392px;
  --dark-border: rgb(0 0 0 / 25%);
  background: #fff;
  color: #000;
  letter-spacing: -.01em;
}
.race-page main > section { scroll-margin-top: 100px; }
.race-section { display: flex; flex-direction: column; align-items: center; gap: 64px; padding: 24px 16px 64px; }
.section-content, .section-heading-wrap { width: 100%; max-width: var(--section-width); }
.section-heading-wrap { display: flex; align-items: flex-start; }
.section-label {
  display: inline-flex; align-items: center; gap: 4px; height: 32px;
  padding: 0 12px 0 8px; border: 1px solid var(--dark-border); border-radius: 2px;
  font: 700 14px/14px var(--heading-font); letter-spacing: -.025em; text-transform: uppercase;
}
.section-label:not(:has(img)) { padding-inline: 12px; }
.race-section--dark { background: var(--ink); color: #fff; }
.race-section--dark .section-label { border-color: var(--border); }
.race-section--ice { background: var(--ice); }
.race-title { font: 700 36px/36px var(--heading-font); letter-spacing: -.8px; text-transform: uppercase; }
.race-subtitle { margin: 0; font: 700 24px/24px var(--heading-font); letter-spacing: -.025em; text-transform: uppercase; }
.race-copy { display: flex; flex-direction: column; gap: 24px; }
.race-page .media-placeholder {
  display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 16 / 9;
  border-radius: 4px; background: #000; color: #fff;
  font: 600 10px/10px var(--body-font); letter-spacing: -.02em; text-transform: uppercase;
}
.race-columns.w3-row { display: flex; flex-direction: column; gap: 24px; }
.race-columns.w3-row::before, .race-columns.w3-row::after { display: none; }
.race-columns > .w3-col { float: none; min-width: 0; width: 100%; }
.awards-copy { max-width: 392px; }

/* Welcome fills at least the viewport; content can grow in short windows.
 * Its actual bottom still controls the fixed header action. */
.welcome {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  height: auto; min-height: 560px;
  min-height: max(560px, 100vh); min-height: max(560px, 100dvh);
  gap: 24px; padding: 80px 16px;
  background: var(--ink); color: #fff;
}
.welcome > *, .welcome-center > * { flex-shrink: 0; }
.welcome-spacer { width: 40px; height: 21px; }
.welcome-center { display: contents; }
.welcome-info { display: flex; flex-direction: column; align-items: center; gap: 24px; text-align: center; text-transform: uppercase; }
.welcome-info > div:first-child { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.welcome-brand { display: block; line-height: 0; }
.welcome-title { font: 700 52px/52px var(--heading-font); letter-spacing: -.03em; }
.welcome-date { font: 700 24px/24px var(--heading-font); letter-spacing: -.025em; }
.countdown { display: flex; gap: 8px; padding-top: 8px; }
.countdown-cell { display: flex; flex-shrink: 0; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 64px; height: 64px; padding: 0 24px 4px; border: 1px solid var(--border); border-radius: 4px; }
.countdown-number { color: var(--accent); font: 700 24px/24px var(--heading-font); letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.countdown-label { font: 600 10px/10px var(--body-font); letter-spacing: -.02em; }
.race-page .welcome-action { width: 100%; max-width: 288px; }

/* Two identical halves keep the leftward loop seamless. */
.last-call { overflow: hidden; background: var(--footer); color: var(--accent); font: 700 36px/36px var(--heading-font); letter-spacing: -.8px; text-transform: uppercase; }
.last-call-track { display: flex; width: max-content; animation: last-call-left 40s linear infinite; }
.last-call-group { display: flex; flex-shrink: 0; justify-content: space-around; gap: 24px; min-width: 100vw; padding-right: 24px; }
.last-call span { flex-shrink: 0; white-space: nowrap; }
@keyframes last-call-left { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.last-call:hover .last-call-track { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .last-call-track { animation: none; } }

/* Entire distance rows open course maps; tags remain informational. */
.distance-list, .entry-list { display: flex; flex-direction: column; gap: 16px; }
.distance-row { display: flex; flex-direction: column; gap: 12px; width: 100%; padding-top: 16px; background: url('../assets/icons/divider-dark.svg') left top / 100% 1px no-repeat; }
.distance-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; width: 100%; }
.distance-heading .icon-button { flex-shrink: 0; margin-top: 4px; }
.distance-name { display: flex; align-items: flex-end; gap: 8px; color: var(--ink); font: 700 52px/52px var(--heading-font); letter-spacing: -.03em; text-transform: uppercase; }
.distance-unit { padding-bottom: 4px; font-size: 24px; line-height: 24px; letter-spacing: -.025em; }
.distance-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.race-page .tag { font: 600 10px/10px var(--body-font); }
.distance-tags .tag--dark { background: var(--ink); color: #fff; }
.wetsuit-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(100%, var(--section-width));
  padding: 8px 12px;
  border-radius: 2px;
  background: rgb(0 0 0 / 15%);
  color: #000;
  font: 500 14px/21px var(--body-font);
  letter-spacing: 0;
}
.wetsuit-notice img { flex: 0 0 24px; }
.awards-copy > .wetsuit-notice { align-self: flex-start; max-width: 100%; }
@media (width < 1280px) {
  .awards-layout--with-notice .race-columns.w3-row { gap: 64px; }
}
.schedule { display: flex; flex-direction: column; gap: 16px; margin-block: 0; }
.schedule-row { display: flex; align-items: flex-end; gap: 16px; padding-top: 16px; border-top: 1px solid var(--dark-border); }
.schedule-time { flex: 0 0 72px; font: 700 36px/36px var(--heading-font); letter-spacing: -.8px; }
.schedule-description { min-width: 0; margin: 0; }
.program-footer { display: flex; flex-direction: column; gap: 64px; }
.program-note { font: 500 14px/21px var(--body-font); text-align: center; }
.race-kids-page .schedule { gap: 8px; }
.race-kids-page .schedule-row { padding-top: 8px; }
.race-kids-page .program-note { text-align: left; }
.race-conditions { flex: 1; min-width: 0; border-top: 1px solid var(--dark-border); }
.race-conditions summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 24px; cursor: pointer; list-style: none; }
.race-conditions summary::-webkit-details-marker { display: none; }
.race-conditions summary .icon-button { flex-shrink: 0; }
.conditions-minus, .race-conditions[open] .conditions-plus { display: none; }
.race-conditions[open] .conditions-minus { display: block; }
.conditions-content { display: flex; flex-direction: column; gap: 40px; padding-top: 40px; }
.conditions-content > div { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 496px; }
.conditions-content h3 { font: 700 20px/20px var(--heading-font); letter-spacing: -.025em; text-transform: uppercase; }
.conditions-content p { font: 500 16px/24px var(--body-font); }

.entry-item { display: flex; flex-direction: column; gap: 8px; padding-top: 16px; background: url('../assets/icons/footer-divider.svg') left top / 100% 1px no-repeat; }
.entry-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ice); }
.discount { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; height: 32px; padding: 0 12px; border-radius: 2px; background: var(--accent); color: #000; font: 700 14px/14px var(--heading-font); letter-spacing: -.025em; }
.entry-price { display: flex; align-items: flex-end; gap: 4px; font: 700 36px/36px var(--heading-font); letter-spacing: -.8px; text-transform: uppercase; }
.entry-price span { padding-bottom: 2px; font-size: 24px; line-height: 24px; letter-spacing: -.025em; }
.entry-footer { display: flex; flex-direction: column; align-items: center; gap: 64px; }
.entry-register { width: 100%; max-width: 288px; }
.entry-note { font: 500 14px/21px var(--body-font); text-align: center; }
.awards-detail { display: contents; }
.age-categories { display: flex; flex-direction: column; gap: 24px; }
.age-list.w3-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.age-list.w3-row::before, .age-list.w3-row::after { display: none; }
.age-list > .w3-col { float: none; width: calc((100% - 16px) / 3); }
.age-list span { display: flex; align-items: center; justify-content: center; height: 54px; border-radius: 2px; background: var(--ice); font: 700 24px/24px var(--heading-font); letter-spacing: -.025em; }
.race-divider { width: 100%; height: 1px; background: var(--dark-border); }
.results-layout { display: flex; flex-direction: column; gap: 64px; }
.results-card { display: flex; flex-direction: column; align-items: flex-start; gap: 40px; padding: 16px; border-radius: 4px; background: var(--accent); color: #000; }
.results-card .section-label { height: auto; min-height: 32px; padding-block: 8px; border-color: var(--dark-border); }
.results-date { margin-top: 4px; font: 700 14px/14px var(--heading-font); letter-spacing: -.025em; text-transform: uppercase; }
.race-page .about-photo { max-width: none; aspect-ratio: 8 / 3; }
.location-row { display: flex; flex-direction: column; gap: 24px; }
.workshop-card-heading { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.race-page .action--small { height: 44px; padding: 2px 2px 2px 12px; border-radius: 2px; font-size: 16px; line-height: 16px; }
.race-page .action--small .action-icon { flex-basis: 40px; width: 40px; height: 40px; }

@media (hover: hover) {
  .distance-row:hover .distance-name { font-style: oblique; }
  .distance-row:hover .icon-button--accent, .race-conditions summary:hover .icon-button--accent { background: #ffea4d; }
}
@media (min-width: 439px) {
  .race-section { padding-top: 40px; }
  .race-kids-page .schedule-row { gap: 24px; }
  .race-kids-page .schedule-time { flex-basis: 80px; }
  .age-list.w3-row { gap: 24px; }
  .age-list > .w3-col { width: calc((100% - 24px) / 2); }
}
@media (min-width: 439px) and (max-width: 767.98px) {
  .awards-layout { max-width: none; }
}
@media (min-width: 768px) {
  .race-page { --section-width: 600px; }
  .race-section { padding: 64px 32px 80px; }
  .welcome { padding-inline: 32px; }
  .age-list > .w3-col { width: calc((100% - 48px) / 3); }
  .awards-copy { min-width: 260px; max-width: none; }
  .awards-copy p, .about-copy > p, .location-copy p { max-width: 496px; }
}
@media (768px <= width < 1280px) {
  .race-kids-page .program-note { max-width: 392px; }
}
@media (min-width: 1280px) {
  .race-page { --section-width: 1224px; font-size: 18px; line-height: 27px; }
  .race-page main > section { scroll-margin-top: 128px; }
  .race-section { gap: 80px; padding: 128px 32px 160px; }
  .wetsuit-notice { font-size: 16px; line-height: 24px; }
  .section-label { font-size: 16px; line-height: 16px; }
  .race-title { font-size: 72px; line-height: 72px; letter-spacing: -.025em; }
  .race-subtitle { font-size: 32px; line-height: 32px; }
  .race-page .media-placeholder, .race-page .tag { font-size: 12px; line-height: 12px; }
  .welcome-info { width: 100%; max-width: 1224px; padding-top: 80px; }
  .welcome-title { font-size: 120px; line-height: 120px; }
  .welcome-date { font-size: 32px; line-height: 32px; }
  .countdown { gap: 8px; }
  .countdown-cell { width: 96px; height: 96px; padding-inline: 32px; }
  .countdown-number { font-size: 32px; line-height: 32px; }
  .countdown-label { font-size: 12px; line-height: 12px; }
  .last-call { font-size: 72px; line-height: 72px; letter-spacing: -.025em; }
  .last-call-track { animation-duration: 80s; }
  .distance-list { gap: 40px; }
  .entry-list { gap: 24px; }
  .distance-row { padding-top: 40px; }
  .entry-item { padding-top: 24px; }
  .distance-heading { align-items: center; }
  .distance-name { gap: 16px; font-size: 120px; line-height: 120px; }
  .distance-unit { padding-bottom: 8px; font-size: 32px; line-height: 32px; }
  .distance-heading .icon-button { flex-basis: 96px; width: 96px; height: 96px; margin-top: 0; }
  .schedule { gap: 24px; }
  .schedule-row { padding-top: 24px; gap: 24px; }
  .schedule-time { flex-basis: 184px; }
  .race-kids-page .schedule { gap: 12px; }
  .race-kids-page .schedule-row { padding-top: 12px; }
  .race-kids-page .schedule-time { flex-basis: 184px; }
  .schedule-time, .entry-price { font-size: 72px; line-height: 72px; letter-spacing: -.025em; }
  .entry-price span { padding-bottom: 4px; font-size: 32px; line-height: 32px; }
  .discount { font-size: 16px; line-height: 16px; }
  .program-footer { flex-direction: row; align-items: flex-start; gap: 24px; }
  .program-note { flex: 1; min-width: 0; padding-top: 10px; font-size: 16px; line-height: 24px; text-align: right; }
  .race-kids-page .program-note { padding-top: 10.5px; text-align: right; }
  .conditions-content h3 { font-size: 24px; line-height: 24px; }
  .conditions-content p { font-size: 18px; line-height: 27px; }
  .entry-footer { flex-direction: row; justify-content: space-between; gap: 24px; }
  .entry-note { width: 600px; max-width: 50%; font-size: 18px; line-height: 27px; text-align: right; }
  .awards-copy { padding-right: 48px; }
  .awards-copy p, .about-copy > p, .location-copy p { max-width: none; }
  .race-columns.w3-row { flex-direction: row; }
  .race-columns > .w3-col { flex: 1; width: auto; }
  .age-list > .w3-col { width: calc((100% - 192px) / 9); }
  .age-list span { font-size: 32px; line-height: 32px; }
  .results-section { padding-bottom: 208px; }
  .results-layout { flex-direction: row; align-items: center; gap: 24px; }
  .results-layout > * { flex: 1; min-width: 0; }
  .results-layout > .race-title { padding-right: 48px; }
  .results-date { font-size: 16px; line-height: 16px; }
  .about-copy { flex-direction: row; gap: 24px; }
  .about-copy > *, .location-row > * { flex: 1; min-width: 0; }
  .about-copy > p, .location-copy { padding-right: 48px; }
  .location-row { flex-direction: row; align-items: flex-start; }
  .race-page .about-photo { border-radius: 8px; }
}

/* Short windows retain the complete welcome without overlapping its controls. */
@media (max-height: 640px) {
  .welcome { padding-top: 88px; padding-bottom: 24px; gap: 24px; }
  .welcome-spacer { display: none; }
  .welcome-info { padding-top: 0; gap: 16px; }
  .welcome-title { font-size: 52px; line-height: 52px; }
  .countdown-cell { width: 54px; height: 54px; }
}


/* Shared visual components kept consistent with the approved Home. */
.race-copy p,
.buoy-product-copy > p {
  font: 500 16px/24px var(--body-font);
  letter-spacing: -.01em;
}


.status-tag {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  height: 24px;
  padding: 0 4px;
  border-radius: 2px;
  background: linear-gradient(rgb(255 255 255 / 25%), rgb(255 255 255 / 20%));
  color: var(--accent);
  font: 600 10px/10px var(--body-font);
  letter-spacing: -.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-tag--accent {
  background: var(--accent);
  color: #000;
}

.status-tag--dark {
  background: var(--ink);
  color: #fff;
}

.buoy-product {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 16px;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
}

.buoy-product > .media-placeholder { border-radius: 2px; }

.buoy-product-content,
.buoy-product-copy {
  display: flex;
  flex-direction: column;
}

.buoy-product-content { gap: 32px; }
.buoy-product-copy { gap: 16px; }

.buoy-product-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.buoy-product-divider {
  height: 0;
}

.buoy-product-divider::before {
  content: '';
  display: block;
  height: 1px;
  transform: translateY(-.5px);
  background: url('../assets/icons/home-buoy-divider.svg') center / 100% 1px no-repeat;
}

.buoy-product-price {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.buoy-product-note {
  min-height: 24px;
  color: rgb(255 255 255 / 50%);
  font: 500 14px/21px var(--body-font);
}

.workshop-layout {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.workshop-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.workshop-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding-top: 24px;
  background: url('../assets/icons/home-workshop-divider.svg') left top / 100% 1px no-repeat;
}

.workshop-card > .media-placeholder {
  flex: 0 0 120px;
  width: 120px;
  border-radius: 2px;
}

.workshop-card-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.workshop-description {
  font: 600 10px/10px var(--body-font);
  letter-spacing: -.02em;
  text-transform: uppercase;
}


.race-page .site-footer {
  padding: 64px 24px;
  color: #fff;
}

.race-page .footer-payment-logos {
  display: flex;
  justify-content: center;
}

.payment-logo-window {
  position: relative;
  flex-shrink: 0;
  width: 352px;
  max-width: calc(100vw - 32px);
  aspect-ratio: 11 / 1;
  overflow: hidden;
}

.payment-logo-window picture {
  display: block;
  height: 100%;
}

.payment-logo-window img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.race-page .footer-bottom {
  padding-top: 32px;
}

.race-page .footer-wordmark {
  max-width: 100%;
  line-height: 0;
}

.race-page .footer-wordmark picture {
  display: block;
}

.race-page .footer-wordmark img {
  max-width: 100%;
  height: auto;
}

.race-page .footer-copyright {
  color: rgb(255 255 255 / 25%);
}

@media (min-width: 439px) {
.race-page .site-footer { padding-bottom: 80px; }
}

@media (min-width: 768px) {
.buoy-product { padding: 24px; }

.buoy-product-copy > p { max-width: 496px; }

.workshop-copy > p { max-width: 392px; }

.workshop-card > .media-placeholder { flex-basis: 160px; width: 160px; }

.race-page .site-footer { padding: 64px 32px 80px; }

.race-page .footer-inner { grid-template-columns: minmax(0, 1fr) auto; }

.race-page .footer-top { grid-column: 1 / -1; grid-row: 1; min-height: 218px; }

.race-page .footer-payment-logos { grid-column: 1 / -1; grid-row: 2; justify-content: flex-end; }

.payment-logo-window { width: 332px; aspect-ratio: 332 / 32; }

.payment-logo-window img { position: absolute; width: 106.02%; height: 100%; max-width: none; }

.race-page .footer-bottom { grid-column: 1 / -1; grid-row: 3; }

.race-page .footer-wordmark { margin: 0; }

.race-page .footer-copyright { text-align: left; }

.race-page .footer-socials { grid-column: 2; grid-row: 3; align-self: start; margin: 32px 0 0; z-index: 1; }
}


@media (min-width: 1280px) {
.race-copy p,
  .buoy-product-copy > p { font-size: 18px; line-height: 27px; }


.status-tag,
  .media-placeholder { font-size: 12px; line-height: 12px; }

.buoy-product { flex-direction: row; padding: 32px; border-radius: 8px; }
  .buoy-product > .media-placeholder { border-radius: 4px; }

.buoy-product > * { flex: 1; min-width: 0; }

.buoy-product-content { justify-content: space-between; align-self: stretch; padding-block: 16px; gap: 0; }

.buoy-product-copy > p { max-width: none; }

.buoy-product-note { font-size: 16px; line-height: 24px; color: rgb(255 255 255 / 65%); }

.workshop-layout { flex-direction: row; align-items: flex-start; gap: 24px; }

.workshop-layout > * { flex: 1; min-width: 0; }

.workshop-copy { padding-right: 48px; }

.workshop-copy > p { max-width: none; }

.workshop-description { font-size: 12px; line-height: 12px; }


.race-page .site-footer { padding: 128px 32px 160px; }

.race-page .footer-inner { gap: 80px 24px; }

.race-page .footer-top { min-height: 0; }

.race-page .footer-bottom { padding-top: 40px; }

.race-page .footer-socials { align-self: end; margin: 0 0 29px; }

.payment-logo-window { width: 414px; aspect-ratio: 414 / 40; }

.payment-logo-window img { width: 106.28%; left: -.12%; top: -.31%; }
}


/* Local photographs fill the existing media slots without changing their ratios. */
.media-placeholder { position: relative; overflow: hidden; }
.media-placeholder > img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Hero exports already include their dark treatment; do not darken them twice. */
.welcome { position: relative; isolation: isolate; overflow: hidden; }
.welcome > .welcome-photo {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.welcome-photo > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* The supplied results image is decorative and already includes a dark overlay. */
.race-page .results-section { position: relative; isolation: isolate; overflow: hidden; }
.race-page .results-photo {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

/* Course rows open a map rather than registering for the race. */
button.distance-row {
  border: 0;
  padding-right: 0;
  padding-bottom: 0;
  padding-left: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
body.course-modal-open { overflow: hidden; }
.course-dialog {
  position: fixed;
  inset: 0;
  width: min(calc(100vw - 32px), calc(100vh - 32px));
  width: min(calc(100vw - 32px), calc(100dvh - 32px));
  max-width: none;
  max-height: none;
  height: auto;
  aspect-ratio: 1;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 3.907%;
  background: #000;
  color: #fff;
}
.course-dialog::backdrop { background: rgb(0 0 0 / 75%); }
.course-map {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.course-dialog .course-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  background: #000;
}
@media (min-width: 439px) {
  .course-dialog {
    width: min(393px, calc(100vw - 32px), calc(100vh - 32px));
    width: min(393px, calc(100vw - 32px), calc(100dvh - 32px));
  }
  .course-dialog .course-close { top: 24px; right: 24px; }
}
@media (min-width: 1280px) {
  .course-dialog {
    width: min(807px, calc(100vw - 64px), calc(100vh - 160px));
    width: min(807px, calc(100vw - 64px), calc(100dvh - 160px));
  }
  .course-dialog .course-close { top: 40px; right: 40px; }
}
