:root {
  --bg-color: #121212;
  --surface-color: #1e11e1e;
  --surface-hover: #2c2c2c;
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0a0;
  --accent-color: #bb86fc;
  --accent-glow: rgba(187, 134, 252, 0.2);
  --border-color: #333333;
}

/* ============================================================
   VIDÉO D'ARRIÈRE-PLAN
   ============================================================ */
.video-background-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  overflow: hidden;
  background-color: #000;
}

.video-background {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  opacity: 0.2;
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: -1;
}

@media (prefers-reduced-motion: reduce) {
  .video-background { display: none; }
  .video-overlay { background: var(--bg-color); }
}

@media (max-width: 768px) {
  .video-background { display: none; }
  .video-overlay { background: var(--bg-color); }
}

body {
  background-color: transparent;
  color: var(--text-primary);
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
}

/* --- HEADER ACCUEIL --- */
.main-header {
  margin-bottom: 40px;
}

.header-image-box {
  max-width: 600px;
  margin: 0 auto;
}

.header-img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.header-img:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
}

h1 {
  color: var(--accent-color);
  text-shadow: 0 0 15px var(--accent-glow);
  font-size: 2.2rem;
  margin-top: 30px;
  margin-bottom: 10px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.2rem;
  margin: 0 0 30px 0;
  font-style: italic;
}

/* --- BLOC INTRO TEXTE DÉPLIABLE --- */
.intro-block {
  margin-top: 30px;
}

.intro-text-container {
  background: rgba(255, 255, 255, 0.04);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-width: 800px;
  margin: 0 auto;
}

.accueil-long-text {
  transition: max-height 0.5s ease, opacity 0.5s ease;
  overflow: hidden;
  opacity: 0.95;
}

.accueil-long-text.collapsed {
  max-height: 120px;
}

.accueil-long-text p {
  margin: 0 0 15px 0;
  line-height: 1.8;
  color: var(--text-secondary);
  font-size: 1rem;
  text-align: justify;
}

.accueil-long-text p:last-child {
  margin-bottom: 0;
}

.accueil-toggle-btn {
  background: none;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  padding: 8px 20px;
  border-radius: 30px;
  cursor: pointer;
  margin-top: 18px;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.accueil-toggle-btn:hover {
  background: var(--accent-color);
  color: #000;
  transform: translateY(-2px);
}

/* --- SECTIONS --- */
.act-section {
  margin-top: 50px;
}

.act-title.centered {
  text-align: center;
  color: var(--accent-color);
  font-size: 1.8rem;
  margin-bottom: 30px;
  position: relative;
  padding-bottom: 15px;
}

.act-title.centered::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--accent-color);
  border-radius: 2px;
}

/* --- GALERIE ACCUEIL (alignée à gauche, 3 colonnes) --- */
.gallery-home {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

/* --- GALERIE ACCUEIL CENTRÉE (pour 2 cartes) --- */
.gallery-home-centered {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.gallery-home-centered .media-card-home {
  flex: 0 0 calc(33.333% - 20px);
  max-width: calc(33.333% - 20px);
}

.media-card-home {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 18px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  height: 100%;
}

.media-card-home:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.20);
}

.media-card-home .img-wrapper {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  flex-shrink: 0;
}

.media-card-home .img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.media-card-home:hover .img-wrapper img {
  transform: scale(1.05);
}

.media-card-home .play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.media-card-home:hover .play-overlay {
  opacity: 1;
}

.media-card-home .card-title {
  margin: 0;
  padding: 16px 16px 6px 16px;
  color: var(--accent-color);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.media-card-home .card-interpretation {
  margin: 0;
  padding: 0 16px 16px 16px;
  line-height: 1.5;
  opacity: 0.85;
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.video-trigger {
  cursor: pointer;
}

/* ============================================================
   GALERIES HORIZONTALES (Business & Documents)
   ============================================================ */
.gallery-wrapper {
  position: relative;
  margin-top: 10px;
  overflow: hidden;
}

/* Style commun pour les deux galeries */
.business-gallery,
.documents-gallery {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  gap: 20px;
  padding: 20px 10px;
  cursor: grab;
  flex-direction: row;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
}

.business-gallery:active,
.documents-gallery:active {
  cursor: grabbing;
}

/* Scrollbar personnalisée */
.business-gallery::-webkit-scrollbar,
.documents-gallery::-webkit-scrollbar {
  height: 6px;
}

.business-gallery::-webkit-scrollbar-track,
.documents-gallery::-webkit-scrollbar-track {
  background: var(--border-color);
  border-radius: 10px;
}

.business-gallery::-webkit-scrollbar-thumb,
.documents-gallery::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 10px;
}

/* Cartes pour les galeries horizontales (format 16/9, 220px de large) */
.business-gallery .media-card,
.documents-gallery .media-card {
  flex: 0 0 220px;
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 15px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
}

.business-gallery .media-card:hover,
.documents-gallery .media-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
  border-color: var(--accent-color);
}

.business-gallery .media-card .img-wrapper,
.documents-gallery .media-card .img-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
}

.business-gallery .media-card .img-wrapper img,
.documents-gallery .media-card .img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.business-gallery .media-card:hover .img-wrapper img,
.documents-gallery .media-card:hover .img-wrapper img {
  transform: scale(1.05);
}

.business-gallery .media-card .card-title,
.documents-gallery .media-card .card-title {
  color: var(--accent-color);
  margin: 10px 0 5px;
  font-size: 1rem;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.business-gallery .media-card .card-year,
.documents-gallery .media-card .card-year {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 5px 0 0;
}

/* Indicateur PDF sur l'image */
.pdf-icon {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 1.8rem;
  opacity: 0.8;
  background: rgba(0,0,0,0.6);
  border-radius: 50%;
  padding: 6px;
  pointer-events: none;
  transition: opacity 0.2s;
}

.image-wrapper:hover .pdf-icon {
  opacity: 1;
}

.pdf-content-link {
  color: var(--accent-color);
  text-decoration: none;
  border-bottom: 1px dashed var(--accent-color);
  transition: all 0.2s;
}

.pdf-content-link:hover {
  color: #000;
  background-color: var(--accent-color);
  border-bottom: 1px solid transparent;
  padding: 2px 6px;
  border-radius: 20px;
}

/* Lien dans les cartes Business (pour Représentations In Situ) */
.business-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}

/* Carte indisponible */
.media-card.unavailable {
  opacity: 0.6;
  cursor: not-allowed;
}

.media-card.unavailable:hover {
  transform: none;
  border-color: var(--border-color);
}

/* Boutons de défilement */
.scroll-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 15px;
}

.scroll-btn {
  background: var(--surface-color);
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  padding: 8px 16px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s;
}

.scroll-btn:hover {
  background: var(--accent-color);
  color: #000;
}

/* --- MODALE POUR LES DOCUMENTS ET BUSINESS --- */
.modal {
  display: none;
  position: fixed;
  z-index: 10001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: var(--surface-color);
  border-radius: 12px;
  width: 95%;
  max-width: 1000px;
  position: relative;
  border: 1px solid var(--accent-color);
  max-height: 90vh;
  display: flex;           /* Ajout */
  flex-direction: column; /* Ajout */
  overflow: hidden;       /* Changé : plus d'auto ici */
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background: var(--surface-color);
  z-index: 10;
  flex-shrink: 0;         /* Empêche l'en-tête de rétrécir */
}

.modal-header-title {
  flex: 1;
  text-align: center;
  color: var(--accent-color);
  font-size: 1.3rem;
  margin: 0;
  order: 1;
}

.close-btn {
  font-size: 32px;
  font-weight: bold;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
  order: 2;
}

.close-btn:hover {
  color: var(--accent-color);
}

.modal-layout {
  display: flex;
  gap: 30px;
  padding: 20px;
  align-items: flex-start;
  overflow-y: auto;       /* Le scroll se fait ici */
  flex: 1;                /* Prend tout l'espace restant */
}

.modal-sidebar {
  flex: 0 0 220px;
  max-width: 40%;
  background: rgba(0, 0, 0, 0.3);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.modal-sidebar .image-wrapper {
  margin-bottom: 20px;
  width: 100%;
  display: flex;
  justify-content: center;
}

.modal-sidebar .modal-book-image {
  max-width: 360px;
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.modal-sidebar .sidebar-info {
  width: 100%;
}

.modal-sidebar .sidebar-label {
  color: var(--accent-color);
  font-size: 0.75rem;
  font-weight: bold;
  margin: 0 0 5px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-sidebar .sidebar-value {
  color: var(--text-primary);
  font-size: 1rem;
  margin: 0 0 10px 0;
  font-weight: bold;
}

.modal-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.modal-sections {
  margin-bottom: 20px;
}

.modal-section {
  margin-bottom: 15px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border-left: 3px solid var(--accent-color);
}

.modal-section strong {
  color: var(--accent-color);
  display: block;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.modal-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.6;
  text-align: justify;
}

/* Message toast pour indisponibilité */
.unavailable-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-color);
  color: #000;
  padding: 12px 24px;
  border-radius: 40px;
  font-size: 0.9rem;
  font-weight: bold;
  z-index: 10002;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  animation: fadeInOut 3s ease forwards;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateX(-50%) translateY(20px); }
  15% { opacity: 1; transform: translateX(-50%) translateY(0); }
  85% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-20px); visibility: hidden; }
}

/* Masquer les menus quand la modale est ouverte */
body.modal-open .burger-menu-container,
body.modal-open .language-menu-floating {
  display: none !important;
}

/* --- VIDÉO PLEINE PAGE --- */
#fullscreen-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
}

#fullscreen-video video {
  width: 100%;
  height: 100%;
  object-fit: contain;  /* ← Changé : contient au lieu de cover */
  background: #000;
}

.fullscreen-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.9);
  color: #000;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.fullscreen-close:hover {
  background: var(--accent-color);
  transform: scale(1.1);
}

/* Conteneur de chargement */
.video-loading-container {
  position: fixed;           /* ← Changé : absolute → fixed */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(0,0,0,0.95) 0%, rgba(30,30,30,0.95) 100%);
  backdrop-filter: blur(8px);
  z-index: 10002;
  transition: opacity 0.4s ease;
  text-align: center;
}

/* Spinner de chargement modernisé */
.video-loading-spinner {
  width: 70px;
  height: 70px;
  border: 3px solid rgba(187, 134, 252, 0.15);
  border-top: 3px solid var(--accent-color);
  border-right: 3px solid var(--accent-color);
  border-radius: 50%;
  animation: spin 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
  margin-bottom: 30px;
  box-shadow: 0 0 15px rgba(187, 134, 252, 0.3);
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
  .gallery-home {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .gallery-home-centered {
    flex-direction: column;
    align-items: center;
  }
  
  .gallery-home-centered .media-card-home {
    flex: 0 0 auto;
    width: 100%;
    max-width: 320px;
  }
  
  h1 {
    font-size: 1.8rem;
  }
  
  .subtitle {
    font-size: 1rem;
  }
  
  .act-title.centered {
    font-size: 1.5rem;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 15px 12px 40px;
  }
  
  .header-img {
    max-width: 100%;
  }
  
  .accueil-long-text p {
    font-size: 0.95rem;
    text-align: left;
  }
  
  /* Responsive pour les galeries horizontales */
  .business-gallery .media-card,
  .documents-gallery .media-card {
    flex: 0 0 180px;
  }
  
  .modal-layout {
    flex-direction: column;
    align-items: center;
  }
  
  .modal-sidebar {
    flex: none;
    width: 100%;
    max-width: 280px;
    position: static;
  }
  
  .business-gallery,
  .documents-gallery {
    gap: 15px;
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Texte de chargement stylisé */
.video-loading-text {
  color: var(--text-primary);
  font-size: 1.2rem;
  margin-bottom: 35px;
  letter-spacing: 1px;
  font-weight: 500;
  position: relative;
  display: inline-block;
}

/* Points d'attente animés */
.video-loading-text::after {
  content: '';
  position: absolute;
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  text-align: left;
  animation: dots 1.5s steps(3, end) infinite;
}

@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

/* Bouton principal modernisé */
.video-play-btn {
  background: rgba(187, 134, 252, 0.1);
  backdrop-filter: blur(10px);
  border: 1.5px solid var(--accent-color);
  color: var(--accent-color);
  padding: 14px 32px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 15px rgba(187, 134, 252, 0.1);
}

.video-play-btn:hover {
  background: var(--accent-color);
  color: #000;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(187, 134, 252, 0.4);
  gap: 15px;
}

.video-play-btn:active {
  transform: translateY(0);
}

/* Icône du bouton */
.video-play-btn::before {
  content: '⏳';
  font-size: 1.1rem;
  transition: transform 0.2s;
}

.video-play-btn:hover::before {
  content: '🎬';
  transform: scale(1.1);
}