/* =========================================
   HISTORIQUE.CSS — Styles spécifiques
========================================= */


/*============================
======= FICHIERS COMMUNS ========
=============================
   Styles de base, sans media queries
=============================*/

/* =========================
   ARBRE
   - conteneur + scène + image
========================= */
.arbre-container {
  max-width: 1000px;
  margin: 50px auto;
}

.arbre-stage { position: relative; }

.arbre-stage > img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid #000;
}

/* Boutons sur l'arbre : au-dessus de l'image */
.btnhisto{
  position: absolute;
  z-index: 5;                 /* au-dessus de l’image */
  transform: translate(-50%, -50%);
  border: 0;
  padding: 8px 12px;
  font-size: 16px;
  width: 60px;
  color: #fff;
  text-shadow: 1px 1px 1px #000;
  border-radius: 10px;
  background-color: rgb(7,185,5);
  background-image: linear-gradient(
    to top left,
    rgba(4,115,3,.2),
    rgba(4,115,3,.2) 30%,
    rgba(4,115,3,0)
  );
  box-shadow:
    inset 2px 2px 3px rgba(0,0,0,.6),
    inset -2px -2px 3px rgba(0,0,0,.6);
  cursor: pointer;
}

/* Positions d’origine (px) — conservées */
.btnhisto2002 { top:730px; left:455px; } .btnhisto2003 { top:680px; left:460px; }
.btnhisto2004 { top:630px; left:425px; } .btnhisto2005 { top:580px; left:390px; }
.btnhisto2006 { top:530px; left:360px; } .btnhisto2007 { top:480px; left:330px; }
.btnhisto2008 { top:430px; left:300px; } .btnhisto2009 { top:380px; left:270px; }
.btnhisto2010 { top:630px; left:500px; } .btnhisto2011 { top:580px; left:465px; }
.btnhisto2012 { top:530px; left:465px; } .btnhisto2013 { top:480px; left:465px; }
.btnhisto2014 { top:430px; left:465px; } .btnhisto2015 { top:380px; left:465px; }
.btnhisto2016 { top:330px; left:465px; } .btnhisto2017 { top:280px; left:465px; }
.btnhisto2018 { top:230px; left:465px; } .btnhisto2019 { top:180px; left:465px; }
.btnhisto2020 { top:580px; left:540px; } .btnhisto2021 { top:530px; left:565px; }
.btnhisto2022 { top:480px; left:610px; } .btnhisto2023 { top:435px; left:620px; }
.btnhisto2024 { top:387px; left:620px; }

/* =========================
   STAR WARS (crawl)
========================= */

.starwars-container{
  position: relative;
  margin: 0 auto 40px;
  width:100%;
  max-width:1400px;
  height: clamp(480px, 70vh, 820px);
  background: #000 url('/img/fond-starwars.jpg') center top / cover no-repeat;
  overflow:hidden;
  border-radius:10px;
  perspective:1600px;
}

/* Texte du crawl */
.starwars-content{
  width:100%;
  max-width:2000px;
  margin: 0 auto;
  color:#ffe81f;
  font-size: 32px;
  line-height:1.35;
  text-align:center;
  font-weight:bold;

  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;

  text-shadow:
    0 0 10px rgba(255,232,31,0.45),
    0 0 18px rgba(255,232,31,0.3);
}

/* TITRE CINÉMA (fixe) */
#starwars-title{
  position:absolute;
  top:35%;
  left:50%;
  transform:translate(-50%, -50%);
  width:100%;
  text-align:center;
  color:#ffe81f;
  font-size:clamp(32px, 4vw, 48px);
  font-weight:bold;
  letter-spacing:3px;
  opacity:0;
  z-index:5;
}

/* Le titre anime SEULEMENT quand .is-playing est présent */
.starwars-container.is-playing #starwars-title{
  animation: fadeTitle 6s ease forwards;
}

/* ZOOM + VIBRATION + DISPARITION du titre */
@keyframes fadeTitle{
  0%{
    opacity:0;
    transform:translate(-50%, -50%) scale(0.6);
  }
  15%{
    opacity:1;
    transform:translate(-50%, -50%) scale(1);
  }
  55%{
    opacity:1;
    transform:translate(-50%, -50%) scale(1.6);
  }
  70%{
    transform:translate(-49%, -51%) scale(2.2) rotate(0.3deg);
  }
  85%{
    transform:translate(-51%, -49%) scale(2.8) rotate(-0.5deg);
  }
  100%{
    opacity:0;
    transform:translate(-50%, -50%) scale(3.4);
  }
}

/* TEXTE QUI DÉFILE – VERSION ORDINATEUR */
.starwars-crawl{
  position:absolute;
  bottom:-120%;
  width:100%;
  transform-origin:50% 100%;
  opacity:0;
}

.starwars-container.is-playing .starwars-crawl{
  animation: crawlCinemaDesktop 55s linear forwards;
}

@keyframes crawlCinemaDesktop{
  0%{
    top:100%;
    opacity:0;
    transform: rotateX(30deg) translateZ(0);
  }
  8%{
    opacity:1;
  }
  80%{
    opacity:1;
  }
  100%{
    top:-520%;
    opacity:0;
    transform: rotateX(32deg) translateZ(-1900px);
  }
}

/* Bouton relire */
#relancer-text{
  position:absolute;
  bottom:20px;
  width:100%;
  text-align:center;
  color:#ffe81f;
  font-size:15px;
  cursor:pointer;
  display:none;          /* affiché / caché uniquement par le JS */
}

/* =========================
   VIDÉO (si utilisée)
========================= */
.video-space{
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 50px auto;
  background: #000;
  border: 1px solid #000;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.video-space iframe{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}



/*============================
====== FICHIERS PETITS FORMATS ======
=============================
   Smartphones portrait (≤480px)
=============================*/

/* ARBRE : largeur légèrement réduite */
@media (max-width: 480px) {
  .arbre-container { max-width: 92vw; }
}

/* Boutons arbre plus confortables */
@media (max-width: 480px) {
  .btnhisto {
    font-size: 14px;
    width: 54px;
    padding: 6px 10px;
  }
}

/* VIDÉO : pleine largeur */
@media (max-width: 480px) {
  .video-space{
    max-width: 100%;
    margin: 40px auto 20px;
  }
}



/*============================
====== FICHIERS MOYENS FORMATS =====
=============================
   Smartphones paysage / petites tablettes (≤600px)
=============================*/

/* ==================================================
   VERSION SMARTPHONE : Star Wars
   (≤ 600px de large)
================================================== */

@media (max-width: 600px){

  /* Box moins haute sur mobile */
  .starwars-container{
    max-width: 100vw;
    height: clamp(260px, 48vh, 380px);
  }

  /* TEXTE DU CRAWL : PLUS GROS + LIGNES PLUS LARGES */
  .starwars-content{
    max-width: 100%;
    font-size: 28px;
    line-height: 1.4;
  }

  /* TITRE SUR UNE SEULE LIGNE */
  #starwars-title{
    font-size: 18px;
    letter-spacing: 1px;
    top: 30%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
  }

  /* ÉTAT INITIAL — PAS DE FLASH */
  .starwars-crawl{
    position:absolute;
    top: 100%;
    bottom:auto;
    width:100%;
    transform-origin:50% 100%;
    opacity:0;
    transform: rotateX(28deg) translate3d(0, 0, 0);
  }

  /* ANIMATION MOBILE PLUS LENTE */
  .starwars-container.is-playing .starwars-crawl{
    animation: crawlCinemaMobile 110s linear forwards;
    will-change: transform, opacity;
  }

  @keyframes crawlCinemaMobile{
    0%{
      opacity:0;
      transform: rotateX(28deg) translate3d(0, 0, 0);
    }
    8%{
      opacity:1;
    }
    100%{
      opacity:0;
      transform: rotateX(28deg) translate3d(0, -260%, -900px);
    }
  }
}



/*============================
===== FICHIERS GRANDS FORMATS ======
=============================
   Tablettes paysage / petits ordis
   (pas de règles spécifiques pour l’instant)
=============================*/



/*============================
======= FICHIERS ORDINATEURS =======
=============================
   Écrans larges (base desktop)
   (géré par les styles communs)
=============================*/
