/* BAKIPA FITNESS - Next Level responsive/calm refinement v2.
   Research-backed corrections for typography, reflow, media scale and scroll calmness.
   Existing copy, images, prices and business logic remain authoritative. */

:root {
  --nl-refinement-v2: 1;
  --nl-xl: clamp(3.25rem, 2.7rem + 1.8vw, 5.15rem);
  --nl-l: clamp(2.1rem, 1.7rem + 1.35vw, 3.45rem);
}

/* Predictable native scrolling and a quieter sticky header. The previous
   section-enter transforms are removed at source; the header no longer keeps
   a large live backdrop blur layer attached to the viewport while scrolling. */
html { scroll-behavior: auto; }
.site-header {
  background: rgba(247, 243, 236, .985);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* Text-only zoom must be allowed to make the header taller rather than wider.
   minmax(0,1fr), wrapping and zero minimums prevent the navigation's min-content
   width from forcing the document beyond the viewport. Individual navigation
   labels remain atomic, preserving the published responsive-header contract. */
.header-inner {
  grid-template-columns: auto minmax(0, 1fr) auto;
}
.brand,
.brand-type,
.main-nav,
.header-cta,
.main-nav .nav-link,
.header-phone {
  min-width: 0;
}
.main-nav {
  flex-wrap: wrap;
}
.site-header .main-nav .nav-link {
  white-space: nowrap;
  overflow-wrap: normal;
  text-align: center;
}
.header-phone {
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}
.header-cta {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.button,
.finder-option {
  white-space: normal;
  text-align: center;
}
.button:hover,
.finder-option:hover { transform: none; }

/* Editorial type should lead without becoming the layout. Keep the display
   scale fluid but bounded, and allow German compound words to reflow safely. */
.page-hero h1 {
  max-width: 18ch;
  font-size: clamp(2.55rem, 2.05rem + 2.15vw, 4.2rem);
  line-height: 1.04;
  hyphens: auto;
  overflow-wrap: break-word;
}
.page-hero .lead { max-width: 62ch; }
.page-hero-inner {
  grid-template-columns: minmax(0, 1.06fr) minmax(320px, .94fr);
  gap: clamp(2rem, 4vw, 4.5rem);
}
.page-hero.wide .page-hero-inner {
  max-width: 880px;
  padding-block: clamp(.75rem, 1.5vw, 1.5rem);
}

body:has(> main > .hero) .hero {
  padding-top: clamp(1.25rem, 2.5vw, 2.25rem);
  padding-bottom: clamp(2.75rem, 5vw, 4.75rem);
}
body:has(> main > .hero) .hero-grid {
  grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  gap: clamp(2rem, 4vw, 4.5rem);
  min-height: auto;
  align-items: center;
}
body:has(> main > .hero) .hero-grid > *,
body:has(> main > .hero) .hero-badges > *,
body:has(> main > .hero) .ribbon-inner > *,
body:has(> main > .hero) .chooser-grid > *,
body:has(> main > .hero) .course-list > *,
body:has(> main > .hero) .schedule-week > *,
body:has(> main > .hero) .slot > * {
  min-width: 0;
}
body:has(> main > .hero) .hero-copy {
  min-width: 0;
  max-width: 620px;
}
body:has(> main > .hero) .hero-copy h1 {
  max-width: 13.5ch;
  font-size: clamp(2.9rem, 2.25rem + 2.35vw, 4.65rem);
  line-height: 1.01;
  letter-spacing: -.02em;
  hyphens: auto;
  overflow-wrap: break-word;
  margin-bottom: 1.15rem;
}
body:has(> main > .hero) .hero-copy h1 em {
  display: block;
  max-width: 15ch;
  margin-top: .08em;
  font-size: .82em;
  line-height: 1.07;
  hyphens: auto;
  overflow-wrap: break-word;
}
body:has(> main > .hero) .hero-copy .lead {
  max-width: 56ch;
  font-size: clamp(1.03rem, .97rem + .28vw, 1.2rem);
  margin-bottom: 1.55rem;
}
body:has(> main > .hero) .hero-photo {
  width: 100%;
  min-height: 0;
  max-height: 520px;
  aspect-ratio: 4 / 3;
  border-radius: 34px 34px 34px 16px;
  transform: none;
}
body:has(> main > .hero) .hero-photo img {
  transform: none;
  object-position: 54% center;
}
body:has(> main > .hero) .hero-chip {
  font-size: .82rem;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(255,255,255,.96);
}
body:has(> main > .hero) .hero-chip.one { left: 18px; bottom: 18px; }
body:has(> main > .hero) .hero-chip.two { right: 18px; top: 18px; }

/* Reflow hardening for repeated home structures. Tracks may shrink to zero and
   the text wraps inside them instead of increasing the page's min-content width. */
body:has(> main > .hero) .ribbon-inner {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
body:has(> main > .hero) .ribbon-inner strong,
body:has(> main > .hero) .ribbon-inner span,
body:has(> main > .hero) .hero-badges strong,
body:has(> main > .hero) .hero-badges span,
body:has(> main > .hero) .slot .time,
body:has(> main > .hero) .slot .slot-body a.name,
body:has(> main > .hero) .slot .slot-body .venue,
body:has(> main > .hero) .slot .slot-body .ask {
  overflow-wrap: anywhere;
  hyphens: auto;
}
body:has(> main > .hero) .slot {
  grid-template-columns: minmax(72px, 88px) minmax(0, 1fr);
}
body:has(> main > .hero) .slot-body {
  min-width: 0;
}

/* Keep images important, but prevent them from becoming full-screen walls on
   ordinary desktop monitors. Card height follows card width, then caps. */
body:has(> main > .hero) .course-item {
  grid-template-rows: auto auto;
}
body:has(> main > .hero) .course-item .cover {
  width: 100%;
  min-height: 0;
  max-height: 420px;
  aspect-ratio: 3 / 2;
}
body:has(> main > .hero) .course-item .cover img {
  transform: none;
  transition: transform .22s ease;
}
body:has(> main > .hero) .course-item .body {
  min-width: 0;
  padding: clamp(1.25rem, 2vw, 1.75rem);
}
body:has(> main > .hero) .course-item h3 {
  font-size: clamp(1.5rem, 1.3rem + .55vw, 1.95rem);
  overflow-wrap: anywhere;
}

/* Compact the supporting editorial zones so image/text pairings can be read as
   one composition rather than as separate full-screen scenes. */
body:has(> main > .hero) .chooser-card { min-height: 190px; }
body:has(> main > .hero) .split-band {
  gap: clamp(2.2rem, 4.5vw, 4.8rem);
}
body:has(> main > .hero) .split-band .split-photo {
  max-height: 480px;
  aspect-ratio: 4 / 3;
}
body:has(> main > .hero) .about-band {
  gap: clamp(2rem, 4vw, 4rem);
  padding: clamp(1.75rem, 3.5vw, 3.25rem);
}
body:has(> main > .hero) .about-band .about-photo {
  max-height: 480px;
  aspect-ratio: 4 / 3;
}
body:has(> main > .hero) .step { min-height: 185px; }
.final-cta { min-height: 300px; }

/* Kursplan and other non-home schedule instances: protect the internal text
   measure and let the content, not device labels, determine when columns drop. */
body:not(:has(> main > .hero)) .schedule-week {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(.85rem, 1.6vw, 1.15rem);
}
body:not(:has(> main > .hero)) .day-card,
body:not(:has(> main > .hero)) .slot,
body:not(:has(> main > .hero)) .slot-body {
  min-width: 0;
}
body:not(:has(> main > .hero)) .day-card {
  padding: clamp(1.05rem, 1.8vw, 1.3rem);
}
body:not(:has(> main > .hero)) .slot {
  grid-template-columns: minmax(78px, 88px) minmax(0, 1fr);
  gap: .75rem;
  padding: .75rem;
}
body:not(:has(> main > .hero)) .slot .slot-body a.name,
body:not(:has(> main > .hero)) .slot .slot-body .venue,
body:not(:has(> main > .hero)) .slot .slot-body .ask {
  max-width: 100%;
  hyphens: auto;
  overflow-wrap: anywhere;
}
body:not(:has(> main > .hero)) .slot .slot-body a.name {
  font-size: clamp(1rem, .96rem + .16vw, 1.08rem);
  line-height: 1.22;
}
body:not(:has(> main > .hero)) .slot .slot-body .ask {
  line-height: 1.35;
}

@media (hover: hover) and (pointer: fine) {
  body:has(> main > .hero) .course-item:hover .cover img {
    transform: scale(1.012);
  }
}

/* Intermediate widths are where the former layout became cramped. Switch the
   home hero earlier, before type and media compete for the same horizontal row. */
@media (max-width: 1100px) {
  body:has(> main > .hero) .hero-grid {
    grid-template-columns: 1fr;
    gap: clamp(1.75rem, 4vw, 2.75rem);
  }
  body:has(> main > .hero) .hero-copy {
    max-width: 760px;
  }
  body:has(> main > .hero) .hero-copy h1 {
    max-width: 15ch;
  }
  body:has(> main > .hero) .hero-photo {
    justify-self: center;
    max-width: 760px;
    max-height: 470px;
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 1180px) {
  body:not(:has(> main > .hero)) .schedule-week {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .page-hero-inner { grid-template-columns: 1fr; }
  body:has(> main > .hero) .course-item:nth-child(n) {
    grid-column: 1 / -1;
  }
  body:has(> main > .hero) .course-item .cover {
    max-height: 380px;
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 760px) {
  body:not(:has(> main > .hero)) .schedule-week {
    grid-template-columns: 1fr;
  }
  body:not(:has(> main > .hero)) .slot {
    grid-template-columns: 1fr;
    gap: .35rem;
  }
}

@media (max-width: 720px) {
  .page-hero h1 {
    max-width: 16ch;
    font-size: clamp(2.35rem, 9.5vw, 3.2rem);
  }
  body:has(> main > .hero) .hero-copy h1 {
    max-width: 14ch;
    font-size: clamp(2.45rem, 10.5vw, 3.45rem);
  }
  body:has(> main > .hero) .hero-copy h1 em {
    max-width: 16ch;
    font-size: .86em;
  }
  body:has(> main > .hero) .hero-photo {
    max-height: 420px;
    aspect-ratio: 5 / 4;
    border-radius: 28px 28px 28px 12px;
  }
  body:has(> main > .hero) .course-item:nth-child(n) {
    grid-template-rows: auto auto;
  }
  body:has(> main > .hero) .course-item .cover {
    max-height: 320px;
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 420px) {
  body:has(> main > .hero) .hero-photo {
    min-height: 0;
    max-height: 360px;
    aspect-ratio: 5 / 4;
  }
  body:has(> main > .hero) .hero-chip.two {
    display: flex;
    inset: 12px 12px auto auto;
    max-width: min(205px, calc(100% - 24px));
    padding: .65rem .75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body:has(> main > .hero) .course-item .cover img,
  .button,
  .finder-option {
    transition: none !important;
    transform: none !important;
  }
}
