/* Public page geometry contract. Visual identity remains owned by each page. */
body.kdb-design-system-v1.kdb-public-page {
  --kdb-public-width: 1320px;
  --kdb-public-gutter: 20px;
  --kdb-public-hero-height: 186px;
}

body.kdb-design-system-v1.kdb-public-page :is(
  .ui-shell,
  .kdb-pilots-v17__shell,
  .kdb-reg-page__container,
  .bracket-shell
) {
  width: min(var(--kdb-public-width), calc(100% - (var(--kdb-public-gutter) * 2))) !important;
  margin-inline: auto !important;
}

body.kdb-design-system-v1.kdb-public-page :is(
  .kdb-pilots17-hero,
  .kdb-premium-ui-page .kdb-premium-ui .ui-hero,
  .bracket-page__intro,
  .kdb-reg-hero
) {
  box-sizing: border-box !important;
  width: 100% !important;
  min-height: var(--kdb-public-hero-height) !important;
  height: var(--kdb-public-hero-height) !important;
  margin: 0 0 18px !important;
}

/* Regulations used to render a second framed page inside the shared shell. */
body.kdb-design-system-v1.kdb-public-page.kdb-regulations-page-v2 .kdb-reg-page {
  overflow: visible;
  padding: 0 0 clamp(58px, 7vw, 96px) !important;
  background: transparent;
}

body.kdb-design-system-v1.kdb-public-page.kdb-regulations-page-v2 .kdb-reg-page__container {
  padding-top: 0 !important;
}

body.kdb-design-system-v1.kdb-public-page.kdb-regulations-page-v2 .kdb-reg-page::before {
  display: none;
}

body.kdb-design-system-v1.kdb-public-page.kdb-regulations-page-v2 .kdb-reg-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 32px 0 25px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--kdb-reg-line) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  clip-path: none !important;
}

/* The shared hero watermark/accent is useful on other pages, but it sits
   directly under the regulations title at this compact height. */
body.kdb-design-system-v1.kdb-public-page.kdb-regulations-page-v2 .kdb-reg-hero::before,
body.kdb-design-system-v1.kdb-public-page.kdb-regulations-page-v2 .kdb-reg-hero::after {
  content: none !important;
}

body.kdb-design-system-v1.kdb-public-page.kdb-regulations-page-v2 .kdb-reg-hero__head {
  min-height: 0;
  padding: 0 clamp(12px, 2vw, 28px) !important;
  border: 0;
  background: transparent;
}

body.kdb-design-system-v1.kdb-public-page.kdb-regulations-page-v2 .kdb-reg-hero__body {
  padding: 14px clamp(12px, 2vw, 28px) 0 !important;
}

body.kdb-design-system-v1.kdb-public-page.kdb-regulations-page-v2 .kdb-reg-hero__body > p {
  max-width: 760px;
  font-family: KDBText, GolosText, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

body.kdb-design-system-v1.kdb-public-page.kdb-regulations-page-v2 .kdb-reg-series-nav {
  max-width: none;
  margin: 0 0 18px;
}

body.kdb-design-system-v1.kdb-public-page .bracket-shell {
  padding-top: 58px;
}

/* Pilot detail navigation uses the same primary action treatment as the rest
   of the public site, without decorative arrows from the legacy rule. */
body.kdb-design-system-v1.kdb-public-page .kdb-pilot17-back.kdb-public-action {
  position: relative;
  min-width: 154px;
  min-height: 42px;
  margin: 0 0 18px !important;
  padding: 0 25px !important;
  align-items: center;
  justify-content: center;
  color: #03131d !important;
  background: linear-gradient(100deg, #17a9e1, #5ad2fa) !important;
  border: 0 !important;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  font: 800 12px/1 KDBText, GolosText, sans-serif !important;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: filter 160ms ease, transform 160ms ease;
}

body.kdb-design-system-v1.kdb-public-page .kdb-pilot17-back.kdb-public-action::before,
body.kdb-design-system-v1.kdb-public-page .kdb-pilot17-back.kdb-public-action::after {
  content: none !important;
}

body.kdb-design-system-v1.kdb-public-page .kdb-pilot17-back.kdb-public-action:hover {
  color: #03131d !important;
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* Season standings: keep every stage heading inside its own data column. */
body.kdb-design-system-v1.kdb-public-page .kdb-season-standings-page .kdb-season-table {
  width: max-content !important;
  min-width: 1740px !important;
  table-layout: fixed !important;
}

body.kdb-design-system-v1.kdb-public-page .kdb-season-standings-page .kdb-col-place {
  width: 72px !important;
}

body.kdb-design-system-v1.kdb-public-page .kdb-season-standings-page .kdb-col-number {
  width: 72px !important;
}

body.kdb-design-system-v1.kdb-public-page .kdb-season-standings-page .kdb-col-pilot {
  width: 240px !important;
}

body.kdb-design-system-v1.kdb-public-page .kdb-season-standings-page .kdb-col-stage {
  width: 100px !important;
}

body.kdb-design-system-v1.kdb-public-page .kdb-season-standings-page .kdb-col-total {
  width: 92px !important;
}

body.kdb-design-system-v1.kdb-public-page .kdb-season-standings-page .kdb-season-table th {
  padding-inline: 10px !important;
  overflow: hidden;
  text-overflow: clip;
}

@media (max-width: 800px) {
  body.kdb-design-system-v1.kdb-public-page {
    --kdb-public-gutter: 14px;
  }

  body.kdb-design-system-v1.kdb-public-page :is(
    .kdb-pilots17-hero,
    .kdb-premium-ui-page .kdb-premium-ui .ui-hero,
    .bracket-page__intro,
    .kdb-reg-hero
  ) {
    min-height: 0 !important;
    height: auto !important;
  }

  body.kdb-design-system-v1.kdb-public-page.kdb-regulations-page-v2 .kdb-reg-hero {
    padding: 23px 0 19px !important;
  }

  body.kdb-design-system-v1.kdb-public-page.kdb-regulations-page-v2 .kdb-reg-hero__head {
    padding-inline: 12px !important;
  }

  body.kdb-design-system-v1.kdb-public-page.kdb-regulations-page-v2 .kdb-reg-hero__body {
    padding-inline: 12px !important;
  }

  body.kdb-design-system-v1.kdb-public-page.kdb-regulations-page-v2 .kdb-reg-series-nav {
    grid-template-columns: 1fr;
  }

  body.kdb-design-system-v1.kdb-public-page .bracket-shell {
    padding-top: 28px;
  }

  body.kdb-design-system-v1.kdb-public-page .kdb-season-standings-page .kdb-season-table {
    min-width: 1740px !important;
  }

  body.kdb-design-system-v1.kdb-public-page .kdb-season-standings-page .kdb-col-place,
  body.kdb-design-system-v1.kdb-public-page .kdb-season-standings-page .kdb-col-number {
    width: 60px !important;
  }

  body.kdb-design-system-v1.kdb-public-page .kdb-season-standings-page .kdb-col-pilot {
    width: 190px !important;
  }

  body.kdb-design-system-v1.kdb-public-page .kdb-season-standings-page .kdb-col-stage {
    width: 100px !important;
  }

  body.kdb-design-system-v1.kdb-public-page .kdb-season-standings-page .kdb-col-total {
    width: 92px !important;
  }
}
