/* ============================================================
   Hero Section — hero.css
   Full-viewport hero with parallax background, overlay, and
   entrance animations.  Mobile-first.
   ============================================================ */


/* ── Hero container ────────────────────────────────────────── */

.hero {
  position: relative;
  margin-top: calc(-1 * var(--header-height-tall));
  min-height: 100svh;            /* small viewport height — good on mobile */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;

  /* Background image set inline via style attribute from PHP */
  background-color: var(--color-secondary);  /* fallback if no image */
  background-size: cover;
  background-position: center 50%;
  background-repeat: no-repeat;

  /* CSS parallax: background stays fixed while page scrolls.
     Disabled on mobile where it renders incorrectly (see media query).
     JS in animations.js upgrades this with rAF-based smooth parallax. */
  background-attachment: fixed;

  color: var(--color-white);
}

/* When JS replaces fixed with scroll for smooth parallax */
.hero.js-parallax {
  background-attachment: scroll;
}


/* ── Dark overlay ──────────────────────────────────────────── */

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(26, 26, 46, 0.72) 0%,
    rgba(26, 26, 46, 0.55) 50%,
    rgba(26, 26, 46, 0.75) 100%
  );
  z-index: 0;
}


/* ── Content wrapper ───────────────────────────────────────── */

.hero .container {
  position: relative;
  z-index: 1;
}

.hero__content {
  max-width: 720px;
  margin-inline: auto;
  padding-block: var(--space-20);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: var(--radius-lg);
  padding-inline: var(--space-12);
}

.section--hero {
  /* Overrides the default section colours set in main.css for this variant */
  background-color: var(--color-secondary);  /* fallback with no image */
  color: var(--color-white);
}


/* ── Heading ───────────────────────────────────────────────── */

.hero__heading {
  color: var(--color-white);
  font-size: var(--text-5xl);
  line-height: 1.1;
  margin-bottom: var(--space-6);
  text-shadow: 0 2px 20px rgba(0 0 0 / 0.35);
}


/* ── Subheading ────────────────────────────────────────────── */

.hero__subheading {
  font-size: var(--text-xl);
  color: rgba(255 255 255 / 0.88);
  max-width: 560px;
  margin-inline: auto;
  margin-bottom: var(--space-10);
  line-height: var(--leading-normal);
  text-shadow: 0 1px 8px rgba(0 0 0 / 0.3);
}


/* ── CTA button ────────────────────────────────────────────── */

.hero__cta {
  font-size: var(--text-lg);
  padding-inline: var(--space-10);
  padding-block: var(--space-4);
  box-shadow: 0 4px 20px rgba(0 0 0 / 0.25);
}

.hero__cta:hover,
.hero__cta:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(0 0 0 / 0.35);
}


/* ── Scroll cue (animated chevron) ────────────────────────── */

.hero__scroll-cue {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255 255 255 / 0.55);
  z-index: 1;
  animation: hero-scroll-bounce 2.2s ease-in-out infinite;
  pointer-events: none;
}

.hero__scroll-cue svg {
  width: 32px;
  height: 32px;
}

@keyframes hero-scroll-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0);   opacity: 0.55; }
  50%       { transform: translateX(-50%) translateY(10px); opacity: 0.8;  }
}


/* ── Entrance animations (driven by animations.js) ─────────── */

[data-animate] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity  var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* ── Section heading utility (shared across sections) ─────── */

.section__heading {
  font-size: var(--text-3xl);
  color: var(--color-heading);
  margin-bottom: var(--space-12);
}


/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 768px) {
  /* background-attachment:fixed is broken on iOS Safari — use scroll */
  .hero {
    background-attachment: scroll;
    min-height: 100svh;
  }

  .hero__heading {
    font-size: var(--text-4xl);
  }

  .hero__subheading {
    font-size: var(--text-lg);
    margin-bottom: var(--space-8);
  }

  .hero__cta {
    font-size: var(--text-base);
    padding-inline: var(--space-8);
  }
}

@media (max-width: 480px) {
  .hero__content {
    padding-block: var(--space-16);
    padding-inline: var(--space-6);
  }

  .hero__heading {
    font-size: var(--text-3xl);
  }
}
