/*!
 * Reepost Video Carrousel
 * CSS externalisé (Étape 8A-3a)
 *
 * Objectif : contenir les styles "base" communs à toutes les instances.
 * Les styles dépendants des réglages (dimensions, couleurs, typo, etc.)
 * restent pour l’instant en inline/Elementor selectors.
 */

/* Root — aspect-ratio overridden en mode adaptif par les styles inline du widget */
.reepost-video-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  aspect-ratio: auto;
}

/* Slides — remplissent tout l’espace du carrousel (inset pour éviter tout décalage) */
.reepost-video-carousel .reepost-carousel-item {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--reepost-z-content);
  opacity: 0;
  transition: opacity var(--reepost-transition-duration, 0.5s) var(--reepost-transition-easing, ease);
}

.reepost-video-carousel .reepost-carousel-item.active {
  opacity: 1;
  z-index: var(--reepost-z-hitarea);
}

/* Vidéo — remplit tout l’item : étirement par top/bottom (hauteur) et display:block pour forcer la hauteur */
.reepost-video-carousel .reepost-carousel-video {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  min-width: 100% !important;
  min-height: 100% !important;
  aspect-ratio: unset !important;
  object-fit: cover;
  z-index: var(--reepost-z-media);
}

/* Fullscreen mode (slide) — commun à tous les types de dimensions (adaptif / prédéfini) */
.reepost-video-carousel .reepost-carousel-item.is-fullscreen {
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  inset: auto !important;
  background: #000;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

/* Plein écran : ratio natif de la vidéo avec bandes noires (blanking), identique en adaptif et prédéfini */
.reepost-video-carousel .reepost-carousel-item.is-fullscreen .reepost-carousel-video {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  aspect-ratio: unset !important;
  object-fit: contain !important;
  background: #000;
  display: block !important;
}

.reepost-video-carousel .reepost-carousel-item.is-fullscreen .reepost-carousel-title,
.reepost-video-carousel .reepost-carousel-item.is-fullscreen .reepost-carousel-description {
  display: none;
}

/* Roue de chargement (affichée tant que la vidéo n’est pas prête) */
.reepost-video-carousel .reepost-video-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  z-index: var(--reepost-z-content);
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.reepost-video-carousel .reepost-video-loading.is-hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.reepost-video-carousel .reepost-video-loading-spinner {
  box-sizing: border-box;
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: reepost-video-spin 0.85s linear infinite;
}

@keyframes reepost-video-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Overlay text */
.reepost-video-carousel .reepost-carousel-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  z-index: var(--reepost-z-overlay);
  pointer-events: none;
}

.reepost-video-carousel .reepost-carousel-content {
  color: #fff;
  pointer-events: auto;
}

.reepost-video-carousel .reepost-carousel-title {
  margin: 0;
}

/* Navigation */
.reepost-video-carousel .reepost-carousel-nav-button {
  position: absolute;
  top: var(--reepost-nav-top, 50%);
  bottom: var(--reepost-nav-bottom, auto);
  transform: translateY(var(--reepost-nav-translate, -50%));
  z-index: var(--reepost-z-controls);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.reepost-video-carousel .reepost-carousel-nav-button.prev {
  left: 20px;
  right: auto;
}

.reepost-video-carousel .reepost-carousel-nav-button.next {
  right: 20px;
  left: auto;
}

.reepost-video-carousel .reepost-carousel-nav-button svg {
  fill: currentColor;
}

/* Focus visible (clavier) */
.reepost-video-carousel .reepost-carousel-nav-button:focus {
  outline: none;
}
.reepost-video-carousel .reepost-carousel-nav-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.95);
  outline-offset: 3px;
}

/* Responsive nav mode switching (classes toggled by JS) */
.reepost-video-carousel.nav-mode-icons .reepost-carousel-nav-button.nav-title {
  display: none;
}

.reepost-video-carousel.nav-mode-titles .reepost-carousel-nav-button:not(.nav-title) {
  display: none;
}

.reepost-video-carousel.nav-hide-prev .reepost-carousel-nav-button.prev {
  display: none;
}

.reepost-video-carousel.nav-hide-next .reepost-carousel-nav-button.next {
  display: none;
}

.reepost-video-carousel .reepost-carousel-nav-caption:empty {
  display: none;
}

.reepost-video-carousel .reepost-carousel-nav-button:not(.nav-title):hover {
  transform: translateY(var(--reepost-nav-translate, -50%))
    scale(var(--reepost-nav-icons-hover-scale, 1.1)) !important;
}

.reepost-video-carousel .reepost-carousel-nav-button.nav-title:hover {
  transform: translateY(var(--reepost-nav-translate, -50%))
    scale(var(--reepost-nav-titles-hover-scale, 1.05)) !important;
}

/* Titles nav layout */
.reepost-video-carousel .reepost-carousel-nav-button.nav-title {
  width: auto !important;
  height: auto !important;
  padding: var(--reepost-nav-title-padding, 10px 14px);
  gap: var(--reepost-nav-title-gap, 6px);
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  max-width: var(--reepost-nav-title-max-width, 44%);
  text-align: left;
}

.reepost-video-carousel .reepost-carousel-nav-button.next.nav-title {
  align-items: flex-end;
  text-align: right;
}

.reepost-video-carousel .reepost-carousel-nav-caption {
  opacity: 0.85;
  white-space: nowrap;
}

.reepost-video-carousel .reepost-carousel-nav-title {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Pagination */
.reepost-video-carousel .reepost-carousel-pagination {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  z-index: var(--reepost-z-controls);
  align-items: center;
  justify-content: center;
}

.reepost-video-carousel .reepost-carousel-pagination-dot {
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s ease;
  outline: none;
}

.reepost-video-carousel .reepost-carousel-pagination-dot:focus {
  outline: none;
}
.reepost-video-carousel .reepost-carousel-pagination-dot:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.95);
  outline-offset: 3px;
}

.reepost-video-carousel .reepost-carousel-pagination-dot:hover {
  opacity: 0.8;
  transform: scale(1.2);
}

.reepost-video-carousel .reepost-carousel-pagination-dot.active {
  background: #fff;
  border-color: #fff;
}

/* Custom video controls */
.reepost-video-carousel .reepost-custom-video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(0, 0, 0, 0.4) 50%,
    transparent 100%
  );
  display: flex;
  align-items: center;
  z-index: var(--reepost-z-controls);
  opacity: 1;
  visibility: visible;
}

.reepost-video-carousel .reepost-custom-video-controls button {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.reepost-video-carousel .reepost-custom-video-controls button:hover {
  opacity: 0.7;
}

.reepost-video-carousel .reepost-custom-video-controls button svg {
  fill: currentColor;
}

.reepost-video-carousel .reepost-video-progress-wrapper {
  flex: 1;
  position: relative;
  cursor: pointer;
}

.reepost-video-carousel .reepost-video-progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: var(--reepost-z-hitarea);
}

.reepost-video-carousel .reepost-video-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  overflow: hidden;
}

.reepost-video-carousel .reepost-video-progress-filled {
  height: 100%;
  background: #fff;
  width: 0%;
  transition: width 0.1s linear;
}

.reepost-video-carousel .reepost-video-time {
  color: #fff;
  font-family: monospace;
  white-space: nowrap;
}

/* Volume — même apparence que l’audio player (reepost-sound-player) */
.reepost-video-carousel .reepost-video-volume-wrapper {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100px;
  min-width: 0;
  overflow: hidden;
}

.reepost-video-carousel .reepost-video-volume {
  flex: 1;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

/* Range thumbs using CSS vars */
.reepost-video-carousel .reepost-video-progress::-webkit-slider-thumb {
  appearance: none;
  width: var(--reepost-progress-thumb-size, 12px);
  height: var(--reepost-progress-thumb-size, 12px);
  background: transparent;
  cursor: pointer;
}
.reepost-video-carousel .reepost-video-progress::-moz-range-thumb {
  width: var(--reepost-progress-thumb-size, 12px);
  height: var(--reepost-progress-thumb-size, 12px);
  background: transparent;
  border: none;
  cursor: pointer;
}

.reepost-video-carousel .reepost-video-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: var(--reepost-volume-thumb-size, 10px);
  height: var(--reepost-volume-thumb-size, 10px);
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
}
.reepost-video-carousel .reepost-video-volume::-moz-range-thumb {
  width: var(--reepost-volume-thumb-size, 10px);
  height: var(--reepost-volume-thumb-size, 10px);
  background: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

