/* =========================================================
   V9 — hero alignment, consistent page rhythm, new territory
   story block and updated office details.
   ========================================================= */
:root{--v9-blue:#4d5dfa;--v9-green:#29a71a;--v9-ink:#111318;--v9-soft:#f6f7fb}

/* Hero heading and CTA return to the original left alignment. */
.ref-hero__copy h1 span{display:block;white-space:nowrap}
.ref-actions{justify-content:flex-start!important;max-width:none!important;margin-left:0!important}
.ref-actions .ref-button{margin-left:0!important;margin-right:0!important}

/* Keep the halo centred behind every cutout instead of following one photo's offset. */
.hero-people__halo{
  left:52%!important;
  right:auto!important;
  bottom:-96px!important;
  width:min(650px,112%)!important;
  transform:translateX(-50%)!important;
  transform-origin:center bottom!important;
}
.hero-people[data-active="3"] .hero-people__halo{left:53%!important;width:min(570px,100%)!important}
.hero-people[data-active="4"] .hero-people__halo{left:51%!important;width:min(620px,108%)!important}

/* Carousel markers follow the white curve. The active marker remains a compact bar. */
.hero-people__dots--edge{
  left:75%!important;
  right:auto!important;
  bottom:17px!important;
  width:172px!important;
  height:36px!important;
  display:block!important;
  transform:translateX(-50%) rotate(-2.5deg)!important;
  pointer-events:auto!important;
}
.hero-people__dots--edge button{
  top:auto!important;
  bottom:auto!important;
  width:10px!important;
  height:10px!important;
  border-radius:50%!important;
  background:#8c93a5!important;
  transform:none!important;
}
.hero-people__dots--edge button:nth-child(1){left:4px!important;top:2px!important;transform:rotate(-8deg)!important}
.hero-people__dots--edge button:nth-child(2){left:46px!important;top:8px!important;transform:rotate(-4deg)!important}
.hero-people__dots--edge button:nth-child(3){left:89px!important;top:12px!important;transform:rotate(1deg)!important}
.hero-people__dots--edge button:nth-child(4){left:132px!important;top:10px!important;transform:rotate(5deg)!important}
.hero-people__dots--edge button.is-active{
  width:31px!important;
  height:9px!important;
  border-radius:4px!important;
  background:#262b3a!important;
}

/* The middle wheel card always starts and ends in its true centred position. */
.ref-mini-card--three,
.ref-mini-card--three.wow,
.ref-mini-card--three.animated{transform:translateX(-50%)!important}
.ref-mini-card:not(.ref-mini-card--three).wow,
.ref-mini-card:not(.ref-mini-card--three).animated{transform:none!important}

/* Shared shifts CTA is central, large and visually primary. */
.shared-shifts .trip-primary-cta,
.shared-shifts .home-shifts-cta{
  display:flex!important;
  width:max-content!important;
  min-width:270px!important;
  justify-content:center!important;
  margin:32px auto 0!important;
  padding:17px 34px!important;
  font-size:17px!important;
  box-shadow:0 0 0 7px rgba(77,93,250,.11),0 17px 38px rgba(77,93,250,.40)!important;
}
.shared-shifts .trip-primary-cta:hover,
.shared-shifts .home-shifts-cta:hover{transform:translateY(-3px) scale(1.025)!important}

/* One identical gap from the header to the display title on every internal page. */
body:not(:has(.reference-home)) .page-hero,
.trip-body .page-hero,
.parents-body .page-hero,
.archive-body .page-hero,
.contacts-page .page-hero{
  padding:86px 0 18px!important;
  margin:0!important;
}
.page-hero .page-heading{margin-top:0!important;margin-bottom:0!important}

/* Stronger download glyph. */
.documents-download-panel__icon{width:68px!important;height:68px!important;padding:12px!important}
.documents-download-panel__icon svg{display:block;width:100%;height:100%;fill:none;stroke:#fff;stroke-width:4.5;stroke-linecap:round;stroke-linejoin:round}

/* Service grid gets enough breathing room before the next story. */
.ref-territory-desktop{padding-bottom:48px!important}
.ref-territory-grid{margin-bottom:0!important}

/* Completely rebuilt lower territory block. */
.territory-community-v9{
  position:relative;
  display:grid;
  gap:22px;
  margin-top:54px;
  padding:18px;
  overflow:hidden;
  border:1px solid rgba(77,93,250,.14);
  border-radius:34px;
  background:linear-gradient(135deg,#f8f9ff 0%,#f7fcf5 100%);
  box-shadow:0 20px 48px rgba(21,31,75,.14);
}
.territory-community-v9::before{
  content:"";
  position:absolute;
  width:250px;height:250px;
  right:-90px;top:-100px;
  border-radius:50%;
  background:rgba(41,167,26,.08);
  pointer-events:none;
}
.territory-community-v9__head{
  position:relative;
  z-index:1;
  max-width:820px;
  padding:28px 30px 4px;
}
.territory-community-v9__head>span{
  display:inline-flex;
  padding:8px 15px;
  border-radius:999px;
  color:#fff;
  background:var(--v9-green);
  font-size:12px;
  font-weight:900;
}
.territory-community-v9__head h3{
  max-width:760px;
  margin:17px 0 0;
  color:var(--v9-ink);
  font-size:clamp(29px,3.6vw,46px);
  font-weight:900;
  line-height:1.04;
  letter-spacing:-.025em;
}
.territory-community-v9__head p{max-width:760px;margin:15px 0 0;font-size:15px;font-weight:650;line-height:1.55}
.territory-community-v9__gallery{
  position:relative;
  z-index:1;
  display:grid;
  grid-template-columns:minmax(0,1.45fr) minmax(230px,.55fr);
  grid-template-rows:225px 225px;
  gap:14px;
}
.territory-community-v9__gallery figure{
  position:relative;
  min-width:0;
  margin:0;
  overflow:hidden;
  border-radius:25px;
  background:#dfe4f2;
  box-shadow:0 12px 28px rgba(19,30,73,.14);
}
.territory-community-v9__gallery figure::after{content:"";position:absolute;inset:42% 0 0;background:linear-gradient(to top,rgba(8,13,35,.82),transparent)}
.territory-community-v9__gallery img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .7s cubic-bezier(.2,.75,.2,1)}
.territory-community-v9__gallery figure:hover img{transform:scale(1.045)}
.territory-community-v9__main{grid-row:1/-1}
.territory-community-v9__main img{object-position:center 48%}
.territory-community-v9__gallery figure:nth-child(2) img{object-position:center 42%}
.territory-community-v9__gallery figure:nth-child(3) img{object-position:center 52%}
.territory-community-v9__gallery figcaption{position:absolute;right:20px;bottom:18px;left:20px;z-index:2;display:flex;flex-direction:column;gap:4px;color:#fff}
.territory-community-v9__gallery figcaption strong{font-size:19px;font-weight:900;line-height:1.1}
.territory-community-v9__gallery figcaption span{font-size:12px;font-weight:700;line-height:1.35}
.territory-community-v9__amenities{position:relative;z-index:1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.territory-community-v9__amenities span{display:flex;min-height:62px;align-items:center;gap:11px;padding:12px 15px;border-radius:18px;background:#fff;box-shadow:0 8px 21px rgba(22,32,75,.09);font-size:13px;font-weight:900}
.territory-community-v9__amenities b{display:grid;width:34px;height:34px;flex:0 0 34px;place-items:center;border-radius:11px;background:var(--v9-blue);color:#fff;font-size:10px}
.territory-community-v9__amenities span:nth-child(even) b{background:var(--v9-green)}
.territory-community-v9__cta{position:relative;z-index:1;justify-self:center;min-width:230px;margin:4px 0 12px!important;box-shadow:0 12px 28px rgba(77,93,250,.28)}

/* New address can be longer without distorting footer columns. */
.footer-contact-link{align-items:flex-start!important;line-height:1.35!important}
.footer-contact-icon{margin-top:1px}

@media(max-width:1050px){
  .ref-hero__copy h1 span{white-space:normal}
  .hero-people__dots--edge{left:76%!important}
  .territory-community-v9__gallery{grid-template-columns:1.25fr .75fr}
}

@media(max-width:780px){
  .ref-hero__copy h1 span{white-space:nowrap}
  .ref-actions{justify-content:center!important}
  .hero-people__halo{left:50%!important;bottom:-45px!important;width:470px!important}
  .hero-people[data-active="3"] .hero-people__halo{left:50%!important;width:410px!important}
  .hero-people[data-active="4"] .hero-people__halo{left:50%!important;width:450px!important}
  .hero-people__dots--edge{left:50%!important;bottom:12px!important;width:158px!important;transform:translateX(-50%) rotate(-2.8deg)!important}
  .hero-people__dots--edge button:nth-child(1){left:0!important;top:0!important}
  .hero-people__dots--edge button:nth-child(2){left:38px!important;top:6px!important}
  .hero-people__dots--edge button:nth-child(3){left:77px!important;top:10px!important}
  .hero-people__dots--edge button:nth-child(4){left:118px!important;top:8px!important}
  .ref-feature-wheel{overflow:visible}
  .ref-mini-card--three,.ref-mini-card--three.wow,.ref-mini-card--three.animated{transform:none!important}
  body:not(:has(.reference-home)) .page-hero,.trip-body .page-hero,.parents-body .page-hero,.archive-body .page-hero,.contacts-page .page-hero{padding:72px 0 14px!important}
  .territory-community-v9{margin-top:28px;padding:11px;border-radius:27px}
  .territory-community-v9__head{padding:23px 19px 2px}
  .territory-community-v9__head h3{font-size:30px}
  .territory-community-v9__gallery{grid-template-columns:1fr 1fr;grid-template-rows:310px 180px}
  .territory-community-v9__main{grid-column:1/-1;grid-row:auto}
  .territory-community-v9__amenities{grid-template-columns:1fr 1fr}
}

@media(max-width:520px){
  .ref-hero__copy h1 span{white-space:normal}
  .ref-actions{display:grid!important;grid-template-columns:1fr 1fr!important;width:100%!important;gap:10px!important}
  .ref-actions .ref-button{min-width:0!important;width:100%!important;padding-inline:12px!important}
  .hero-people__halo{bottom:-34px!important;width:420px!important}
  .hero-people[data-active="3"] .hero-people__halo{width:360px!important}
  .hero-people[data-active="4"] .hero-people__halo{width:395px!important}
  .hero-people__dots--edge{bottom:8px!important}
  .territory-community-v9__gallery{grid-template-columns:1fr;grid-template-rows:260px 175px 175px}
  .territory-community-v9__main{grid-column:auto}
  .territory-community-v9__amenities{grid-template-columns:1fr}
  .territory-community-v9__amenities span{min-height:56px}
  .documents-download-panel__icon{width:72px!important;height:72px!important}
}

@media(max-width:780px){
  .floating-contact-shell{right:10px!important;bottom:10px!important}
  .floating-contact-shell .floating-contact{width:50px!important;height:50px!important}
  .floating-contact-shell .floating-contact img{width:33px!important;height:33px!important}
}

/* One stable vertical rhythm for every internal page hero. */
.page-hero,
.parents-hero{
  padding:120px 0 30px!important;
}

@media(max-width:780px){
  .page-hero,
  .parents-hero{
    padding:92px 0 24px!important;
  }
}

/* Final internal-page spacing override: same baseline as the Parents page. */
body:not(:has(.reference-home)) .page-hero,
.trip-body .page-hero,
.parents-body .page-hero,
.archive-body .page-hero,
.contacts-page .page-hero,
.parents-hero{
  padding:120px 0 30px!important;
}
@media(max-width:780px){
  body:not(:has(.reference-home)) .page-hero,
  .trip-body .page-hero,
  .parents-body .page-hero,
  .archive-body .page-hero,
  .contacts-page .page-hero,
  .parents-hero{
    padding:92px 0 24px!important;
  }
}

/* The taller girls' cutout needs a slightly more rightward halo center. */
@media(min-width:781px){
  .hero-people[data-active="3"] .hero-people__halo{left:56%!important}
}

/* Do not let the floating contact launcher cover the compact mobile footer. */
@media(max-width:780px){
  .floating-contact-shell.is-footer-near{opacity:0!important;pointer-events:none!important;transform:translateY(12px)!important}
}
