/*
 * Ka Nui Kai v2.5.31 — narrow regression repair.
 * Restores the schedule title stacking and stable responsive media sizing.
 */

.schedule .section-title {
  isolation: isolate;
}

.schedule .section-title h2 {
  position: relative;
  z-index: 3;
}

/* Restore the approved beam through the day title, behind the lettering. */
body.home .schedule .section-title {
  padding: 0 10px !important;
  margin-bottom: 38px !important;
}

body.home .schedule .section-title::before,
body.home .schedule .section-title::after {
  top: calc(50% + 13.2px) !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) !important;
  z-index: 0 !important;
  pointer-events: none !important;
}

.schedule .days {
  position: relative;
  z-index: 2;
}

.knk-schedule-artwork,
.knk-schedule-video {
  display: block;
  width: 100%;
  max-width: 100%;
}

.knk-schedule-artwork {
  height: auto;
}

.knk-schedule-video {
  aspect-ratio: 2 / 3;
  height: auto;
  object-fit: cover;
}

/* Prevent three desktop posters from expanding to nearly the full 1540px
 * schedule container. Tracks may still shrink at narrower laptop widths. */
@media (min-width: 993px) {
  body .schedule .cards.knk-schedule-cards-count-3 {
    grid-template-columns: repeat(3, minmax(0, 380px)) !important;
    justify-content: center !important;
    width: min(100%, 1200px) !important;
    max-width: 1200px !important;
    margin-inline: auto !important;
  }

  body .schedule .cards.knk-schedule-cards-count-3 > .day {
    width: 100% !important;
    max-width: 380px !important;
    margin-inline: auto !important;
  }
}


/* v2.5.31 unified heading-anchored bilingual beam */
body .schedule > .section-title,
body .schedule .schedule-page-title {
  position: relative !important;
  isolation: isolate !important;
  padding: 0 10px !important;
  margin-bottom: 38px !important;
}

body .schedule > .section-title::before,
body .schedule > .section-title::after,
body .schedule .schedule-page-title::before,
body .schedule .schedule-page-title::after {
  content: none !important;
  display: none !important;
}

body .schedule > .section-title h2,
body .schedule .schedule-page-title h2 {
  position: relative !important;
  isolation: isolate !important;
  z-index: 1 !important;
}

body .schedule > .section-title h2::before,
body .schedule .schedule-page-title h2::before,
body .schedule > .section-title h2::after,
body .schedule .schedule-page-title h2::after {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  top: calc(50% + 2px) !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) !important;
  pointer-events: none !important;
  z-index: -1 !important;
  display: block !important;
}

body .schedule > .section-title h2::before,
body .schedule .schedule-page-title h2::before {
  width: min(1040px, 88vw) !important;
  height: 34px !important;
  border-radius: 999px !important;
  background: radial-gradient(ellipse at center, rgba(255,255,255,.55) 0%, rgba(255,212,90,.44) 24%, rgba(255,138,0,.30) 43%, rgba(53,228,255,.22) 60%, transparent 78%) !important;
  filter: blur(9px) !important;
  opacity: .48 !important;
  animation: knkScheduleTargetBeam 7.8s ease-in-out infinite !important;
}

body .schedule > .section-title h2::after,
body .schedule .schedule-page-title h2::after {
  width: min(1080px, 91vw) !important;
  height: 3px !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, transparent 0%, #d71920 12%, #ff8a00 30%, #ffd45a 46%, #fff 50%, #35e4ff 65%, #00b7c7 82%, transparent 100%) !important;
  background-size: 220% 100% !important;
  box-shadow: 0 0 12px rgba(255,212,90,.62), 0 0 22px rgba(53,228,255,.38) !important;
  opacity: .84 !important;
  animation: none !important;
}


@media (min-width: 669px) {
/* Neutralize the legacy Home flare motion that changes the beam position. */
body.page .schedule > .section-title h2::after {
  animation: none !important;
  top: calc(50% + 2px) !important;
  transform: translate(-50%, -50%) !important;
}
}

/* v2.5.31 unified footer metrics across every English and Hawaiian page. */
@media (max-width: 576px) {
  body footer { padding: 24px 14px 12px !important; }
  body footer .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px 12px !important;
    max-width: 100% !important;
    margin-inline: auto !important;
    text-align: left !important;
  }
  body footer .footer-grid > :nth-child(5) {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: 100% !important;
    justify-self: center !important;
    text-align: center !important;
  }
  body footer .footer-grid > :nth-child(5) form {
    width: min(100%, 330px) !important;
    margin-inline: auto !important;
  }
  body footer h2 { margin-bottom: 6px !important; }
  body footer a {
    display: block !important;
    min-height: 0 !important;
    margin: 3px 0 !important;
    font-size: 11px !important;
  }
  body footer .copy {
    flex-direction: column !important;
    align-items: center !important;
    margin-top: 14px !important;
    padding-top: 8px !important;
    gap: 7px !important;
    font-size: 10px !important;
    text-align: center !important;
  }
  body footer .footer-legal-links {
    display: flex !important;
    flex-flow: row wrap !important;
    justify-content: center !important;
    gap: 4px 8px !important;
  }
}

@media (min-width: 577px) and (max-width: 900px) {
  body footer { padding: 34px 24px 14px !important; }
  body footer .footer-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 20px 28px !important;
    max-width: 720px !important;
    margin-inline: auto !important;
    text-align: left !important;
  }
  body footer .footer-grid > :nth-child(5) {
    grid-column: 1 / -1 !important;
    width: min(100%, 520px) !important;
    max-width: 520px !important;
    justify-self: center !important;
    text-align: center !important;
  }
  body footer .copy {
    flex-direction: column !important;
    align-items: center !important;
    max-width: 720px !important;
    margin: 18px auto 0 !important;
    padding-top: 10px !important;
    gap: 8px !important;
    text-align: center !important;
  }
  body footer .footer-legal-links {
    display: flex !important;
    flex-flow: row wrap !important;
    justify-content: center !important;
    gap: 6px 12px !important;
  }
}


/* v2.5.31 final targeted visual regression corrections. */
/* Keep the beam inside the title stacking context, behind only the lettering. */
body .schedule > .section-title h2,
body .schedule .schedule-page-title h2 {
  z-index: 2 !important;
}
body .schedule > .section-title h2::before,
body .schedule .schedule-page-title h2::before,
body .schedule > .section-title h2::after,
body .schedule .schedule-page-title h2::after {
  z-index: -1 !important;
}
body .schedule > .section-title h2::before,
body .schedule .schedule-page-title h2::before {
  opacity: .72 !important;
}
body .schedule > .section-title h2::after,
body .schedule .schedule-page-title h2::after {
  opacity: 1 !important;
}

/* Restore readable three-card sizing for artwork and artist video text. */
@media (min-width: 1200px) {
  body .schedule .cards.knk-schedule-cards-count-3 {
    grid-template-columns: repeat(3, minmax(0, 430px)) !important;
    width: min(100%, 1350px) !important;
    max-width: 1350px !important;
  }
  body .schedule .cards.knk-schedule-cards-count-3 > .day {
    max-width: 430px !important;
  }
}

/* Four partnership opportunities stay in one balanced row on desktop. */
@media (min-width: 993px) {
  body .sponsors-page .partner-row,
  body .hawaiian-sponsors-page .partner-row,
  body.page-id-99 .partner-row,
  body.page-id-150 .partner-row {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    width: min(100%, 1200px) !important;
    max-width: 1200px !important;
    margin-inline: auto !important;
  }
}
