/* Shared screen grid for website and project pages. */
@media screen {
  :root {
    --section-space: clamp(36px, 5vw, 88px);
    /* Tighten the wide-screen grid without using up space on phones. */
    --hdw-content-inset: calc(max(16px, min(6.8%, calc(10% - 46px))) + clamp(0px, calc(5vw - 38px), 0.5cm));
    --hdw-content-width: calc(100% - 2 * var(--hdw-content-inset));
  }

  .container,
  .wrap,
  body[data-page="our-work"] main > .section > .container,
  body[data-page="our-work"] .editorial-hero > .container,
  #education-projects > .container,
  #healthcare-projects > .container,
  main#home > section > .wrap,
  body main .feature-project {
    width: var(--hdw-content-width) !important;
    max-width: none !important;
    margin-inline: auto !important;
    box-sizing: border-box;
  }

  .site-header,
  body > header:has(> a.brand) {
    padding-inline: var(--hdw-content-inset) !important;
  }

  body:is([data-page="education"], [data-page="healthcare"], [data-page="hunger-relief"], [data-page="social-welfare"]) .chapter-hero {
    --hero-gutter: var(--hdw-content-inset);
  }

  .donor-faq > .container {
    max-width: none !important;
  }

  .donor-faq > .container > details {
    max-width: 850px;
  }

  html:has(link[href="/admin/admin.css"]) body > main {
    width: var(--hdw-content-width);
    max-width: none;
    margin-inline: auto;
    padding-inline: 0;
    box-sizing: border-box;
  }

  /* Keep the headline and controls in flow when text wraps or the screen is short. */
  .cinema {
    display:grid;
    grid-template-rows:auto 1fr auto;
    gap:clamp(20px,4svh,42px);
    height:auto;
    min-height:100svh;
    max-height:none;
    padding-block:clamp(116px,16svh,156px) clamp(22px,4svh,44px);
    padding-inline:var(--hdw-content-inset);
  }

  .cinema > :is(.cinema-top, .cinema-copy, .cinema-bottom) {
    position:relative;
    inset:auto;
    min-width:0;
    width:auto;
  }

  .cinema > .cinema-copy {
    align-self:center;
    max-width:min(100%,clamp(720px,52vw,960px));
  }

  .cinema h1 {
    min-height:0;
    max-width:none;
    font-size:clamp(36px,6vw,108px);
    overflow-wrap:anywhere;
  }

  .cinema .actions {flex-wrap:wrap}
  .cinema .scene-tabs {grid-template-columns:repeat(4,minmax(0,1fr))}
  .cinema .scene-tab {min-width:0}

  .purpose-grid > .purpose-card { min-width: 0; }

  .budget-scroll, .sp-budget-scroll {
    min-width:0;
    max-width:100%;
    overflow-x:auto;
  }

  @media (max-width: 760px) {
    .purpose-grid {
      grid-template-columns: minmax(0, 1fr);
    }

    .hero .grid {
      grid-template-columns: minmax(0, 1fr);
    }

    .hero .grid > * {
      min-width: 0;
    }

    .cinema h1 {font-size:clamp(36px,9.5vw,64px)}
    .cinema .scene-tabs {grid-template-columns:repeat(2,minmax(0,1fr))}
    .cinema > .cinema-bottom {display:grid;gap:12px}
    .cinema .motion-toggle {margin-block:0}
    body main .feature-visual {min-height:clamp(230px,60vw,450px)}
  }
}

/* Mobile hero: one clear action, a quieter introduction and controls in normal flow. */
@media screen and (max-width:760px){
 body[data-page="home"] .cinema{display:flex;flex-direction:column;gap:28px;min-height:calc(100svh - var(--hdw-staging-offset,0px));padding-top:118px;padding-bottom:22px;height:auto;max-height:none;overflow:clip}
 body[data-page="home"] .cinema-top{font-size:9px;line-height:1.5;letter-spacing:.09em;flex:none}
 body[data-page="home"] .cinema-copy{align-self:stretch;flex:none;width:100%;max-width:100%;margin:0}
 body[data-page="home"] .cinema-copy .overline{display:none}
 body[data-page="home"] .cinema h1{font-size:clamp(34px,9.8vw,46px);line-height:1.12;letter-spacing:-.045em;min-height:3.36em;margin:0 0 22px;overflow-wrap:normal}
 body[data-page="home"] .cinema-description{font-size:15px;line-height:1.65;max-width:34ch;margin:0}
 body[data-page="home"] .cinema .actions{display:flex;flex-direction:column;align-items:flex-start;gap:8px;margin:24px 0 0;max-width:100%}
 body[data-page="home"] .cinema .actions>.btn:first-child{min-height:50px;padding:13px 23px;font-size:14px}
 body[data-page="home"] .cinema .actions .verify-button{display:none}
 body[data-page="home"] .cinema .actions .text-light{order:2;justify-content:flex-start;width:auto;min-height:44px;margin:0;padding:9px 0;font-size:13px}
 body[data-page="home"] .cinema-bottom{display:flex;flex-direction:column;align-items:stretch;gap:8px;margin-top:auto;flex:none}
 body[data-page="home"] .scene-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 20px;width:100%}
 body[data-page="home"] .scene-tab{min-height:46px;padding:12px 0 8px;font-size:12px;line-height:1.4;display:flex;align-items:center;gap:9px}
 body[data-page="home"] .motion-toggle{position:static;align-self:flex-end;margin:0;min-height:36px}
}
@media screen and (max-width:360px){body[data-page="home"] .cinema{gap:24px;padding-top:112px}body[data-page="home"] .cinema h1{font-size:34px}body[data-page="home"] .cinema-description{font-size:14px}}

@media screen and (max-width:850px) and (min-width:761px){.hero .grid{grid-template-columns:minmax(0,1fr)}}
@media screen and (max-width:370px){body[data-page="home"] .site-header .header-give{display:inline-flex;padding:8px 10px;min-height:38px;font-size:11px}body[data-page="home"] .site-header{gap:8px}body[data-page="home"] .site-header .give-mobile{font-size:11px}}
