/****************************************************
 * RESET
 ****************************************************/
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/****************************************************
 * VARIABLES — THÈME CLAIR
 ****************************************************/
:root {
  --header-bg: #e7f8f0;
  --header-text: #1f6f4a;

  --page-text: #1f6f4a;

  --content-bg: rgba(255, 255, 255, 0.92);
  --content-text: #1f6f4a;

  --card-bg: #ffffff;
  --card-border: #b3dccc;
  --card-text: #1f6f4a;

  --nav-bg: rgba(0, 0, 0, 0.06);
  --nav-hover: rgba(0, 0, 0, 0.14);

  --footer-bg: rgba(255, 255, 255, 0.85);

  --bg-overlay: rgba(255, 255, 255, 0.15);
}

/****************************************************
 * VARIABLES — THÈME SOMBRE
 ****************************************************/
body.dark {
  --header-bg: #062014;
  --header-text: #ffffff;

  --page-text: #ffffff;

  --content-bg: rgba(6, 32, 20, 0.92);
  --content-text: #ffffff;

  --card-bg: rgba(8, 40, 26, 0.96);
  --card-border: #39c98b;
  --card-text: #ffffff;

  --nav-bg: rgba(255, 255, 255, 0.12);
  --nav-hover: rgba(255, 255, 255, 0.25);

  --footer-bg: rgba(0, 0, 0, 0.55);

  --bg-overlay: rgba(0, 0, 0, 0.45);
}

/****************************************************
 * BODY
 ****************************************************/
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  line-height: 1.6;
  color: var(--page-text);

  background-image: url("../images/bandeau.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;

  transition: 0.3s ease-in-out;
  position: relative;
  z-index: 0;
}

/* arrière-plan semi-transparent */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  pointer-events: none;
  z-index: -9999 !important;
}

/****************************************************
 * HEADER
 ****************************************************/
header {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 0.8rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.8rem;
  font-weight: 600;
}

.site-logo {
  height: 48px;
  width: 48px;
  border-radius: 50%;
  border: 2px solid var(--header-text);
}

/****************************************************
 * NAVIGATION — DESKTOP
 ****************************************************/
.desktop-nav {
  flex: 1;
}

.desktop-nav ul {
  list-style: none;
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  justify-content: center;
}

.desktop-nav a {
  color: var(--header-text);
  text-decoration: none;
  padding: 0.45rem 0.8rem;
  background: var(--nav-bg);
  border-radius: 6px;
  transition: background 0.15s;
}

.desktop-nav a:hover {
  background: var(--nav-hover);
}

/****************************************************
 * LANGUE + THÈME
 ****************************************************/
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
}

.lang-box,
.theme-toggle {
  height: 36px;
  min-width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--header-text);
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
}

.theme-toggle {
  font-size: 1.1rem;
  color: var(--header-text);
}

.lang-box svg {
  width: 26px;
  height: auto;
}

.lang-btn svg {
  opacity: 0.85;
  transition: 0.2s ease;
}

.lang-btn:hover svg {
  opacity: 1;
  transform: scale(1.05);
}

.lang-box:hover,
.theme-toggle:hover {
  background: var(--nav-hover);
}

/****************************************************
 * BOUTON HAMBURGER
 ****************************************************/
.hamburger {
  display: none;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--header-text);
  color: var(--header-text);
  font-size: 1.6rem;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.25s;
  backdrop-filter: blur(6px);
}

.hamburger:hover {
  background: rgba(255, 255, 255, 0.85);
}

/****************************************************
 * MENU MOBILE
 ****************************************************/
.close-menu-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  font-size: 1.8rem;
  color: var(--header-text);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--header-text);
  border-radius: 8px;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
  transition: 0.2s;
  backdrop-filter: blur(6px);
}

body.dark .close-menu-btn {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border-color: rgba(255, 255, 255, 0.3);
}

.close-menu-btn:hover {
  background: rgba(255, 255, 255, 1);
}

#mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 270px;

  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(22px);
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 6px 0 25px rgba(0, 0, 0, 0.25);
  transform: translateX(-100%);
  transition: transform 0.28s ease-out;

  padding-top: 70px;
  padding-bottom: 40px;
  z-index: 9999;
}

body.dark #mobile-menu {
  background: rgba(10, 35, 24, 0.85);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 6px 0 22px rgba(0, 0, 0, 0.55);
}

#mobile-menu.open {
  transform: translateX(0);
}

#mobile-menu ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
  padding: 0 1.6rem;
}

#mobile-menu a {
  display: block;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 1.18rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.95);
  color: #1f6f4a;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16);
  transition: 0.22s;
}

body.dark #mobile-menu a {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

#mobile-menu a:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-2px);
}

body.dark #mobile-menu a:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* overlay du menu mobile */
#menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 9998;
}

#menu-overlay.show {
  opacity: 1;
}

/****************************************************
 * RESPONSIVE
 ****************************************************/
@media (max-width: 768px) {
  .hamburger { display: block; }
  .desktop-nav { display: none; }

  header { padding: 0.7rem 1rem; }
  .logo { font-size: 1.4rem; }
  .site-logo { width: 40px; height: 40px; }
}

/****************************************************
 * CONTENU GÉNÉRAL
 ****************************************************/
main {
  padding: 2rem 1rem;
}

.content-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--content-bg);
  color: var(--content-text);
  border-radius: 14px;
  padding: 2rem 1.25rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

/* option élégante pour grands écrans */
@media (min-width: 900px) {
  .content-wrapper {
    padding: 2.2rem 2rem;
  }
}

.section-title {
  font-size: 1.7rem;
  margin: 2rem 0 0.9rem;
}

/* Premier titre de page un peu plus proche du haut */
.content-wrapper > .section-title:first-of-type {
  margin-top: 0;
}

/****************************************************
 * TEXTE & DESCRIPTIONS
 ****************************************************/
.intro,
.species-desc {
  text-align: justify;
  text-indent: 1.3em;
  margin-bottom: 1.2rem;
}

/* petit espacement supplémentaire avant une grille après un paragraphe de description */
.intro + .grid,
.species-desc + .grid {
  margin-top: 0.6rem;
}

/****************************************************
 * GRILLES + CARDS
 ****************************************************/
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2.2rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1rem;
  color: var(--card-text);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
}

/* Titre -> Image */
.card h2,
.card h3,
.card h4 {
  margin-bottom: 1rem;
}

/* Image -> Texte */
.card img,
.card .style-image {
  margin-bottom: 0.6rem;
}

/****************************************************
 * IMAGES
 ****************************************************/
.card img:not(.video-thumb),
.style-image,
.tiktok-wrapper img,
.content-wrapper img {
  max-width: 100%;
  max-height: 430px;
  width: auto;
  height: auto;
  object-fit: contain;

  border-radius: 10px;
  display: block;
  margin: 0 auto;
}

/****************************************************
 * VARIETY BUTTON
 ****************************************************/
.variety-button {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--nav-bg);
  color: var(--card-text);
  cursor: pointer;
  font-size: 1rem;
}

.variety-button:hover {
  background: var(--nav-hover);
}

/****************************************************
 * MODAL
 ****************************************************/
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-box {
  background: var(--card-bg);
  color: var(--card-text);
  padding: 1.8rem;
  border-radius: 14px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  transform: scale(0.9);
  opacity: 0;
  transition: 0.3s ease;
}

.modal-box.active {
  transform: scale(1);
  opacity: 1;
}

.modal-box img {
  width: 100%;
  height: auto;
  max-height: 40vh;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.modal-close {
  margin-top: 1rem;
  background: #1f6f4a;
  color: white;
  border: none;
  padding: 0.7rem 1.4rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
}

body.dark .modal-close {
  background: #39c98b;
  color: #062014;
}

/****************************************************
 * BOUTON TIKTOK
 ****************************************************/
.tiktok-btn {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  font-weight: bold;
  text-decoration: none;
  border-radius: 8px;
  background: #1f6f4a;
  color: white;
}

body.dark .tiktok-btn {
  background: #39c98b;
  color: #062014;
}

/****************************************************
 * FOOTER
 ****************************************************/
footer {
  margin-top: 1rem;
  padding: 1rem;
  text-align: center;
  background: var(--footer-bg);
}

/* Espace entre un titre de section et la grille de cards
   (utile pour les pages sans paragraphe d'intro) */
.section-title + .grid {
  margin-top: 1.2rem;
}

/* Alinéa pour les descriptions */
.card p {
  text-indent: 1.3em;
}

/* Retrait des listes à puces */
.card ul {
  padding-left: 1.8em;
  margin-top: 0.6rem;
}

.card li {
  margin-left: 0.5em;
}

/* Option lisibilité */
.card p,
.card li {
  text-align: justify;
}

/* ==================================================
   MODAL GALERIE PHOTO – VERSION AGRANDIE
   ================================================== */

#photo-modal-box {
  max-width: 1100px;      /* plus large sur desktop */
  width: 100%;
  padding: 1.2rem 1.5rem;
}

/* Image dans la galerie photo */
#photo-modal-box img {
  max-height: 75vh;       /* image bien plus grande */
  width: 100%;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
}

/* Légende */
#photo-modal-caption {
  margin-top: 0.6rem;
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.85;
}

/* ============= MOBILE ============= */
@media (max-width: 768px) {

  #photo-modal-box {
    max-width: 100%;
    padding: 0.6rem 0.8rem;
  }

  #photo-modal-box img {
    max-height: 60vh;    /* pas de débordement mobile */
  }
}

/* ==================================================
   BOUTONS NAVIGATION – GALERIE PHOTO
   ================================================== */

/* Boutons précédent / suivant / fermer :
   on écrase le style de .modal-close + inline */
#photo-modal-box #photo-prev,
#photo-modal-box #photo-next,
#photo-modal-box #photo-close {
  padding: 0.3rem 0.7rem;    /* plus petit */
  font-size: 0.8rem;         /* texte discret */
  line-height: 1.2;
  border-radius: 8px;
}

/* Précédent / Suivant : ne plus prendre toute la largeur */
#photo-modal-box #photo-prev,
#photo-modal-box #photo-next {
  flex: 0 0 auto !important;  /* écrase le flex:1 inline */
  width: auto !important;     /* écrase un éventuel width:100% */
}

/* Bouton Fermer plus petit et centré */
#photo-modal-box #photo-close {
  width: auto !important;     /* écrase width:100% inline */
  display: inline-block;
  margin-top: 0.6rem;
}

/* Hover léger */
#photo-modal-box #photo-prev:hover,
#photo-modal-box #photo-next:hover,
#photo-modal-box #photo-close:hover {
  opacity: 0.95;
}

/* Désactivé */
#photo-modal-box #photo-prev:disabled,
#photo-modal-box #photo-next:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ================= MOBILE ================= */
@media (max-width: 768px) {
  #photo-modal-box #photo-prev,
  #photo-modal-box #photo-next,
  #photo-modal-box #photo-close {
    padding: 0.4rem 0.8rem;   /* un peu plus gros pour le doigt */
    font-size: 0.85rem;
  }
}

/* ==================================================
   CENTRAGE DES BOUTONS – VISUALISEUR PHOTO
   ================================================== */

/* Conteneur global des contrôles */
#photo-modal-box .photo-controls {
  display: flex;
  flex-direction: column;
  align-items: center;   /* ✅ centre tout */
  gap: 0.6rem;
  margin-top: 0.8rem;
}

/* Ligne Précédent / Suivant */
#photo-modal-box .photo-nav {
  display: flex;
  justify-content: center;  /* ✅ centre horizontalement */
  gap: 0.6rem;
  max-width: 320px;         /* ✅ réduit la “largeur visuelle” */
  width: 100%;
}

/* Boutons Précédent / Suivant */
#photo-modal-box #photo-prev,
#photo-modal-box #photo-next {
  flex: 0 0 auto !important;
  width: auto !important;
}

/* Bouton Fermer centré et étroit */
#photo-modal-box #photo-close {
  width: auto !important;
}

/* ==================================================
   CTA – COLLECTION VIDÉO EXPO
   ================================================== */

.video-collection-cta {
  max-width: 520px;
  margin: 1.5rem auto 2.5rem;
  text-align: center;
  padding: 1.4rem 1.2rem;
  border-radius: 14px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
}

.video-collection-cta h3 {
  margin-bottom: 0.5rem;
}

.video-collection-cta .variety-button {
  width: auto;              /* ✅ plus full-width */
  padding: 0.6rem 1.4rem;
  margin-top: 0.8rem;
}

/* ==================================================
   CARD – COLLECTION VIDÉO (VERSION STABLE & PURISTE)
   ================================================== */

/* Card horizontale */
.card.video-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* ===============================
   IMAGE = ~50 % DE LA CARD
   =============================== */

.card.video-card img.video-thumb {
  flex: 0 0 48%;          /* ≈ 50 % réel de la card */
  max-width: 380px;      /* limite haute */
  min-width: 260px;      /* évite l’effet "ridicule" */

  aspect-ratio: 4 / 3;   /* vignette propre */
  height: auto;
  object-fit: cover;

  border-radius: 14px;
  display: block;
}

/* ===============================
   CONTENU À DROITE
   =============================== */

.video-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Bouton CTA */
.video-card-content .video-collection-btn {
  align-self: flex-start;
  margin-top: 0.8rem;

  padding: 0.6rem 1.4rem;
  border-radius: 12px;
  border: 1px solid var(--card-border);

  background: var(--nav-bg);
  color: var(--card-text);
  cursor: pointer;
}

.video-card-content .video-collection-btn:hover {
  background: var(--nav-hover);
}

/* ===============================
   MOBILE
   =============================== */

@media (max-width: 700px) {
  .card.video-card {
    flex-direction: column;
    text-align: center;
  }

  .card.video-card img.video-thumb {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .video-card-content .video-collection-btn {
    align-self: center;
  }
}

/* ==================================================
   CARD – EXPO PHOTO (style comme les collections vidéo)
   ================================================== */

.card.photo-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.card.photo-card img.photo-thumb {
  flex: 0 0 48%;
  max-width: 380px;
  min-width: 260px;

  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;

  border-radius: 14px;
  display: block;
}

.photo-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.photo-card-content .variety-button {
  align-self: flex-start;
  width: auto;           /* au lieu de 100% */
  padding: 0.6rem 1.4rem;
  border-radius: 12px;
  margin-top: 0.8rem;
}

@media (max-width: 700px) {
  .card.photo-card {
    flex-direction: column;
    text-align: center;
  }

  .card.photo-card img.photo-thumb {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .photo-card-content .variety-button {
    align-self: center;
  }
}

/* ==================================================
   MODAL – COLLECTION VIDÉO TIKTOK (RESPONSIVE)
   Objectif: ne jamais dépasser l'écran en mobile
   ================================================== */

/* On réutilise la logique .modal-overlay active,
   mais on force un centrage + padding "safe" */
#video-modal-overlay.modal-overlay {
  padding: 1rem;
  align-items: center;
  justify-content: center;
}

/* Box vidéo : plus grande mais bornée par le viewport */
#video-modal-box.modal-box {
  width: 100%;
  max-width: 520px;          /* un peu + large que 420 */
  padding: 1rem;
}

/* Conteneur du player */
#video-player {
  width: 100%;
  /* Important: la box entière ne doit pas dépasser */
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Iframe TikTok : ratio vertical + hauteur limitée */
#video-player iframe {
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;      /* TikTok vertical */
  max-height: 80vh;          /* évite les vidéos "trop grandes" */
  border: none;
  border-radius: 12px;
  display: block;
}

/* Boutons nav : on garde l'esprit "modal-close" (vert)
   mais en version compacte et utilisable sur mobile */
#video-modal-box #video-prev,
#video-modal-box #video-next,
#video-modal-box #video-close {
  padding: 0.35rem 0.8rem;
  font-size: 0.85rem;
  line-height: 1.2;
  border-radius: 10px;
}

/* Précédent/Suivant : pas full width (comme pour photo) */
#video-modal-box #video-prev,
#video-modal-box #video-next {
  flex: 0 0 auto !important;
  width: auto !important;
}

/* Fermer : centré */
#video-modal-box #video-close {
  width: auto !important;
  display: inline-block;
  margin-top: 0.6rem;
}

/* Hover léger */
#video-modal-box #video-prev:hover,
#video-modal-box #video-next:hover,
#video-modal-box #video-close:hover {
  opacity: 0.95;
}

/* Désactivé */
#video-modal-box #video-prev:disabled,
#video-modal-box #video-next:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============= MOBILE ============= */
@media (max-width: 768px) {

  /* On réduit un peu la hauteur max pour éviter la barre d'URL mobile */
  #video-player {
    max-height: 75vh;
  }

  #video-player iframe {
    max-height: 75vh;
  }

  /* Boutons un peu + gros pour le doigt */
  #video-modal-box #video-prev,
  #video-modal-box #video-next,
  #video-modal-box #video-close {
    padding: 0.45rem 0.9rem;
    font-size: 0.9rem;
  }
}


