/*
 * Locked REBUILD homepage hero shell: TODAY structure + MENTAL presence.
 *
 * The three existing hero roots share this one rule set. Their artwork, copy
 * and section-specific image treatment remain independent; this file owns only
 * shared outer geometry, frame depth and surrounding gaps.
 */

:is(#today, #recovery, #mental) {
  --rebuild-home-hero-gutter: 15px;
  --rebuild-home-hero-top-gap: 33px;
  --rebuild-home-hero-bottom-gap: 26px;
  --rebuild-home-hero-height: 300px;
  --rebuild-home-hero-radius: 26px;
  --rebuild-home-hero-border: rgba(91, 73, 55, 0.48);
  --rebuild-home-hero-inner-line: rgba(49, 41, 33, 0.28);
  --rebuild-home-hero-rim: #f4eadf;
  --rebuild-home-hero-highlight: #fffdf9;
  --rebuild-home-hero-bevel: #d7c7b5;
  --rebuild-home-hero-shadow-tight: rgba(57, 51, 45, 0.25);
  --rebuild-home-hero-shadow-broad: rgba(57, 51, 45, 0.18);
}

html body main.app > #today.page > .today-v3-hero,
html body main.app > #recovery.page > .recoveryTop,
html body main.app > #mental.page .mental-quiet-hero {
  box-sizing: border-box !important;
  width: min(calc(100vw - (var(--rebuild-home-hero-gutter) * 2)), 760px) !important;
  height: var(--rebuild-home-hero-height) !important;
  min-height: var(--rebuild-home-hero-height) !important;
  margin-right: auto !important;
  margin-left: auto !important;
  border: 1px solid var(--rebuild-home-hero-border) !important;
  border-radius: var(--rebuild-home-hero-radius) !important;
  overflow: hidden !important;
  isolation: isolate !important;
  box-shadow:
    inset 0 0 0 1px var(--rebuild-home-hero-inner-line),
    0 0 0 6px var(--rebuild-home-hero-rim),
    -2px -2px 0 8px var(--rebuild-home-hero-highlight),
    2px 2px 0 8px var(--rebuild-home-hero-bevel),
    0 7px 6px 8px var(--rebuild-home-hero-shadow-tight),
    0 20px 34px 9px var(--rebuild-home-hero-shadow-broad) !important;
}

/* One fixed visual anchor beneath the shared app header. */
html body main.app > #today.page {
  padding-top: var(--rebuild-home-hero-top-gap) !important;
}

html body main.app > #recovery.page > .recoveryTop {
  margin-top: var(--rebuild-home-hero-top-gap) !important;
  margin-bottom: var(--rebuild-home-hero-bottom-gap) !important;
}

html body main.app > #mental.page > .mental-approved-home {
  padding-top: var(--rebuild-home-hero-top-gap) !important;
}

/* MENTAL is nested inside its padded card container; centre the shared shell
 * against the page, not the container's section-specific inner padding. */
html body main.app > #mental.page .mental-quiet-hero {
  left: 50% !important;
  transform: translateX(-50%) !important;
}

/* The next homepage surface begins at the same distance from each hero. */
html body main.app > #today.page > .today-v3-body {
  padding-top: var(--rebuild-home-hero-bottom-gap) !important;
}

html body main.app > #mental.page .mental-quiet-top {
  margin-top: var(--rebuild-home-hero-bottom-gap) !important;
}

@media (max-width: 390px) {
  :is(#today, #recovery, #mental) {
    --rebuild-home-hero-height: 292px;
  }
}

@media (max-width: 360px) {
  :is(#today, #recovery, #mental) {
    --rebuild-home-hero-gutter: 12px;
    --rebuild-home-hero-top-gap: 30px;
    --rebuild-home-hero-bottom-gap: 24px;
    --rebuild-home-hero-height: 282px;
  }

  html body main.app > #today.page > .today-v3-hero,
  html body main.app > #recovery.page > .recoveryTop,
  html body main.app > #mental.page .mental-quiet-hero {
    box-shadow:
      inset 0 0 0 1px var(--rebuild-home-hero-inner-line),
      0 0 0 5px var(--rebuild-home-hero-rim),
      -2px -2px 0 7px var(--rebuild-home-hero-highlight),
      2px 2px 0 7px var(--rebuild-home-hero-bevel),
      0 7px 6px 7px var(--rebuild-home-hero-shadow-tight),
      0 18px 30px 8px var(--rebuild-home-hero-shadow-broad) !important;
  }
}

@media (min-width: 800px) {
  :is(#today, #recovery, #mental) {
    --rebuild-home-hero-gutter: 50px;
    --rebuild-home-hero-top-gap: 36px;
    --rebuild-home-hero-bottom-gap: 30px;
    --rebuild-home-hero-height: 360px;
  }
}

@media (max-height: 600px) and (orientation: landscape) {
  :is(#today, #recovery, #mental) {
    --rebuild-home-hero-top-gap: 18px;
    --rebuild-home-hero-bottom-gap: 18px;
    --rebuild-home-hero-height: 220px;
  }
}

@media (forced-colors: active) {
  html body main.app > #today.page > .today-v3-hero,
  html body main.app > #recovery.page > .recoveryTop,
  html body main.app > #mental.page .mental-quiet-hero {
    border-color: CanvasText !important;
    box-shadow: none !important;
  }
}
