/* Shared public-site sizing and spacing. Loaded last to keep every page aligned. */
:root {
  --site-max: 1200px;
  --site-gutter: max(clamp(0.875rem, 5vw, 3rem), env(safe-area-inset-left), env(safe-area-inset-right));
  --site-width: min(var(--site-max), calc(100% - (2 * var(--site-gutter))));
  --section-space: clamp(2.5rem, 5vw, 3.5rem);
  --content-gap: clamp(1rem, 2vw, 1.5rem);
}

#site-header .nav-wrap,
.page,
.site-footer-inner,
.site-footer-bottom p,
main > section > .mx-auto {
  width: var(--site-width);
  max-width: var(--site-max);
  margin-inline: auto;
}

main > section:not(#hero) {
  padding-block: var(--section-space) !important;
}

#faq > .mx-auto {
  width: min(900px, calc(100% - (2 * var(--site-gutter))));
  max-width: 900px;
}

.card-grid,
.gallery-grid,
.pkg-layout {
  gap: var(--content-gap);
}

/* Phone and small-tablet layout */
#hero .bg-gradient-to-b {
  display: block;
  background-image: linear-gradient(
    to right,
    rgb(255 255 255 / 0.82) 0%,
    rgb(247 244 239 / 0.55) 32%,
    rgb(255 255 255 / 0.18) 50%,
    transparent 62%
  ) !important;
}

#hero [data-cms="heroSubtitle"],
#hero p:has(> [data-cms="heroBody"]) {
  position: relative;
  z-index: 0;
  width: fit-content;
  max-width: 36rem;
  color: #12221e;
}

#hero [data-cms="heroSubtitle"]::before,
#hero p:has(> [data-cms="heroBody"])::before {
  content: "";
  position: absolute;
  inset: -1.4em -1.8em;
  z-index: -1;
  background: radial-gradient(closest-side, rgb(247 244 239 / 0.8), rgb(247 244 239 / 0.22) 55%, transparent 100%);
  filter: blur(22px);
  pointer-events: none;
}

#hero [data-cms="heroBody"] {
  color: #12221e;
}

html.dark #hero .bg-gradient-to-b {
  background-image: linear-gradient(
    to right,
    rgb(36 48 44 / 0.28) 0%,
    rgb(36 48 44 / 0.1) 36%,
    transparent 52%
  ) !important;
}

@media (max-width: 720px) {
  html.dark #hero .bg-gradient-to-b {
    background-image: linear-gradient(
      to bottom,
      rgb(20 28 26 / 0.55) 0%,
      rgb(20 28 26 / 0.28) 42%,
      transparent 72%
    ),
    linear-gradient(
      to right,
      rgb(20 28 26 / 0.62) 0%,
      rgb(20 28 26 / 0.28) 44%,
      transparent 72%
    ) !important;
  }
}

html.dark #hero [data-cms="heroSubtitle"],
html.dark #hero [data-cms="heroBody"],
html.dark #hero p:has(> [data-cms="heroBody"]) {
  color: #eef3f1;
}

html.dark #hero [data-cms="heroSubtitle"]::before,
html.dark #hero p:has(> [data-cms="heroBody"])::before {
  background: radial-gradient(closest-side, rgb(36 48 44 / 0.55), transparent 72%);
}

html {
  overflow-x: clip;
}

body {
  overflow-x: clip;
  max-width: 100%;
}

img,
video,
iframe,
svg {
  max-width: 100%;
}

.site-footer-reach a,
.site-footer-copy {
  overflow-wrap: anywhere;
}

#site-header {
  padding-top: max(0.65rem, env(safe-area-inset-top));
}

@media (max-width: 1080px) {
  .site-nav-desktop,
  #site-header .site-nav-desktop,
  #site-header .nav-cta {
    display: none !important;
  }

  .site-menu-toggle,
  #site-header .site-menu-toggle {
    display: grid !important;
  }

  #site-header {
    padding-left: 0;
    padding-right: 0;
  }

  #site-header .nav-shell {
    gap: 0.5rem;
    padding: 0.45rem 0.7rem;
    background-color: rgba(244, 248, 246, 0.94);
    border-color: rgba(26, 36, 33, 0.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  html.dark #site-header .nav-shell {
    background-color: rgba(42, 54, 51, 0.96);
    border-color: rgba(255, 255, 255, 0.12);
  }

  #site-header .nav-brand {
    gap: 0.5rem;
  }

  #site-header .nav-brand img {
    width: 34px;
    height: 34px;
  }

  #site-header .nav-brand span {
    font-size: 0.82rem;
  }

  .mobile-nav nav {
    padding-top: max(5.5rem, calc(4.5rem + env(safe-area-inset-top)));
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  }

  body.has-fixed-nav .page {
    padding-top: 96px;
  }
}

@media (max-width: 420px) {
  #site-header .nav-brand span {
    max-width: 11.5rem;
  }
}

@media (max-width: 900px) {
  /* First screen = full homepage photo */
  #hero.min-h-dvh,
  #hero .min-h-dvh,
  #hero .mx-auto.flex {
    min-height: 100svh !important;
    height: auto;
  }

  #hero {
    min-height: 100svh !important;
  }

  #hero .absolute.inset-0.-z-10 {
    inset: 0;
    height: 100%;
    min-height: 100%;
  }

  #hero .absolute.inset-0 img,
  #hero img.object-cover {
    height: 100% !important;
    width: 100% !important;
    object-fit: cover;
    object-position: 72% 28%;
  }
}

.hero-gallery-jump {
  display: none;
}

@media (max-width: 720px) {
  .hero-gallery-jump {
    display: flex;
    gap: 0.65rem;
    width: min(1200px, calc(100% - 2rem));
    margin: 0.85rem auto 0.35rem;
    padding-inline: max(0px, env(safe-area-inset-left));
  }

  .hero-gallery-jump a {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-decoration: none;
    color: #fff;
    border: none;
    background: linear-gradient(135deg, #5ecfb5 0%, #2f9d8a 52%, #1a7a6a 100%);
    box-shadow: 0 8px 20px rgba(36, 51, 50, 0.14);
  }

  html.dark .hero-gallery-jump a {
    background: linear-gradient(135deg, #7dcebf 0%, #3db89f 48%, #2f9d8a 100%);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  }

  /* Soften photo under copy so type stays readable */
  #hero .bg-gradient-to-b {
    background-image: linear-gradient(
      to bottom,
      rgb(255 255 255 / 0.55) 0%,
      rgb(247 244 239 / 0.42) 38%,
      rgb(255 255 255 / 0.12) 62%,
      transparent 78%
    ),
    linear-gradient(
      to right,
      rgb(255 255 255 / 0.78) 0%,
      rgb(247 244 239 / 0.45) 42%,
      transparent 72%
    ) !important;
  }

  #hero .mx-auto.flex {
    box-sizing: border-box;
    width: min(1200px, calc(100% - 2rem)) !important;
    max-width: 100%;
    padding-top: max(5.25rem, calc(env(safe-area-inset-top) + 4.25rem));
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    justify-content: flex-start;
    align-items: flex-start;
    gap: 0;
  }

  #hero h1 {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin: 0;
    margin-top: auto !important;
    max-width: none;
  }

  #hero h1 > span {
    display: block;
  }

  #hero [data-cms="heroSubtitle"] {
    margin-top: 0.85rem !important;
    max-width: 18rem;
  }

  #hero p:has(> [data-cms="heroBody"]) {
    margin-top: 0.75rem !important;
    max-width: 20rem;
  }

  #hero .mt-10 {
    margin-top: 1.35rem !important;
    width: 100%;
    max-width: 20rem;
    flex-direction: column;
    align-items: stretch !important;
  }

  #hero h1,
  #hero .text-5xl {
    font-size: clamp(2.15rem, 11vw, 2.75rem) !important;
    line-height: 1.08 !important;
  }

  #hero .mt-10 > a {
    justify-content: center;
    text-align: center;
  }

  #hero .hero-cta-ghost {
    background: #fff;
    color: #1a2421;
    border-color: rgba(26, 36, 33, 0.2);
  }

  html.dark #hero .hero-cta-ghost {
    background: rgba(30, 45, 42, 0.82);
    color: #eef3f1;
    border-color: rgba(238, 243, 241, 0.32);
  }

  main > section:not(#hero) {
    padding-top: 1.75rem !important;
    padding-bottom: 1.75rem !important;
  }

  main > section:not(#hero) .blob {
    display: none;
  }

  main > section:not(#hero) h2 {
    font-size: 1.6rem !important;
    line-height: 1.2 !important;
  }

  #about {
    padding-top: 0.75rem !important;
  }

  #about .lg\:grid-cols-2,
  #why-pilates [data-cms-trainers-grid],
  #classes [data-cms-classes-grid],
  #contact .lg\:grid-cols-\[1\.05fr_1fr\],
  #contact form .sm\:grid-cols-2 {
    grid-template-columns: 1fr !important;
  }

  #about .grid.grid-cols-2 {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  #about .grid.grid-cols-2 > img,
  #about .grid.grid-cols-2 > .col-span-2 img {
    height: 12.5rem !important;
    width: 100%;
    object-fit: cover;
  }

  #about .grid.grid-cols-2 > .glass {
    height: auto !important;
    min-height: 0;
  }

  #about [class*="lg:grid-cols-4"],
  #about .sm\:grid-cols-2 {
    grid-template-columns: 1fr 1fr !important;
  }

  #why-pilates ul {
    --gap: 0.7rem;
  }

  .why-marquee {
    margin-top: 1.1rem;
  }

  #why-pilates ul article {
    padding: 1rem !important;
  }

  #why-pilates ul article > div {
    width: 2.25rem !important;
    height: 2.25rem !important;
    border-radius: 0.9rem !important;
  }

  #why-pilates ul h3 {
    margin-top: 0.6rem !important;
    font-size: 0.95rem !important;
  }

  #why-pilates ul p {
    margin-top: 0.3rem !important;
  }

  #why-pilates [data-cms-trainers-grid] img.h-80 {
    height: 14rem !important;
  }

  #cafe ul.sm\:grid-cols-2 {
    grid-template-columns: 1fr 1fr !important;
  }

  .gallery-page-links {
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .gallery-page-links a {
    flex: 0 0 auto;
    font-size: 0.75rem !important;
    padding: 0.55rem 0.9rem !important;
  }

  #faq [data-faq-item] {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  #faq [data-faq-q] {
    font-size: 0.98rem !important;
  }

  #gallery [data-cms-gallery-grid] {
    columns: 1 !important;
  }

  .cafe-showcase {
    max-width: none;
  }

  .cafe-showcase-stage {
    max-width: none;
    height: auto;
    min-height: 0;
  }

  #contact iframe {
    height: 16rem;
    min-height: 16rem;
  }

  .fixed.bottom-5.right-5 {
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .pkg-modal {
    padding: 0.75rem;
    align-items: end;
  }

  .pkg-modal-panel {
    width: 100%;
    max-height: min(90dvh, 40rem);
    border-radius: 1.25rem 1.25rem 0.75rem 0.75rem;
    padding: 1.25rem 1rem 1.15rem;
  }

  .pkg-card-wrap.is-pkg-host .pkg-modal-panel {
    max-height: none;
    height: 100%;
    border-radius: 1.35rem;
  }

  .pkg-option {
    grid-template-columns: auto 1fr;
    gap: 0.7rem;
  }

  .pkg-option-price {
    grid-column: 2;
    justify-self: start;
    white-space: normal;
    font-size: 1.15rem;
  }

  .site-footer-inner {
    padding-top: 2.25rem;
    padding-bottom: 1.5rem;
    gap: 1.5rem;
  }

  .page-hero h1,
  .about-block h2,
  .cafe-layout h2 {
    font-size: clamp(1.7rem, 8vw, 2.2rem);
  }

  .chip-grid,
  .cafe-photos {
    grid-template-columns: 1fr;
  }

  .cafe-photos img {
    height: 200px;
  }

  .filters {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .filters a {
    flex: 0 0 auto;
  }

  .gallery-grid {
    columns: 1 160px;
  }

  .lightbox,
  .cms-lightbox {
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }
}

@media (min-width: 421px) and (max-width: 720px) {
  .gallery-grid {
    columns: 2 140px;
  }
}

/* Compact phone layout — same content, far less scrolling */
@media (max-width: 720px) {
  /* Section rhythm */
  main > section:not(#hero) {
    padding-top: 1.25rem !important;
    padding-bottom: 1.25rem !important;
  }

  main > section:not(#hero) h2 {
    margin-top: 0.4rem !important;
  }

  main > section:not(#hero) .max-w-2xl > p.mt-5 {
    margin-top: 0.45rem !important;
    font-size: 0.83rem !important;
  }

  main > section:not(#hero) [class*="mt-16"],
  main > section:not(#hero) [class*="mt-14"],
  main > section:not(#hero) [class*="mt-12"],
  main > section:not(#hero) [class*="mt-10"] {
    margin-top: 1.1rem !important;
  }

  /* Mission / Vision / Why-us: icon beside the text instead of above it */
  #about [class*="gap-10"] {
    gap: 1rem !important;
  }

  #about .grid.gap-4 {
    gap: 0.6rem !important;
  }

  #about .grid.gap-4 > article.glass {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.75rem;
    padding: 0.9rem 1rem !important;
  }

  #about .grid.gap-4 > article.glass > div:first-child {
    grid-row: span 2;
    width: 2.25rem !important;
    height: 2.25rem !important;
    border-radius: 0.9rem !important;
  }

  #about .grid.gap-4 > article.glass h3 {
    margin-top: 0 !important;
    font-size: 1rem !important;
  }

  #about .grid.gap-4 > article.glass p {
    margin-top: 0.25rem !important;
    font-size: 0.78rem !important;
  }

  /* Class cards: photo beside the text instead of stacked above it */
  #classes [data-cms-classes-grid] {
    gap: 0.6rem !important;
  }

  #classes [data-cms-classes-grid] article {
    display: grid;
    grid-template-columns: 38% 1fr;
  }

  /* Fill the photo column without a percentage height: iOS Safari resolves
     height:100% against an indefinite row and blows the card up. */
  #classes [data-cms-classes-grid] article > div:first-child {
    position: relative;
    min-height: 9rem;
  }

  #classes [data-cms-classes-grid] img {
    position: absolute;
    inset: 0;
    height: 100% !important;
    width: 100%;
    object-fit: cover;
  }

  #classes [data-cms-classes-grid] .p-6 {
    padding: 0.8rem 0.9rem !important;
  }

  #classes [data-cms-classes-grid] h3 {
    font-size: 1rem !important;
  }

  #classes [data-cms-classes-grid] .mt-3 {
    margin-top: 0.4rem !important;
  }

  #classes [data-cms-classes-grid] p.mt-4 {
    margin-top: 0.4rem !important;
    font-size: 0.78rem !important;
  }

  #classes [data-cms-classes-grid] a.mt-6 {
    margin-top: 0.6rem !important;
    padding: 0.5rem 0.9rem !important;
  }

  #why-pilates [data-cms-trainers-grid] {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.6rem !important;
  }

  #why-pilates [data-cms-trainers-grid] img.h-80 {
    height: 9.5rem !important;
  }

  #why-pilates [data-cms-trainers-grid] .p-6 {
    padding: 0.7rem 0.8rem !important;
  }

  #why-pilates [data-cms-trainers-grid] h3 {
    font-size: 1rem !important;
  }

  #why-pilates [data-cms-trainers-grid] p {
    margin-top: 0.3rem !important;
    font-size: 0.72rem !important;
  }

  #gallery [data-cms-gallery-grid] {
    columns: 2 !important;
    column-gap: 0.6rem !important;
  }

  #gallery [data-cms-gallery-grid] > * {
    break-inside: avoid;
    margin-bottom: 0.6rem !important;
  }

  #contact iframe {
    height: 12rem;
    min-height: 12rem;
  }

  #contact .glass.rounded-3xl {
    padding: 1rem !important;
  }

  /* Subpages (about, classes, cafe, plans, gallery) */
  .page {
    padding: 14px 0 28px;
  }

  body.has-fixed-nav .page {
    padding-top: 84px;
  }

  .page-hero {
    margin-bottom: 12px;
  }

  .page-hero p {
    font-size: 0.85rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .card {
    display: grid;
    grid-template-columns: 38% 1fr;
    align-items: stretch;
  }

  .card img {
    aspect-ratio: 3 / 4;
    height: auto;
    align-self: stretch;
    min-height: 9rem;
    object-fit: cover;
  }

  .card-body {
    padding: 0.8rem 0.9rem;
    gap: 6px;
    align-content: start;
  }

  .card h3 {
    font-size: 1.05rem;
  }

  .card .badge {
    font-size: 0.8rem;
  }

  .card .btn,
  .card .outline {
    justify-self: start;
    padding: 7px 12px;
    font-size: 0.78rem;
  }

  .stats {
    margin-top: 16px;
  }

  .chip-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px;
    margin: 12px 0;
  }

  .chip-grid span {
    padding: 9px 10px;
    font-size: 0.8rem;
    text-align: center;
  }

  .cafe-photos {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .cafe-photos img {
    height: 140px;
  }

  .filters {
    margin: 10px 0 12px;
  }

  .gallery-grid {
    columns: 2 120px;
    column-gap: 10px;
  }

  .gallery-card {
    margin-bottom: 10px;
  }

  .gallery-card img {
    border-radius: 16px;
  }

  .site-footer-inner {
    padding-top: 1.5rem;
    padding-bottom: 1rem;
    gap: 1rem;
  }
}

/* Dark mode — no white section slabs on phone */
@media (max-width: 720px) {
  html.dark main > section:not(#hero),
  html.dark #testimonials,
  html.dark #membership {
    background: #1e2d2a !important;
  }

  html.dark .site-footer {
    background: linear-gradient(180deg, #1c2623 0%, #243532 100%) !important;
  }
}
