/* =====================================================
   0. VARIABLES ROOT & STYLES GÉNÉRAUX DE LA PAGE VIDÉO
   ===================================================== */
:root {
  --video-bg: #fff;
  --video-card-bg: #141414;
  --video-text: #000;
  --video-accent: #e50914;
  --video-hover: #1f1f1f;
  --shadow-dark: 0 10px 20px rgba(0,0,0,0.5);
  /* Fallback pour --gris-texte, nécessaire dans les blocs ci-dessous */
  --gris-texte: #555555; 
}

body {
  background-color: var(--video-bg);
  color: var(--video-text);
}

.video-page-wrapper {
  background-color: var(--video-bg);
  min-height: 100vh;
  padding-bottom: 40px;
}

/* --- CATÉGORIES ET LAYOUT GÉNÉRAL --- */
.video-categories-wrapper {
  margin-top: 0px;
  position: relative;
  z-index: 2;
  padding-bottom: 0px;
}

.video-category {
  margin-bottom: 0px;
  margin-top: 40px;
  padding: 0 4%;
}

.category-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 20px;
  margin-top: 20px;
  color: #000;
  text-align: left;
  border-left: 4px solid var(--video-accent);
  padding-left: 10px;
}

/* =====================================================
   1. HERO SECTION & CALL TO ACTION
   ===================================================== */
.video-hero {
  position: relative;
  height: 50vh;
  min-height: 400px;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.hero-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #0a0a0a 0%, rgba(10,10,10,0.8) 40%, rgba(10,10,10,0.2) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 650px;
  padding-left: 15%;
  margin-top: 40px;
}

.tag-hero {
  display: inline-block;
  background-color: rgba(255,255,255,0.2);
  color: #fff;
  padding: 5px 10px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 15px;
  backdrop-filter: blur(5px);
  border-left: 3px solid var(--video-accent);
}

.hero-content h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.hero-content p {
  font-size: 1.1rem;
  color: #ddd;
  margin-bottom: 30px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions {
  display: flex;
  gap: 15px;
}

.btn-play, .btn-info {
  border: none;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.2s, opacity 0.2s;
}

.btn-play {
  background-color: #fff;
  color: #000;
}

.btn-play:hover {
  background-color: #e6e6e6;
  transform: scale(1.05);
}

.btn-info {
  background-color: rgba(109, 109, 110, 0.7);
  color: #fff;
  backdrop-filter: blur(4px);
}

.btn-info:hover {
  background-color: rgba(109, 109, 110, 0.4);
}

/* =====================================================
   2. GRID LAYOUT & CARDS (GÉNÉRIQUE)
   ===================================================== */

/* --- LAYOUTS --- */
.video-grid-layout {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Toujours 2 colonnes */
  gap: 20px;
  width: 100%;
}

/* --- CARTE VIDÉO GÉNÉRIQUE --- */
.video-card {
  background: transparent;
  cursor: pointer;
  transition: transform 0.3s ease;
  position: relative;
  width: 100%;
}

.video-card:hover {
  transform: translateY(-5px);
}

.video-thumb-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.video-thumb-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s;
}

.video-card:hover img {
  opacity: 0.7;
}

/* Contenu de l'overlay (s'applique par défaut aux titres DANS .video-info) */
.video-info h3 {
  font-size: 0.95rem;
  margin-top: 10px;
  color: #ccc;
  font-weight: 500;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-card:hover .video-info h3 {
  color: #fff;
}

/* Description cachée par défaut pour les autres cartes */
.video-description {
  display: none;
}

/* --- OVERLAYS et INDICATEURS --- */
.play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  width: 50px;
  height: 50px;
  border: 2px solid #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: all 0.3s ease;
  background: rgba(0,0,0,0.5);
  z-index: 3;
}

.video-card:hover .play-overlay {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.video-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.8);
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 3;
}

/* =====================================================
   3. STYLE SPÉCIFIQUE DE LA CARTE PRINCIPALE (OVERLAY ÉTENDU)
   ===================================================== */
.video-grid-layout .video-card:first-child {
  grid-column: 1 / -1; 
  margin-bottom: 10px;
  position: relative; 
  overflow: hidden;
  border-radius: 6px;
}

.video-grid-layout .video-card:first-child .video-thumb-wrapper {
  aspect-ratio: 16/9;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  height: 100%; 
}

.video-grid-layout .video-card:first-child .video-info {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 40px 20px 20px 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 60%, rgba(0,0,0,0) 100%);
  z-index: 2;
  pointer-events: none; 
}

.video-grid-layout .video-card:first-child h3 {
  font-size: 1.8rem; 
  color: #fff;
  margin: 0 0 10px 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.video-card:first-child .video-description {
  display: block;
  font-size: 1rem;
  color: #ddd;
  line-height: 1.4;
  max-width: 800px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-card:first-child:hover .play-overlay {
   opacity: 1;
   transform: translate(-50%, -50%) scale(1.2); 
}

/* =====================================================
   4. STYLE SPÉCIFIQUE DES CARTES EN COLONNE (Titre en dessous)
   ===================================================== */
.video-card-column {
  /* Rend la carte flexible pour empiler vignette et texte */
  display: flex; 
  flex-direction: column;
  background-color: transparent; 
  height: auto; 
}

/* Cacher le bloc .video-info (destiné à l'overlay) dans les cartes en colonne */
.video-card-column .video-info {
  display: none;
}

/* Conteneur de texte sous la vignette */
.video-info-below {
  padding: 8px 0 0 0; 
  flex-grow: 1; 
}

/* Style du Titre pour le bloc en dessous */
.video-info-below h3 {
  font-size: 1rem;
  color: #000; 
  font-weight: 700;
  margin-top: 5px;
  margin-bottom: 5px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Style de la Description pour le bloc en dessous */
.video-info-below .video-description {
  display: block; 
  font-size: 0.85rem;
  color: var(--gris-texte);
  margin-top: 5px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Effet de survol sur le titre (pour l'accessibilité/feedback) */
.video-card-column:hover .video-info-below h3 {
    color: var(--video-accent); 
}

/* =====================================================
   5. CAROUSEL SHORTS
   ===================================================== */

.shorts-section {
  padding: 0 5%; 
  margin-top: 50px; 
  margin-bottom: 0px;
}

.carousel-wrapper {
  position: relative;
  margin-bottom: 0px;
}

.video-scroll-container {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  margin-left: -25px;
  padding: 0px 0;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.video-scroll-container::-webkit-scrollbar { display: none; }

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  width: 40px;
  height: 100%;
  cursor: pointer;
  z-index: 5;
  font-size: 2rem;
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel-wrapper:hover .nav-arrow { opacity: 1; }
.nav-arrow.left { left: 0; }
.nav-arrow.right { right: 0; }

.video-scroll-container .video-card {
  flex: 0 0 280px;
}

.short-card {
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.short-card:hover {
  transform: translateY(-5px);
}

.short-thumb-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 9/16;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  border: 2px solid transparent;
  transition: border-color 0.3s;
}

.short-card:hover .short-thumb-wrapper { border-color: #fff; }

.short-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.short-title-below {
  margin-top: 10px;
  font-size: 1rem;
  color: #000;
  font-weight: 600;
  line-height: 1.3;
  padding: 5px;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.short-card:hover .short-title-below { color: #fff; }


/* =====================================================
   6. MODALE VIDÉO & SHORTS
   ===================================================== */

.modal-overlay { 
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
  background: rgba(0,0,0,0.95); 
  z-index: 10000; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  opacity: 0; 
  pointer-events: none; 
  transition: opacity 0.3s ease; 
}

.modal-overlay.active { 
  opacity: 1; 
  pointer-events: auto; 
}

.modal-content { 
  width: 90%; 
  max-width: 1000px; 
  position: relative; 
  background: #000; 
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.1); 
}

.modal-close { 
  position: absolute; 
  top: -40px; 
  right: 0; 
  background: none; 
  border: none; 
  color: #fff; 
  font-size: 2rem; 
  cursor: pointer; 
}

/* Conteneur de l'iframe classique 16:9 */
.video-responsive-container { 
  position: relative; 
  padding-bottom: 56.25%; 
  height: 0; 
  overflow: hidden; 
}

.video-responsive-container iframe { 
  position: absolute; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%; 
}

#video-modal.active { 
  display: flex !important; 
  opacity: 1 !important; 
  pointer-events: auto !important; 
}

/* Conteneur du contenu de la modale */
#video-modal .modal-content { 
  background: #000; 
  width: 100%; 
  max-width: 100vw; 
  max-height: 95vh; 
  padding: 0; 
  border: none; 
  display: flex; 
  flex-direction: column; 
}

#video-modal .modal-close { 
  z-index: 1000; 
  top: 30px; 
  right: 20px; 
  background: rgba(0,0,0,0.6); 
  width: 40px; 
  height: 40px; 
  border-radius: 50%; 
  color: white; 
  font-size: 24px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  border: 1px solid rgba(255,255,255,0.2); 
  cursor: pointer; 
}

/* Shorts spécifique */
.shorts-modal-scroll-wrapper { 
  flex: 1; 
  width: 100%; 
  height: 100%; 
  overflow-y: scroll; 
  scroll-snap-type: y mandatory; 
  -webkit-overflow-scrolling: touch; 
  scrollbar-width: none; 
}

.shorts-modal-scroll-wrapper::-webkit-scrollbar { 
  display: none; 
}

.short-slide { 
  width: 100%; 
  height: 100vh; 
  scroll-snap-align: start; 
  display: flex; 
  justify-content: center; 
  align-items: center; 
  background: #000; 
  position: relative; 
}

.short-slide-inner { 
  width: 100%; 
  height: 100%; 
  max-width: 500px; 
  aspect-ratio: 9/16; 
  position: relative; 
}

.short-slide iframe { 
  width: 100%; 
  height: 100%; 
  display: block; 
  border: none; 
}

/* =====================================================
   7. APPEL À L'ACTION ARTICLES (STYLE H1)
   ===================================================== */
.articles-callout-title {
    font-size: clamp(1.2rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
    margin: 30px auto 30px auto; 
    max-width: 90%;
    color: var(--video-text); 
    text-shadow: 1px 1px 3px rgba(0,0,0,0.1); 
}

.articles-callout-title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}

.articles-callout-title a:hover {
    color: var(--video-accent);
}

/* =====================================================
   8. RESPONSIVE MOBILE (@media 768px)
   ===================================================== */

@media (max-width: 768px) {
  .video-hero { 
    height: 50vh; 
  }
  
  .hero-content h1 { 
    font-size: 1.8rem; 
  }
  
  .video-categories-wrapper { 
    margin-top: 0; 
  }
  
  .nav-arrow { 
    display: none; 
  }
  
  .video-grid-layout {
    grid-template-columns: 1fr 1fr; /* 2 colonnes */
    gap: 30px;
  }

  .video-grid-layout .video-card:first-child h3 {
    font-size: 1.2rem; /* Titre plus petit sur mobile */
  }
  
  .video-grid-layout .video-card:first-child .video-description {
    font-size: 0.85rem; /* Description plus petite */
    -webkit-line-clamp: 3; /* 3 lignes sur mobile */
  }

  .video-grid-layout .video-info h3 {
    font-size: 0.85rem; 
    margin-top: 6px;
  }
  
  /* Ajustements spécifiques aux colonnes sur mobile */
  .video-card-column .video-info-below .video-description {
    display: none; 
  }
    
  .video-info-below {
    padding: 5px 0 0 0;
  }
    
  .video-info-below h3 {
    font-size: 0.9rem;
  }

  .short-card { 
    flex: 0 0 160px; 
  }
  
  .short-title-below { 
    font-size: 1rem; 
  }
}
