/* scripts/styles.css */
/* =========================================================
   IMPORTS & VARIABLES GLOBALES
   ========================================================= */

@import url("https://fonts.googleapis.com/css2?family=Lobster&display=swap");

:root {
  --color-bg: #101014;
  --color-surface: #181820;
  --color-text: #f5f5f5;
  --color-muted: #b3b3c0;
  --color-accent: #d7263d;
  --color-accent-soft: rgba(215, 38, 61, 0.25);
  --color-header-bg: #14141c;
  --color-header-border: #2b2b38;
  --color-menu-bg: #111118;
  --color-menu-border: #20202a;
  --color-link-hover: #ff3b4d;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.45);

  --transition-fast: 0.15s ease-out;
  --transition-med: 0.25s ease-out;

  /* Hauteur standard sur PC */
  --header-height: 72px;
  --menu-width: 260px;
}


/* Jauge de progression globale du diaporama (barre verte) */
.diaporama-gauge-container {
  width: 100%;
  height: 18px; /* ~+10% par rapport à 16px */
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  overflow: hidden;
  backdrop-filter: blur(4px);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
  cursor: pointer;
  position: relative;
  touch-action: none;
}

.diaporama-gauge-fill {
  height: 100%;
  width: 0%;
  background-color: #22c55e;
  background-image: linear-gradient(90deg, #22c55e, #4ade80);
  transition: width 0.1s linear;
  border-radius: 10px;
}




/* =========================================================
   RESET DE BASE & BODY
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; height: 100%; }

body {
  font-family: "Montserrat", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at top left, #050509 0, #050509 45%, #050509 100%);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}


/* =========================================================
   HEADER PRINCIPAL
   ========================================================= */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: linear-gradient(120deg, var(--color-header-bg), #181822 60%, #121217 100%);
  border-bottom: 1px solid var(--color-header-border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  z-index: 1000;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

/* Logo + titre */
.logo-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Logo circulaire Shotokan */
.logo-shotokan {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #ff5b6c, var(--color-accent) 55%, #5a050f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.07);
}

.logo-shotokan svg { width: 36px; height: 36px; }
.logo-circle { fill: none; stroke: rgba(0, 0, 0, 0.7); stroke-width: 4; }
.logo-tiger { fill: rgba(0, 0, 0, 0.75); }
.logo-kanji { fill: rgba(255, 255, 255, 0.9); opacity: 0.9; }

/* Titre principal */
.title-block h1 {
  font-family: "Oswald", sans-serif;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.2;
}

/* Sous-titre */
.title-block .subtitle {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

/* Bouton MENU */
.header-menu-button {
  margin-left: auto;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.6);
  background: linear-gradient(120deg, var(--color-accent), #ff5466);
  color: #ffffff;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s ease-out;
}

/* Au survol, juste un léger effet, pas de changement de couleur */
.header-menu-button:hover {
  transform: translateY(-1px);
}

.form-group {
  margin-bottom: 1.2rem;
}

/* Un peu plus d'air avant les cases */
.human-check-group {
  margin-top: 1.2rem;
}

/* Espacement spécifique entre les deux cases */
.human-check-group + .human-check-group {
  margin-top: 3rem; /* espace supplémentaire avant "Je suis un humain" */
}


/* Container général */
.human-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-md);
  background: #111118;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* On cache les checkboxes natives */
#humanCheck,
#newsletterOptIn {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Label cliquable */
.human-check label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

/* Faux carré de validation */
.human-check-box {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

/* Texte "Je suis un humain" */
.human-check-label {
  color: var(--color-text);
  font-size: 0.9rem;
}

/* État coché : carré rempli + petite coche */
#humanCheck:checked + label .human-check-box {
  background: linear-gradient(120deg, var(--color-accent), #ff5466);
  border-color: var(--color-accent);
}

#humanCheck:checked + label .human-check-box::after {
  content: "✓";
  font-size: 0.9rem;
  color: #fff;
}
/* État coché pour "Recevoir les actualités du KDojo" */
#newsletterOptIn:checked + label .human-check-box {
  background: linear-gradient(120deg, var(--color-accent), #ff5466);
  border-color: var(--color-accent);
}

#newsletterOptIn:checked + label .human-check-box::after {
  content: "✓";
  font-size: 0.9rem;
  color: #fff;
}

/* Erreur sous la case */
.form-error[data-for="humanCheck"] {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: #ff8080;
}

/* Messages d'erreur des formulaires */
.form-error {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: #ff4d4d; /* rouge bien visible */
}


/* =========================================================
   LAYOUT GLOBAL & MENU LATÉRAL
   ========================================================= */

.app-layout {
  display: block;
  height: 100vh;
  padding-top: var(--header-height);
}

/* Menu latéral (slide-in) */
.side-menu {
  background: radial-gradient(circle at top, #1b1b28, var(--color-menu-bg));
  border-left: 1px solid var(--color-menu-border);
  position: fixed;
  top: var(--header-height);
  right: 0;
  width: min(280px, 90vw);
  max-height: calc(100vh - var(--header-height));
  overflow-y: auto;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.25s ease-out;
  z-index: 900;
  box-shadow: -10px 10px 30px rgba(0,0,0,0.6);
  pointer-events: none;
}

.side-menu.is-visible {
  opacity: 1;
  transform: translateY(0);
  padding: 1rem 0.5rem;
  pointer-events: auto;
}

/* Clics désactivés quand le menu est fermé */
.side-menu:not(.is-visible) .menu-root {
  pointer-events: none;
}

/* Clics réactivés quand le menu est ouvert */
.side-menu.is-visible .menu-root {
  pointer-events: auto;
}

/* Liste racine du menu */
.menu-root {
  list-style: none;
  margin: 0;
  padding: 0.4rem 0;
}

.menu-root > li {
  margin-bottom: 0.35rem;
}

/* Entrées de menu (niveau 1 + sous-menus) */
.menu-item,
.submenu-link {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--color-text);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.menu-item:hover,
.submenu-link:hover {
  background: var(--color-accent-soft);
  color: #fff;
}

/* Élément de menu actif */
.menu-item.is-active {
  background: linear-gradient(120deg, var(--color-accent), #ff5466);
  color: #fff;
}

/* Sous-menu repliable */
.submenu {
  list-style: none;
  padding: 0.25rem 0.25rem 0.35rem 1.5rem;
  border-left: 1px solid rgba(255,255,255,0.05);
  max-height: 0;
  overflow: hidden;
  transition: 0.25s;
  opacity: 0;
}

.submenu.is-open {
  max-height: 800px;
  opacity: 1;
  transform: translateY(0);
}


/* =========================================================
   CONTENU PRINCIPAL
   ========================================================= */

.main-content {
  padding: 1.25rem 1.75rem;
  position: relative;
  overflow-y: auto;
  max-height: calc(100vh - var(--header-height));
}

/* Sections de contenu (accueil, techniques, vidéos, etc.) */
.content-section {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: 0.25s;
}

.content-section.is-active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.content-section h2 {
  font-family: "Oswald";
  font-size: 1.4rem;
  text-transform: uppercase;
  margin: 0 0 0.75rem 0;
}

.content-section p {
  color: var(--color-muted);
  line-height: 1.6;
}


/* =========================================================
   BOUTONS D’ACTION
   ========================================================= */

.btn-accent,
.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(120deg, var(--color-accent), #ff5466);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-accent:hover {
  transform: translateY(-1px);
  background: var(--color-link-hover);
}


/* =========================================================
   GRILLE TECHNIQUES & CARTES
   ========================================================= */

.section-header {
  padding-bottom: 1.5rem;
  padding-top: 0.5rem;
}

.section-title {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--color-muted);
}

/* Grille des cartes techniques (PC/tablette) */
.techniques-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

/* Carte technique générique */
.technique-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--color-surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1rem;
  cursor: pointer;
  transition: 0.15s;
}

.technique-card:hover {
  transform: translateY(-3px);
  background: #252535;
}

/* Icône dans une carte technique */
.technique-card .card-icon {
  width: 80px;
  height: 80px;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

/* Titre de carte technique */
.technique-card .card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

/* Description courte de carte technique */
.technique-card .card-description {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 0.25rem;
}

/* Image dans une icône de carte */
.card-icon-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}


/* =========================================================
   CATÉGORIES TECHNIQUES (tuiles)
   ========================================================= */

/* Grille de tuiles de catégories techniques */
.techniques-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

/* Tuile de catégorie active */
.technique-card.tech-category-tile.is-active {
  background: #252535;
}

/* Tuile de catégorie inactive */
.technique-card.tech-category-tile:not(.is-active) {
  background: #181820;
}

/* Liste de lignes techniques (utilise renderMetalLinesList) */
.line-list.techniques-list-lines {
  width: 100%;
}

/* Tuiles de catégories techniques = pleine colonne */
.technique-card.tech-category-tile {
  width: 100%;
}

/* Grille des catégories techniques sur mobile (1 à 3 colonnes) */
@media (max-width: 768px) {
  .techniques-categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
  }
}


/* =========================================================
   CATÉGORIES VIDÉOS (tuiles)
   ========================================================= */

/* Grille de catégories vidéos (Kata / Kumite / Karaté Contact) */
.video-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
  width: 100%;
}


/* Tuiles de catégories vidéos */
.video-card-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--color-surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1rem;
  cursor: pointer;
  transition: 0.15s;
}

/* Tuile vidéo active */
.video-card-tile.is-active {
  background: #252535;
}

/* Tuile vidéo inactive */
.video-card-tile:not(.is-active) {
  background: #181820;
}

/* Styles hérités d’une ancienne carte vidéo simple (conservés si réutilisés) */
.video-tile {
  background: var(--color-surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1rem 1.2rem;
  cursor: pointer;
  transition: 0.15s;
}

.video-tile:hover {
  transform: translateY(-3px);
  background: #252535;
}

.video-tile h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

/* Frame vidéo intégrée (YouTube) */
.video-card iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: none;
  border-radius: var(--radius-md);
}

/* Wrapper ratio 16:9 */
.video-frame {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}

.video-frame iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}


/* =========================================================
   LISTE DES TECHNIQUES (dans une catégorie)
   ========================================================= */

.techniques-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Ligne clicable : nom d’une technique */
.tech-list-item {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 1.1rem;
  padding: 0.8rem 0;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.tech-list-item:hover {
  color: var(--color-accent);
  transform: translateX(3px);
}

/* Bouton retour */
.back-button {
  color: var(--color-accent);
  border: none;
  background: none;
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Séparateur vertical entre groupes de techniques */
.tech-line-break {
  grid-column: 1 / -1;
  height: 0.75rem;
  padding: 0;
  margin: 0;
}


/* =========================================================
   DIAPORAMA (overlay techniques)
   ========================================================= */

#section-techniques {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.05s ease;
}

#section-techniques.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* Cadre principal du diaporama */
#mon-conteneur-wrapper {
  position: relative;
  width: 80vw;
  height: 85vh;
  max-width: 1200px;
  max-height: 900px;
  background: #ffffff;
  box-shadow: 0 0 50px rgba(0,0,0,0.9);
  border-left: 4px solid #1a1a1a;
  border-right: 4px solid #1a1a1a;
  transition: all 0.3s ease;
}

#mon-conteneur-wrapper.is-visible {
  opacity: 1;
  transform: scale(1);
}

/* Racine JS du diaporama */
#mon-conteneur.diaporama-container {
  width: 100%;
  height: 100%;
  background-color: transparent !important;
  display: block !important;
  margin: 0;
  padding: 0;
}

#diaporama-root {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Titre principal */
.diaporama-main-title {
  font-family: 'Lobster', cursive;
  font-size: 2.5rem;
  color: #fff;
  text-shadow: 1px 1px 2px #000;
  text-align: center;
  background: linear-gradient(180deg, #666666 0%, #2a2a2a 50%, #000000 51%, #444444 100%);
  border-bottom: 1px solid #000;
  padding: 0.5rem 0;
  margin: 0;
  flex-shrink: 0;
}

.diaporama-main-title.hidden {
  display: none;
}

/* Container des slides */
.diaporama-slider-container {
  position: relative;
  flex-grow: 1;
  width: 100%;
  min-height: 0;
  background: #ffffff;
  overflow: hidden;
}

/* Toast diaporama : message en bas de l'écran */
.diaporama-toast {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 100;
}

.diaporama-toast.visible {
  opacity: 1;
  pointer-events: auto;
}


/* Titre du site dans la carte */
.link-card h3 {
  margin-bottom: 0.25rem; /* Réduit l'espace sous le titre */
}

/* Description sous le titre (même police que lexique) */
.link-card .lexique-definition {
  margin-top: 0;          /* Colle au titre */
  margin-bottom: 1.5rem;  /* Augmente l'espace avant le bouton */
}

/* Bouton "Visiter" */
.link-card .btn-link {
  margin-top: 0;          /* Au cas où il y aurait une marge par défaut */
}

/* Slide individuelle */
.diaporama-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.diaporama-slide.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 10;
}

/* Background visuel d’un slide */
.diaporama-slide-bg {
  position: absolute;
  inset: 0;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

/* Overlay de détails de slide */
.diaporama-details {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: 0.4s;
  z-index: 50;
  color: white;
  pointer-events: none;
}

.diaporama-details-active .diaporama-details {
  opacity: 1;
  pointer-events: auto;
}

/* Texte détaillé dans l’overlay */
.diaporama-description-content {
  padding: 0 10%;
  font-size: 1.3rem;
  line-height: 1.6;
  max-height: 80vh;
  overflow-y: auto;
}

/* Zone L1/L2 (bas du diaporama) */
.diaporama-title-zone {
  background: #ffffff;
  border-top: 1px solid #dddddd;
  padding: 0.5rem;
  text-align: center;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 60;
}

.diaporama-title-zone.hidden {
  display: none;
}

/* Titre L1 */
.diaporama-text-l1 {
  text-transform: none !important;
  font-size: 1.4rem;
  font-weight: bold;
  color: blue !important;
  margin: 0;
  line-height: 1.2;
  cursor: pointer;
}

/* Titre L2 */
.diaporama-text-l2 {
  font-size: 1.3rem;
  font-weight: bold;
  color: green !important;
  margin: 0;
  line-height: 1.2;
  cursor: pointer;
}

/* Mot de vocabulaire cliquable dans le diaporama */
.diaporama-vocab {
  border-bottom: 2px dotted currentColor;
  cursor: pointer;
}

/* Barre de contrôles */
.diaporama-controls {
  background: linear-gradient(180deg, #666666 0%, #2a2a2a 50%, #000000 51%, #444444 100%);
  border-top: 1px solid #000;
  padding: 5px 0;
  z-index: 30;
  flex-shrink: 0;
}
.diaporama-controls-bottom {
  padding: 4px 1rem 10px; /* 10px de marge sous la jauge */
}

.diaporama-controls-top {
  display: flex;
  justify-content: space-between;
  padding: 0 1rem;
  width: 100%;
}

.diaporama-btn-group {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* Boutons d’icônes du diaporama */
.diaporama-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px;
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.diaporama-btn svg {
  width: 32px;
  height: 32px;
  fill: #ffffff;
}

/* Home / Eye / Back : contour blanc, intérieur transparent */
#diaporama-home svg,
#diaporama-eye svg,
#diaporama-back svg {
  fill: none !important;
  stroke: #ffffff !important;
  stroke-width: 2px;
}

/* Bouton Info “D” */
#diaporama-info {
  font-size: 1.8rem;
}

/* Masquage utilitaire */
.diaporama-hidden {
  display: none !important;
}


/* =========================================================
   INFOBULLES VOCABULAIRE (diaporama)
   ========================================================= */

.diaporama-vocab {
  position: relative;
}

/* Contenu de l’infobulle */
.diaporama-tooltip {
  position: absolute;
  z-index: 2000;
  max-width: 260px;
  background: rgba(15, 15, 24, 0.95);
  color: #fff;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  line-height: 1.4;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
  transform: translate(-50%, -100%);
  left: 50%;
  bottom: 100%;
  margin-bottom: 0.35rem;
  pointer-events: none;
}

/* Flèche de l’infobulle */
.diaporama-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: rgba(15, 15, 24, 0.95) transparent transparent transparent;
}


/* =========================================================
   LEXIQUE
   ========================================================= */

/* Séparateur logique dans la liste du lexique */
.lexique-line-break {
  grid-column: 1 / -1;
  height: 0;
  padding: 0;
  margin: 0;
}

/* Ancienne structure de ligne lexique (déroulante) */
.lexique-line {
  align-items: flex-start;
  flex-direction: column;
  gap: 0.25rem;
}

.lexique-line-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.lexique-term {
  position: relative;
  z-index: 1;
}

.lexique-toggle-icon {
  position: relative;
  z-index: 1;
  font-size: 0.8rem;
  opacity: 0.7;
}

.lexique-def {
  width: 100%;
  font-size: 0.9rem;
  color: var(--color-muted);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.25s ease;
}

.lexique-line.is-open .lexique-def {
  max-height: 200px;
  opacity: 1;
}

/* Conteneur général du lexique */
.lexique-list {
  margin-top: 1rem;
}


/* =========================================================
   LISTE GÉNÉRIQUE DE LIGNES MÉTALLIQUES
   ========================================================= */

.line-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 1rem;
}

/* Ligne métallique générique */
.line-metal {
  width: 100%;
  text-align: left;
  border-radius: var(--radius-md);
  padding: 0.6rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: linear-gradient(135deg, #3b3b3f 0%, #15151a 40%, #2c2c30 100%);
  color: var(--color-text);
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;

  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-transform: none;
  position: relative;
  overflow: hidden;
}

/* Texture métallique */
.line-metal::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.08) 0%,
    transparent 35%,
    transparent 65%,
    rgba(255, 255, 255, 0.06) 100%
  );
  mix-blend-mode: screen;
  opacity: 0.7;
  pointer-events: none;
}

/* Survol : effet brillant */
.line-metal:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.45);
  background: linear-gradient(135deg, #55565b 0%, #1d1e24 45%, #707076 100%);
}

/* Reflet mobile au hover */
.line-metal::after {
  content: "";
  position: absolute;
  top: -120%;
  left: -40%;
  width: 60%;
  height: 340%;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.212), transparent 60%);
  opacity: 0;
  pointer-events: none;
}

.line-metal:hover::after {
  opacity: 1;
  transform: translateX(220%);
}

/* Variante de ligne pour le lexique */
.line-metal.lexique-line {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: flex-start;
  gap: 1rem;
}

/* Texte de définition / sous-titre */
.line-metal-def {
  color: var(--color-muted);
  font-style: italic;
  font-size: 0.9rem;
}

/* Variante de ligne pour les vidéos */
.line-metal.video-line {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: flex-start;
  gap: 1rem;
}

.video-line .line-metal-def {
  color: var(--color-muted);
  font-style: italic;
  font-size: 0.9rem;
}


/* =========================================================
   AUTRES BLOCS (cartes simples, vignettes, formulaires)
   ========================================================= */

/* Anciennes cartes vidéo/lexique (si encore utilisées) */
.video-card,
.lexique-item {
  background: var(--color-surface);
  padding: 0.7rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

/* Vignette vidéo simple */
.video-thumb {
  height: 130px;
  background: #333;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 0.5rem;
}

/* Champs de formulaire (contact) */
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.4rem;
  background: var(--color-surface);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  border-radius: 4px;
}
/* Grille de tuiles d'histoires (même esprit que techniques / vidéos) */
.history-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

/* Tuile d'histoire (ici : on réutilise le style des cartes techniques) */
.history-tile.card-history {
  background: var(--color-surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1rem;
  cursor: pointer;
  transition: 0.15s;
  text-align: center;
}

.history-tile.card-history:hover {
  transform: translateY(-3px);
  background: #252535;
}

/* Tuile active (histoire sélectionnée) */
.history-tile.card-history.is-active {
  background: #252535;
}

/* Carte de contenu de l'histoire (sous les tuiles) */
.history-content-card {
  background: var(--color-surface);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.4rem;
  box-shadow: var(--shadow-soft);
  color: var(--color-text);
  line-height: 1.6;
}

/* Titre du contenu d'histoire (si tu en ajoutes un via JS) */
.history-content-card h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
  font-weight: 700;
}


/* =========================================================
   RÉGLAGES SPÉCIFIQUES MOBILE (≤ 768px)
   ========================================================= */

@media (max-width: 768px) {
  :root {
    --header-height: 55px;
  }

  /* Header plus compact */
  .site-header {
    padding: 0 10px;
    height: var(--header-height);
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .logo-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    overflow: hidden;
  }

  .logo-shotokan {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
  }

  .title-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .title-block h1 {
    font-size: 1.2rem;
    line-height: 0.85;
    margin: 0 0 -3px 0;
    white-space: nowrap;
    padding: 0;
  }

  .title-block .subtitle {
    font-size: 0.65rem;
    margin: 10px 0 0 0;
    padding: 0;
    line-height: 1;
    color: var(--color-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-menu-button {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    padding: 0 12px;
    margin-left: 10px;
    font-size: 0.7rem;
    line-height: 1;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: transparent;
    border-radius: 20px;
  }

  /* Conteneur du diaporama ajusté sur mobile */
  #mon-conteneur-wrapper {
    width: 100%;
    height: auto;
    border: none;
    border-radius: 0;
    background: transparent;
  }

  /* Jauge du diaporama plus lisible sur mobile */
  .diaporama-gauge-container {
    height: 22px;   /* un peu plus haute sur mobile */
    border-width: 1px;
  }

  .diaporama-gauge-fill {
    border-radius: 999px;
  }


  .diaporama-main-title {
    font-size: 1.8rem !important;
    padding: 0.3rem 0 !important;
  }

  .diaporama-title-zone {
    min-height: 80px !important;
    padding: 0.5rem !important;
  }

  /* Grille techniques → flex wrap sur mobile */
  .techniques-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
  }
  /* Marge sous la jauge du diaporama (mobile) */
  .diaporama-controls-bottom {
    padding: 4px 1rem 14px; /* même padding que desktop + marge un peu plus grande en bas */
  }
  /* Espace sous toute la barre de contrôle (mobile) */
  .diaporama-controls {
    margin-bottom: 10px;
  }

  .technique-card {
    flex-direction: row !important;
    padding: 0.8rem !important;
    min-height: 70px;
  }

  .technique-card .card-description {
    display: none !important;
  }

  .main-content {
    padding: 1rem !important;
  }

  .side-menu {
    top: var(--header-height);
    padding-top: 0;
  }

  /* Catégories vidéos (tuiles) ajustées sur mobile */
  .video-tiles {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); /* 1 à 3 tuiles selon la largeur */
    gap: 0.75rem;
  }
}

/* =========================================================
   ACCUEIL (image + texte)
========================================================= */
.accueil-layout {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* on commence à gauche */
  gap: 2rem;
  margin-top: 1.5rem;
  width: 90%;          /* 90% utile */
  margin-left: 0;      /* collé à gauche */
  margin-right: auto;  /* laisse ~10% de marge à droite */
}

/* 50% image / 40% texte à l'intérieur des 90% utiles */
.accueil-col-image {
  flex: 0 0 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Image : responsives en largeur ET en hauteur */
.accueil-image {
  max-width: 90%;
  max-height: 70vh; /* ne dépasse pas 70% de la hauteur visible */
  height: auto;
  width: auto;
  display: block;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
.logo-shotokan .logo-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}


/* Texte à droite plus grand */
.accueil-col-texte {
  flex: 0 0 40%;
  text-align: left;
  font-size: 1.2rem;
  line-height: 1.7;
  font-weight: 600;
}

/* Marges des paragraphes */
.accueil-col-texte p {
  margin-top: 0;
  margin-bottom: 1.5rem;
}

/* Lien contact */
.accueil-contact-link {
  font-size: 1.2rem;
  line-height: 1.7;
  font-weight: 600;
  padding: 0;
  background: none;
  border: none;
  color: var(--color-accent);
  font-weight: 600;
}

/* Logo dans la page Contact */
.contact-logo-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1.5rem 0;
}
/* Bas du formulaire de contact : deux colonnes */
.contact-bottom {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-top: 1.5rem;
}

/* Colonne gauche : cases + bouton */
.contact-bottom-left {
  flex: 1 1 50%;
}

/* Colonne droite : logo centré */
/* Colonne droite : logo parfaitement centré */
.contact-bottom-right {
  flex: 0 0 70%;
  display: flex;
  justify-content: center; /* centre horizontalement */
  align-items: bottom;     /* centre verticalement */
  min-height: 140px;       /* hauteur mini pour bien voir le centrage */
}

/* Logo responsive */
.contact-logo {
  width: 25vw;
  max-width: 180px;
  height: auto;
  display: block;
  opacity: 0.9;
}

/* Responsive : empiler sur mobile */
@media (max-width: 768px) {
  .contact-bottom {
    flex-direction: column;
    align-items: stretch;
  }

  .contact-bottom-right {
    justify-content: center;
  }

  .contact-logo {
    width: 40vw;
    max-width: 160px;
  }
}


/* Responsive mobile : tout passe en pleine largeur */
@media (max-width: 768px) {
  .accueil-layout {
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    width: 100%;
    margin-right: 0;
  }

  .accueil-col-image,
  .accueil-col-texte {
    flex: 0 0 auto;
    width: 100%;
  }

  .accueil-image {
    max-width: 70vw;
    max-height: 50vh;
  }

  .accueil-col-texte {
    font-size: 1rem;
  }
}