/* Health Coaching source grid only. Load after the restored source CSS.
   Content, image sources, section themes, native controls and divider geometry
   are unchanged. Desktop retains the source text/photo and FAQ pairings. */

/* Content height replaces the source's empty numbered rows in these grids. */
body[data-riot-layout~="health"] #page.health-source-main :is(
  .fe-6acccb720a3ad5316aaef845,
  .fe-6acccb720a3ad5316aaef849,
  .fe-6acccb720a3ad5316aaef84d,
  .fe-6acccb720a3ad5316aaef851,
  .fe-6acccb720a3ad5316aaef855,
  .fe-6acccb720a3ad5316aaef859,
  .fe-6acccb720a3ad5316aaef85d
) {
  height: auto;
  min-width: 0;
  grid-template-rows: none;
  grid-auto-rows: auto;
  overflow: visible;
}

body[data-riot-layout~="health"] #page.health-source-main > .page-section:not([data-section-id="6acccb720a3ad5316aaef842"]) {
  min-height: 0 !important;
}

/* Wrapper padding must win over the source's long section-height selectors
   and the introduction's captured inline zero padding. Keep section-level
   divider padding intact. */
body[data-riot-layout~="health"] #page.health-source-main > .page-section:not([data-section-id="6acccb720a3ad5316aaef842"]) > .content-wrapper {
  max-width: 1240px;
  padding: clamp(40px, 4vw, 64px) clamp(20px, 4vw, 56px) !important;
}

body[data-riot-layout~="health"] #page.health-source-main .fluid-engine > .fe-block {
  min-width: 0;
  min-height: 0;
}

body[data-riot-layout~="health"] #page.health-source-main .fluid-engine .sqs-block:is(.sqs-block-html, .sqs-block-button, .sqs-block-accordion) {
  height: auto;
}

/* The only four source photo blocks: use each image's intrinsic dimensions,
   not the captured grid cell height. No logos, icons or background are reset. */
body[data-riot-layout~="health"] #page.health-source-main :is(
  #block-329f1a2230fe23f26eda,
  #block-f8bf5e7386f10a140ef0,
  #block-b58ce5ff8949c00d967e,
  #block-f2d632ca6d144b4638a6
) {
  height: auto;
  max-width: 26rem;
  margin-inline: auto;
}

body[data-riot-layout~="health"] #page.health-source-main :is(
  #block-329f1a2230fe23f26eda,
  #block-f8bf5e7386f10a140ef0,
  #block-b58ce5ff8949c00d967e,
  #block-f2d632ca6d144b4638a6
) :is(.sqs-block-content, .image-block-outer-wrapper, .fluid-image-animation-wrapper, .sqs-image-content, .js-content-mode-element-wrapper, .content-fill) {
  position: relative;
  width: 100%;
  height: auto;
  max-width: 100%;
}

body[data-riot-layout~="health"] #page.health-source-main :is(
  #block-329f1a2230fe23f26eda,
  #block-f8bf5e7386f10a140ef0,
  #block-b58ce5ff8949c00d967e,
  #block-f2d632ca6d144b4638a6
) img {
  position: relative !important;
  width: 100% !important;
  height: auto !important;
  max-width: 100%;
  object-fit: contain !important;
}

/* Keep existing CTA paint and corner shapes; give wrapped labels their own
   height instead of inheriting a stretched, fixed-row button box. */
body[data-riot-layout~="health"] #page.health-source-main .sqs-block-button .sqs-stretched {
  height: auto;
  max-width: 26rem;
}

body[data-riot-layout~="health"] #page.health-source-main .fluid-engine .sqs-block-button .sqs-stretched .sqs-block-button-element {
  box-sizing: border-box;
  height: auto;
  min-width: 44px;
  min-height: 44px;
  max-width: 100%;
  padding: 12px 20px !important;
  white-space: normal;
  line-height: 1.35;
}

body[data-riot-layout~="health"] #page.health-source-main #block-7f14c5e98b62fd5f4587 .accordion-item__click-target {
  min-height: 44px;
  gap: 12px;
}

body[data-riot-layout~="health"] #page.health-source-main #block-7f14c5e98b62fd5f4587 .accordion-item__title {
  min-width: 0;
  overflow: visible;
}

body[data-riot-layout~="health"] #page.health-source-main #block-7f14c5e98b62fd5f4587 .accordion-icon-container {
  flex-shrink: 0;
}

body[data-riot-layout~="health"] #page.health-source-main #block-7f14c5e98b62fd5f4587 .accordion-item__description {
  min-width: 0;
  max-width: 100%;
}

@media (min-width: 768px) {
  body[data-riot-layout~="health"] #page.health-source-main :is(
    .fe-6acccb720a3ad5316aaef845,
    .fe-6acccb720a3ad5316aaef849,
    .fe-6acccb720a3ad5316aaef84d,
    .fe-6acccb720a3ad5316aaef851,
    .fe-6acccb720a3ad5316aaef855,
    .fe-6acccb720a3ad5316aaef859
  ) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: clamp(28px, 4vw, 56px);
    row-gap: 24px;
    align-items: start;
  }

  /* A spanning portrait must not distribute its extra height into the
     heading/copy rows and push the next text block or CTA away. */
  body[data-riot-layout~="health"] #page.health-source-main :is(
    .fe-6acccb720a3ad5316aaef845,
    .fe-6acccb720a3ad5316aaef849,
    .fe-6acccb720a3ad5316aaef84d
  ) {
    grid-template-rows: auto minmax(0, 1fr);
  }
  body[data-riot-layout~="health"] #page.health-source-main .fe-6acccb720a3ad5316aaef855 {
    grid-template-rows: auto auto auto minmax(0, 1fr);
  }

  /* Introduction: copy and CTA on the left, full portrait on the right. */
  body[data-riot-layout~="health"] #page.health-source-main .fe-6acccb720a3ad5316aaef845 > .fe-block-e59e97125ae0974763d0 {
    grid-area: 1 / 1;
  }
  body[data-riot-layout~="health"] #page.health-source-main .fe-6acccb720a3ad5316aaef845 > .fe-block-329f1a2230fe23f26eda {
    grid-area: 1 / 2 / 3 / 3;
  }
  body[data-riot-layout~="health"] #page.health-source-main .fe-6acccb720a3ad5316aaef845 > .fe-block-3b9607446d3463c20d98 {
    grid-area: 2 / 1;
    align-self: start;
  }

  /* The lavender rectangle stays behind the complete familiar-symptoms pair. */
  body[data-riot-layout~="health"] #page.health-source-main .fe-6acccb720a3ad5316aaef849 {
    padding: clamp(24px, 3vw, 40px);
    box-sizing: border-box;
  }
  body[data-riot-layout~="health"] #page.health-source-main .fe-6acccb720a3ad5316aaef849 > .fe-block-ac427811cd7453c922d6 {
    position: absolute;
    inset: 0;
    grid-area: auto;
  }
  body[data-riot-layout~="health"] #page.health-source-main .fe-6acccb720a3ad5316aaef849 > .fe-block-4f89d81444efe1083a74 {
    grid-area: 1 / 1 / 3 / 2;
  }
  body[data-riot-layout~="health"] #page.health-source-main .fe-6acccb720a3ad5316aaef849 > .fe-block-f8bf5e7386f10a140ef0 {
    grid-area: 1 / 2;
  }
  body[data-riot-layout~="health"] #page.health-source-main .fe-6acccb720a3ad5316aaef849 > .fe-block-c023b771c99ace47f3f1 {
    grid-area: 2 / 2;
  }

  /* Georgia's complete biography determines its row height; no text overlap. */
  body[data-riot-layout~="health"] #page.health-source-main .fe-6acccb720a3ad5316aaef84d > .fe-block-b58ce5ff8949c00d967e {
    grid-area: 1 / 2 / 3 / 3;
  }
  body[data-riot-layout~="health"] #page.health-source-main .fe-6acccb720a3ad5316aaef84d > .fe-block-c04992c0f45c0589514d {
    grid-area: 1 / 1;
  }
  body[data-riot-layout~="health"] #page.health-source-main .fe-6acccb720a3ad5316aaef84d > .fe-block-58a8441ad62086b378a0 {
    grid-area: 2 / 1;
  }

  /* Preserve the source's centered heading, two benefits, then final benefit. */
  body[data-riot-layout~="health"] #page.health-source-main .fe-6acccb720a3ad5316aaef851 > .fe-block-51c5c8e273a7ce281c2e {
    grid-area: 1 / 1 / 2 / 3;
    max-width: 52rem;
    justify-self: center;
  }
  body[data-riot-layout~="health"] #page.health-source-main .fe-6acccb720a3ad5316aaef851 > .fe-block-58d314b3dcd02c5c9e4f {
    grid-area: 2 / 1;
  }
  body[data-riot-layout~="health"] #page.health-source-main .fe-6acccb720a3ad5316aaef851 > .fe-block-9d5819fd452761528de9 {
    grid-area: 2 / 2;
  }
  body[data-riot-layout~="health"] #page.health-source-main .fe-6acccb720a3ad5316aaef851 > .fe-block-f862a9f8fc0d12b5ce3e {
    grid-area: 3 / 1 / 4 / 3;
    max-width: 56rem;
    justify-self: center;
  }

  /* Call details, membership note and booking CTA never share a fixed row. */
  body[data-riot-layout~="health"] #page.health-source-main .fe-6acccb720a3ad5316aaef855 > .fe-block-f2d632ca6d144b4638a6 {
    grid-area: 1 / 2 / 5 / 3;
  }
  body[data-riot-layout~="health"] #page.health-source-main .fe-6acccb720a3ad5316aaef855 > .fe-block-2514beaae3373e24f69d {
    grid-area: 1 / 1;
  }
  body[data-riot-layout~="health"] #page.health-source-main .fe-6acccb720a3ad5316aaef855 > .fe-block-5dd2124ba75a4adb9bc4 {
    grid-area: 2 / 1;
  }
  body[data-riot-layout~="health"] #page.health-source-main .fe-6acccb720a3ad5316aaef855 > .fe-block-yui_3_17_2_1_1791806484691_27719 {
    grid-area: 3 / 1;
  }
  body[data-riot-layout~="health"] #page.health-source-main .fe-6acccb720a3ad5316aaef855 > .fe-block-ee90600f640258343694 {
    grid-area: 4 / 1;
    align-self: start;
  }

  body[data-riot-layout~="health"] #page.health-source-main .fe-6acccb720a3ad5316aaef859 > .fe-block-f51623651fc6b3ac9867 {
    grid-area: 1 / 1;
  }
  body[data-riot-layout~="health"] #page.health-source-main .fe-6acccb720a3ad5316aaef859 > .fe-block-7f14c5e98b62fd5f4587 {
    grid-area: 1 / 2;
  }

  body[data-riot-layout~="health"] #page.health-source-main .fe-6acccb720a3ad5316aaef85d {
    grid-template-columns: minmax(0, 56rem);
    justify-content: center;
    gap: 24px;
  }
  body[data-riot-layout~="health"] #page.health-source-main .fe-6acccb720a3ad5316aaef85d > .fe-block {
    grid-area: auto;
  }
}

@media (max-width: 767px) {
  /* Phone layout follows the existing DOM order, including image-first
     biography and Getting Started sections. No order changes or hidden blocks. */
  body[data-riot-layout~="health"] #page.health-source-main > .page-section > .content-wrapper {
    padding: 32px 20px !important;
  }
  body[data-riot-layout~="health"] #page.health-source-main > .page-section {
    min-height: 0 !important;
  }
  body[data-riot-layout~="health"] #page.health-source-main .fluid-engine {
    display: flex;
    flex-direction: column;
    gap: 24px;
    height: auto;
    min-width: 0;
    overflow: visible;
  }
  body[data-riot-layout~="health"] #page.health-source-main .fluid-engine > .fe-block {
    width: 100%;
    height: auto;
    grid-area: auto;
  }

  /* Keep the source's background hero and measured header offset. Only its
     viewport-height-driven headline size and unused rows are reduced. */
  body[data-riot-layout~="health"] #page.health-source-main #block-ed640ef400589dd047e0 h2 {
    font-size: clamp(2.375rem, 10.5vw, 3.5rem);
    line-height: 1.04;
    margin-top: 20px;
    margin-bottom: 0;
    overflow-wrap: normal;
  }

  body[data-riot-layout~="health"] #page.health-source-main .fe-6acccb720a3ad5316aaef849 {
    position: relative;
    box-sizing: border-box;
    padding: 24px 16px;
  }
  body[data-riot-layout~="health"] #page.health-source-main .fe-6acccb720a3ad5316aaef849 > .fe-block-ac427811cd7453c922d6 {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  body[data-riot-layout~="health"] #page.health-source-main .sqs-block-button .sqs-stretched {
    width: 100%;
    max-width: 100%;
  }
  body[data-riot-layout~="health"] #page.health-source-main #block-0b355981142712cd0ebc a[href="/wellness"] {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}
