/* The parent split-panel layout sets two columns even on narrow phones. */
@media (max-width: 560px) {
  #main .spl dl.p-facts {
    grid-template-columns: minmax(0, 1fr);
    overflow-wrap: anywhere;
  }

  #main .spl dl.p-facts :is(a.tel, dd span) {
    max-inline-size: 100%;
    white-space: normal;
  }
}

@media (max-width: 767px) {
  #main .ogh-employment-application textarea {
    box-sizing: border-box;
    inline-size: 100%;
    block-size: 8.5em;
    min-block-size: 4em;
    overflow: auto;
    resize: vertical;
  }
}

/* The site has three header templates. Give their content the same desktop
   canvas. A minimum lets the header grow for larger type and translations. */
@media (min-width: 960px) {
  body.ogh #main {
    --ogh-hero-height: 36rem;
    --ogh-hero-inset-top: 1.75rem;
    --ogh-hero-inset-bottom: max(3.75rem, calc(var(--og-seam, 3rem) + .75rem));
    --ogh-section-start: 2.75rem;
  }

  #main:not(:has(.ogh-v2)) > :is(.p-hero, .ghero) > .wrap {
    box-sizing: border-box;
    align-content: center;
    row-gap: 1rem;
    /* The parent theme sets important, post-specific hero dimensions. */
    min-height: var(--ogh-hero-height) !important;
    padding-top: var(--ogh-hero-inset-top) !important;
    padding-bottom: var(--ogh-hero-inset-bottom) !important;
  }

  #main:not(:has(.ogh-v2)) > .p-hero > .wrap > .p-htext,
  #main > .ghero > .wrap > div:first-child {
    min-inline-size: 0;
    max-width: min(48rem, 68%);
  }

  #main > .ghero .btnrow {
    flex-wrap: wrap;
  }

  #main > .ghero {
    --ogh-hero-inset-top: 1.375rem;
  }

  #main .ogh-v2 .v2-hero.v2-photo {
    min-height: var(--ogh-hero-height);
    align-items: center;
  }

  #main .ogh-v2 .v2-hero .v2-photo-copy {
    padding-block: var(--ogh-hero-inset-top) var(--ogh-hero-inset-bottom);
  }

  #main .ogh-v2 .v2-hero .v2-photo-copy h1 {
    max-width: min(19ch, 62%);
    font-size: calc(clamp(3rem, 4.8vw, 4.375rem) * var(--ts, 1));
    line-height: 1.08;
    margin-block-end: 1rem;
  }

  /* Some routes join the first section with an SVG, and others draw the
     seam over the header. The section padding starts after either seam. */
  #main:not(:has(.ogh-v2)) > :is(.p-hero, .ghero) + :is(.p-sec, .blk),
  #main:not(:has(.ogh-v2)) > :is(.p-hero, .ghero) + .edge9 + :is(.p-sec, .blk),
  #main .ogh-v2 .v2-hero + .v2-section,
  #main .ogh-v2 .v2-hero + .care-review-bookmark + .v2-section,
  #main #ogh-visual-home.ogh-edge-selected #patient-tasks {
    padding-block-start: var(--ogh-section-start) !important;
  }

  /* Start split-panel headings beside the top of the photo. Full-image
     panels keep their overlay, with the copy in its upper-left corner. */
  #main > :nth-child(1 of :is(.p-sec, .blk):not([hidden])) > .wrap > :is(.sph, .spl):first-child > :is(.sph-t, .spl-t) {
    align-self: start;
  }

  #main > :nth-child(1 of :is(.p-sec, .blk):not([hidden])) > .wrap > :is(.sph, .spl):first-child > :is(.sph-t, .spl-t) > :first-child {
    margin-block-start: 0;
  }
}
