/* =====================================================================
   PHYSIQUE-TERMINALE.CSS — série d'animations de physique Terminale
   À charger APRÈS style.css :
     <link rel="stylesheet" href="style.css">
     <link rel="stylesheet" href="physique-terminale.css">

   SOMMAIRE
    1. Bloc de l'animation  (.serie : boutons, consigne, curseurs, dessin, panneau
                             tous de la même largeur)
    2. Boutons
    3. Curseurs
    4. Dessin + panneau d'explication
    5. Lien ☰ vers l'accueil de la série
    6. Page d'accueil de la série (physique-terminale.html)
   ===================================================================== */


/* =====================================================================
   1. BLOC DE L'ANIMATION
   Tout ce qui est dans <div class="serie"> a la même largeur :
   menu de boutons, consigne, curseurs, dessin + panneau.
   ===================================================================== */
.serie {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}
.serie > * {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

/* menu de boutons (classe .menu de style.css) : pleine largeur du bloc */
.serie > .menu {
  display: block;
  max-width: none;
  margin-bottom: 8px;
}


/* =====================================================================
   2. BOUTONS
   ===================================================================== */
.mode-btn {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 8px;
  border: 2px solid #ccc;
  background: rgba(255,255,255,0.7);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  margin: 3px;
}
.mode-btn.active {
  border-color: #3b82f6;
  background: #3b82f6;
  color: white;
}
.mode-btn:disabled { opacity: 0.4; cursor: default; }
.serie .button4 { width: auto; }

.hint {
  font-size: 12px;
  color: #888;
  font-style: italic;
  text-align: center;
  margin: 4px 0 6px;
}


/* =====================================================================
   3. CURSEURS
   ===================================================================== */
.curseurs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 6px 0 10px;
}
.op-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.55);
  border-radius: 8px;
  padding: 5px 10px;
}
.op-label {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  min-width: 230px;
}
.op-val {
  white-space: nowrap;
  font-size: 12px;
  color: #64748b;
  min-width: 48px;
  text-align: right;
}
.op-slider {
  flex: 1;
  height: 4px;
  cursor: pointer;
  accent-color: #3b82f6;
}


/* deux ou trois curseurs côte à côte (classe .cote ajoutée au bloc .curseurs) */
.curseurs.cote {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 6px 10px;
}
.curseurs.cote .op-row { margin: 0; }
.curseurs.cote .op-label { min-width: 0; }
@media (max-width: 760px) {
  .curseurs.cote { grid-auto-flow: row; }
}

/* cases à cocher (afficher / cacher des éléments du dessin) */
.cases {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  align-items: center;
  margin: 0 0 10px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.55);
  border-radius: 8px;
  box-sizing: border-box;
}
.cases .chk {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}
.cases input { width: 17px; height: 17px; accent-color: #3b82f6; cursor: pointer; }
.cases .trait { display: inline-block; width: 22px; height: 4px; border-radius: 2px; }


/* =====================================================================
   4. DESSIN + PANNEAU D'EXPLICATION
   ===================================================================== */
.anim-layout {
  display: flex;
  gap: 16px;
  align-items: stretch;
}
.anim-layout canvas,
.anim-layout #canvas {           /* l'emporte sur #canvas de style.css (max-width, margin auto) */
  flex: 1 1 0;
  min-width: 0;
  width: 100% !important;
  max-width: none;
  height: auto !important;
  display: block;
  margin: 0;
  align-self: flex-start;        /* garde ses proportions même si le panneau est plus haut */
  border-radius: 12px;
  cursor: pointer;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.legend-panel {
  flex: 0 0 250px;
  background: rgba(18,18,26,0.88);
  border-radius: 12px;
  padding: 14px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: #d4d4d4;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
}
.legend-panel .lg-title {
  font-family: monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #facc15;
  text-align: center;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #333;
}
.lg-texte b { color: #ffffff; }
.lg-sep { border-top: 1px solid #333; margin: 12px 0 8px; }
.lg-valeurs {
  font-family: monospace;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.7;
  margin-top: auto;
}
.lg-valeurs .g { color: #facc15; }
.lg-points { display: flex; gap: 6px; justify-content: center; margin-bottom: 10px; }
.lg-points span {
  width: 9px; height: 9px; border-radius: 50%;
  background: #444; display: inline-block;
}
.lg-points span.fait { background: #94a3b8; }
.lg-points span.ici { background: #facc15; }

@media (max-width: 760px) {
  .anim-layout { flex-direction: column; }
  .legend-panel { flex: none; width: 100%; }
  .op-row { flex-wrap: wrap; }
  .op-label { min-width: 0; flex: 1 1 auto; }
  .op-slider { order: 3; flex: 1 1 100%; }
}


/* vecteur dans un texte : <span class="vec">v</span> (flèche au-dessus de la lettre) */
.vec {
  position: relative;
  display: inline-block;
}
.vec::after {
  content: "→";
  position: absolute;
  left: 0;
  right: 0;
  top: -0.72em;
  font-size: 0.8em;
  font-weight: 400;
  text-align: center;
}

/* données enregistrées (listes à copier dans Python) */
.donnees {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(18,18,26,0.88);
  border-radius: 12px;
  box-sizing: border-box;
}
.donnees[hidden] { display: none; }
.donnees-titre {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #facc15;
}
.donnees textarea {
  display: block;
  width: 100%;
  height: 120px;
  box-sizing: border-box;
  padding: 8px 10px;
  font-family: monospace;
  font-size: 12px;
  color: #d4d4d4;
  background: #0f0f16;
  border: 1px solid #333;
  border-radius: 8px;
  resize: vertical;
}


/* =====================================================================
   5. LIEN ☰ VERS L'ACCUEIL DE LA SÉRIE
   <a class="hamb" href="physique-terminale.html">&#9776;</a>
   ===================================================================== */
a.hamb {
  text-decoration: none;
}


/* =====================================================================
   6. PAGE D'ACCUEIL DE LA SÉRIE
   ===================================================================== */
.theme {
  margin: 0 0 28px;
}
.theme > h2 {
  opacity: 1;
  display: inline-block;
  margin: 0 0 14px;
  padding: 6px 16px;
  font-size: 22px;
  color: #000;
  background: #FFCC00;
  border-radius: 8px;
}
.cartes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}
.carte {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #141c2e;
  text-decoration: none;
  background: rgba(255,255,255,0.92);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  transition: transform .2s, box-shadow .2s;
}
.carte:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
}
.carte img {
  display: block;
  width: 100%;
  aspect-ratio: 1.8 / 1;
  object-fit: cover;
  border-bottom: 3px solid #FFCC00;
}
.carte .carte-texte {
  padding: 10px 14px 14px;
  font-family: "Segoe UI", Arial, sans-serif;
}
.carte h3 {
  margin: 0 0 4px;
  font-size: 17px;
}
.carte p {
  margin: 0;
  padding: 0;
  text-align: left;
  font-size: 13.5px;
  line-height: 1.45;
  color: #475569;
}
.a-venir {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  font-style: italic;
  color: #475569;
  background: rgba(255,255,255,0.6);
  border-radius: 8px;
  padding: 8px 14px;
  display: inline-block;
}


/* =====================================================================
   7. NAVIGATION ENTRE LES ANIMATIONS (en bas du bloc de l'animation)
   (créés par physique-terminale.js)
   ===================================================================== */

/* fil d'Ariane en haut du bloc : Animations › Physique Terminale › page */
.fil-ariane {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0 0 12px;
  padding: 6px 14px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 13.5px;
  color: #141c2e;
  background: rgba(255,255,255,0.75);
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  box-sizing: border-box;
}
.fil-ariane a {
  color: #1f4e79;
  text-decoration: none;
  border-bottom: 1px dotted rgba(31,78,121,0.5);
}
.fil-ariane a:hover { color: #000; background: #FFCC00; border-bottom-color: transparent; }
.fil-ariane .sep { color: #94a3b8; }
.fil-ariane [aria-current] { font-weight: 600; }

/* navigation en bas : précédente · toutes · suivante */
.nav-serie {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  margin-top: 16px;
  font-family: "Segoe UI", Arial, sans-serif;
}
.nav-serie a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 10px 16px;
  color: #141c2e;
  text-decoration: none;
  background: rgba(255,255,255,0.85);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.nav-serie a:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
  background: #ffffff;
}
.nav-serie small {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #64748b;
}
.nav-serie span { font-size: 15px; font-weight: 600; }
.nav-serie .ns-suiv { text-align: right; }
.nav-serie .ns-accueil {
  align-items: center;
  text-align: center;
  color: #e5e7eb;
  background: rgba(18,18,26,0.88);
}
.nav-serie .ns-accueil:hover { background: rgba(18,18,26,1); }
.nav-serie .ns-accueil small { color: #facc15; }
.nav-serie .ns-grille { font-size: 18px; color: #facc15; line-height: 1; }

@media (max-width: 600px) {
  .nav-serie { grid-template-columns: 1fr 1fr; }
  .nav-serie .ns-accueil { grid-column: 1 / -1; grid-row: 1; }
  .nav-serie .ns-vide { display: none; }
}

/* carte d'accueil sans vignette */
.carte-sans-image {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1.8 / 1;
  padding: 12px;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  color: #FFCC00;
  background: #12121a;
  border-bottom: 3px solid #FFCC00;
}

/* badges du niveau (cycle 4, seconde, première, terminale) sous la description */
.carte .carte-texte { display: flex; flex-direction: column; flex: 1; }
.carte .badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; }
.carte[hidden], .theme[hidden] { display: none !important; }
.badge-niveau {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font: 700 11px "Segoe UI", Arial, sans-serif;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fff;
  background: #1f4e79;
}
.badge-niveau.niv-cycle-4 { background: #0369a1; }
.badge-niveau.niv-seconde { background: #15803d; }
.badge-niveau.niv-premiere { background: #b45309; }
.badge-niveau.niv-terminale { background: #6d28d9; }

/* texte d'introduction de l'accueil de la série */
.intro-serie {
  margin: 0 0 18px;
  padding: 14px 18px;
  background: #ffffff;
  border-left: 4px solid #ffc107;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 15.5px;
  line-height: 1.55;
  color: #2b3445;
}
.intro-serie p { margin: 0 0 8px; text-align: left; }
.intro-serie p:last-child { margin-bottom: 0; }
@media (max-width: 600px) { .intro-serie { font-size: 14.5px; padding: 12px 14px; } }

/* boutons de filtrage par niveau (accueil) */
.filtres {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 0 0 20px;
  font-family: "Segoe UI", Arial, sans-serif;
}
.filtres-titre { font-size: 14px; font-weight: 600; color: #2b3445; margin-right: 2px; }
.filtre {
  --c: #1f4e79;
  padding: 5px 14px;
  border: 2px solid var(--c);
  border-radius: 999px;
  background: #fff;
  color: var(--c);
  font: 700 13px "Segoe UI", Arial, sans-serif;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.filtre small { font-size: 11px; font-weight: 600; opacity: .75; margin-left: 2px; }
.filtre:hover { background: color-mix(in srgb, var(--c) 12%, #fff); }
.filtre.actif { background: var(--c); color: #fff; }
.filtre.niv-cycle-4 { --c: #0369a1; }
.filtre.niv-seconde { --c: #15803d; }
.filtre.niv-premiere { --c: #b45309; }
.filtre.niv-terminale { --c: #6d28d9; }
@media (max-width: 600px) { .filtre { padding: 4px 10px; font-size: 12px; } .filtres-titre { width: 100%; } }

/* bandeau titre : même taille que #titro de style.css (classe, pour éviter un identifiant en double) */
.titro { font-size: 30px; }
@media screen and (min-width: 601px) { .titro { font-size: 40px; } }
