/* V17 — one exact desktop pin/motion system copied across every card section. */
@media (min-width: 992px){
  body:not(.v4-home) main{overflow:visible!important}

  .site-pin-runway{
    position:relative!important;
    width:100%!important;
    overflow:visible!important;
    margin:0!important;
    padding:0!important;
  }

  .site-pin-panel{
    position:-webkit-sticky!important;
    position:sticky!important;
    top:78px!important;
    z-index:2!important;
    margin-top:0!important;
    margin-bottom:0!important;
    box-sizing:border-box!important;
  }

  /* Exact same visible footprint used by the approved homepage scene. */
  .site-pin-panel-approved,
  .site-pin-panel-generic{
    height:calc(100dvh - 78px)!important;
    min-height:560px!important;
    display:flex!important;
    align-items:center!important;
    overflow:hidden!important;
  }

  .site-pin-panel-approved > .wrap,
  .site-pin-panel-generic > .wrap{
    width:min(1280px,90vw)!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }

  /* Preserve the two approved Thrive scene placements. */
  body.v4-home .site-thrive-parent-v14{
    padding:0!important;
    overflow:visible!important;
    background:#fff8f2!important;
  }
  body.v4-home .site-home-match-panel{
    height:calc(100dvh - 78px)!important;
    min-height:560px!important;
    box-sizing:border-box!important;
    background:#fff8f2!important;
    overflow:hidden!important;
    padding:0!important;
    isolation:isolate;
  }
  body.v4-home .site-home-match-inner{
    position:relative!important;
    z-index:2!important;
    width:min(1280px,90vw)!important;
    height:100%!important;
    margin:0 auto!important;
    padding:0!important;
    box-sizing:border-box!important;
  }
  body.v4-home .site-home-match-primary .ref-eyebrow{
    position:absolute!important;left:0!important;top:var(--approved-eyebrow-top,17%)!important;margin:0!important
  }
  body.v4-home .site-home-match-primary h2{
    position:absolute!important;left:0!important;top:var(--approved-heading-top,29%)!important;width:min(100%,1100px)!important;max-width:1100px!important;margin:0!important;text-align:left!important
  }
  body.v4-home .site-home-match-primary .thrive-primary-grid,
  body.v4-home .site-home-match-support .thrive-support-grid{
    position:absolute!important;left:0!important;right:0!important;top:var(--approved-grid-top,52%)!important;width:100%!important;max-width:1280px!important;margin:0 auto!important
  }
  body.v4-home .site-home-match-support .thrive-support-title{
    position:absolute!important;left:0!important;top:var(--approved-heading-top,29%)!important;width:100%!important;max-width:1280px!important;margin:0!important;text-align:left!important
  }

  body.v4-home .site-section-flower{
    position:absolute;z-index:1;color:#f4a7bd;opacity:.32;font-family:Georgia,serif;line-height:1;pointer-events:none;
    animation:siteSectionFlowerFloat 5.8s ease-in-out infinite alternate;animation-delay:var(--flower-delay,0s)
  }
  body.v4-home .site-section-flower-1{left:3.2%;top:17%;font-size:34px;transform:rotate(-11deg)}
  body.v4-home .site-section-flower-2{right:5%;top:24%;font-size:22px;transform:rotate(9deg)}
  body.v4-home .site-section-flower-3{left:7%;bottom:10%;font-size:24px;transform:rotate(7deg)}
  body.v4-home .site-section-flower-4{right:3.5%;bottom:8%;font-size:38px;transform:rotate(-8deg)}
  @keyframes siteSectionFlowerFloat{from{translate:0 0;rotate:-2deg}to{translate:0 -13px;rotate:7deg}}

  .site-desktop-pin-card{
    opacity:1!important;
    will-change:transform!important;
    backface-visibility:hidden!important;
    transform-origin:center center!important;
    transition:none!important;
  }
}

@media (prefers-reduced-motion: reduce){
  .site-desktop-pin-card{transform:none!important}
  .site-section-flower{animation:none!important}
}

/* V19: Restore actual sticky scrolling on the five affected desktop pages.
   Older site-wide overflow:hidden rules create a non-scrolling sticky ancestor.
   Scope this fix narrowly; homepage, About, Contact and mobile are unchanged. */
@media (min-width: 992px) {
  body:is(.programs-page,.enrollment-page,.transport-page,.meals-page,.parents-page) {
    overflow-x:clip!important;
    overflow-y:visible!important;
  }
  body:is(.programs-page,.enrollment-page,.transport-page,.meals-page,.parents-page) main {
    overflow:visible!important;
    overflow-x:visible!important;
    overflow-y:visible!important;
  }
  body:is(.programs-page,.enrollment-page,.transport-page,.meals-page,.parents-page) .site-pin-runway {
    overflow:visible!important;
    contain:none!important;
    isolation:auto!important;
  }
  body:is(.programs-page,.enrollment-page,.transport-page,.meals-page,.parents-page) .site-pin-panel-generic {
    position:-webkit-sticky!important;
    position:sticky!important;
    top:78px!important;
  }
}

/* V20: Contact desktop uses the identical sticky ancestor fix as V19 pages. */
@media (min-width: 992px) {
  body.contact-page { overflow-x:clip!important; overflow-y:visible!important; }
  body.contact-page main { overflow:visible!important; overflow-x:visible!important; overflow-y:visible!important; }
  body.contact-page .site-pin-runway { overflow:visible!important; contain:none!important; isolation:auto!important; }
  body.contact-page .site-pin-panel-generic { position:-webkit-sticky!important; position:sticky!important; top:78px!important; }

  /* About desktop: end the memorial immediately after its final chapter,
     rather than retaining the old 455vh empty runway. Mobile is untouched. */
  body.about-page .zemira-garden-story { height:320vh!important; min-height:320vh!important; margin-bottom:0!important; padding-bottom:0!important; }
  body.about-page .zemira-garden-story + .section { margin-top:0!important; }
  body.about-page { overflow-x:clip!important; overflow-y:visible!important; }
  body.about-page main { overflow:visible!important; overflow-x:visible!important; overflow-y:visible!important; }
  body.about-page .site-pin-runway { overflow:visible!important; contain:none!important; isolation:auto!important; }
}
