/*
 * Race Across the World site styles, hand-written because the shared Tailwind build
 * (theme/static_src) can't be recompiled locally. Linked from
 * templates/nexus/ratw/structure/scaffolding.html - bump its ?v= whenever this changes.
 */

/* The phone menu, race chooser and sticky Book bar are included at the top level of
   <body> (structure/base.html), outside each page's Outfit wrapper. Every RATW page
   declares the Outfit @font-face in its head. */
.ratw-mobile-menu,
.ratw-sticky-bar,
#bookWidgetOverlay {
  font-family: "Outfit", ui-sans-serif, system-ui, sans-serif;
}

/* A plain text link on cream (the inherited link colour is too faint there). */
.ratw-text-link {
  color: #0b6a6e;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ratw-text-link:hover,
.ratw-text-link:focus-visible {
  color: #1f1e1e;
}

/* ------------------------------------------------------------------ header */
/* Solid teal by default (interior pages sit on cream, where the white logo and nav
   were unreadable). Pages with a full-bleed hero start transparent and turn solid once
   scrolled (ratw.js adds .is-scrolled). */
.ratw-header {
  background-color: #0e7e82;
  transition: background-color 0.2s ease-in-out;
}
.ratw-header--over-hero {
  background-color: transparent;
  -webkit-backdrop-filter: blur(8px) brightness(0.9);
  backdrop-filter: blur(8px) brightness(0.9);
}
.ratw-header--over-hero.is-scrolled {
  background-color: #0e7e82;
}
.ratw-header--over-hero:not(.is-scrolled) .ratw-nav-link {
  text-shadow: 0 0 10px #000;
}
.ratw-nav-link:hover,
.ratw-nav-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Locations dropdown: also opens from the keyboard. */
.nav-item:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ------------------------------------------------------- announcement bar */
.ratw-announcement {
  background-color: #6d28d9; /* white text on this: 7.1:1 */
}
.ratw-announcement a {
  color: #fff;
  display: inline-block;
  font-weight: 600;
}
.ratw-announcement a:hover,
.ratw-announcement a:focus-visible {
  color: #fff7ed;
}

/* ------------------------------------------------------------- phone menu */
.ratw-mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 60;
}
.ratw-mobile-menu__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}
.ratw-mobile-menu__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 24rem;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff7ed;
  padding: 1.25rem 1.5rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.18);
}
.ratw-mobile-menu__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.ratw-mobile-menu__title {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #1f1e1e;
}
.ratw-mobile-menu__links a {
  display: block;
  padding: 0.6rem 0.25rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #1f1e1e;
  border-bottom: 1px solid rgba(31, 30, 30, 0.1);
}
.ratw-mobile-menu__links a:hover,
.ratw-mobile-menu__links a:focus-visible {
  color: #0e7e82;
}
.ratw-mobile-menu__heading {
  margin: 1.25rem 0 0.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0e7e82;
}
.ratw-mobile-menu__book {
  margin-top: 1.5rem;
}
.ratw-mobile-menu__book > * {
  width: 100%;
  justify-content: center;
}
html.ratw-menu-open,
html.ratw-menu-open body {
  overflow: hidden;
}

/* ------------------------------------------------------ sticky Book bar */
.ratw-sticky-bar {
  z-index: 40;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html.ratw-menu-open .ratw-sticky-bar,
body:has(#shareWidgetOverlay:not(.hidden)) .ratw-sticky-bar,
body:has(#bookWidgetOverlay:not(.hidden)) .ratw-sticky-bar {
  visibility: hidden;
}

/* ----------------------------------------------------------- race links */
.ratw-race-links {
  flex-wrap: wrap;
}

/* --------------------------------------------------------- video facade */
.ratw-video-facade {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: #1f1e1e;
  overflow: hidden;
}
.ratw-video-facade img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ratw-video-facade__play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4.5rem;
  height: 4.5rem;
  margin: -2.25rem 0 0 -2.25rem;
  border-radius: 9999px;
  background: rgba(29, 78, 216, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease-in-out;
}
.ratw-video-facade:hover .ratw-video-facade__play,
.ratw-video-facade:focus-visible .ratw-video-facade__play {
  transform: scale(1.08);
}
.ratw-video-facade__play svg {
  width: 1.75rem;
  height: 1.75rem;
  margin-left: 0.2rem;
  fill: #fff;
}

/* --------------------------------------------------------- reviews pager */
.ratw-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 3rem;
  color: #1f1e1e;
  font-weight: 600;
}
.ratw-pager a {
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------------------------------------------ 404 */
.ratw-404-races {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

@media (prefers-reduced-motion: reduce) {
  .ratw-header,
  .ratw-video-facade__play {
    transition: none;
  }
}
