/* ===========================================
   Phase 0 - Styles principaux
   =========================================== */

/* --- Variables CSS --- */
:root {
  /* Fond */
  --color-white: #FFFFFF;

  /* Turquoise */
  --color-turquoise-dark: #275E59;
  --color-turquoise-light: #68ABA2;

  /* Gris */
  --color-gray-dark: #131517;
  --color-gray-medium: #3C3E40;
  --color-gray-light: #BABBBF;

  /* Bleus */
  --color-blue-dark: #000000;
  --color-blue-medium: #6A8EBB;
  --color-blue-muted: #64788D;

  /* Oranges */
  --color-orange-light: #852818;
  --color-orange-dark: #852818;

  /* Couleurs sémantiques (facilement ajustables) */
  --color-primary: var(--color-blue-dark);
  --color-secondary: var(--color-orange-dark);
  --color-accent: var(--color-orange-light);
  --color-text: var(--color-gray-dark);
  --color-text-muted: var(--color-gray-medium);
  --color-border: var(--color-gray-light);

  /* Typographie */
  --font-title: 'Zilla Slab', serif;
  --font-body: 'Zilla Slab', serif;

  /* Dimensions */
  --container-max-width: 1400px;
  --container-padding: 40px;
}

/* --- Reset et base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-white);
  /* min-width: 1400px; */
}

/* --- Typographie --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  font-weight: 400;
  line-height: 1.2;
  color: var(--color-primary);
}
/* h1, h2, h3, h4, h5, h6{  
  text-transform: lowercase;
} */
h1 {
  font-size: 4rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-secondary);
}

/* --- Container principal --- */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* --- Navigation sticky --- */
.nav-sticky {
  position: fixed;
  top: 20px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--color-text);
  transition: opacity 0.2s ease;
}

.nav-sticky:hover {
  opacity: 0.9;
}

.nav-sticky.nav-left {
  left: 20px;
}

.nav-sticky.nav-right {
  /* Finalement on mets le bouton de langue à gauche */
  top: unset;
  left: 20px;
  bottom: 20px;
}

/* --- Page d'accueil --- */

/* Header / Titre */
.home-header {
  text-align: center;
  padding: 80px 0 40px;
}

.home-header h1 {
  font-size: 5rem;
  color: var(--color-primary);
}

.home-header .subtitle {
  font-size: 1.7rem;
  /*color: var(--color-text-muted); */
  color: #852818;
  /* text-transform: uppercase; */
  margin-top: 1rem;
}

.home-header .teams {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 0.5rem;
  font-size: 1.1rem;
  color: var(--color-text);
}

/* Mise en contexte */
.context-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 0 10px 0;
  text-align: justify;
}

.context-section p {
  font-size: 1.3rem;
  line-height: 1.8;
}

/* Supprime la marge sous le dernier paragraphe de cette section */
.context-section p:last-child {
  margin-bottom: 0;
}

/* Boutons d'entrée */
.entry-buttons {
  display: flex;
  justify-content: center;
  padding-top: 0; /* S'assure qu'il n'y a pas de padding en haut ici */
}

.entry-btn {
  display: inline-block;
  padding: 20px 50px;
  font-family: var(--font-title);
  font-size: 1.5rem;
  color: var(--color-white);
  background-color: var(--color-primary);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.entry-btn:hover {
  background-color: var(--color-secondary);
  color: var(--color-white);
  transform: translateY(-2px);
}

.entry-btn.secondary {
  background-color: var(--color-blue-muted);
}

.entry-btn.secondary:hover {
  background-color: var(--color-secondary);
}

/* Section remerciements */
.thanks-section {
  display: flex;
  align-items: flex-start;
  gap: 3rem;
  padding: 60px 0;
  max-width: 1000px;
  margin: 0 auto;
  text-align: justify;
  font-size: 1.3rem;
}

.thanks-section .thanks-image {
  flex-shrink: 0;
  width: 30%;
  height: 30%;
  object-fit: cover;
  border-radius: 4px;
}

.thanks-section .thanks-content {
  flex: 1;
}

.thanks-section h3 {
  margin-bottom: 1rem;
}

/* Footer */
.site-footer {
  background-color: var(--color-gray-dark);
  background-color:#000000;
  color: var(--color-white);
  padding: 60px 0 40px;
  margin-top: 60px;
}

.footer-credits {
  display: flex;
  justify-content: center;
  gap: 4rem;
  margin-bottom: 3rem;
}

.footer-credits .credit-group h4 {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-gray-light);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-credits .credit-group p {
  color: var(--color-white);
  margin: 0;
}
.footer-section {
  text-align: center;
  padding: 2rem 0;
  border-top: 1px solid var(--color-gray-medium);
}

.footer-section h4 {
  font-family: var(--font-title);
  font-size: 1.25rem;
  color: var(--color-white);
  margin-bottom: 1.5rem;
}

.footer-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-logos img {
  height: 60px;
  width: auto;
  /*filter: brightness(0) invert(1); */
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

/* On garde le filtre seulement pour les autres logos si tu veux les icônes blanches */
.footer-logos img:not(.logo-ofi) {
  filter: brightness(0) invert(1);
}

.footer-logos img:hover {
  opacity: 1;
}

.footer-logos.large img {
  height: 80px;
}

/* ===========================================
   Page Glossaire
   =========================================== */

.page-header {
  text-align: center;
  padding: 100px 0 60px;
}

.page-header h1 {
  color: var(--color-primary);
}

.glossary-list {
  max-width: 900px;
  margin: 0 auto;
  padding-bottom: 80px;
}

.glossary-item {
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--color-border);
}

.glossary-item:last-child {
  border-bottom: none;
}

.glossary-item h2 {
  color: var(--color-primary);
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.glossary-item .definition {
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.glossary-item .bibliography {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  padding-left: 1rem;
  border-left: 3px solid var(--color-border);
}

.glossary-item .bibliography em {
  font-style: italic;
}

/* ===========================================
   Page Théorie
   =========================================== */

.theory-placeholder {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 200px);
}

.theory-placeholder h1 {
  font-size: 6rem;
  color: var(--color-gray-light);
}

/* ===========================================
   Page Récit (Scrollytelling)
   =========================================== */

.recit-page {
  overflow-x: hidden;
}

/* Background image container */
.recit-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  transition: opacity 0.6s ease;
}

.recit-background.fade-out {
  opacity: 0;
}

/* Container pour les background layers */
.recit-bg-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 0;
}

/* Background layers (générés dynamiquement) */
.recit-bg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.recit-bg-layer.active {
  opacity: 1;
}

/* Scrolly container */
.scrolly {
  position: relative;
  z-index: 10;
}

/* Steps container */
.scrolly-steps {
  position: relative;
  padding-top: 100vh;
}

/* Individual step */
.step {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  padding: 20vh 60px 20vh 0;
  justify-content: flex-end;
}

.step.is-last {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Step content box */
.step-content {
  max-width: 550px;
  padding: 30px 35px;
  background-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  margin-right: 80px;
}

.step-content h3 {
  font-family: var(--font-title);
  font-size: 1.8rem;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.step-content p {
  font-size: 1.3rem;
  line-height: 1.7;
  color: var(--color-text);
}

.step-content p:last-child {
  margin-bottom: 0;
}


.step-content ul {
  font-size: 1.3rem;
}



.step-content span[data-pop-def] {
  white-space: nowrap;
  font-weight: bold;
  color: #D6764D;
  text-decoration: underline;
  cursor: pointer;
  &:hover{
    color: #1E3F63;
  }
}

/* Step positions */
.step.position-left {
  justify-content: flex-start;
  padding-left: 60px;
  padding-right: 0;
}

.step.position-left .step-content {
  margin-right: 0;
  margin-left: 80px;
}

.step.position-center {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.step.position-center .step-content {
  margin-right: 0;
  margin-left: 0;
}

/* Step color variants */
.step-content.color-blue {
  background-color: rgba(30, 63, 99, 0.9);
}

.step-content.color-blue h3,
.step-content.color-blue p {
  color: var(--color-white);
}

.step-content.color-orange {
  background-color: rgba(214, 118, 77, 0.9);
}

.step-content.color-orange h3,
.step-content.color-orange p {
  color: var(--color-white);
}

/* Progress dots */
.progress-dots {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: row;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 45px;
}

.progress-dots.hidden {
  display: none;
}

.progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.progress-dot:hover {
  transform: scale(1.3);
  background-color: rgba(255, 255, 255, 0.8);
}

.progress-dot.active {
  background-color: var(--color-secondary);
  border-color: var(--color-secondary);
}

/* Bouton retour dans le dernier step */
.step-content .btn-back {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 10px 25px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-white);
  background-color: var(--color-primary);
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.step-content .btn-back:hover {
  background-color: var(--color-secondary);
}

.nav-sticky.nav-left{
  color: var(--color-white);
  background-color: var(--color-primary);
  transition: background-color 0.2s ease;
}

.nav-sticky.nav-left:hover {
  background-color: var(--color-secondary);
}

/* ===========================================
   Popup Définitions
   =========================================== */

/* Overlay sombre */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Container du popup */
.popup-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 90%;
  max-width: 720px;
  max-height: 80vh;
  background-color: var(--color-blue-dark);
  border-radius: 8px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.4);
  z-index: 2001;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
  overflow: hidden;
}

.popup-overlay.active + .popup-container,
.popup-container.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* Bouton fermer */
.popup-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  color: var(--color-white);
  font-size: 2rem;
  font-weight: 300;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  line-height: 1;
  padding: 5px;
}

.popup-close:hover {
  opacity: 1;
}

/* Contenu du popup */
.popup-content {
  padding: 40px 50px 50px;
  overflow-y: auto;
  max-height: 80vh;
}

.popup-content h2 {
  font-family: var(--font-title);
  font-size: 1.75rem;
  color: var(--color-white);
  margin-bottom: 1.5rem;
  padding-right: 40px;
}

.popup-content .popup-definition {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--color-white);
  margin-bottom: 1.5rem;
}

.popup-content .popup-bibliography {
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.75);
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.popup-content .popup-bibliography em {
  font-style: italic;
}

/* Cacher les définitions non actives */
.popup-def-item {
  display: none;
}

.popup-def-item.active {
  display: block;
}

/* ===========================================
   RESPONSIVE - Tablette (768px - 1199px)
   =========================================== */

@media screen and (max-width: 1199px) {
  /* Variables ajustées */
  :root {
    --container-padding: 30px;
  }

  /* Typographie réduite */
  h1 {
    font-size: 3.5rem;
  }

  h2 {
    font-size: 2rem;
  }

  h3 {
    font-size: 1.5rem;
  }

  /* Page d'accueil */
  .home-header h1 {
    font-size: 4rem;
  }

  .home-header .subtitle {
    font-size: 1.5rem;
  }

  .home-header .teams {
    gap: 2rem;
    font-size: 1rem;
  }

 .video-section {
    max-width: 900px;
    margin: 40px auto; 
    padding: 0 20px;
  }


  .context-section p {
    font-size: 1.2rem;
  }

  .entry-buttons {
    gap: 1.5rem;
    padding: 40px 0;
  }

  .entry-btn {
    padding: 15px 40px;
    font-size: 1.3rem;
  }

  .thanks-section {
    gap: 2rem;
    font-size: 1.2rem;
  }

  .thanks-section .thanks-image {
    width: 280px;
    height: 280px;
  }

  /* Footer */
  .footer-credits {
    gap: 3rem;
  }

  /* Page récit */
  .step {
    padding: 20vh 40px 20vh 0;
  }

  .step.position-left {
    padding-left: 40px;
  }

  .step-content {
    max-width: 480px;
    padding: 25px 30px;
    margin-right: 60px;
  }

  .step.position-left .step-content {
    margin-left: 60px;
  }

  .step-content h3 {
    font-size: 1.5rem;
  }

  .step-content p,
  .step-content ul {
    font-size: 1.15rem;
  }

  /* Popup */
  .popup-content {
    padding: 35px 40px 40px;
  }

  .popup-content h2 {
    font-size: 1.5rem;
  }

  .popup-content .popup-definition {
    font-size: 1rem;
  }
}

/* ===========================================
   RESPONSIVE - Mobile (< 768px)
   =========================================== */

@media screen and (max-width: 767px) {
  /* Variables ajustées */
  :root {
    --container-padding: 20px;
  }

  /* Typographie mobile */
  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  /* Navigation sticky */
  .nav-sticky {
    padding: 8px 15px;
    font-size: 0.85rem;
  }

  .nav-sticky.nav-left {
    left: 15px;
    top: 15px;
  }

  .nav-sticky.nav-right {
    left: 15px;
    bottom: 15px;
  }

  /* Page d'accueil */
  .home-header {
    padding: 60px 0 30px;
  }

  .home-header h1 {
    font-size: 2.8rem;
  }

  .home-header .subtitle {
    font-size: 1.2rem;
  }


  .home-header .teams {
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.95rem;
  }

  .context-section {
    padding: 30px 0;
  }

  .context-section p {
    font-size: 1.1rem;
    line-height: 1.7;
  }

  /* Boutons d'entrée empilés */
  .entry-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 40px 20px;
  }

  .entry-btn {
    width: 100%;
    padding: 18px 30px;
    font-size: 1.2rem;
    text-align: center;
  }

  /* Section remerciements */
  .thanks-section {
    flex-direction: column;
    padding: 40px 0;
    font-size: 1.1rem;
  }

  .thanks-section .thanks-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    aspect-ratio: 340 / 500;
    margin: 0 auto;
  }

  /* Footer */
  .site-footer {
    padding: 40px 0 30px;
    margin-top: 40px;
  }

  .footer-credits {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }

  .footer-section {
    padding: 1.5rem 0;
  }

  .footer-section h4 {
    font-size: 1.1rem;
  }

  .footer-logos {
    gap: 1.5rem;
  }

  .footer-logos img {
    height: 45px;
  }

  .footer-logos.large img {
    height: 60px;
  }

  /* Page Glossaire */
  .page-header {
    padding: 80px 0 40px;
  }

  .glossary-list {
    padding: 0 var(--container-padding) 60px;
  }

  .glossary-item {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
  }

  .glossary-item h2 {
    font-size: 1.4rem;
  }

  .glossary-item .definition {
    font-size: 1rem;
  }

  .glossary-item .bibliography {
    font-size: 0.9rem;
  }

  /* Page Théorie */
  .theory-placeholder h1 {
    font-size: 3.5rem;
  }

  /* Page Récit - Mobile */

  /* Images de fond - repositionnées et agrandies pour mobile */
  .recit-bg-layer {
    background-size: contain;
    background-color: transparent;
    background-position: 0 0;
    transform: scale(1.5) translate(10%, 20%);
  }
  /* Pour les mobiles et certaines images plus portrait, on peut augmenter sensiblement la taille et ajuster l'image pour remplir l'espace */
  .recit-bg-layer.portrait1 {
    transform: scale(2.5) translate(17%, 30%);
  }
  .recit-bg-layer.portrait2 {
    transform: scale(2.0) translate(17%, 30%);
  }

  /* Masquer les progress dots */
  .progress-dots {
    display: none;
  }

  /* Steps */
  .scrolly-steps {
    padding-top: 50vh;
  }

  .step {
    min-height: 100vh;
    padding: 20px;
    padding-bottom: 100vh;
    justify-content: center;
    align-items: flex-start;
  }

  .step.position-left,
  .step.position-center {
    padding: 20px;
    padding-bottom: 100vh;
    justify-content: center;
  }

  .step.is-last {
    min-height: 80vh;
    padding-bottom: 20px;
    align-items: center;
  }

  /* Step content - centré avec marges */
  .step-content {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 20px 25px;
  }

  .step.position-left .step-content,
  .step.position-center .step-content {
    margin: 0;
  }

  .step-content h3 {
    font-size: 1.3rem;
  }

  .step-content p,
  .step-content ul {
    font-size: 1.05rem;
    line-height: 1.6;
  }

  .step-content .btn-back {
    margin-top: 1rem;
    padding: 12px 20px;
    font-size: 0.9rem;
    width: 100%;
    text-align: center;
  }

  /* Popup - Mobile */
  .popup-container {
    width: 95%;
    max-height: 85vh;
  }

  .popup-close {
    top: 10px;
    right: 15px;
    font-size: 2.5rem;
    padding: 10px;
  }

  .popup-content {
    padding: 30px 25px 35px;
  }

  .popup-content h2 {
    font-size: 1.3rem;
    padding-right: 30px;
  }

  .popup-content .popup-definition {
    font-size: 0.95rem;
    line-height: 1.7;
  }

  .popup-content .popup-bibliography {
    font-size: 0.85rem;
  }
}


@media screen and (max-width: 580px) {
  .home-header .subtitle br {
    display:none;
  }
}

/* Aligne le nom et les logos sur la même ligne */
  .nom-reseaux {
    display: flex;
    align-items: center;
    gap: 15px; /* Espace entre le nom et les logos */
  }

  .nom-artiste {
    margin: 0; /* Enlever les marges par défaut du <p> */
  }

  .logos {
    display: flex;
    gap: 10px; /* Espace entre les deux icônes */
  }

  /* Style pour rendre les logos gris et petits */
  .icon-gris {
    width: 20px;
    height: 20px;
    filter: grayscale(100%); /* Rend le logo gris */
    opacity: 0.6; /* Un peu de transparence pour la sobriété */
    transition: 0.3s;
  }

  /* Effet au survol (devient coloré ou plus foncé) */
  .icon-gris:hover {
    filter: grayscale(0%);
    opacity: 1;
  }

  .intro-image {
  /* Définit la largeur à 50% de la fenêtre d'affichage */
  width: 50vw; 
  /* Sécurité pour les petits écrans (mobiles) */
  max-width: 25%; 
  /* Conserve les proportions de l'image */
  height: auto; 
  /* Optionnel : centre l'image si elle est seule sur sa ligne */
  display: block;
  margin: 10px auto; 
}