/* ═══════════════════════════════════════════════════════════════════════
   LETLOU ENERGY — HOME SECTION
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Section shell ──
   --news-flash-height token: explicit height for the news-flash strip
   so .hero-content can reserve matching space at the bottom of the
   hero (desktop only — see @media (min-width: 901px) below). */
#home {
  --news-flash-height: 64px;
  background-color: var(--color-navy);
  position: relative;
  overflow-x: clip; /* clip (not hidden) — contains children without creating a
                       scroll container that would break position:sticky */
}


/* ── Brand note ── */
.hero-brand-note {
  font-size: 0.8rem;
  color: color-mix(in srgb, white 55%, transparent);
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
}

.hero-brand-note i {
  color: var(--color-amber);
}


/* ── Hero Video Background ── */
.hero-video-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.hero-video-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Fallback poster image — hidden once video loads successfully */
.hero-video-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;          /* hidden by default; JS shows it only if video fails */
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.hero-video-fallback.visible {
  opacity: 1;
}

/* Dark gradient overlay (same as before) */
.hero-video-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    color-mix(in srgb, var(--color-navy-deep) 82%, transparent) 0%,
    color-mix(in srgb, var(--color-navy-deep) 55%, transparent) 55%,
    color-mix(in srgb, var(--color-navy-deep) 25%, transparent) 100%
  );
  z-index: 1;
}


/* ── Video Progress Bar (replaces slide dots) ── */
.video-progress-bar {
  position: absolute;
  right: clamp(1rem, 3vw, 2.5rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 3px;
  height: 120px;
  background: color-mix(in srgb, white 20%, transparent);
  border-radius: 2px;
  overflow: hidden;
}

.video-progress-fill {
  width: 100%;
  height: 0%;          /* updated by JS via timeupdate */
  background: var(--color-amber);
  border-radius: 2px;
  transition: height 0.25s linear;
}

@media (max-width: 600px) {
  .video-progress-bar { display: none; }
}


/* ── Hero wrapper ── */
.hero-section {
  position: relative;
  width: 100%;
  /* min-height (not height): the hero fills the viewport below the header
     on tall viewports, but is allowed to grow taller than the viewport on
     short/wide screens (e.g. 1920×1080 TVs) so hero content is never
     clipped by the news-flash strip or cut off at the fold.
     The 480px floor guards against tiny landscape-phone viewports where
     100dvh - header could otherwise be very small. */
  min-height: max(480px, calc(100dvh - var(--header-height, 68px)));
  display: flex;
  align-items: center;
}


/* ── Hero content ── */
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1.25rem, 6vw, 5rem); /* horizontal floor reduced
     from 2rem — at 320px, 2rem each side left only 256px text column */
  animation: heroFadeUp 1s ease both;
}

@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-amber);
  margin-bottom: 1.25rem;
  animation: heroFadeUp 1s 0.15s ease both;
}

.hero-eyebrow::before {
  content: "";
  display: block;
  width: 28px;
  height: 2px;
  background: var(--color-amber);
  flex-shrink: 0;
}

.hero-headline {
  font-family: 'Georgia', 'Times New Roman', serif;
  /* Scales with the smaller pressure of width or height — on a wide-but-
     short viewport (e.g. 1920×1080 TV) the 4vh term keeps the headline
     from reaching its max size and overflowing vertically. */
  font-size: clamp(2.2rem, 4vw + 2vh, 3.8rem);
  font-weight: 700;
  color: var(--color-white);
  line-height: 1.15;
  margin: 0 0 1.25rem;
  animation: heroFadeUp 1s 0.25s ease both;
}

.hero-headline span {
  color: var(--color-amber);
}

.hero-sub {
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  color: color-mix(in srgb, white 82%, transparent);
  line-height: 1.7;
  max-width: 520px;
  margin: 0 0 2rem;
  animation: heroFadeUp 1s 0.35s ease both;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  animation: heroFadeUp 1s 0.45s ease both;
}

.hero-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-amber);
  color: var(--color-navy);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  padding: 0.85rem 2rem;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.hero-btn-primary:hover {
  background: var(--color-amber-hover);
  transform: translateY(-2px);
}
.hero-btn-primary:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
}

.hero-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--color-white);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  padding: 0.85rem 2rem;
  text-decoration: none;
  border: 1.5px solid color-mix(in srgb, white 55%, transparent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}
.hero-btn-ghost:hover {
  border-color: var(--color-amber);
  color: var(--color-amber);
  transform: translateY(-2px);
}
.hero-btn-ghost:focus-visible {
  outline: 2px solid var(--color-amber);
  outline-offset: 2px;
}


/* ── Stats bar ── */
.hero-stats {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 5;
  background: var(--color-navy-deep);
  display: flex;
  justify-content: center;
  gap: clamp(1.5rem, 5vw, 5rem);
  padding: clamp(1rem, 2vw, 1.2rem) clamp(1rem, 4vw, 3rem);
  border-top: 1px solid color-mix(in srgb, black 5%, transparent);
  animation: heroFadeUp 1s 0.55s ease both;
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
  color: var(--color-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 100px;     /* floor reduced from 120px — allows more stats to fit without wrapping */
}

.hero-stat i {
  opacity: 0.8;
  margin-bottom: 4px;
}

.hero-stat-number {
  display: block;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--color-amber);
  line-height: 1;
}

.hero-stat-label {
  display: block;
  font-size: clamp(0.68rem, 1.2vw, 0.75rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-white);
}

.hero-stat:hover i {
  transform: translateY(-2px);
  transition: transform 0.3s ease;
}


/* ── Home News Flash Strip ── */
.home-news-flash {
  background: var(--color-white);
  border-top: 1px solid var(--color-border-soft);
  border-bottom: 1px solid var(--color-border-soft);
  padding: 0.9rem clamp(1rem, 4vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative; /*-- New: For Newsflash placement at bottom - Default to relative for mobile */
  bottom: auto; /*-- New: For Newsflash placement at bottom - Default to relative for mobile */
  z-index: 2; /*-- New: For Newsflash placement at bottom - Default to relative for mobile */
}

@media (min-width: 901px) {
  #home {
    position: relative;
  }

  .home-news-flash {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: var(--news-flash-height, 64px); /* fixed height so hero content can reserve space */
    margin: 0;
    border-radius: 0;
  }

  /* Reserve the news-flash's footprint so hero headline/CTAs never
     sit beneath the white overlay strip. */
  .hero-content {
    padding-bottom: calc(var(--news-flash-height, 64px) + clamp(1.5rem, 4vw, 3rem));
  }
}

.home-news-flash-content {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.home-news-flash-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: color-mix(in srgb, var(--color-amber) 12%, transparent);
  border-radius: 50%;
  flex-shrink: 0;
}

.home-news-flash-icon i {
  font-size: 1.2rem;
  color: var(--color-amber);
}

.home-news-flash-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-amber);
  background: color-mix(in srgb, var(--color-amber) 10%, transparent);
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  white-space: nowrap;
}

.home-news-flash-text {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-mid);
  line-height: 1.4;
}

.home-news-flash-text a {
  color: inherit;
  text-decoration: none;
}

.home-news-flash-text a:hover {
  color: var(--color-amber);
}

.home-news-flash-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-navy);
  text-decoration: none;
  transition: color 0.2s ease;
  flex-shrink: 0;
  margin-left: 0.75rem;
}

.home-news-flash-link i {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.home-news-flash-link:hover {
  color: var(--color-amber);
}

.home-news-flash-link:hover i {
  transform: translateX(3px);
}


/* ── Empty / loading states ── */
.home-news-flash-loading,
.home-news-flash-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.home-news-flash-empty i {
  font-size: 1.2rem;
  opacity: 0.5;
}

.home-news-flash-loading i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}


/* ── Responsive ── */

/* News flash: collapse to icon + "Read more" on narrow screens.
   This is qualitative (content is hidden) so a breakpoint is correct. */
@media (max-width: 640px) {
  .home-news-flash {
    padding: 0.65rem 1rem;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .home-news-flash-content { display: none; }

  .home-news-flash-icon { width: 32px; height: 32px; }
  .home-news-flash-icon i { font-size: 1rem; }
  .home-news-flash-link { margin-left: 0; }
}

/* Progress bar: purely decorative on small screens — hide it.
   Qualitative removal, not a sizing adjustment. */
@media (max-width: 600px) {
  .video-progress-bar { display: none; }
}

/* Large screen: wider hero content. All font sizes use clamp() above
   and don't need overrides. Only the max-width containers change. */
@media (min-width: 1400px) {
  .hero-content {
    max-width: 820px;
    padding: clamp(2.5rem, 4vh, 4rem) clamp(2rem, 5vw, 4rem);
  }

  .hero-sub { max-width: 620px; }

  .hero-stats {
    padding: 1.5rem clamp(2rem, 5vw, 4rem);
  }
}
