/* ============================================================
   VARIABLES GLOBALES
   ============================================================ */
:root {
  --bg-color: #121212;
  --surface-color: #1e1e1e;
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0a0;
  --accent-color: #bb86fc;
  --accent-glow: rgba(187, 134, 252, 0.2);
  --border-color: #333333;
  
  /* Dimensions des images */
  --image-width-landscape: 400px;
  --image-height-landscape: 267px;
  --image-width-portrait: 267px;
  --image-height-portrait: 400px;
}

/* ============================================================
   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; /* Fond noir derrière la vidéo */
}

.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.15; /* Transparence qui tire vers le noir */
}

/* Ajustement de l'overlay pour compléter l'assombrissement */
.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6); /* Overlay noir supplémentaire */
  z-index: -1;
}

/* Désactiver la vidéo pour les utilisateurs sensibles au mouvement */
@media (prefers-reduced-motion: reduce) {
  .video-background {
    display: none;
  }
  
  .video-overlay {
    background: var(--bg-color);
  }
}

/* Optionnel : désactiver la vidéo sur mobile pour économiser batterie et données */
@media (max-width: 768px) {
  .video-background {
    display: none;
  }
  
  .video-overlay {
    background: var(--bg-color);
  }
}

/* ============================================================
   BASE
   ============================================================ */
body {
  background-color: transparent; /* Devient transparent pour laisser voir la vidéo */
  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;
}

/* ============================================================
   EN-TÊTE (HEADER)
   ============================================================ */
.main-header {
  margin-bottom: 40px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
}

.header-content {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 30px;
  text-align: left;
  max-width: 900px;
  margin: 0 auto;
}

.header-image-box {
  flex: 0 0 375px;
  max-width: 30%;
}

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

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

.header-text-box {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.header-title-row {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 10px;
}

.header-title-row h1 {
  margin: 0;
  color: var(--accent-color);
  text-shadow: 0 0 10px var(--accent-glow);
  font-size: 2rem;
}

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

/* Bloc de texte long repliable */
.long-text-container {
  background: rgba(255, 255, 255, 0.04);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

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

.long-text p {
  margin: 10px 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  text-align: justify;
}

.toggle-btn {
  background: none;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.3s;
  display: block;
  width: fit-content;
}

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

/* ============================================================
   SECTIONS
   ============================================================ */
.content-section {
  margin: 50px 0;
  padding: 20px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.content-section:last-child {
  border-bottom: none;
}

.section-container {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  text-align: left;
}

/* Quand le contenu est réduit : centrer l'image verticalement */
.section-container:has(.section-content[data-is-reduced="true"]) {
  align-items: center;
}

.section-container.reverse {
  flex-direction: row-reverse;
}

/* ============================================================
   IMAGES DES SECTIONS
   ============================================================ */
.section-image {
  flex: 0 0 33.333%;
  width: 33.333%;
  height: auto;
  max-width: var(--image-width-landscape);
}

.section-image.portrait {
  flex: 0 0 33.333%;
  width: 33.333%;
  height: auto;
  max-width: var(--image-width-portrait);
}

.image-gallery {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  background: #000;
}

/* Ratios exacts pour correspondance parfaite */
#sectionA .image-gallery,
#sectionC .image-gallery {
  aspect-ratio: 400 / 267;
}

#sectionB .image-gallery {
  aspect-ratio: 267 / 367;
}

.gallery-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}

.gallery-img.active {
  opacity: 1;
}

/* ============================================================
   ZONE DE TEXTE DES SECTIONS
   ============================================================ */
.section-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 10px 0;
  border-bottom: 1px solid var(--accent-color);
  margin-bottom: 15px;
  transition: border-bottom-color 0.3s;
  flex-shrink: 0;
  user-select: none;
}

.section-header:hover {
  border-bottom-color: #d4b5ff;
}

.section-header h2 {
  margin: 0;
  color: var(--accent-color);
  font-size: 1.5rem;
}

.section-arrow {
  color: var(--accent-color);
  font-size: 1.2rem;
  transition: transform 0.2s;
  display: inline-block;
  animation: arrowPulse 1.5s ease-in-out 2;
}

@keyframes arrowPulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

.section-content {
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

/* Effet de fondu en bas quand le contenu est réduit */
.section-content::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--bg-color));
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.section-content[data-is-reduced="true"]::after {
  opacity: 1;
}

.content-inner {
  padding-bottom: 10px;
}

.section-content h3 {
  color: var(--accent-color);
  font-size: 1.2rem;
  margin: 15px 0 10px;
  opacity: 0.9;
}

.section-content h4 {
  color: var(--accent-color);
  line-height: 1.8;
  margin: 10px 0;
  text-align: justify;
}

.section-content p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin: 10px 0;
  text-align: justify;
}

.section-link {
  margin-top: 25px;
  text-align: center;
}

.btn-section-link {
  display: inline-block;
  padding: 8px 20px;
  background: transparent;
  border: 1px solid var(--accent-color);
  border-radius: 40px;
  color: var(--accent-color);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

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

/* ============================================================
   CORRECTION PIED DE PAGE TOKEN-NOE
   ============================================================ */
/* S'assurer que les éléments injectés par token-noe.js conservent leur style d'origine */
.token-footer .footer-content,
.token-footer .author-bio,
.token-footer .author-bio h3,
.token-footer .author-bio p {
  text-align: center !important;
}

/* Forcer le centrage sur tous les éléments texte du footer token */
[class*="token"],
[class*="footer"] {
  text-align: center;
}

/* Exception pour les éléments qui doivent rester alignés à gauche */
.section-text,
.header-text-box,
.long-text p {
  text-align: left;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .section-container,
  .section-container.reverse {
    flex-direction: column;
    gap: 20px;
  }

  .section-image,
  .section-image.portrait {
    flex: none;
    width: 100%;
    max-width: none;
  }

  #sectionA .image-gallery,
  #sectionC .image-gallery,
  #sectionB .image-gallery {
    aspect-ratio: 16 / 9;
  }

  .section-text {
    width: 100%;
  }

  .section-content {
    max-height: none !important;
    transition: none;
  }

  .section-arrow {
    display: none;
  }

  .section-content::after {
    display: none;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  .header-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .header-image-box {
    flex: 0 0 140px;
    width: 140px;
  }

  .header-text-box {
    width: 100%;
    align-items: center;
  }

  .header-title-row {
    justify-content: center;
  }

  .header-title-row h1 {
    text-align: center;
    font-size: 1.6rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .section-header h2 {
    font-size: 1.2rem;
  }

  .section-content h3 {
    font-size: 1rem;
  }

  .section-content p {
    font-size: 0.9rem;
  }
}