/* Private Pilates source grid only. Load after pilates-original-v1.css.
   Preserve the source palette, 24-column desktop alignment, jagged divider,
   media, draft copy, native accordion state and Momence destinations. */

/* Empty source rows and viewport minimums must not determine service height. */
body[data-riot-layout~="pilates"] #page.riot-pilates-source section[data-section-id]:is(
  [data-section-id="6acce85d96fef1470df9c784"],
  [data-section-id="6acce85d96fef1470df9c78d"],
  [data-section-id="6acce85d96fef1470df9c792"],
  [data-section-id="6acce85d96fef1470df9c796"],
  [data-section-id="6acce85d96fef1470df9c79a"]
) {
  min-height: 0;
  height: auto;
}

body[data-riot-layout~="pilates"] #page.riot-pilates-source section[data-section-id]:is(
  [data-section-id="6acce85d96fef1470df9c784"],
  [data-section-id="6acce85d96fef1470df9c78d"],
  [data-section-id="6acce85d96fef1470df9c792"],
  [data-section-id="6acce85d96fef1470df9c796"],
  [data-section-id="6acce85d96fef1470df9c79a"]
) > .content-wrapper {
  padding-top: clamp(2rem, 4vw, 4rem) !important;
  padding-bottom: clamp(2rem, 4vw, 4rem) !important;
}

body[data-riot-layout~="pilates"] #page.riot-pilates-source :is(
  .fe-6acce85d96fef1470df9c782,
  .fe-6acce85d96fef1470df9c78c,
  .fe-6acce85d96fef1470df9c790,
  .fe-6acce85d96fef1470df9c795,
  .fe-6acce85d96fef1470df9c799
) {
  row-gap: 1rem;
  align-items: start;
  overflow: visible;
}

body[data-riot-layout~="pilates"] #page.riot-pilates-source :is(
  .fe-6acce85d96fef1470df9c782,
  .fe-6acce85d96fef1470df9c78c,
  .fe-6acce85d96fef1470df9c790,
  .fe-6acce85d96fef1470df9c795,
  .fe-6acce85d96fef1470df9c799
) > .fe-block {
  min-width: 0;
  height: auto;
  align-self: start;
}

body[data-riot-layout~="pilates"] #page.riot-pilates-source :is(
  .fe-6acce85d96fef1470df9c782,
  .fe-6acce85d96fef1470df9c78c,
  .fe-6acce85d96fef1470df9c790,
  .fe-6acce85d96fef1470df9c795,
  .fe-6acce85d96fef1470df9c799
) > .fe-block > .sqs-block {
  height: auto;
}

/* These three photos are 8192 x 5464 in the source, not portraits.
   Release the absolute fill chain rather than imposing a substitute ratio. */
body[data-riot-layout~="pilates"] #page.riot-pilates-source :is(
  #block-d262b39328323cf5c271,
  #block-162a095aed51792aecd5,
  #block-daaeaf55f1fa4579a5c1
) :is(
  .sqs-block-content,
  .fluid-image-component-root,
  .fluid-image-animation-wrapper,
  .fluid-image-container,
  .js-content-mode-element-wrapper,
  .content-fill
) {
  height: auto !important;
  min-height: 0;
  width: 100%;
  aspect-ratio: auto;
}

body[data-riot-layout~="pilates"] #page.riot-pilates-source :is(
  #block-d262b39328323cf5c271,
  #block-162a095aed51792aecd5,
  #block-daaeaf55f1fa4579a5c1
) .content-fill,
body[data-riot-layout~="pilates"] #page.riot-pilates-source :is(
  #block-d262b39328323cf5c271,
  #block-162a095aed51792aecd5,
  #block-daaeaf55f1fa4579a5c1
) img {
  position: relative !important;
  inset: auto !important;
}

body[data-riot-layout~="pilates"] #page.riot-pilates-source :is(
  #block-d262b39328323cf5c271,
  #block-162a095aed51792aecd5,
  #block-daaeaf55f1fa4579a5c1
) img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto !important;
}

/* Primary taps already have source minimums; keep them within narrow columns. */
body[data-riot-layout~="pilates"] #page.riot-pilates-source .sqs-block-button-element {
  box-sizing: border-box;
  max-width: 100%;
  min-height: 44px;
  white-space: normal;
}

body[data-riot-layout~="pilates"] #page.riot-pilates-source #block-237e4f718271f6aa249b .accordion-item__click-target {
  min-height: 44px;
  gap: 0.75rem;
}

body[data-riot-layout~="pilates"] #page.riot-pilates-source #block-237e4f718271f6aa249b .accordion-item__title {
  min-width: 0;
  overflow-wrap: break-word;
}

@media (min-width: 768px) {
  /* Retain the original desktop columns; replace only reserved vertical rows. */
  body[data-riot-layout~="pilates"] #page.riot-pilates-source :is(
    .fe-6acce85d96fef1470df9c782,
    .fe-6acce85d96fef1470df9c78c
  ) {
    grid-template-rows: auto minmax(0, 1fr);
  }

  body[data-riot-layout~="pilates"] #page.riot-pilates-source .fe-6acce85d96fef1470df9c790 {
    grid-template-rows: auto auto auto minmax(0, 1fr);
  }

  body[data-riot-layout~="pilates"] #page.riot-pilates-source .fe-6acce85d96fef1470df9c795 {
    grid-template-rows: auto;
  }

  body[data-riot-layout~="pilates"] #page.riot-pilates-source .fe-6acce85d96fef1470df9c799 {
    grid-template-rows: auto auto;
  }

  body[data-riot-layout~="pilates"] #page.riot-pilates-source .fe-block-d0686249f851942935c8 { grid-area: 1 / 3 / 2 / 15; }
  body[data-riot-layout~="pilates"] #page.riot-pilates-source .fe-block-d262b39328323cf5c271 { grid-area: 1 / 16 / 3 / 25; }
  body[data-riot-layout~="pilates"] #page.riot-pilates-source .fe-block-dc87677bee210ae22975 { grid-area: 2 / 3 / 3 / 10; }

  body[data-riot-layout~="pilates"] #page.riot-pilates-source .fe-block-162a095aed51792aecd5 { grid-area: 1 / 15 / 3 / 26; }
  body[data-riot-layout~="pilates"] #page.riot-pilates-source .fe-block-2d6d4d9622c11d45721d { grid-area: 1 / 2 / 2 / 13; }
  body[data-riot-layout~="pilates"] #page.riot-pilates-source .fe-block-0a08c45609bfe78c565d { grid-area: 2 / 2 / 3 / 13; }

  body[data-riot-layout~="pilates"] #page.riot-pilates-source .fe-block-daaeaf55f1fa4579a5c1 { grid-area: 1 / 15 / 5 / 26; }
  body[data-riot-layout~="pilates"] #page.riot-pilates-source .fe-block-a6a74fae0a831d7c87ee { grid-area: 1 / 2 / 2 / 13; }
  body[data-riot-layout~="pilates"] #page.riot-pilates-source .fe-block-a298ea1dcf8ae60f77e7 { grid-area: 2 / 2 / 3 / 13; }
  body[data-riot-layout~="pilates"] #page.riot-pilates-source .fe-block-3992e010bcf76b3e7f00 { grid-area: 3 / 2 / 4 / 13; }
  body[data-riot-layout~="pilates"] #page.riot-pilates-source .fe-block-de35281378ddd883a46d { grid-area: 4 / 2 / 5 / 10; }

  body[data-riot-layout~="pilates"] #page.riot-pilates-source .fe-block-2017d0c6069a8ead4e73 { grid-area: 1 / 2 / 2 / 11; }
  body[data-riot-layout~="pilates"] #page.riot-pilates-source .fe-block-237e4f718271f6aa249b { grid-area: 1 / 14 / 2 / 26; }
  body[data-riot-layout~="pilates"] #page.riot-pilates-source .fe-block-78e84877ea0e7511238d { grid-area: 1 / 5 / 2 / 23; }
  body[data-riot-layout~="pilates"] #page.riot-pilates-source .fe-block-b377b0ac03bf2f427890 { grid-area: 2 / 5 / 3 / 12; }
}

@media (max-width: 767px) {
  /* The source header offset stays intact; only the phone hero's reserve shrinks. */
  body[data-riot-layout~="pilates"] #page.riot-pilates-source section[data-section-id="6acce85d96fef1470df9c77f"] {
    min-height: 0;
    height: auto;
  }

  body[data-riot-layout~="pilates"] #page.riot-pilates-source section[data-section-id="6acce85d96fef1470df9c77f"] > .content-wrapper {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }

  body[data-riot-layout~="pilates"] #page.riot-pilates-source #block-4de2d80f114b403ab849 h2 {
    font-size: clamp(2.25rem, 10vw, 4.25rem);
    line-height: 1.02;
  }

  body[data-riot-layout~="pilates"] #page.riot-pilates-source :is(
    .fe-6acce85d96fef1470df9c77d,
    .fe-6acce85d96fef1470df9c782,
    .fe-6acce85d96fef1470df9c78c,
    .fe-6acce85d96fef1470df9c790,
    .fe-6acce85d96fef1470df9c795,
    .fe-6acce85d96fef1470df9c799
  ) {
    box-sizing: border-box;
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-auto-rows: auto;
    gap: 1.25rem;
    padding-inline: clamp(1rem, 6vw, 1.75rem);
    overflow: visible;
  }

  body[data-riot-layout~="pilates"] #page.riot-pilates-source :is(
    .fe-6acce85d96fef1470df9c77d,
    .fe-6acce85d96fef1470df9c782,
    .fe-6acce85d96fef1470df9c78c,
    .fe-6acce85d96fef1470df9c790,
    .fe-6acce85d96fef1470df9c795,
    .fe-6acce85d96fef1470df9c799
  ) > .fe-block {
    grid-area: auto;
    min-width: 0;
    height: auto;
  }

  /* Keep the source's existing heading-before-answers visual presentation.
     No DOM nodes, keyboard order or accordion visibility rules are changed. */
  body[data-riot-layout~="pilates"] #page.riot-pilates-source .fe-6acce85d96fef1470df9c795 > .fe-block-2017d0c6069a8ead4e73 {
    grid-area: 1 / 1;
  }

  body[data-riot-layout~="pilates"] #page.riot-pilates-source .fe-6acce85d96fef1470df9c795 > .fe-block-237e4f718271f6aa249b {
    grid-area: 2 / 1;
  }

  body[data-riot-layout~="pilates"] #page.riot-pilates-source .sqs-block-button-container,
  body[data-riot-layout~="pilates"] #page.riot-pilates-source .sqs-block-button-element {
    width: 100%;
  }
}
