/* Keep public page titles compact while leaving the Home composition untouched. */
body.legacy-public-shell:not([data-page="home"]) #site-shell .page-main > .page-hero {
  min-height: 0 !important;
  padding-block: clamp(18px, 1.8vw, 28px) !important;
  row-gap: clamp(12px, 1.4vw, 20px) !important;
}

body.legacy-public-shell:not([data-page="home"]) #site-shell .page-main > .page-hero h1 {
  margin-top: 7px !important;
  font-size: clamp(2.35rem, 4.2vw, 4.6rem) !important;
  line-height: 1.02 !important;
}

body.legacy-public-shell:not([data-page="home"]) #site-shell .page-main > .page-hero .hero-text {
  margin-top: 11px !important;
  font-size: clamp(0.86rem, 1vw, 1rem) !important;
  line-height: 1.45 !important;
}

/* The participant summary should fit the figures instead of filling its grid column. */
body[data-page="participantes"] #site-shell > .participants-page-frame > .page-main > .participants-page-hero .participants-hero-summary {
  width: fit-content;
  max-width: 100%;
  justify-self: end;
  grid-template-columns: max-content max-content max-content;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
}

body[data-page="participantes"] #site-shell > .participants-page-frame > .page-main > .participants-page-hero .participants-hero-total {
  align-items: center;
  padding-right: 14px;
  text-align: center;
}

body[data-page="participantes"] #site-shell > .participants-page-frame > .page-main > .participants-page-hero .participants-hero-total strong {
  font-size: clamp(2.5rem, 3.8vw, 3.7rem);
}

body[data-page="participantes"] #site-shell > .participants-page-frame > .page-main > .participants-page-hero .participants-hero-series {
  justify-items: center;
  gap: 7px;
}

body[data-page="participantes"] #site-shell > .participants-page-frame > .page-main > .participants-page-hero .participants-hero-series-item {
  justify-content: center;
  gap: 10px;
}

body[data-page="participantes"] #site-shell > .participants-page-frame > .page-main > .participants-page-hero .participants-hero-guest-total {
  padding-left: 12px;
}

/* Favorites uses the same content-sized, centered summary treatment. */
body[data-page="favoritos"] #site-shell > .favorites-page-frame > .page-main > .favorites-page-hero .favorites-hero-summary {
  width: fit-content;
  max-width: 100%;
  justify-self: end;
  grid-template-columns: max-content max-content;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
}

body[data-page="favoritos"] #site-shell > .favorites-page-frame > .page-main > .favorites-page-hero .favorites-hero-total,
body[data-page="favoritos"] #site-shell > .favorites-page-frame > .page-main > .favorites-page-hero .favorites-hero-limit {
  justify-items: center;
  align-items: center;
  text-align: center;
}

body[data-page="favoritos"] #site-shell > .favorites-page-frame > .page-main > .favorites-page-hero .favorites-hero-total {
  padding-right: 14px;
}

body[data-page="favoritos"] #site-shell > .favorites-page-frame > .page-main > .favorites-page-hero .favorites-hero-total > span,
body[data-page="favoritos"] #site-shell > .favorites-page-frame > .page-main > .favorites-page-hero .favorites-hero-limit > span {
  max-width: 15ch;
  line-height: 1.3;
}

body[data-page="favoritos"] #site-shell > .favorites-page-frame > .page-main > .favorites-page-hero .favorites-hero-total strong {
  font-size: clamp(2.5rem, 3.8vw, 3.7rem);
}

body[data-page="favoritos"] #site-shell > .favorites-page-frame > .page-main > .favorites-page-hero .favorites-hero-limit strong {
  font-size: clamp(1.8rem, 2.8vw, 2.5rem);
}

/* The pilot profile has its own hero structure and portrait. */
body[data-page="piloto"] #site-shell .pilot-profile-hero {
  min-height: 0;
}

body[data-page="piloto"] #site-shell .pilot-profile-hero .pilot-driver-hero-topline {
  padding-top: 13px;
}

body[data-page="piloto"] #site-shell .pilot-profile-hero .pilot-driver-hero-main {
  min-height: clamp(190px, 18vw, 270px);
}

body[data-page="piloto"] #site-shell .pilot-profile-hero .pilot-driver-hero-copy {
  padding-block: 14px 18px;
}

body[data-page="piloto"] #site-shell .pilot-profile-hero .pilot-driver-kicker {
  margin-bottom: 9px;
}

body[data-page="piloto"] #site-shell .pilot-profile-hero .pilot-driver-hero-copy h1 {
  font-size: clamp(2.3rem, 4.4vw, 4.4rem);
  line-height: 1.02;
}

body[data-page="piloto"] #site-shell .pilot-profile-hero .pilot-photo-frame {
  height: clamp(190px, 18vw, 270px);
}

body[data-page="piloto"] #site-shell .pilot-profile-hero .pilot-driver-stat-strip {
  margin-bottom: 14px;
}

body[data-page="piloto"] #site-shell .pilot-profile-hero .pilot-driver-stat {
  min-height: 82px;
  padding-block: 11px;
}

/* Stage detail shares one full-height panel between its map and result actions. */
body[data-page="etapa"] #site-shell .stage-detail-hero {
  min-height: 0;
}

body[data-page="etapa"] #site-shell .stage-detail-hero-content {
  gap: clamp(16px, 2.5vw, 36px);
  padding-block: clamp(18px, 2.3vw, 30px);
}

body[data-page="etapa"] #site-shell .stage-detail-hero h1 {
  margin-top: 9px;
  font-size: clamp(2rem, 3.8vw, 3.7rem);
  line-height: 1.04;
}

body[data-page="etapa"] #site-shell .stage-detail-description {
  margin-top: 9px;
}

body[data-page="etapa"] #site-shell .stage-detail-meta {
  margin-top: 14px;
}

body[data-page="etapa"] #site-shell .stage-detail-back-link {
  margin-top: 15px;
}

body[data-page="etapa"] #site-shell .stage-detail-map {
  height: 100%;
}

body[data-page="etapa"] #site-shell .stage-detail-unavailable {
  min-height: 0;
  padding-block: clamp(18px, 2.3vw, 30px);
}

body[data-page="etapa"] #site-shell .stage-detail-unavailable h1 {
  margin-top: 7px;
  font-size: clamp(2rem, 3.8vw, 3.7rem);
}

/* The upcoming-season notice stays expressive without filling most of the viewport. */
body.legacy-public-shell #site-shell .upcoming-season-hero {
  min-height: clamp(340px, 46vh, 520px);
  padding-block: clamp(24px, 3.8vw, 56px);
}

body.legacy-public-shell #site-shell .upcoming-season-copy .eyebrow {
  margin-bottom: 12px;
}

body.legacy-public-shell #site-shell .upcoming-season-copy h1 {
  font-size: clamp(2.6rem, 4.7vw, 4.8rem);
  line-height: 1.02;
}

body.legacy-public-shell #site-shell .upcoming-season-copy .hero-text {
  margin-top: 14px;
  line-height: 1.5;
}

body.legacy-public-shell #site-shell .upcoming-season-return {
  min-height: 46px;
  margin-top: 18px;
}

@media (max-width: 760px) {
  body.legacy-public-shell:not([data-page="home"]) #site-shell .page-main > .page-hero {
    min-height: 0 !important;
    padding-block: 15px !important;
    padding-inline: 14px !important;
    row-gap: 12px !important;
  }

  body.legacy-public-shell:not([data-page="home"]) #site-shell .page-main > .page-hero h1 {
    margin-top: 5px !important;
    font-size: clamp(1.9rem, 7.5vw, 2.65rem) !important;
    line-height: 1.04 !important;
  }

  body.legacy-public-shell:not([data-page="home"]) #site-shell .page-main > .page-hero .hero-text {
    margin-top: 8px !important;
    font-size: 0.8rem !important;
    line-height: 1.45 !important;
  }

  body[data-page="participantes"] #site-shell > .participants-page-frame > .page-main > .participants-page-hero .participants-hero-summary,
  body[data-page="favoritos"] #site-shell > .favorites-page-frame > .page-main > .favorites-page-hero .favorites-hero-summary {
    justify-self: center;
    gap: 10px;
    padding: 10px 12px;
  }

  body[data-page="participantes"] #site-shell > .participants-page-frame > .page-main > .participants-page-hero .participants-hero-summary {
    grid-template-columns: minmax(74px, 0.85fr) minmax(78px, 1.08fr) minmax(64px, 0.67fr);
  }

  body[data-page="participantes"] #site-shell > .participants-page-frame > .page-main > .participants-page-hero .participants-hero-guest-total {
    padding-left: 8px;
  }

  body[data-page="participantes"] #site-shell > .participants-page-frame > .page-main > .participants-page-hero .participants-hero-total strong,
  body[data-page="favoritos"] #site-shell > .favorites-page-frame > .page-main > .favorites-page-hero .favorites-hero-total strong {
    font-size: 2.35rem;
  }

  body[data-page="participantes"] #site-shell > .participants-page-frame > .page-main > .participants-page-hero .participants-hero-total > span,
  body[data-page="favoritos"] #site-shell > .favorites-page-frame > .page-main > .favorites-page-hero .favorites-hero-total > span,
  body[data-page="favoritos"] #site-shell > .favorites-page-frame > .page-main > .favorites-page-hero .favorites-hero-limit > span {
    font-size: 0.55rem;
  }

  body[data-page="participantes"] #site-shell > .participants-page-frame > .page-main > .participants-page-hero .participants-hero-total > small,
  body[data-page="favoritos"] #site-shell > .favorites-page-frame > .page-main > .favorites-page-hero .favorites-hero-total > small,
  body[data-page="favoritos"] #site-shell > .favorites-page-frame > .page-main > .favorites-page-hero .favorites-hero-limit > small {
    font-size: 0.49rem;
  }

  body[data-page="favoritos"] #site-shell > .favorites-page-frame > .page-main > .favorites-page-hero .favorites-hero-limit strong {
    font-size: 1.9rem;
  }

  body[data-page="piloto"] #site-shell .pilot-profile-hero .pilot-driver-hero-topline {
    padding-top: 10px;
  }

  body[data-page="piloto"] #site-shell .pilot-profile-hero .pilot-driver-hero-main {
    min-height: 160px;
  }

  body[data-page="piloto"] #site-shell .pilot-profile-hero .pilot-driver-hero-copy {
    padding-block: 12px;
  }

  body[data-page="piloto"] #site-shell .pilot-profile-hero .pilot-photo-frame {
    height: 178px;
  }

  body[data-page="piloto"] #site-shell .pilot-profile-hero .pilot-driver-stat-strip {
    margin-bottom: 9px;
  }

  body[data-page="piloto"] #site-shell .pilot-profile-hero .pilot-driver-stat {
    min-height: 70px;
    padding-block: 9px;
  }

  body[data-page="etapa"] #site-shell .stage-detail-hero-content {
    gap: 13px;
    padding-block: 15px;
  }

  body[data-page="etapa"] #site-shell .stage-detail-hero h1,
  body[data-page="etapa"] #site-shell .stage-detail-unavailable h1 {
    margin-top: 6px;
    font-size: clamp(1.7rem, 7vw, 2.4rem);
  }

  body[data-page="etapa"] #site-shell .stage-detail-meta {
    margin-top: 10px;
  }

  body[data-page="etapa"] #site-shell .stage-detail-back-link {
    margin-top: 11px;
  }

  body[data-page="etapa"] #site-shell .stage-detail-map {
    height: 125px;
  }

  body[data-page="etapa"] #site-shell .stage-detail-unavailable {
    padding-block: 16px;
  }

  body.legacy-public-shell #site-shell .upcoming-season-hero {
    min-height: min(420px, calc(100svh - 110px));
    padding: 22px 18px;
  }

  body.legacy-public-shell #site-shell .upcoming-season-copy .eyebrow {
    margin-bottom: 10px;
  }

  body.legacy-public-shell #site-shell .upcoming-season-copy h1 {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  body.legacy-public-shell #site-shell .upcoming-season-copy .hero-text {
    margin-top: 12px;
  }

  body.legacy-public-shell #site-shell .upcoming-season-return {
    min-height: 44px;
    margin-top: 15px;
  }
}

@media (max-width: 380px) {
  body[data-page="piloto"] #site-shell .pilot-profile-hero .pilot-driver-hero-main {
    min-height: 150px;
  }

  body[data-page="piloto"] #site-shell .pilot-profile-hero .pilot-photo-frame {
    height: 160px;
  }
}
