/* Full-width homepage hero: image fill and overlay are controlled from /admin. */
html body :is(#home-landing, .hero-preview){
  max-width:none;
  width:100%;
  padding:0 0 10px;
}
html body :is(#home-landing, .hero-preview) .home-hero{
  direction:ltr;
  display:block;
  position:relative;
  width:100%;
  max-width:var(--hero-max-width, none);
  margin:0 auto;
  aspect-ratio:auto;
  /* When --hero-height is set (editor /api/hero), use it exactly — do not cap with vw. */
  height:var(--hero-height, min(46vw, 520px));
  min-height:var(--hero-height, 380px);
  max-height:var(--hero-height, 520px);
  overflow:hidden;
  border:0;
  border-radius:0;
  background:#f4efe6;
  box-shadow:none;
  isolation:isolate;
}
html body :is(#home-landing, .hero-preview) .home-hero::before,
html body :is(#home-landing, .hero-preview) .home-hero::after{
  display:none;
  content:none;
}
html body :is(#home-landing, .hero-preview) .home-hero-media{
  direction:ltr;
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  min-height:0;
  overflow:hidden;
  background:#f4efe6;
  z-index:0;
}
/* Soft left scrim for text contrast — does NOT clip the photo; image stays full-bleed. */
html body :is(#home-landing, .hero-preview) .home-hero-media::after{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:var(--hero-overlay-width, 50%);
  opacity:var(--hero-overlay, .38);
  background:linear-gradient(90deg,rgba(247,243,234,.95) 0%,rgba(247,243,234,.55) 48%,rgba(247,243,234,0) 100%);
  pointer-events:none;
  z-index:1;
}
html body :is(#home-landing, .hero-preview) .home-books-poster{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  overflow:hidden;
  transform:none;
  -webkit-mask-image:none;
  mask-image:none;
}
/* Beat theme !important width/max-width caps that leave cream gutters on wide screens.
   Cover fills edge-to-edge; --hero-pos-x still crops from the right (100%) or left (0%). */
html body :is(#home-landing, .hero-preview) .home-books-poster img,
html body :is(#home-landing, .hero-preview) .home-hero-media img,
html body :is(#home-landing, .hero-preview) img[data-edit="home-hero-image"]{
  display:block;
  position:absolute;
  inset:0 !important;
  left:0 !important;
  right:0 !important;
  top:0 !important;
  bottom:0 !important;
  width:100% !important;
  height:100% !important;
  max-width:none !important;
  min-width:0 !important;
  min-height:0 !important;
  margin:0 !important;
  object-fit:var(--hero-fit, cover);
  object-position:var(--hero-pos-x, 50%) var(--hero-pos-y, 45%);
  transform:scale(var(--hero-zoom, 1));
  transform-origin:var(--hero-pos-x, 50%) var(--hero-pos-y, 45%);
  opacity:var(--hero-opacity, 1);
  visibility:visible;
  filter:saturate(var(--hero-saturation, 1));
}
html body :is(#home-landing, .hero-preview) .home-hero-copy{
  direction:rtl;
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  z-index:2;
  width:min(var(--hero-copy-width, 36%), 560px);
  max-width:none;
  min-width:0;
  min-height:0;
  height:auto;
  margin:0;
  padding:28px clamp(22px,3.6vw,56px) 30px;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  text-align:right;
  /* Transparent so the photo reads across the full mother section width. */
  background:transparent;
}
html body :is(#home-landing, .hero-preview) .home-kicker{
  margin:0 0 10px;
  font-size:calc(12px * var(--hero-text-size, 1));
  letter-spacing:.04em;
  color:var(--hero-text-color, #52627e);
  text-shadow:0 1px 2px rgba(247,243,234,.95),0 0 20px rgba(247,243,234,.7);
}
html body :is(#home-landing, .hero-preview) .home-kicker::before{
  background:var(--hero-accent-color, #d72d36);
}
html body :is(#home-landing, .hero-preview) .home-hero h1{
  width:100%;
  max-width:620px;
  margin:0 0 14px;
  font-size:calc(clamp(30px,3vw,50px) * var(--hero-title-size, 1));
  line-height:1.18;
  color:var(--hero-title-color, #10244a);
  text-shadow:0 1px 2px rgba(247,243,234,.95),0 0 24px rgba(247,243,234,.75);
}
html body :is(#home-landing, .hero-preview) .home-hero h1 span,
html body :is(#home-landing, .hero-preview) .home-hero h1 strong{display:block}
/* A text identity remains readable beside the logo and survives studio copy updates. */
html body :is(#home-landing, .hero-preview) .home-hero h1 .home-brand-name{
  display:block;
  width:fit-content;
  max-width:100%;
  margin-block-end:.5rem;
  font-family:Arial,sans-serif;
  font-size:clamp(1.25rem,2vw,1.65rem);
  font-weight:700;
  line-height:1.2;
  letter-spacing:normal;
  overflow-wrap:anywhere;
  unicode-bidi:isolate;
}
html body :is(#home-landing, .hero-preview) .home-hero h1 strong{
  margin-top:4px;
  color:var(--hero-accent-color, #d72d36);
}
html body :is(#home-landing, .hero-preview) .home-hero-copy>p{
  max-width:540px;
  margin:0 0 18px;
  font-size:calc(15px * var(--hero-text-size, 1));
  line-height:1.85;
  color:var(--hero-text-color, #52627e);
  text-shadow:0 1px 2px rgba(247,243,234,.95),0 0 18px rgba(247,243,234,.7);
}
html body :is(#home-landing, .hero-preview) .home-hero-actions a{
  min-height:46px;
  padding:9px 20px;
}
html body :is(#home-landing, .hero-preview) .home-hero-note{
  margin-top:14px;
  text-shadow:0 1px 2px rgba(247,243,234,.9);
}
html body #home-landing .home-stats{
  max-width:1540px;
  margin:-28px auto 0;
  width:calc(100% - 56px);
}
html body #home-landing .home-section,
html body #home-landing .home-why{
  max-width:1540px;
  margin-inline:auto;
  padding-inline:28px;
}

@media(max-width:900px){
  html body :is(#home-landing, .hero-preview) .home-hero{
    display:flex;
    flex-direction:column;
    aspect-ratio:auto;
    height:auto;
    min-height:0;
    max-height:none;
  }
  html body :is(#home-landing, .hero-preview) .home-hero-media{
    position:relative;
    inset:auto;
    width:100%;
    aspect-ratio:auto;
    height:var(--hero-height, min(56vw, 520px));
    min-height:var(--hero-height, 220px);
    max-height:var(--hero-height, 520px);
  }
  html body :is(#home-landing, .hero-preview) .home-hero-media::after{
    width:100%;
    opacity:calc(var(--hero-overlay, .38) + .28);
    background:linear-gradient(180deg,rgba(247,243,234,0) 55%,rgba(247,243,234,.92) 100%);
  }
  html body :is(#home-landing, .hero-preview) .home-hero-copy{
    position:relative;
    inset:auto;
    left:auto;
    width:100%;
    min-height:0;
    padding:22px 22px 28px;
    background:#f7f3ea;
    text-shadow:none;
  }
  html body :is(#home-landing, .hero-preview) .home-kicker,
  html body :is(#home-landing, .hero-preview) .home-hero h1,
  html body :is(#home-landing, .hero-preview) .home-hero-copy>p,
  html body :is(#home-landing, .hero-preview) .home-hero-note{text-shadow:none}
  html body #home-landing .home-stats{width:calc(100% - 28px);margin-top:-18px}
  html body #home-landing .home-section,
  html body #home-landing .home-why{padding-inline:16px}
}

/* Inner-page heroes: same photo + cream overlay language as the homepage hero. */
html body #page-hero.page-hero{
  direction:ltr;
  display:block;
  position:relative;
  width:100%;
  max-width:var(--page-hero-max-width, none);
  margin:0 auto;
  padding:0;
  /* Explicit --page-hero-height from the editor must win; vw is only the unset default. */
  height:var(--page-hero-height, min(32vw, 340px));
  min-height:var(--page-hero-height, 220px);
  max-height:var(--page-hero-height, 340px);
  overflow:hidden;
  border:0;
  border-radius:0;
  background:#f4efe6;
  color:inherit;
  box-shadow:none;
  isolation:isolate;
  grid-column:auto;
}
html body #page-hero.page-hero[hidden]{display:none!important}
html[data-view="home"] #page-hero{display:none!important}
html body #page-hero .page-hero-media{
  direction:ltr;
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  overflow:hidden;
  background:#f4efe6;
}
html body #page-hero .page-hero-media::after{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:var(--page-hero-overlay-width, 48%);
  opacity:var(--page-hero-overlay, .42);
  background:linear-gradient(90deg,rgba(247,243,234,.95) 0%,rgba(247,243,234,.55) 48%,rgba(247,243,234,0) 100%);
  pointer-events:none;
  z-index:1;
}
html body #page-hero .page-hero-media img,
html body #page-hero img[data-edit^="page-hero"][data-edit$="-image"]{
  display:block;
  position:absolute;
  inset:0 !important;
  left:0 !important;
  right:0 !important;
  top:0 !important;
  bottom:0 !important;
  width:100% !important;
  height:100% !important;
  max-width:none !important;
  min-width:0 !important;
  min-height:0 !important;
  margin:0 !important;
  object-fit:var(--page-hero-fit, cover);
  object-position:var(--page-hero-pos, 50% 45%);
  transform:scale(var(--page-hero-zoom, 1));
  transform-origin:center;
  opacity:var(--page-hero-opacity, 1);
  filter:saturate(var(--page-hero-saturation, 1));
}
html body #page-hero .page-hero-copy{
  direction:rtl;
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  z-index:2;
  width:min(46%, 640px);
  margin:0;
  padding:22px clamp(20px,3vw,48px);
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  text-align:right;
  background:transparent;
}
html body #page-hero .page-hero-kicker,
html body #page-hero .page-hero-title,
html body #page-hero .page-hero-text{
  text-shadow:0 1px 2px rgba(247,243,234,.95),0 0 20px rgba(247,243,234,.7);
}
html body #page-hero .page-hero-kicker{
  display:inline-flex;
  align-items:center;
  width:max-content;
  max-width:100%;
  margin:0 0 8px;
  font-size:12px;
  font-weight:800;
  letter-spacing:.08em;
  color:#52627e;
}
html body #page-hero .page-hero-kicker::before{
  content:"";
  width:28px;
  height:2px;
  margin-inline-end:10px;
  background:#d72d36;
  border-radius:999px;
}
html body #page-hero .page-hero-title{
  width:100%;
  max-width:520px;
  margin:0 0 10px;
  font-size:clamp(24px,2.6vw,38px);
  line-height:1.22;
  color:#10244a;
}
html body #page-hero .page-hero-text{
  max-width:480px;
  margin:0;
  font-size:15px;
  line-height:1.8;
  color:#52627e;
}
html:not([data-view="home"]) #workspace.shell{padding-top:22px}

@media(max-width:900px){
  html body #page-hero.page-hero{
    display:flex;
    flex-direction:column;
    height:auto;
    min-height:0;
    max-height:none;
    max-width:var(--page-hero-max-width, none);
  }
  html body #page-hero .page-hero-media{
    position:relative;
    inset:auto;
    aspect-ratio:auto;
    width:100%;
    height:var(--page-hero-height, min(56vw, 340px));
    min-height:var(--page-hero-height, 180px);
    max-height:var(--page-hero-height, 340px);
  }
  html body #page-hero .page-hero-media::after{
    width:100%;
    background:linear-gradient(180deg,rgba(247,243,234,0) 55%,rgba(247,243,234,.94) 100%);
  }
  html body #page-hero .page-hero-copy{
    position:relative;
    inset:auto;
    left:auto;
    width:100%;
    padding:18px 20px 22px;
    background:#f7f3ea;
  }
  html body #page-hero .page-hero-kicker,
  html body #page-hero .page-hero-title,
  html body #page-hero .page-hero-text{text-shadow:none}
  html body #page-hero .page-hero-title{font-size:24px}
  html body #page-hero .page-hero-text{font-size:14px}
}
