/* Shared screen layout. The narrower editorial and form reading widths still apply. */
@media screen {
  :root {
    --sgmc-gutter: clamp(1rem, 4vw, 3.5rem);
    --sgmc-section-space: clamp(2.5rem, 5vw, 4.25rem);
    --sgmc-compact-space: clamp(1.75rem, 3.5vw, 3rem);
    --sgmc-heading-gap: clamp(1.25rem, 2.2vw, 2rem);
    --sgmc-column-gap: clamp(1.25rem, 3vw, 2.75rem);
  }
  body .wrap {
    width: min(82rem, calc(100% - var(--sgmc-gutter) - var(--sgmc-gutter)));
    margin-inline: auto;
  }
  main > .section { padding-block: var(--sgmc-section-space); }
  main > .section.compact { padding-block: var(--sgmc-compact-space); }
  main > .section.compact:has(> .wrap > .callout:only-child) {
    padding-block: clamp(1.25rem, 2.5vw, 2rem);
  }
  main .section-head {
    gap: var(--sgmc-heading-gap) var(--sgmc-column-gap);
    margin-block-end: var(--sgmc-heading-gap);
  }
  main .section-head > div, main .split > *, main .topic-grid > *,
  main .form-layout > *, main .field-grid > *, main .sgmc-fields > * {
    min-inline-size: 0;
  }
  main .section-head h2:last-child { margin-block-end: 0; }
  main .topic-grid { gap: var(--sgmc-heading-gap) var(--sgmc-column-gap); }
  main .topic-grid.cols-2 { column-gap: var(--sgmc-column-gap); }
  main .topic { padding-block: clamp(.875rem, 1.6vw, 1.375rem) 0; }
  main .topic .topic-top {
    align-items: flex-start;
    gap: .75rem;
    margin-block-end: .75rem;
  }
  main .topic .topic-top .icon { flex-shrink: 0; }
  main .split { gap: clamp(1.75rem, 4vw, 3.5rem); }
  main .field-grid, main .sgmc-fields {
    column-gap: clamp(1rem, 2vw, 1.5rem);
    row-gap: 1.25rem;
  }
  main .actions { row-gap: .75rem; }
  main .btn { max-inline-size: 100%; }
  main .btn .icon, main .text-link .icon, main .directory a .icon { flex-shrink: 0; }
  main .faq-grid { column-gap: var(--sgmc-column-gap); }
  .footer-grid { column-gap: var(--sgmc-column-gap); }
  .footer-grid > * { min-inline-size: 0; }
}
@media screen and (max-width: 720px) {
  main .section-head { margin-block-end: 1.25rem; }
  main .section-head > .text-link { margin-block-start: .75rem; }
  main .directory a { gap: .875rem; }
  main .faq summary { padding-block: .875rem; }
  main .form-layout, main .flow-layout { gap: 1.5rem; }
  main .form-aside, main .flow-panel, main .feature-card {
    padding: clamp(1rem, 4.8vw, 1.5rem);
  }
  main .field-grid, main .sgmc-fields { row-gap: 1rem; }
  main .field-grid, main .flow-fields, main .sgmc-fields { grid-template-columns: minmax(0, 1fr); }
  main .topic-grid, main .topic-grid.cols-2 { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { row-gap: 1.5rem; }
}
@media screen and (max-width: 480px) {
  .masthead .header-inner { column-gap: .625rem; row-gap: .625rem; }
  .masthead .header-inner > .brand { min-inline-size: 0; }
  main .hero .actions, main .visit-band .actions, .contact-page .contact-intro .actions {
    gap: .625rem .875rem;
  }
  main .actions .btn { white-space: normal; text-align: center; }
  main .field input:not([type="checkbox"]):not([type="radio"]),
  main .field select, main .field textarea { min-inline-size: 0; max-inline-size: 100%; }
}


/* Keep the mobile navigation in the same upper-right position on every page. */
@media screen and (max-width: 1050px) {
  .masthead { position: relative; z-index: 35; }
  .masthead .wrap.header-inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    column-gap: .75rem;
    row-gap: .5rem;
    padding-block: .75rem;
    min-height: 0;
  }
  .masthead .header-inner > .brand { grid-area: 1 / 1; min-width: 0; justify-self: start; align-self: center; }
  .masthead .header-inner > .menu-button {
    grid-area: 1 / 2;
    justify-self: end;
    align-self: start;
    justify-content: center;
    margin: 0;
    min-height: 44px;
    min-width: 44px;
    padding: .625rem;
  }
  .masthead .header-inner > .header-paperwork { grid-column: 1 / -1; }
  .masthead .header-inner > .primary-nav {
    position: absolute;
    inset: 100% 0 auto auto;
    width: min(21rem, 100%);
    max-height: 70vh;
    max-height: 70dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-sizing: border-box;
    padding: .5rem 1rem;
    background: var(--paper);
    border: 1px solid var(--line);
    box-shadow: 0 .5rem 1.5rem #293f481a;
  }
  .masthead .header-inner > .primary-nav.open { gap: 0; align-items: stretch; }
  .masthead .primary-nav > a, .masthead .primary-nav > details > summary { min-height: 44px; white-space: normal; }
  .masthead .primary-nav .dropdown { position: static; width: 100%; margin: 0; padding: .25rem 0 .5rem .75rem; }
}

@media screen and (max-width: 1050px) {
  .masthead .brand-since { white-space: nowrap; }
}

/* Give the full clinic tagline its own line beneath the mobile wordmark. */
@media screen and (max-width: 1050px) {
  .masthead .header-inner .brand-subtitle {
    white-space: nowrap;
    max-width: none;
  }
}
@media screen and (max-width: 600px) {
  .masthead .header-inner > .brand {
    grid-column: 1 / -1;
    justify-self: stretch;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 3rem;
    align-items: center;
    gap: .35rem .6rem;
  }
  .masthead .header-inner .brand-type { display: contents; }
  .masthead .header-inner .brand-crest {
    grid-area: 1 / 1;
    width: clamp(4.25rem, 20vw, 5.75rem);
    height: auto;
    max-height: none;
  }
  .masthead .header-inner .brand-title { grid-area: 1 / 2; }
  .masthead .header-inner .brand-subtitle {
    grid-row: 2;
    grid-column: 1 / -1;
    margin: 0;
    font-size: clamp(.5625rem, 2.4vw, .625rem);
    letter-spacing: .015em;
    line-height: 1.4;
    text-align: left;
  }
  .masthead .header-inner > .menu-button { position: relative; z-index: 1; }
}

/* Keep the italic phrase on its own line in paired titles. */
main :is(h1,h2,h3) > span + em { display: block !important; }

/* Phone titles: keep the regular and italic phrases on separate lines. */
@media screen and (max-width: 700px) {
  body main#main h1 {
    font-size: clamp(1.5625rem, 6.7vw, 1.875rem) !important;
    line-height: 1.14 !important;
    max-width: 100%;
    margin-block-end: 1rem;
  }
  body.sgmc-unified-type main#main .hero h1.sgmc-page-title {
    font-size: clamp(1.125rem, 6.7cqi, 1.875rem) !important;
  }
  body main#main h1 > :is(span, em) { white-space: normal; }
  body main#main .section-head h2:not(.eyebrow):not(.workforce-services-heading),
  body main#main .split h2, body main#main .visit-band h2 {
    font-size: clamp(1.375rem, 5.5vw, 1.625rem) !important;
    line-height: 1.2 !important;
  }
  body main#main .topic-top h3 {
    font-size: clamp(1.125rem, 4.8vw, 1.375rem) !important;
    line-height: 1.25 !important;
  }
}

/* Slightly deepen the existing light section backgrounds. */
@media screen {
  main > section.tint { background-color: #e1e7dc; }
  main > section.stone { background-color: #ebe4d8; }
  main > #home-services { background-color: #fcfaf5; }
  main > .section:not(.tint, .stone, .navy) + .section:not(.tint, .stone, .navy, .service-directory) {
    box-shadow: inset 0 1px 0 rgba(89, 82, 63, .13);
  }
}

@media screen {
  main .icon-title-row, main .topic .topic-top {
    display:flex; flex-direction:row; flex-wrap:nowrap; align-items:baseline;
    gap:.65rem; min-width:0; container-type:inline-size;
  }
  main .icon-title-row { margin-bottom:.65rem; }
  main .icon-title-row > svg.icon, main .topic .topic-top > svg.icon {
    flex:0 0 1.3rem; width:1.3rem; height:1.3rem; margin:0; align-self:flex-start;
    margin-top:.12em; color:var(--sage-ink);
  }
  body main#main .icon-title-row > h3, body main#main .topic .topic-top > h3 {
    flex:1; min-width:0; margin:0; min-height:0; text-wrap:wrap;
    font-size:clamp(1rem,calc((100cqi - 2rem) / var(--title-length, 16)),1.65rem)!important;
    line-height:1.18!important;
  }
  body[data-page="employers"] main#main .employer-service-item { display:block; }
  body[data-page="employers"] main#main .employer-service-item > .text-link { display:inline-flex; }
  body[data-page="employers"] main#main .employer-service-heading h2 { max-width:none; }
  body.sgmc-unified-type main#main .hero h1.sgmc-page-title {
    font-size:clamp(1.125rem,calc(100cqi / var(--hero-length, 15)),3.25rem)!important;
    text-wrap:wrap;
  }
}
