/*
 * Hero Splash - full-viewport hero for the front page.
 * Hidden by default; front.php prints the inline rule that shows it, wrapped
 * in a media query built from the "Largeur d'écran maximale" setting.
 */

#hu-hero-splash {
  display: none;
  /* Fixed overlay on top of the normal page (header included), NOT part of
     document flow, so the theme's header and sticky-menu logic stay untouched. */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 100vh;
  height: calc(var(--hu-vh, 1vh) * 100);
  height: 100svh;
  overflow: hidden;
  background-color: #111;
  opacity: 0;
  z-index: 99999;
  transform: translateY(0);
  transition: opacity .4s ease;
  will-change: transform, opacity;
}

#hu-hero-splash.hu-hero-loaded {
  opacity: 1;
}

/* Triggered on the very first scroll/swipe: the whole overlay slides away in one motion. */
#hu-hero-splash.hu-hero-dismissed {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: transform .45s cubic-bezier(0.22, 0.61, 0.36, 1), opacity .45s ease;
}

#hu-hero-splash.hu-hero-gone {
  display: none;
}

#hu-hero-splash .hu-hero-media {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1s ease;
}

#hu-hero-splash .hu-hero-media.is-active {
  opacity: 1;
}

#hu-hero-splash .hu-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  text-align: center;
  background: linear-gradient(to bottom, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.1) 40%, rgba(0,0,0,0.45) 100%);
}

/* Text stays centered on the photo. */
#hu-hero-splash .hu-hero-text {
  position: absolute;
  top: 50%;
  left: 24px;
  right: 24px;
  transform: translateY(-50%);
  color: #fff;
  font-size: 1.9em;
  line-height: 1.25;
  margin: 0;
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

/* Buttons live in the bottom quarter of the screen, clear of the photo's
   focal area, but not glued to the very bottom edge (room for the arrow). */
#hu-hero-splash .hu-hero-buttons {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: max(18%, 140px); /* keeps clear of the chevron column */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 0 auto;
  max-width: 280px;
}

#hu-hero-splash .hu-hero-btn {
  display: block;
  padding: 12px 20px;
  border-radius: 4px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

#hu-hero-splash .hu-hero-scroll-arrow {
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 2;
  transform: translateX(-50%);
  margin: 0;
  padding: 8px;
  border: 0;
  background: none;
  box-shadow: none;
  color: #fff;
  font-size: 1.6em;
  line-height: 1;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  --hu-hero-electric: #00c8ff;
}

/* Cascade: each chevron lights up electric blue and dips in turn, top to bottom. */
#hu-hero-splash .hu-hero-chevron {
  display: block;
  color: #fff;
  opacity: 0.3;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
  animation: hu-hero-chevron 1.8s ease-in-out infinite;
}

#hu-hero-splash .hu-hero-chevron:nth-child(2) { animation-delay: .15s; }
#hu-hero-splash .hu-hero-chevron:nth-child(3) { animation-delay: .3s; }
#hu-hero-splash .hu-hero-chevron:nth-child(4) { animation-delay: .45s; }
#hu-hero-splash .hu-hero-chevron:nth-child(5) { animation-delay: .6s; }
#hu-hero-splash .hu-hero-chevron:nth-child(6) { animation-delay: .75s; }

#hu-hero-splash .hu-hero-scroll-arrow:hover .hu-hero-chevron,
#hu-hero-splash .hu-hero-scroll-arrow:focus-visible .hu-hero-chevron {
  animation-duration: 1.1s;
}

@keyframes hu-hero-chevron {
  0%, 50%, 100% {
    color: #fff;
    opacity: 0.3;
    transform: translateY(0);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
  }
  20% {
    color: var(--hu-hero-electric);
    opacity: 1;
    transform: translateY(4px);
    filter: drop-shadow(0 0 4px var(--hu-hero-electric)) drop-shadow(0 0 10px var(--hu-hero-electric));
  }
}

@media (prefers-reduced-motion: reduce) {
  #hu-hero-splash .hu-hero-chevron {
    animation: none;
    opacity: 0.9;
  }
}

#hu-hero-splash .hu-hero-btn:hover,
#hu-hero-splash .hu-hero-btn:focus-visible {
  color: #fff;
  filter: brightness(1.1);
}

/* Larger screens (when "Ordinateur" is enabled): bigger title, buttons side by side. */
@media only screen and (min-width: 768px) {
  #hu-hero-splash .hu-hero-text {
    font-size: 3.2em;
    max-width: 900px;
    margin: 0 auto;
  }

  #hu-hero-splash .hu-hero-buttons {
    flex-direction: row;
    justify-content: center;
    max-width: none;
    bottom: max(18%, 165px);
    gap: 16px;
  }

  #hu-hero-splash .hu-hero-btn {
    min-width: 200px;
    padding: 14px 28px;
    font-size: 1.1em;
  }

  #hu-hero-splash .hu-hero-scroll-arrow {
    font-size: 2em;
    bottom: 28px;
  }
}
