/* Maratón de Santiago 2027 landing. One stylesheet for every variant.
   Built from the PM's desktop mockup; the mobile layout is our own. */

:root {
  --naranja: #f75b1a;
  --blanco: #fff;
  --tinta: #1c1612;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  background: var(--blanco);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--blanco);
  color: var(--tinta);
  font-family:
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------
   Eventrid top bar. Same height, logo and link style as the main
   site's navigation, on the event's orange. Sticky, so the page
   needs no offset.
   ------------------------------------------------------------ */
html {
  scroll-behavior: smooth;
}

.eventrid-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 71px;
  padding-inline: 1rem;
  background: var(--naranja);
}

.eventrid-nav__brand {
  display: block;
}

.eventrid-nav__logo {
  width: clamp(140px, 40vw, 224px);
}

.eventrid-nav__link {
  padding-block: 0.75rem;
  color: var(--blanco);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
}

.eventrid-nav__link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.eventrid-nav a:focus-visible {
  outline: 3px solid var(--blanco);
  outline-offset: 3px;
}

/* Keeps the band's top clear of the sticky bar when the link scrolls to it. */
.band {
  scroll-margin-top: 71px;
}

@media (min-width: 48rem) {
  .eventrid-nav {
    height: 72.5px;
  }
}

@media (min-width: 64rem) {
  .eventrid-nav {
    height: 77px;
    padding-inline: 125px;
  }

  .band {
    scroll-margin-top: 77px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ------------------------------------------------------------
   Hero. The artwork already carries the white arc the logo sits
   in, so on wide screens the logo overlays the image. Positions
   are percentages of the artboard, as in the mockup.
   ------------------------------------------------------------ */
.hero {
  position: relative;
}

.hero__logo {
  position: absolute;
  top: 26.4%;
  left: 32.9%;
  width: 34.3%;
}

.hero__art {
  width: 100%;
}

/* ------------------------------------------------------------
   Orange band: description and registration button.
   White on this orange is 3.25:1, so every text in the band is
   large text (24 px, or bold from 18.7 px), where 3:1 passes.
   ------------------------------------------------------------ */
.band {
  background: var(--naranja);
  color: var(--blanco);
  padding-block: clamp(3.5rem, 7.5vw, 8rem);
}

.band__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.75rem, 3.8vw, 3.5rem);
  width: min(100% - 3rem, max(63%, 36rem), 62rem);
  margin-inline: auto;
}

.band__text {
  margin: 0;
  font-size: clamp(1.5rem, 1.1rem + 0.9vw, 1.75rem);
  line-height: 1.45;
  text-wrap: pretty;
}

@media (min-width: 48rem) {
  .band__text {
    text-align: justify;
  }
}

.band__text strong {
  font-weight: 800;
}

.cta {
  display: inline-block;
  padding: 0.5em 1.5em;
  border: 0;
  border-radius: 999px;
  background: var(--blanco);
  color: var(--naranja);
  font: inherit;
  font-size: clamp(1.375rem, 1rem + 1.4vw, 2.25rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.01em;
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0.35rem 1.1rem rgba(120, 30, 0, 0.28);
  transition:
    transform 0.2s var(--ease-out),
    box-shadow 0.2s var(--ease-out);
}

.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.6rem 1.5rem rgba(120, 30, 0, 0.36);
}

.cta:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 0.2rem 0.6rem rgba(120, 30, 0, 0.3);
}

.cta:focus-visible {
  outline: 4px solid var(--blanco);
  outline-offset: 4px;
}

/* Two-button variant. */
.band__ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 1.5rem;
}

/* ------------------------------------------------------------
   Runners strip and sponsors.
   ------------------------------------------------------------ */
.runners {
  width: 100%;
}

/* The image is cropped to its content, so these paddings are the whole gap. */
.sponsors {
  padding-block: clamp(1.5rem, 5vw, 4.5rem) clamp(1.5rem, 8vw, 7.5rem);
}

.sponsors img {
  width: min(100% - 1.5rem, 39.5rem);
  margin-inline: auto;
}

/* ------------------------------------------------------------
   Registration modal.
   ------------------------------------------------------------ */
.ticket-modal {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.ticket-modal[hidden] {
  display: none;
}

.ticket-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 22, 18, 0.8);
}

.ticket-modal__content {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  /* The iframe height follows its content, so the dialog scrolls. */
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  border-radius: 18px;
  background: var(--blanco);
  color: var(--tinta);
}

.ticket-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid rgba(28, 22, 18, 0.12);
}

.ticket-modal__header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.ticket-modal__close {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid rgba(28, 22, 18, 0.25);
  border-radius: 999px;
  background: transparent;
  color: var(--tinta);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.ticket-modal__close:hover {
  background: rgba(28, 22, 18, 0.08);
}

.ticket-modal__close:focus-visible,
.ticket-modal__error-link:focus-visible {
  outline: 3px solid var(--tinta);
  outline-offset: 3px;
}

.ticket-modal__iframe-wrap {
  position: relative;
  width: 100%;
}

.ticket-modal__loader {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  background: var(--blanco);
  font-size: 0.95rem;
}

.ticket-modal__loader[hidden] {
  display: none;
}

.ticket-modal__spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(247, 91, 26, 0.22);
  border-top-color: var(--naranja);
  border-radius: 50%;
  animation: ticket-spin 0.8s linear infinite;
}

/* Fills the frame when the flow does not load, instead of a blank one. */
.ticket-modal__error {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  text-align: center;
  background: var(--blanco);
}

.ticket-modal__error[hidden] {
  display: none;
}

.ticket-modal__error p {
  margin: 0;
  font-size: 1.05rem;
}

/* Dark ink, not white: white on the orange is 3.25:1 and this text is small. */
.ticket-modal__error-link {
  padding: 0.7rem 1.3rem;
  border-radius: 999px;
  background: var(--naranja);
  color: var(--tinta);
  font-weight: 700;
  text-decoration: none;
}

.ticket-modal__error-link:hover {
  text-decoration: underline;
}

/* `iframe.resizer.js` writes the height inline. This is the reserve height until
   the first message from the flow, and the one that stays if the CDN script
   does not load. */
.ticket-modal__iframe {
  display: block;
  width: 100%;
  height: min(760px, calc(100vh - 6.8rem));
  height: min(760px, calc(100dvh - 6.8rem));
  border: 0;
  background: var(--blanco);
}

.ticket-modal__iframe.is-loading {
  opacity: 0;
}

@keyframes ticket-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cta {
    transition: none;
  }

  .ticket-modal__spinner {
    animation-duration: 2.4s;
  }
}

/* ------------------------------------------------------------
   Mobile. The hero artwork is wide and its tagline is baked in,
   so a narrow screen gets a tighter crop of the same image and
   the logo moves above it, at a size that reads.
   ------------------------------------------------------------ */
@media (max-width: 640px) {
  .hero__logo {
    position: static;
    width: min(16rem, 68vw);
    margin: 1.5rem auto 0.75rem;
  }

  .ticket-modal {
    padding: 0.6rem;
  }

  .ticket-modal__iframe {
    height: calc(100vh - 6rem);
    height: calc(100dvh - 6rem);
  }
}
