/* step218 site layout, sitewide (2026-11-11). Service and lead pages only (not the home page, which has step217).
   Layout only: no words, links, prices or form behavior change. Extends the step217 home-page patterns. */

/* 1. Hero buttons (step217 pattern): on phones the buttons stack full width at equal size, so none sits alone
   at a different width. Wider screens keep one row (two buttons already fit). */
@media(max-width:600px){
  .nb-hero .ctas{display:grid;grid-template-columns:minmax(0,1fr);gap:calc(10px * var(--scale))}
  .nb-hero .ctas>.pill{width:100%}
}

/* 2. No one-word lines: headings balance their lines; short text avoids a lone last word. */
main h1,main h2,main h3,main .sub,main .nb-cov-sub{text-wrap:balance}
main p,main li,main dt,main dd,main figcaption,main summary{text-wrap:pretty}

/* 3. How it works: the heading starts on the same top line as the timeline card, not floating mid-height. */
.flow:has(>.tl){align-items:start}

/* 4. Photo beside a panel: the photo fills the panel's height, so the pair reads as one balanced block.
   A very long price panel keeps its photo at the top and lets it stay in view while reading. */
@media(min-width:860px){
  .nb-photo-row:not(.nb-art){align-items:stretch}
  .nb-photo-row:not(.nb-art)>.ph{aspect-ratio:auto;min-height:calc(320px * var(--scale));position:relative}
  .nb-photo-row:not(.nb-art)>.ph img{position:absolute;inset:0}
  .nb-photo-row:not(.nb-art):has(.cycle-rows>:nth-child(5)){align-items:start}
  .nb-photo-row:not(.nb-art):has(.cycle-rows>:nth-child(5))>.ph{aspect-ratio:5/4;min-height:0;position:sticky;top:calc(var(--lead-header-height,calc(134px * var(--scale))) + calc(24px * var(--scale)))}
}

/* 6. Do we cover your building (homes, building walk; step217 pattern): areas in tidy borough lists that start
   on the same top line (New York City boroughs first, Westchester second). From 1024 px the map sits beside the lists. */
@media(min-width:560px){
  section.nb-coverage .nb-cov-chips{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:calc(16px * var(--scale));align-items:start}
  section.nb-coverage .nb-chipgroup{flex-direction:column;flex-wrap:nowrap;align-items:stretch;align-content:flex-start;gap:calc(8px * var(--scale))}
  section.nb-coverage .nb-chiphead{flex-basis:auto}
  section.nb-coverage .nb-cov-chip,section.nb-coverage .nb-chipgroup>button{width:100%;overflow-wrap:normal}
  section.nb-coverage .nb-chipgroup[aria-labelledby="nbg-westchester"]{grid-column:2!important;grid-row:1/span 3}
  section.nb-coverage .nb-chipgroup:not([aria-labelledby="nbg-westchester"]){grid-column:1!important}
}
@media(min-width:1024px){
  section.nb-coverage>.wrap{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);column-gap:calc(32px * var(--scale));align-items:start}
  section.nb-coverage>.wrap>*{grid-column:2}
  section.nb-coverage>.wrap>.nb-cov-h,section.nb-coverage>.wrap>.nb-cov-h+.nb-cov-sub{grid-column:1/-1}
  section.nb-coverage>.wrap>.nb-map-host{grid-column:1;grid-row:3/span 4;max-width:none;margin-inline:0}
}
@media(min-width:1280px){section.nb-coverage>.wrap{grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);column-gap:calc(40px * var(--scale))}}

/* 7. What you can check (homes): the three proof cards in one even row across the section,
   the real report centered below at reading width, instead of three squeezed cards beside a tall report. */
.hr2-proofsec .hr2-pair{grid-template-columns:minmax(0,1fr)!important;align-items:start;margin-top:calc(24px * var(--scale))}
@media(max-width:759px){.hr2-proofsec .hr2-proof{grid-template-columns:minmax(0,1fr)!important}}
.hr2-proofsec .hr2-sample{width:100%;max-width:calc(820px * var(--scale));justify-self:center}

/* 8. Card grids in two columns (commercial): an odd last card spans the row, so no card sits alone beside a gap. */
@media(min-width:860px){.hr2-grid2>.hr2-card:last-child:nth-child(odd){grid-column:1/-1}}

/* 9. Ready-when-you-are chips (homes, commercial): from 600 px an even two-column set of equal chips, so none sits alone. */
@media(min-width:600px){
  .homes-r2 .close .hr2-chips{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .homes-r2 .close .hr2-chips a{justify-content:center;text-align:center}
}

/* 10. Close back links (commercial, homes): from 600 px the back links sit as an even two-up set (question beside its link).
   On phones they stay full-width cards, one under the other. */
@media(min-width:600px){
  .homes-r2 .close .fit>div:has(>a.hr2-back+a.hr2-back){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:calc(12px * var(--scale));align-content:start}
  .homes-r2 .close .fit>div:has(>a.hr2-back+a.hr2-back)>*{grid-column:1/-1}
  .homes-r2 .close .fit>div:has(>a.hr2-back+a.hr2-back)>a.hr2-back{grid-column:auto;max-width:none;align-content:center}
}

/* 11. Commercial questions: the same lined list as every other page's questions. */
.faqs{display:grid;margin-top:calc(20px * var(--scale));border-top:calc(1px * var(--scale)) solid var(--line)}
.faqs details{border-bottom:calc(1px * var(--scale)) solid var(--line)}
.faqs summary{cursor:pointer;padding:calc(20px * var(--scale)) calc(2px * var(--scale));font-weight:700;line-height:1.35}
.faqs details p{padding:0 calc(2px * var(--scale)) calc(20px * var(--scale));max-width:68ch}

/* 12. A button inside a wide panel keeps its natural width instead of stretching across the panel. */
@media(min-width:601px){.nb-panel>a.pill{width:fit-content;max-width:100%;justify-self:start;align-self:flex-start}}
