/* Red Grove Health — mobile layer. Loaded after the page's own inline styles.
   Everything is scoped to <=900px; desktop is untouched. */

@media (max-width: 900px) {
  html { -webkit-text-size-adjust: 100%; }
  body { padding-bottom: 74px; }

  /* --- container gutters --- */
  [style*="padding: 0px 48px"], [style*="padding:0 48px"] { padding-left: 20px !important; padding-right: 20px !important; }
  [style*="padding: 0px 40px"] { padding-left: 20px !important; padding-right: 20px !important; }

  /* --- vertical rhythm --- */
  section:not(#top) { padding-top: 56px !important; padding-bottom: 56px !important; }
  footer { padding-top: 56px !important; }

  /* --- every multi-column grid stacks (opt out with data-m-keep) --- */
  [style*="grid-template-columns"]:not([data-m-keep]) { grid-template-columns: 1fr !important; }
  [data-m-keep] { grid-template-columns: 1fr 1fr !important; gap: 12px !important; }

  /* --- large gaps close up --- */
  [style*="gap: 96px"], [style*="gap: 88px"], [style*="gap: 80px"], [style*="gap: 72px"],
  [style*="gap: 64px"], [style*="gap: 56px"], [style*="gap: 48px"] { gap: 26px !important; }
  [style*="column-gap: 96px"] { column-gap: 26px !important; }

  /* --- type --- */
  h1 { font-size: clamp(29px, 8.4vw, 42px) !important; line-height: 1.1 !important; letter-spacing: -0.028em !important; max-width: none !important; }
  h2 { font-size: clamp(25px, 7.2vw, 34px) !important; line-height: 1.14 !important; letter-spacing: -0.024em !important; max-width: none !important; text-align: left !important; }
  h3 { font-size: 19px !important; }
  p { max-width: none !important; }
  [style*="font-size: 104px"], [style*="font-size: 96px"], [style*="font-size: 88px"] { font-size: 34px !important; line-height: 1.06 !important; }
  [style*="font-size: 60px"], [style*="font-size: 56px"], [style*="font-size: 52px"] { font-size: 36px !important; }
  [style*="font-size: 42px"], [style*="font-size: 38px"] { font-size: 30px !important; }

  /* --- card & panel padding --- */
  [style*="padding: 80px"], [style*="padding: 72px"], [style*="padding: 64px"], [style*="padding: 56px"],
  [style*="padding: 48px"], [style*="padding: 44px 40px"], [style*="padding: 40px 36px"], [style*="padding: 44px"],
  [style*="padding: 46px"], [style*="padding: 52px"] { padding: 24px !important; }
  [style*="border-radius: 32px"], [style*="border-radius: 28px"] { border-radius: 20px !important; }
  [style*="margin: 56px"], [style*="margin: 48px"] { margin: 16px !important; }

  /* --- media: shorter, tighter crops --- */
  [style*="height: 720px"], [style*="height: 700px"], [style*="height: 680px"], [style*="height: 640px"],
  [style*="height: 620px"], [style*="height: 600px"], [style*="height: 560px"], [style*="height: 520px"],
  [style*="height: 500px"], [style*="height: 480px"] { height: 288px !important; }
  [style*="min-height: 560px"], [style*="min-height: 520px"], [style*="min-height: 480px"] { min-height: 360px !important; }

  /* --- header: desktop nav out, mobile chrome in (mobile.js) --- */
  header nav, header [data-m-hide] { display: none !important; }
  header { padding: 16px 20px !important; row-gap: 0 !important; }
  header > div:first-child { height: 66px !important; }
  header [data-panel] { display: none !important; }

  /* --- payer marquee --- */
  [data-marquee-track] { gap: 40px !important; padding-left: 40px !important; }

  /* --- footer --- */
  footer [style*="font-size: 184px"] { font-size: 54px !important; margin-bottom: -10px !important; }
  footer [data-m-col] > *:nth-child(n+2) { display: none !important; }
  footer [data-m-col][data-open] > *:nth-child(n+2) { display: flex !important; }
  footer [data-m-col][data-open] > p, footer [data-m-col][data-open] > form { display: block !important; }

  /* --- big-number callout blocks stop right-aligning --- */
  [style*="justify-content: flex-end"] { justify-content: flex-start !important; }
  [style*="text-align: right"] { text-align: left !important; }

  /* --- horizontal flex rows of substance wrap --- */
  [style*="display: flex"][style*="gap: 32px"], [style*="display: flex"][style*="gap: 40px"] { flex-wrap: wrap !important; }

  /* --- absolutely-positioned decorative numerals shrink --- */
  [style*="position: absolute"][style*="font-size: 220px"], [style*="position: absolute"][style*="font-size: 184px"] { font-size: 96px !important; }

  /* --- testimonial carousel: portrait above quote --- */
  [data-mo-carousel] { grid-template-columns: 1fr !important; border-radius: 20px !important; }
  [data-mo-carousel] > div:first-child { min-height: 300px !important; }
  [data-mo-carousel] > div:last-child { padding: 30px 22px 26px !important; }
  [data-mo-carousel] p { font-size: 21px !important; line-height: 1.45 !important; }
  [data-mo-carousel] [style*="1fr auto"] { grid-template-columns: 1fr !important; row-gap: 26px !important; }
  [data-mo-carousel] [style*="repeat(3,"] { grid-template-columns: repeat(3, minmax(0,1fr)) !important; gap: 12px !important; }

  /* --- program index: rail above panel, single-column items --- */
  [data-mo-index] { grid-template-columns: 1fr !important; border-radius: 20px !important; }
  [data-mo-index] > div:first-child { border-right: 0 !important; border-bottom: 1px solid rgba(27,27,27,0.10) !important; padding: 12px !important; flex-direction: row !important; overflow-x: auto !important; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
  [data-mo-index] > div:first-child::-webkit-scrollbar { display: none; }
  [data-mo-index] > div:first-child button { width: auto !important; flex: 0 0 auto; scroll-snap-align: start; grid-template-columns: auto auto !important; gap: 10px !important; padding: 13px 18px !important; border-radius: 999px !important; }
  [data-mo-index] > div:first-child button > *:nth-child(3) { display: none !important; }
  [data-mo-index] > div:first-child button > *:nth-child(2) { font-size: 15px !important; white-space: nowrap; }
  [data-mo-index] > div:last-child { padding: 30px 22px 34px !important; }
  [data-mo-index] > div:last-child > span:first-child { font-size: 108px !important; top: -18px !important; right: 10px !important; }
  [data-mo-index] [style*="repeat(2,"] { grid-template-columns: 1fr !important; }

  /* --- injected mobile chrome --- */
  #rg-m-burger, #rg-m-cta { display: flex !important; }
}

@media (min-width: 901px) {
  #rg-m-burger, #rg-m-cta, #rg-m-menu { display: none !important; }
}
