/* Phone stories: discreet edge controls and a genuinely one-screen cover. */
@media(max-width:700px),(max-width:950px) and (max-height:550px){
 body.page-project-detail{--project-phone-top:calc(72px + env(safe-area-inset-top,0px));--project-phone-bottom:calc(48px + env(safe-area-inset-bottom,0px))}
 body.page-project-detail :is(.story-project-nav a,.story-next-slide,.story-previous-slide){
  position:fixed;box-sizing:border-box;display:grid;place-items:center;
  width:44px;height:44px;min-width:44px;min-height:44px;padding:0;
  border:0;border-radius:0;background:transparent;touch-action:manipulation;
 }
 body.page-project-detail .story-project-nav a.story-project-nav__previous{left:env(safe-area-inset-left,0px);right:auto;justify-items:start;padding-left:6px}
 body.page-project-detail .story-project-nav a.story-project-nav__next{right:env(safe-area-inset-right,0px);left:auto;justify-items:end;padding-right:6px}
 body.page-project-detail .story-project-nav svg{width:5.25px;height:10.85px}
 body.page-project-detail :is(.story-next-slide,.story-previous-slide){left:50%;right:auto;transform:translateX(-50%)}
 body.page-project-detail .story-next-slide{top:auto;bottom:env(safe-area-inset-bottom,0px)}
 body.page-project-detail .story-previous-slide{top:calc(var(--project-phone-top) - 8px);bottom:auto}
 body.page-project-detail :is(.story-next-slide,.story-previous-slide) svg{width:11.2px;height:7.7px}
 body.page-project-detail :is(.story-project-nav a,.story-next-slide,.story-previous-slide) svg,
 body.page-project-detail :is(.story-project-nav a,.story-next-slide,.story-previous-slide):is(:hover,:focus-visible) svg{
  fill:currentColor;stroke:none;stroke-width:0!important;filter:none!important;transform:none!important;
  opacity:.8;transition:opacity .2s ease!important;
 }
 body.page-project-detail :is(.story-project-nav a,.story-next-slide,.story-previous-slide):is(:active,:focus-visible) svg{opacity:1}
 body.page-project-detail :is(.story-project-nav a,.story-next-slide,.story-previous-slide)::after{display:none}
 body.page-project-detail :is(.story-next-slide,.story-previous-slide)[hidden]{display:none!important}

 /* The photograph uses the space left by the compact text, not a fixed square
    added to the text height. Only an explicit expansion makes this scroll. */
 html.project-deck body.page-project-detail .project-story>.project-cover.is-active,
 html.project-deck body.page-project-detail .project-story>.project-cover.is-exiting{
  display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;
  align-content:stretch;align-items:stretch;justify-content:normal;
  padding:var(--project-phone-top) 0 var(--project-phone-bottom)!important;
  overflow:hidden!important;scrollbar-width:thin;
 }
 body.page-project-detail .project-cover .project-cover__media{
  position:relative!important;inset:auto!important;width:100%;height:100%!important;
  min-height:0;aspect-ratio:auto;z-index:0;
 }
 body.page-project-detail .project-cover .project-cover__content{
  position:relative!important;display:flex!important;flex-direction:column;align-items:stretch;
  margin:0;gap:14px;width:100%;min-height:0;max-height:calc(100dvh - var(--project-phone-top) - var(--project-phone-bottom) - 140px);
  padding:20px 28px 0!important;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;
  align-self:stretch;color:#f4f4f1!important;
 }
 body.page-project-detail .project-cover .project-cover__identity{max-width:100%;min-width:0}
 body.page-project-detail .project-cover :is(.project-cover__identity,.project-facts){opacity:1!important;visibility:visible!important;pointer-events:auto;transform:none!important}
 body.page-project-detail .project-cover .project-cover__identity h1{font-size:clamp(28px,8vw,40px)!important;line-height:1.06;max-width:none}
 body.page-project-detail .project-cover .project-cover__identity .story-eyebrow{font-size:9px;line-height:1.5;letter-spacing:.12em;margin-bottom:10px;overflow-wrap:anywhere}
 body.page-project-detail .project-cover .project-cover__intro{font-size:14px;line-height:1.45;max-width:none;max-height:none;margin:10px 0 0;opacity:1;overflow:visible}
 body.page-project-detail .project-cover .project-cover__data{grid-template-rows:1fr;opacity:1}
 body.page-project-detail .project-cover .project-cover__data-inner{visibility:visible}
 body.page-project-detail .project-cover .project-cover__content::before{display:none}
 body.page-project-detail .project-cover .project-facts-more,
 body.page-project-detail .project-cover .project-facts-more__inner{position:relative;overflow:hidden}
 body.page-project-detail .project-cover .project-facts.has-mobile-summary>div:not(.project-facts-more){padding-bottom:0}
 body.page-project-detail .project-cover .project-facts.has-mobile-summary{padding-top:4px;grid-template-columns:repeat(2,minmax(0,1fr))}
 body.page-project-detail .project-cover .project-facts-more__inner{column-gap:16px}
 body.page-project-detail .project-cover .project-facts-more__inner>div{padding-block:12px;min-width:0}
 body.page-project-detail .project-cover .project-facts-more__inner>.project-fact--wide{grid-column:1/-1}
 body.page-project-detail .project-cover .project-facts-more__inner>div:has(.credit-portrait),
 body.page-project-detail .project-cover .project-facts-more__inner>div:has(dd .project-credit-link[target]){grid-column:1/-1}
 html.project-deck body.page-project-detail .project-story>.project-cover.has-expanded-details{
  grid-template-rows:min(var(--cover-summary-media-height,38dvh),70dvh) max-content;
  align-content:start;overflow-y:auto!important;
 }
 body.page-project-detail .project-cover.has-expanded-details .project-cover__content{max-height:none;overflow:visible}
 body.page-project-detail .story-progress{right:3px;width:1px}
 /* Give the small arrows their own edge gutters. Keep long slides readable. */
 body.page-project-detail .project-story>.story-panel.story-slide{
  padding-top:calc(var(--project-phone-top) + 44px)!important;
  padding-bottom:var(--project-phone-bottom)!important;
  overflow-y:auto!important;scroll-padding-bottom:var(--project-phone-bottom);
 }
 body.page-project-detail .project-story .story-copy__body{overflow-y:auto!important;scrollbar-width:thin}
}
@media(max-width:950px) and (max-height:550px) and (orientation:landscape){
 body.page-project-detail{--project-phone-top:64px;--project-phone-bottom:36px}
 html.project-deck body.page-project-detail .project-story>.project-cover.is-active,
 html.project-deck body.page-project-detail .project-story>.project-cover.is-exiting{
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:minmax(0,1fr);
  gap:0;padding-inline:28px!important;
 }
 body.page-project-detail .project-cover .project-cover__content{max-height:100%;padding:8px 20px!important;align-self:center}
 body.page-project-detail .project-cover .project-cover__identity h1{font-size:28px!important}
 html.project-deck body.page-project-detail .project-story>.project-cover.has-expanded-details{grid-template-rows:max-content;align-items:start}
 body.page-project-detail .project-cover.has-expanded-details .project-cover__media{height:calc(100dvh - var(--project-phone-top) - var(--project-phone-bottom))!important}
 body.page-project-detail .project-cover.has-expanded-details .project-cover__content{align-self:start;max-height:none}
}
@media(prefers-reduced-motion:reduce){body.page-project-detail :is(.story-project-nav a,.story-next-slide,.story-previous-slide) svg{transition:none!important}}
/* Portrait cover runs behind the wordmark, with more room for the photograph.
   Keep facts in normal flow and preserve independent editor framing choices. */
@media(max-width:700px) and (orientation:portrait){
 body.page-project-detail{--project-phone-bottom:calc(32px + env(safe-area-inset-bottom,0px))}
 html.project-deck body.page-project-detail .project-story>.project-cover.is-active,
 html.project-deck body.page-project-detail .project-story>.project-cover.is-exiting{padding-top:0!important}
 body.page-project-detail .project-cover .project-cover__content{gap:10px;padding:16px 28px 0!important;max-height:calc(100dvh - var(--project-phone-bottom) - 200px)}
 body.page-project-detail .project-cover.has-expanded-details .project-cover__content{max-height:none}
}
