/* fix-b.css: layout fixes for about, cases, whitepapers, locations */

/* SHARED */
/* (none: every rule below is scoped to its page) */

/* Section header: stack heading and intro so the paragraph no longer floats
   bottom right with a void between them (it already stacked below ~1240px). */
body:is([data-page="about"],[data-page="cases"],[data-page="whitepapers"],[data-page="locations"]) section:not(#facts) .sh{flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:14px}
body:is([data-page="about"],[data-page="cases"],[data-page="whitepapers"],[data-page="locations"]) section:not(#facts) .sh .h2{max-width:24ch}
body:is([data-page="about"],[data-page="cases"],[data-page="whitepapers"],[data-page="locations"]) section:not(#facts) .sh p{max-width:44em}

/* Tighter stacking gap for two column sections once they go single column */
@media(max-width:860px){
  body:is([data-page="about"],[data-page="cases"],[data-page="locations"]) .grid-2{gap:28px}
}

/* ABOUT */
/* Q&A cards: the long clients answer goes full width, the short ones pair up,
   so no card carries a tall empty bottom. */
@media(min-width:901px){
  body[data-page="about"] .aqas{grid-auto-flow:row dense}
  body[data-page="about"] .aqa:nth-child(5),
  body[data-page="about"] .aqa:nth-child(7){grid-column:1/-1}
}
/* Founders: centre the text block against the portrait instead of hanging it at the bottom */
body[data-page="about"] .founder{align-items:center}
/* Founders on phones: small portrait beside the name instead of a full width square */
@media(max-width:520px){
  body[data-page="about"] .founder{grid-template-columns:88px minmax(0,1fr);gap:16px;padding:20px;align-items:start}
  body[data-page="about"] .founder h3{font-size:24px}
}
/* Clients and offices: the photo fills the right column at full height and the
   office paragraph and buttons sit under the client list, so neither side is half empty. */
@media(min-width:861px){
  body[data-page="about"] section[aria-labelledby="cH"] .grid-2{grid-template-rows:auto auto 1fr;align-items:start!important;row-gap:0}
  body[data-page="about"] section[aria-labelledby="cH"] .grid-2>div:last-child{display:contents}
  body[data-page="about"] section[aria-labelledby="cH"] .grid-2>div:first-child{grid-column:1;grid-row:1}
  body[data-page="about"] section[aria-labelledby="cH"] .photo{grid-column:2;grid-row:1/span 3;align-self:stretch;aspect-ratio:auto!important;min-height:340px;margin:0!important}
  body[data-page="about"] section[aria-labelledby="cH"] .grid-2>div:last-child>.lede{grid-column:1;grid-row:2;margin-top:18px}
  body[data-page="about"] section[aria-labelledby="cH"] .grid-2>div:last-child>.btn-row{grid-column:1;grid-row:3;margin-top:24px!important}
}

/* CASES */
/* Featured case figures: a tidy 2 x 2 of boxes instead of the hero stat strip,
   whose borders and indents broke on the second row. */
body[data-page="cases"] section[aria-labelledby="featH"] .hero-stats{margin-top:0;border-top:0;gap:12px}
body[data-page="cases"] section[aria-labelledby="featH"] .hero-stats div{padding:20px 22px;border-left:0;border-radius:18px;background:#fff;box-shadow:inset 0 0 0 1px var(--line-l)}
body[data-page="cases"] section[aria-labelledby="featH"] .hero-stats div:nth-child(3){padding-left:22px}
body[data-page="cases"] section[aria-labelledby="featH"] .hero-stats b{font-size:clamp(26px,2.6vw,40px)}
@media(max-width:420px){
  body[data-page="cases"] section[aria-labelledby="featH"] .hero-stats div{padding:16px}
  body[data-page="cases"] section[aria-labelledby="featH"] .hero-stats div:nth-child(3){padding-left:16px}
}

/* WHITEPAPERS */
/* Covers were 16:10 with a large empty yellow area under the title. */
body[data-page="whitepapers"] .wp-cover{aspect-ratio:auto;min-height:168px;padding:20px 22px}
/* "Get the paper" button had default button padding, so it sat indented from the text */
body[data-page="whitepapers"] .wp-body button.link{padding:0;background:none;border:0}

/* LOCATIONS */
/* Globe was much taller than the copy beside it, leaving voids above and below the text. */
@media(min-width:861px){
  body[data-page="locations"] section[aria-labelledby="gH"] .grid-2{grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr)}
  body[data-page="locations"] .globe{max-width:440px}
}
@media(max-width:860px){
  body[data-page="locations"] .globe{max-width:340px}
}
/* Office cards: share rows so clocks, notes and links line up even though
   Fort Lauderdale has an extra phone line. */
@supports(grid-template-rows:subgrid){
  @media(min-width:981px){
    body[data-page="locations"] .loc{display:grid;grid-row:span 6;grid-template-rows:subgrid;row-gap:10px;align-content:start}
    body[data-page="locations"] .loc .link{align-self:end;justify-self:start}
  }
}
body:is([data-page="about"],[data-page="cases"],[data-page="whitepapers"],[data-page="locations"]) section:not(#facts) .sh p{text-wrap:pretty}
/* Whitepapers: cover and body rows line up across each row of cards */
@supports(grid-template-rows:subgrid){
  @media(min-width:600px){
    body[data-page="whitepapers"] .wp{display:grid;grid-row:span 2;grid-template-rows:subgrid;row-gap:0}
  }
}
