/* =========================================================
   BLOCK — Header video
========================================================= */

.header-video{
  width: 100%;

  --hv-pad: 0px;
  --hv-wide-pad: clamp(
    var(--hv-pad),
    calc((100vw - var(--layout-wide-size)) / 2 + var(--hv-pad)),
    999px
  );

  /* timing intro */
  --hv-intro-duration: 2400ms;
  --hv-fade-duration: 350ms;
}

.header-video__inner{
  position: relative;
  width: 100%;
  min-height: 260px;
  background: var(--color-noir);
  overflow: hidden;
  height: 60vh;
}

/* =========================================================
   VIDEO BACKGROUND
========================================================= */

.header-video__bg{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  z-index: 0;
}

/* =========================================================
   CONTAINER (FADE RULES)
   - visible on first load (intro)
   - then hidden by default
   - visible only on hover
========================================================= */

.header-video__container{
  width: 100%;
  margin: 0 auto;

  position: relative;
  z-index: 2;

  display: flex;
  align-items: stretch;
  justify-content: space-between;

  height: 100%;

  /* hidden by default after intro */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition:
    opacity var(--hv-fade-duration) ease,
    visibility 0s linear var(--hv-fade-duration);
}

/* visible on hover */
.header-video:hover .header-video__container{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;

  transition:
    opacity var(--hv-fade-duration) ease,
    visibility 0s linear 0s;
}

/* intro: play once */
.header-video.is-intro .header-video__container{
  visibility: visible;
  pointer-events: auto;
  animation: hvIntro var(--hv-intro-duration) ease both;
  transition: none;
}

@keyframes hvIntro{
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  75%  { opacity: 1; }
  100% { opacity: 0; }
}

/* accessibility */
@media (prefers-reduced-motion: reduce){
  .header-video.is-intro .header-video__container{
    animation: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .header-video__container{
    transition: none;
  }
}

/* =========================================================
   CONTENT
========================================================= */

.header-video__content{
  flex: 0 0 55%;
  min-width: 0;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 22px;

  padding-left: var(--hv-wide-pad);
  padding-right: clamp(20px, 4vw, 64px);
}

.header-video__title{
  margin: 0;
  text-transform: uppercase;
  font-size: var(--font-size-xxl);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;

  color: #fff;
  max-width: 90%;
}

/* bouton */
.header-video__content .btn_primary{
  width: auto;
  display: inline-flex;
}

/* =========================================================
   BOTTOM / BREADCRUMB
========================================================= */

.header-video__bottom{
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;

  display: flex;
  justify-content: flex-start;
  align-items: flex-end;

  padding: 0 var(--hv-wide-pad) 28px;

  z-index: 2;
}

/* dégradé DERRIÈRE le breadcrumb */
.header-video__bottom::before{
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;

  background: linear-gradient(
    to top,
    rgba(0,0,0,0.75) 0%,
    rgba(0,0,0,0.45) 35%,
    rgba(0,0,0,0.15) 60%,
    rgba(0,0,0,0) 100%
  );
}

/* breadcrumb au-dessus du dégradé */
.header-video__bottom .breadcrumb{
  position: relative;
  z-index: 1;

  font-size: var(--font-size-xs, 12px);
  line-height: 1.2;
  color: #fff;
}

/* liens breadcrumb */
.header-video__bottom .breadcrumb a{
  color: #fff;
  text-decoration: none;
}
.header-video__bottom .breadcrumb a:hover{
  text-decoration: underline;
}

/* breadcrumb_last EN BLANC (override ciblé) */
.header-video .breadcrumb .breadcrumb_last{
  color: #fff;
  font-size: var(--font-size-xs);
  font-weight: 500;
}

/* =========================================================
   ANIMATION DES ÉLÉMENTS — HEADER VIDEO
========================================================= */

@keyframes headerVideoItemReveal {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* état initial des éléments internes */
.header-video__title,
.header-video__content .btn_primary,
.header-video__bottom .breadcrumb {
  opacity: 0;
  transform: translateY(16px);
}

/* ========= INTRO ========= */
.header-video.is-intro .header-video__title {
  animation: headerVideoItemReveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: 0.10s;
}

.header-video.is-intro .header-video__content .btn_primary {
  animation: headerVideoItemReveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: 0.22s;
}

.header-video.is-intro .header-video__bottom .breadcrumb {
  animation: headerVideoItemReveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: 0.34s;
}

/* ========= HOVER DESKTOP ========= */
.header-video:hover .header-video__title {
  animation: headerVideoItemReveal 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: 0.04s;
}

.header-video:hover .header-video__content .btn_primary {
  animation: headerVideoItemReveal 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: 0.12s;
}

.header-video:hover .header-video__bottom .breadcrumb {
  animation: headerVideoItemReveal 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: 0.20s;
}

/* ========= MOBILE ========= */
@media (max-width: 860px) {
  .header-video__title {
    animation: headerVideoItemReveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: 0.08s;
  }

  .header-video__content .btn_primary {
    animation: headerVideoItemReveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: 0.18s;
  }

  .header-video__bottom .breadcrumb {
    animation: headerVideoItemReveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: 0.28s;
  }
}

/* accessibilité */
@media (prefers-reduced-motion: reduce) {
  .header-video__title,
  .header-video__content .btn_primary,
  .header-video__bottom .breadcrumb {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

/* =========================================================
   RESPONSIVE — MOBILE : contenu toujours visible
========================================================= */

@media (max-width: 860px){

  .header-video{
    --hv-pad: 20px;
    --hv-wide-pad: var(--hv-pad);
  }

  /* ✅ MOBILE : toujours visible (pas de hover, pas d'intro) */
  .header-video__container{
    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transition: none;
    animation: none;

    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 18px;

    padding: 0 0 30px 0;
    height: 100%;
    min-height: unset;
  }

  .header-video__content{
    width: 100%;
    flex: 0 0 auto;
    height: 100%;

    gap: 16px;

    padding-left: var(--hv-wide-pad);
    padding-right: var(--hv-pad);
  }

  /* bottom dans le flux */
  .header-video__bottom{
    position: static;
    width: 100%;
    padding: 24px var(--hv-wide-pad);
  }

  .header-video__bottom::before{
    inset: auto 0 0 0;
    height: 120px;
  }

  /* breadcrumb pivoté */
  .header-video__inner .breadcrumb{
    position: absolute;
    top: 13px;
    right: 23px;

    transform: rotate(-90deg);
    transform-origin: top right;

    text-align: right;
    white-space: nowrap;
    z-index: 5;
  }
}
