/* These three profiles, shades and proportions match the approved photo hero. */
#main {
  --ogh-front-cut: polygon(0 36%,8% 25%,17% 48%,28% 18%,40% 61%,52% 34%,64% 51%,76% 25%,88% 38%,95% 17%,100% 34%,100% 100%,0 100%);
  --ogh-middle-cut: polygon(0 23%,11% 52%,22% 37%,34% 56%,46% 19%,59% 40%,71% 24%,82% 61%,92% 35%,100% 45%,100% 100%,0 100%);
  --ogh-back-cut: polygon(0 48%,9% 21%,20% 42%,33% 15%,45% 56%,57% 32%,69% 44%,80% 22%,91% 51%,100% 30%,100% 100%,0 100%);
  --ogh-join-height: 48px;
  --ogh-hero-back: rgb(137 165 192 / .52);
  --ogh-hero-middle: rgb(231 238 246 / .72);
}
@media (max-width: 760px) {
  #main { --ogh-join-height: 40px; }
}

/* Repaint the existing join in place. Its negative margin makes the translucent
   parts show the previous sheet or photo and contributes no new page height. */
body.ogh #main .edge9.ogh-section-cut {
  position: relative;
  width: 100%;
  max-width: none;
  height: var(--ogh-join-height) !important;
  min-height: 0;
  margin: calc(-1 * var(--ogh-join-height)) 0 0 !important;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  isolation: isolate;
  background: transparent;
  z-index: 3;
  pointer-events: none;
}
#main .ogh-section-cut > span {
  display: block;
  position: absolute;
  inset: auto 0 0;
  margin: 0;
  border: 0;
  width: 100%;
  background-color: var(--og-in, #e8f0f8);
}
#main .ogh-section-cut > .ogh-cut-back {
  height: 100%;
  opacity: .36;
  clip-path: var(--ogh-back-cut);
}
#main .ogh-section-cut > .ogh-cut-middle {
  height: 68%;
  opacity: .59;
  clip-path: var(--ogh-middle-cut);
}
#main .ogh-section-cut > .ogh-cut-front { height: 38%; clip-path: var(--ogh-front-cut); }
#main .care-review-jobs > .ogh-section-cut { --og-in: var(--next, white); }
#main > :is(.p-hero,.ghero) + .ogh-section-cut > .ogh-cut-back,
#main .ogh-paper-page .v2-hero > .edge-bottom .ogh-sheet-back {
  height: 100%;
  opacity: 1;
  background: var(--ogh-hero-back);
  clip-path: var(--ogh-back-cut);
}
#main > :is(.p-hero,.ghero) + .ogh-section-cut > .ogh-cut-middle,
#main .ogh-paper-page .v2-hero > .edge-bottom .ogh-sheet-middle {
  height: 68%;
  opacity: 1;
  background: var(--ogh-hero-middle);
  clip-path: var(--ogh-middle-cut);
}
#main .ogh-paper-page .v2-hero > .edge-bottom {
  height: var(--ogh-join-height);
  transform: none;
}
#main .ogh-paper-page .v2-hero > .edge-bottom .ogh-sheet-front {
  height: 38%;
  clip-path: var(--ogh-front-cut);
}
#main .ogh-paper-page .v2-hero > .edge-top { display: none; }

/* The full-width photo must end at the paper, not the rounded corner from
   the older card/photo treatment. Keep the clinic-specific photographic crop. */
body.ogh #main > .p-hero.ph-full,
body.ogh #main > .p-hero.ph-full > :is(img.ph-bg,.ph-shade),
body.ogh #main .v2-hero,
body.ogh #main .v2-hero > .v2-backdrop,
body.ogh #main .v2-hero > .v2-backdrop img {
  border-radius: 0 !important;
}
body.ogh-get-ready #main > .p-hero.ph-full,
body.ogh-get-ready #main > .p-hero.ph-full > :is(img.ph-bg,.ph-shade) {
  clip-path: none;
  mask-image: none;
}

/* Make the news archive's three editorial groups actual full-width surfaces.
   Each list keeps the same reading width as its neighbouring hero. */
body.ogh #main > .p-sec:has(.nw-up) {
  padding-block: 0;
}
body.ogh #main > .p-sec:has(.nw-up) > .wrap,
body.ogh #main .entry:has(> .nw-up) {
  width: 100%;
  max-width: none;
  padding-inline: 0;
  margin-inline: 0;
}
#main .entry:has(> .nw-up) > :is(.nw-up,.ogh-news-latest,.ogh-news-more) {
  margin: 0;
  padding-block: clamp(2rem, 4vw, 3.75rem) calc(var(--ogh-join-height) + 1.5rem);
  padding-inline: max(clamp(1rem, 3.3vw, 2.5rem), calc((100% - 1184px) / 2 + 2.5rem));
}
#main .entry > :is(.nw-up,.ogh-news-more) { background: var(--og-sheet, #e8f0f8); }
#main .entry > .ogh-news-latest { background: white; }
#main .entry > .ogh-section-cut:has(+ .ogh-news-latest) { --og-in: white; }
#main .entry > .ogh-section-cut:has(+ .ogh-news-more) { --og-in: var(--og-sheet, #e8f0f8); }
