/* Kastor V40 — Hero vidéo authentique, cadre inférieur miroir du linteau haut.
 * Styles confinés à la page d’accueil pour préserver les autres pages.
 */
:root { --kastor-window-red: #8f1018; }
main.page-home > .hero-overlay.hero-overlay--window {
  --kastor-window-cut: clamp(46px,4.5vw,76px);
  --kastor-window-depth: clamp(25px,2.4vw,34px);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #171716 url('../images/kastor-home-poster-v40.jpg') center / cover no-repeat;
  /* Compense le cadre, mais ne crée pas de bande blanche entre les sections. */
  padding-bottom: max(var(--ks-section-y, 32px),calc(var(--kastor-window-depth) + 20px));
}
main.page-home .hero-overlay--window .hero-overlay__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
main.page-home .hero-overlay--window .hero-overlay__video {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: transparent;
}
main.page-home .hero-overlay--window .hero-overlay__shade { z-index: 1; pointer-events: none; }
main.page-home .hero-overlay--window .hero-overlay__content { z-index: 2; }
main.page-home .hero-overlay--window .hero-overlay__frame-bottom {
  position: absolute;
  display: block;
  z-index: 4;
  left: 0; right: 0; bottom: 0;
  width: 100%;
  height: var(--kastor-window-depth);
  background: var(--kastor-window-red);
  clip-path: polygon(var(--kastor-window-cut) 0,
    calc(100% - var(--kastor-window-cut)) 0,
    100% 100%, 0 100%);
  box-shadow: inset 0 -3px 0 rgba(70,0,0,.16);
  pointer-events: none;
}
/* Une seconde arête intérieure suggère la profondeur du cadre 2D. */
main.page-home .hero-overlay--window .hero-overlay__frame-bottom::before {
  content: '';
  position: absolute;
  left: var(--kastor-window-cut);
  right: var(--kastor-window-cut);
  top: 1px;
  height: 2px;
  background: rgba(255,255,255,.22);
}
main.page-home .hero-overlay--window .hero-overlay__video-toggle {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  bottom: calc(var(--kastor-window-depth) + 12px);
  right: clamp(14px, 3vw, 36px);
  z-index: 5;
  padding: 9px 14px;
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 999px;
  color: #fff;
  background: rgba(20,20,20,.55);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  font-family: inherit;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
main.page-home .hero-overlay--window .hero-overlay__video-toggle[hidden] { display: none !important; }
main.page-home .hero-overlay--window .hero-overlay__video-toggle:hover,
main.page-home .hero-overlay--window .hero-overlay__video-toggle:focus-visible {
  background: var(--kastor-window-red);
  border-color: #fff;
}
main.page-home .hero-overlay--window .hero-overlay__video-toggle:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
@media (max-width: 767px) {
  main.page-home > .hero-overlay.hero-overlay--window {
    --kastor-window-depth: 21px;
    --kastor-window-cut: clamp(30px,9vw,48px);
    padding-bottom: 38px !important;
  }
  /* V39 masquait le hero dans l'app. V40 rétablit uniquement celui-ci.
   * Conserver sa hauteur compacte et épargner le footer mobile. */
  html.kastor-native-app main.page-home > .hero-overlay.hero-overlay--window {
    display: flex !important;
    align-items: flex-end !important;
    width: 100% !important;
    min-height: 0 !important;
    height: 218px !important;
    padding: 0 !important;
  }
  html.kastor-native-app main.page-home .hero-overlay--window .hero-overlay__content {
    padding-bottom: calc(var(--kastor-window-depth) + 13px) !important;
  }
  main.page-home .hero-overlay--window .hero-overlay__video-toggle {
    top: 12px;
    bottom: auto;
    right: 12px;
    padding: 8px 10px;
    font-size: 12px;
  }
  main.page-home .hero-overlay--window .hero-overlay__frame-bottom::before { height: 1px; }
  /* Le CTA, le texte et les boutons existants gardent priorité sur le décor. */
  main.page-home .hero-overlay--window .hero-overlay__content { padding-bottom: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  main.page-home .hero-overlay--window .hero-overlay__video-toggle { transition: none; }
}
