/* Vidéos des annonces sur la page d'accueil (01/12/2026) : bouton du bandeau, bulle flottante, pop-up.
   Chargé sur l'accueil seulement, et seulement s'il existe une vidéo prête (vues/_videos-accueil.php).
   Couleurs et typographie = variables du site (commun.css + site.css). Tout est caché sans JavaScript (hidden). */

/* ---------------------------------------------------------------- commun */
.vid-ico { flex: none; }
.vid-etiq { display: inline-block; padding: .18rem .55rem; border-radius: 999px; background: var(--accent-bouton); color: #fff;
  font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; line-height: 1.5; white-space: nowrap; }
.vid-duree { display: inline-block; padding: .1rem .45rem; border-radius: 6px; background: rgb(0 0 0 / 68%); color: #fff;
  font-size: .74rem; font-weight: 700; line-height: 1.5; font-variant-numeric: tabular-nums; }
.vid-rond { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 999px; background: rgb(20 20 20 / 72%); color: #fff; font: inherit; cursor: pointer; }
.vid-rond:hover { background: rgb(60 60 60 / 85%); border-color: #fff; }
.vid-son .vid-ico--son, .vid-son[aria-pressed="true"] .vid-ico--muet { display: none; }
.vid-son[aria-pressed="true"] .vid-ico--son { display: block; }
html.vid-fige, html.vid-fige body { overflow: hidden; }
.vid-pop__scene :focus-visible { outline-color: #fff; }

/* ---------------------------------------------------------------- bouton du bandeau d'accueil */
.vid-hero { margin: 1rem 0 0; }
.vid-hero[hidden] { display: none; }
.vid-hero__bouton { display: inline-flex; align-items: center; gap: .65rem; min-height: 48px; padding: .35rem 1.1rem .35rem .4rem; border: 1px solid rgb(255 255 255 / 30%);
  border-radius: 999px; background: rgb(0 0 0 / 55%); color: #fff; font: inherit; font-weight: 700; cursor: pointer; text-align: left; }
.vid-hero__bouton:hover { background: rgb(0 0 0 / 78%); border-color: #fff; }
.vid-hero__rond { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; background: var(--accent-bouton); }

/* ---------------------------------------------------------------- bulle flottante */
.vid-bulle { position: fixed; z-index: 60; right: 6px; bottom: calc(8px + env(safe-area-inset-bottom)); width: 72px; height: 106px;
  transition: opacity .25s ease, transform .35s cubic-bezier(.2, .9, .3, 1.2), visibility 0s; }
.vid-bulle[hidden] { display: none; }
.vid-bulle.est-ecartee, .vid-bulle.arrive { opacity: 0; visibility: hidden; transform: translateY(24px) scale(.9); pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s; }
.vid-bulle__ouvrir { position: relative; display: block; width: 100%; height: 100%; padding: 0; overflow: hidden; border: 3px solid var(--accent); border-radius: 16px;
  background: var(--sombre); color: #fff; cursor: pointer; font: inherit; box-shadow: 0 10px 30px rgb(0 0 0 / 40%); }
.vid-bulle__ouvrir img, .vid-bulle__ouvrir video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vid-bulle__ouvrir video { opacity: 0; pointer-events: none; }
.vid-bulle__ouvrir video.est-visible { opacity: 1; }
.vid-bulle__legende { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; gap: .2rem; padding: 1.1rem .2rem .35rem;
  background: linear-gradient(transparent, rgb(0 0 0 / 88%)); font-size: .66rem; font-weight: 800; white-space: nowrap; }
.vid-bulle__fermer { position: absolute; top: -9px; right: -3px; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 2px solid #fff;
  border-radius: 999px; background: var(--sombre); color: #fff; cursor: pointer; box-shadow: 0 2px 8px rgb(0 0 0 / 35%); }
.vid-bulle__fermer::before { content: ""; position: absolute; inset: -7px; }
@media (min-width: 768px) {
  .vid-bulle { right: 24px; bottom: 24px; width: 158px; height: 236px; }
  .vid-bulle__legende { font-size: .86rem; gap: .35rem; padding-bottom: .55rem; }
  .vid-bulle__fermer { top: -10px; right: -4px; width: 30px; height: 30px; }
}
/* La bulle reste en continu : le pied de page réserve la place pour que ses derniers liens restent lisibles. */
@media (max-width: 767px) { html.vid-bulle-la .pied { padding-bottom: calc(118px + env(safe-area-inset-bottom)); } }
html.vid-fige .vid-bulle { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .vid-bulle, .vid-bulle.est-ecartee, .vid-bulle.arrive { transition: none; transform: none; } }

/* ---------------------------------------------------------------- pop-up */
.vid-pop { position: fixed; inset: 0; width: 100%; max-width: 100%; height: 100%; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0; overflow: hidden; background: #fff; color: var(--encre); }
.vid-pop::backdrop { background: rgb(8 9 10 / 76%); }
.vid-pop__boite { display: grid; height: 100%; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "tete" "scene" "fiche" "vignettes"; }
.vid-pop__tete { grid-area: tete; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: max(.5rem, env(safe-area-inset-top)) .75rem .5rem 1rem; border-bottom: 3px solid var(--accent); }
.vid-pop__tete h2 { margin: 0; font-size: 1.15rem; }
.vid-pop__tete .vid-rond { background: var(--fond-teinte); border-color: var(--bord); color: var(--encre); }
.vid-pop__tete .vid-rond:hover { border-color: var(--accent-texte); color: var(--accent-texte); }
.vid-pop__scene { grid-area: scene; position: relative; min-height: 0; overflow: hidden; isolation: isolate; background: #000; }
.vid-pop__fond { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(34px) brightness(.45) saturate(1.3); transform: scale(1.25); }
.vid-pop__fond[hidden] { display: none; }
.vid-pop__scene video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: transparent; }
.vid-pop__fiche { grid-area: fiche; min-width: 0; padding: .7rem 1rem .2rem; }
.vid-pop__sur { margin: 0 0 .2rem; font-size: .84rem; color: var(--encre-2); }
.vid-pop__sur .vid-etiq { margin-right: .35rem; }
.vid-pop__fiche h3 { margin: 0; font-size: 1.12rem; line-height: 1.3; }
.vid-pop__prix { margin: 0; }
.vid-pop__prix strong { font-size: 1.35rem; font-weight: 800; }
.vid-pop__prix small { font-size: .8rem; color: var(--encre-2); }
.vid-pop__actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .5rem; }
.vid-pop__actions .bouton { justify-content: center; gap: .4rem; min-height: 46px; padding-inline: .4rem; line-height: 1.25; text-align: center; font-size: .94rem; white-space: nowrap; }
.vid-pop__son { background: #fff; color: var(--encre); border-color: var(--bord); }
.vid-pop__son:hover { background: var(--fond-teinte); color: var(--encre); }
.vid-pop__vignettes { grid-area: vignettes; list-style: none; display: grid; grid-auto-flow: column; grid-auto-columns: 82px; gap: .6rem; margin: 0;
  padding: .7rem 1rem max(.75rem, env(safe-area-inset-bottom)); overflow-x: auto; scroll-padding-inline: 1rem; scrollbar-width: none; }
.vid-pop__vignettes::-webkit-scrollbar { display: none; }
.vid-pop__vignettes li { min-width: 0; }
.vid-vignette { display: grid; align-content: start; gap: .25rem; width: 100%; padding: 0; border: 0; background: none; color: var(--encre); font: inherit; text-align: left; cursor: pointer; }
.vid-vignette__image { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 10px; background: var(--sombre); outline: 1px solid var(--bord); outline-offset: -1px; }
.vid-vignette__image img { width: 100%; height: 100%; object-fit: cover; }
.vid-vignette__vide { display: grid; place-items: center; width: 100%; height: 100%; color: #fff; opacity: .8; }
.vid-vignette__image::after { content: ""; position: absolute; inset: 0; border-radius: 10px; border: 3px solid transparent; }
.vid-vignette:hover .vid-vignette__image::after { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.vid-vignette[aria-current="true"] .vid-vignette__image::after { border-color: var(--accent); }
.vid-vignette__image .vid-duree { position: absolute; right: 4px; bottom: 4px; z-index: 1; font-size: .68rem; padding: 0 .3rem; }
.vid-vignette__nom { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: .74rem; font-weight: 600; line-height: 1.25; }
.vid-vignette[aria-current="true"] .vid-vignette__nom { color: var(--accent-texte); font-weight: 800; }
@media (min-width: 900px) and (min-height: 560px) {
  .vid-pop { inset: 0; margin: auto; width: min(1080px, calc(100vw - 48px)); height: min(680px, calc(100dvh - 48px)); border-radius: 18px; box-shadow: 0 30px 80px rgb(0 0 0 / 50%); }
  .vid-pop__boite { grid-template-columns: minmax(0, 1fr) 420px; grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas: "tete tete" "scene fiche" "scene vignettes"; }
  .vid-pop__tete { padding: .65rem .85rem .65rem 1.25rem; }
  .vid-pop__tete h2 { font-size: 1.3rem; }
  .vid-pop__fiche { padding: 1.1rem 1.25rem .25rem; }
  .vid-pop__fiche h3 { font-size: 1.3rem; }
  .vid-pop__prix strong { font-size: 1.6rem; }
  .vid-pop__vignettes { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-columns: auto; align-content: start;
    gap: .65rem; padding: .9rem 1.25rem 1.1rem; overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; }
  .vid-vignette__image { aspect-ratio: 3 / 4; }
}
@media (orientation: landscape) and (max-height: 559.98px) {
  .vid-pop__boite { grid-template-columns: minmax(0, 1fr) minmax(250px, 42%); grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas: "tete tete" "scene fiche" "scene vignettes"; }
  .vid-pop__vignettes { align-content: end; }
}
