/* Page Hero (template-parts/page-hero.php). Colours and the Inter font come from .cn-shell
   in the Header & Footer plugin; sizes follow SITE-RULES.md §14. Contrast checked in §14.2. */

.cn-page-hero {
  --cn-blue-light: #9db8ff;
  position: relative;
  display: flex;
  align-items: center;
  padding-block: 64px;
  overflow: hidden;
  isolation: isolate;
  background: var(--cn-navy);
  color: #fff;
}
.cn-page-hero *,
.cn-page-hero *::before,
.cn-page-hero *::after { box-sizing: border-box; }

/* Background photo: fills the section symmetrically and stays completely still from frame 1. */
.cn-page-hero .cn-page-hero-image {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  max-width: none;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

/* Subtle centered navy scrim so white text and --cn-blue-light stay crisp while preserving light beams. */
.cn-page-hero--image::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(
    ellipse 80% 90% at 50% 50%,
    rgb(11 31 51 / .28) 0%,
    rgb(11 31 51 / .48) 100%
  );
}

/* No real image yet: dark placeholder note (exception to the light-grey placeholder in §12.1). */
.cn-page-hero .cn-page-hero-placeholder {
  position: absolute;
  bottom: 16px;
  inset-inline: calc((100% - min(1200px, 100% - 48px)) / 2);
  margin: 0;
  color: rgb(255 255 255 / .7);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

.cn-page-hero-inner { position: relative; }
.cn-page-hero-text {
  max-width: 100%;
  margin-inline: auto;
  text-align: center;
}

.cn-page-hero :is(p, h1) { margin: 0; }
.cn-page-hero .cn-page-hero-eyebrow {
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.cn-page-hero h1 {
  margin-top: 12px;
  color: #fff;
  font-family: inherit;
  font-size: 56px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.025em;
}
.cn-page-hero .cn-page-hero-lead { max-width: 720px; margin-top: 16px; margin-inline: auto; color: #fff; font-size: 18px; line-height: 1.65; }

.cn-page-hero-breadcrumb { margin-top: 16px; }
.cn-page-hero-breadcrumb p { color: #fff; font-size: 14px; line-height: 1.6; }
.cn-page-hero-breadcrumb .separator { color: rgb(255 255 255 / .55); }
.cn-shell .cn-page-hero-breadcrumb a {
  color: rgb(255 255 255 / .85);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color .2s;
}
.cn-shell .cn-page-hero-breadcrumb a:hover { color: var(--cn-blue-light); text-decoration: underline; }
.cn-page-hero-breadcrumb .last { color: var(--cn-blue-light); }

.cn-page-hero .cn-page-hero-actions { margin-top: 32px; }
.cn-shell.cn-page-hero .cn-primary { transition: background-color .2s, border-color .2s; }

/* Intro paragraph right under the hero. Reading width per §13; lead size per §14.1. */
.cn-page-intro { padding-top: 48px; background: #fff; }
.cn-page-intro p { max-width: 800px; margin: 0; color: var(--cn-text); font-size: 18px; line-height: 1.65; }
.cn-page-intro p + p { margin-top: 16px; }

/* Brand blue focus rings disappear on navy: use white inside the hero. */
.cn-shell.cn-page-hero :focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* Entrance animation: text only, background stays completely still so it never flickers. */
.cn-page-hero-text > * {
  animation: cn-page-hero-text-in .55s cubic-bezier(.22, 1, .36, 1) both;
}
.cn-page-hero-text > .cn-page-hero-eyebrow { animation-delay: 0ms; }
.cn-page-hero-text > h1 { animation-delay: 70ms; }
.cn-page-hero-text > .cn-page-hero-lead { animation-delay: 110ms; }
.cn-page-hero-text > .cn-page-hero-breadcrumb { animation-delay: 140ms; }
.cn-page-hero-text > .cn-page-hero-actions { animation-delay: 210ms; }

@keyframes cn-page-hero-text-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* Smooth scrolling for the hero's on-page anchor button. */
@media (prefers-reduced-motion: no-preference) {
  html:has(.cn-page-hero) { scroll-behavior: smooth; }
}

@media (width < 1024px) {
  .cn-page-hero { padding-block: 48px; }
  .cn-page-hero h1 { font-size: 44px; }
  .cn-page-hero--image::before {
    background: radial-gradient(
      ellipse 85% 95% at 50% 50%,
      rgb(11 31 51 / .32) 0%,
      rgb(11 31 51 / .56) 100%
    );
  }
}

@media (width < 768px) {
  .cn-page-hero { padding-block: 36px; }
  .cn-page-hero:has(.cn-page-hero-placeholder) { padding-bottom: 96px; }
  .cn-page-hero h1 { font-size: 34px; }
  .cn-page-hero .cn-page-hero-lead { font-size: 16px; }
  .cn-page-intro { padding-top: 32px; }
  .cn-page-intro p { font-size: 16px; }
  .cn-page-hero--image::before {
    background: radial-gradient(
      ellipse 90% 95% at 50% 50%,
      rgb(11 31 51 / .38) 0%,
      rgb(11 31 51 / .62) 100%
    );
  }
  .cn-page-hero .cn-page-hero-placeholder { inset-inline: 20px; bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .cn-page-hero-text > * { animation: none; will-change: auto; }
  .cn-shell .cn-page-hero-breadcrumb a,
  .cn-shell.cn-page-hero .cn-primary { transition: none; }
}
