/* Stillwater V8 — content-first responsive layout repairs.
   Restores the intended invisible grid at the card-group level.
   Original V7 is SHA-256 checkpointed and unchanged.
   This file is additive; does not change any page text or links.
*/

/* CRITICAL: "projects" is both the SECTION name and a card-group namespace.
   V7 applied grid-template-columns to section.projects, compressing .wrap into
   a single 50-100px grid cell and producing 20,000px-tall narrow cards.
   Section is the canvas; .project-grid is the actual collection. */
body[data-v7-template="projects"] > main > section.section.projects{
  display:block!important;
  grid-template-columns:none!important;
  width:min(1450px,calc(100% - clamp(24px,3.5vw,72px)))!important;
  padding:clamp(38px,4.8vw,74px) 0!important;
  margin:20px auto 32px!important;
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
  overflow:visible!important;
}
body[data-v7-template="projects"] > main > section.section.projects::before,
body[data-v7-template="projects"] > main > section.section.projects::after{
  display:none!important;
}
body[data-v7-template="projects"] > main > section.section.projects > .wrap{
  display:block!important;
  position:relative;
  min-width:0!important;
  width:min(1325px,calc(100% - 55px))!important;
  max-width:1325px!important;
  margin:0 auto!important;
}
body[data-v7-template="projects"] .projects .section-head{
  width:100%;max-width:none!important;
  display:grid;
  grid-template-columns:minmax(0,1.45fr) minmax(235px,.7fr);
  align-items:end;
  gap:20px 34px;
  margin-bottom:28px;
}
body[data-v7-template="projects"] .projects .section-head h2{
  font-size:clamp(35px,3.6vw,54px)!important;
  width:auto!important;max-width:none!important;
  line-height:1.06!important;letter-spacing:-.045em;
  color:white!important;
}
body[data-v7-template="projects"] .projects .section-head p{
  width:auto!important;max-width:390px!important;
  justify-self:end;
  color:#e0f0fa!important;
  line-height:1.63;
  font-size:14px;
}
body[data-v7-template="projects"] .project-grid{
  display:grid!important;
  grid-template-columns:repeat(12,minmax(0,1fr))!important;
  align-items:stretch!important;
  grid-auto-flow:row!important;
  gap:18px!important;
  width:100%!important;
  max-width:100%!important;
  margin:0!important;
  min-width:0!important;
}
body[data-v7-template="projects"] .project-grid > .project{
  grid-column:span 4!important;
  width:auto!important;max-width:none!important;
  min-width:0!important;min-height:0!important;
  height:auto!important;
  align-self:stretch!important;justify-self:stretch!important;
  display:flex;flex-direction:column;
  position:relative;overflow:hidden;
  border-radius:24px!important;
}
body[data-v7-template="projects"] .project-grid > .project:nth-child(1){grid-column:span 7!important}
body[data-v7-template="projects"] .project-grid > .project:nth-child(2){grid-column:span 5!important}
body[data-v7-template="projects"] .project-grid > .project:nth-child(n+6){grid-column:span 3!important}
body[data-v7-template="projects"] .project-grid > .project .project-top{
  width:100%!important;height:clamp(175px,16vw,245px)!important;
  min-height:175px;
  flex:0 0 auto!important;
  background-size:cover!important;background-position:center!important;
}
body[data-v7-template="projects"] .project-grid > .project .project-body{
  width:100%!important;min-width:0;
  height:auto!important;
  flex:1 1 auto!important;
  padding:clamp(23px,2vw,29px)!important;
}
body[data-v7-template="projects"] .project-grid > .project h3{
  font-size:clamp(22px,1.9vw,29px)!important;
  overflow-wrap:break-word!important;
  word-break:normal!important;
  line-height:1.13!important;
  width:auto!important;
}
body[data-v7-template="projects"] .project-grid > .project p{
  font-size:13px!important;line-height:1.65!important;
  overflow-wrap:break-word;
  word-break:normal!important;
}
body[data-v7-template="projects"] .projects .filterbar{
  display:flex!important;flex-wrap:wrap!important;
  align-items:center!important;gap:8px!important;
  width:100%!important;max-width:100%!important;
  margin:0 0 23px!important;
}
body[data-v7-template="projects"] .projects .filterbar > *{
  min-width:0;flex:0 0 auto;
}
body[data-v7-template="projects"] .projects .no-results{
  width:100%;min-width:0;
}

/* Shared editorial headers: title and description have a normal reading measure.
   Prevent original split-column markup from making 12-word-tall narrow paragraphs. */
body:not([data-v7-template="home"]) .sub-hero > .wrap{
  display:block!important;min-width:0!important;
}
body:not([data-v7-template="home"]) .sub-hero .hero-copy,
body:not([data-v7-template="home"]) .sub-hero .intro,
body:not([data-v7-template="home"]) .sub-hero p{
  width:auto!important;min-width:0!important;
  max-width:min(760px,100%)!important;
  line-height:1.64!important;
  overflow-wrap:normal!important;
  word-break:normal!important;
}
body:not([data-v7-template="home"]) .sub-hero .breadcrumbs{margin-bottom:18px;}
body:not([data-v7-template="home"]) .sub-hero h1{
  display:block!important;
  max-width:min(980px,100%)!important;
  min-width:0!important;
  margin-top:0!important;
  margin-bottom:18px!important;
}

/* Site-wide common safeguards: prevent flex/grid descendants from shrinking to
   unreadable widths; keep whitespace purposeful rather than forced. */
body:not([data-v7-template="home"]) .section > .wrap,
body:not([data-v7-template="home"]) .hub-shortcuts > .wrap,
body:not([data-v7-template="home"]) .library > .wrap{
  min-width:0!important;
}
body[data-v7-template="programs"] .programs,
body[data-v7-template="hub"] .hub-link-grid,
body[data-v7-template="resources"] .hub-link-grid{
  min-width:0;max-width:100%;
}
body[data-v7-template="programs"] .program,
body[data-v7-template="hub"] .hub-link,
body[data-v7-template="resources"] .hub-link{
  word-break:normal!important;overflow-wrap:break-word!important;
}
/* The original source note remains low prominence and never fills the whole width
   in an opaque bar. */
body:not([data-v7-template="home"]) .source-origin{
  max-width:1250px!important;
  border-radius:15px!important;
}

@media(max-width:1100px){
  body[data-v7-template="projects"] .project-grid > .project,
  body[data-v7-template="projects"] .project-grid > .project:nth-child(n){
    grid-column:span 6!important;
  }
  body[data-v7-template="projects"] .project-grid > .project h3{
    font-size:clamp(22px,2.7vw,29px)!important;
  }
}
@media(max-width:760px){
  body[data-v7-template="projects"] .projects .section-head{
    display:block!important;
  }
  body[data-v7-template="projects"] .projects .section-head p{
    max-width:100%!important;justify-self:start;
    margin-top:15px!important;
  }
}
@media(max-width:650px){
  body[data-v7-template="projects"] > main > section.section.projects{
    width:calc(100% - 24px)!important;
    padding:32px 0!important;
    margin:12px auto 25px!important;
  }
  body[data-v7-template="projects"] > main > section.section.projects > .wrap{
    width:calc(100% - 25px)!important;
  }
  body[data-v7-template="projects"] .project-grid{
    grid-template-columns:minmax(0,1fr)!important;
    gap:14px!important;
  }
  body[data-v7-template="projects"] .project-grid > .project,
  body[data-v7-template="projects"] .project-grid > .project:nth-child(n){
    grid-column:1/-1!important;
  }
  body[data-v7-template="projects"] .project-grid > .project .project-top{height:205px!important;}
  body[data-v7-template="projects"] .project-grid > .project .project-body{padding:24px!important;}
}
@media(prefers-reduced-motion:reduce){
  body[data-v7-template="projects"] .project-grid > .project{transition:none!important;}
}
