/**
 * Walters Construction FL — Hero Section Component
 *
 * Full-viewport hero with video background (drone footage), static image
 * fallback, and content overlay containing the brand logo, 20-year
 * anniversary badge, and call-to-action buttons.
 *
 * Depends on styles/variables.css for brand tokens.
 * Video is hidden and replaced by a static image on mobile (< 768px) to
 * conserve bandwidth; this is enforced via CSS display rules combined with
 * JS-conditional loading in hero-video.js.
 */

/* ─────────────────────────────────────────────────────────────────────────────
   HERO VARIABLES
   ───────────────────────────────────────────────────────────────────────────── */
:root {
  /* Overlay gradient — tuned for WCAG AA contrast (≥ 4.5:1) with white text.
     Middle stop raised from 0.10 to 0.30 so hero body copy meets the threshold. */
  --hero-overlay-gradient: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.35) 0%,
    rgba(0, 0, 0, 0.30) 40%,
    rgba(0, 0, 0, 0.65) 100%
  );
  --hero-logo-shadow: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.65));
  --btn-primary-bg: #D4A84B;
  --btn-primary-hover: #be9338;
  --btn-primary-text: #ffffff;
  --btn-outline-color: #ffffff;
  --btn-outline-hover-bg: rgba(255, 255, 255, 0.15);
  --btn-radius: 3px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   HERO SECTION CONTAINER
   ───────────────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  width: 100%;
  /* 100dvh accounts for mobile browser chrome shrinking/growing */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}

/* Gradient overlay for text legibility — sits between media layer and content */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--hero-overlay-gradient);
  z-index: 5;
  pointer-events: none;
}

/* ─────────────────────────────────────────────────────────────────────────────
   HERO MEDIA LAYER — video and fallback image
   ───────────────────────────────────────────────────────────────────────────── */
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero-video,
.hero-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Video sits above the poster/fallback image */
.hero-video {
  z-index: 2;
}

.hero-image {
  z-index: 1;
}

/* On mobile: hide video, show static image */
@media (max-width: 767px) {
  .hero-video {
    display: none;
  }
}

/* On desktop: static image is used as the poster while video loads, then
   hidden by hero-video.js once playback starts */
@media (min-width: 768px) {
  .hero-image {
    /* Remains visible as poster; hero-video.js hides it after play() resolves */
    display: block;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   HERO CONTENT OVERLAY — logo, badge, and CTAs
   ───────────────────────────────────────────────────────────────────────────── */
.hero-content {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  /* Top padding clears the fixed header */
  padding: calc(var(--header-height-mobile, 64px) + 2rem) 1.5rem 3rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

/* ─────────────────────────────────────────────────────────────────────────────
   HERO BRAND — logo + badge grouped together
   ───────────────────────────────────────────────────────────────────────────── */
.hero-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* The Walters Construction sign logo */
.hero-logo {
  display: block;
  width: 240px;
  max-width: 75vw;
  height: auto;
  filter: var(--hero-logo-shadow);
}

/* ─────────────────────────────────────────────────────────────────────────────
   20-YEAR ANNIVERSARY BADGE — pure CSS, no image dependency
   ───────────────────────────────────────────────────────────────────────────── */
.hero-badge {
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--btn-primary-bg, #D4A84B);
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  color: #ffffff;
  text-align: center;
  line-height: 1;
  gap: 0.125rem;
}

.badge-number {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-family-heading, system-ui, sans-serif);
  letter-spacing: -0.03em;
  line-height: 1;
}

.badge-years {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
}

.badge-subtext {
  font-size: 0.5625rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.9;
}

/* ─────────────────────────────────────────────────────────────────────────────
   HERO DESCRIPTION
   ───────────────────────────────────────────────────────────────────────────── */
.hero-description {
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.6;
  max-width: 560px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  margin: 0;
}

/* ─────────────────────────────────────────────────────────────────────────────
   CALL-TO-ACTION BUTTONS
   ───────────────────────────────────────────────────────────────────────────── */
.hero-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
  width: 100%;
  max-width: 320px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-decoration: none;
  font-family: var(--font-family-body, system-ui, sans-serif);
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: var(--btn-radius);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.btn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

/* Primary — Walters Gold fill */
.btn--primary {
  background-color: var(--btn-primary-bg);
  border-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}

.btn--primary:hover {
  background-color: var(--btn-primary-hover);
  border-color: var(--btn-primary-hover);
}

/* Outline / Ghost — white border, transparent fill */
.btn--outline {
  background-color: transparent;
  border-color: var(--btn-outline-color);
  color: var(--btn-outline-color);
}

.btn--outline:hover {
  background-color: var(--btn-outline-hover-bg);
}

/* Large size */
.btn--lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
}

/* ─────────────────────────────────────────────────────────────────────────────
   PREFERS-REDUCED-MOTION — disable video animation
   ───────────────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .hero-video {
    /* Paused by hero-video.js when this query matches */
    display: none;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   DESKTOP BREAKPOINT — 768px and above
   ───────────────────────────────────────────────────────────────────────────── */
@media (min-width: 768px) {
  .hero-content {
    padding-top: calc(var(--header-height, 80px) + 3rem);
    padding-bottom: 4rem;
    gap: 2.5rem;
  }

  .hero-brand {
    flex-direction: row;
    align-items: center;
    gap: 2.5rem;
    justify-content: center;
  }

  .hero-logo {
    width: 320px;
  }

  .badge-circle {
    width: 118px;
    height: 118px;
  }

  .badge-number {
    font-size: 2.375rem;
  }

  .hero-description {
    font-size: 1.125rem;
    max-width: 620px;
  }

  .hero-cta {
    flex-direction: row;
    max-width: none;
    width: auto;
    gap: 1rem;
  }

  .btn {
    width: auto;
  }

  .btn--lg {
    padding: 0.9375rem 2rem;
    font-size: 1.0625rem;
  }
}

@media (min-width: 1024px) {
  .hero-logo {
    width: 380px;
  }
}
