/* ==========================================================================
   1. SYSTÈME DE THÈMES (VARIABLES CSS CENTRALISÉES)
   ========================================================================== */
/* Thème par défaut (Gris / Portfolio / Carte) */
:root {
  --theme-bg: #D6D9E0;
  --theme-color: #2A281D;
  --theme-border: #2A281D;
}

/* Thème Transparent / Overlay (Page Prologue) */
body.theme-transparent {
  --theme-bg: #D6D9E0;
  --theme-color: #2A281D;
  --theme-border: #2A281D;
}

/* Thème Sombre (Page Paysages) */
body.theme-dark {
  --theme-bg: #2A281D !important;
  --theme-color: #D6D9E0 !important;
  --theme-border: #D6D9E0 !important;
}

/* Sécurité : force la flèche en clair sur fond foncé (Paysages) */
body.theme-dark .arrow-icon-left,
body.theme-dark .arrow-close-desktop,
body.theme-dark .arrow-close-vertical {
  background-color: #D6D9E0 !important;
}

body.theme-dark .arrow-icon-left::after,
body.theme-dark .arrow-close-desktop::after,
body.theme-dark .arrow-close-vertical::after {
  border-color: #D6D9E0 !important;
}

/* Thème Jaune (Pages Date & Crédits) */
body.theme-yellow,
body.bg-jaune,
.bg-jaune {
  --theme-bg: #EBC03F !important;
  --theme-color: #2A281D !important;
  --theme-border: #2A281D !important;
}

/* ==========================================================================
   2. TYPOGRAPHIE GLOBALE DES LANGUES
   ========================================================================== */
.lang-fr, .lang-fr * {
  font-style: normal !important;
}

.lang-cat, .lang-cat * {
  font-style: italic !important;
}

/* ==========================================================================
   3. BOUTON BASCULE DE LANGUE MOBILE (FIXÉ SOUS LE MENU)
   ========================================================================== */
.mobile-lang-container {
  display: none;
  position: fixed;
  top: 4.5rem;
  left: 2rem;
  z-index: 1001;
}

.lang-toggle-btn {
  background: rgba(42, 40, 29, 0.15);
  border: 1px solid currentColor;
  border-radius: 20px;
  color: inherit;
  padding: 0.4rem 0;
  width: 65px;
  height: 32px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
}

.lang-toggle-btn .cat-label {
  font-style: italic !important;
}

.lang-toggle-btn .fr-label {
  font-style: normal !important;
}

/* ==========================================================================
   4. CONFIGURATION DU MENU & HEADER (STRUCTURE COMMUNE)
   ========================================================================== */
.site-header {
  width: 100%;
  background-color: transparent !important;
  border-bottom: none;
  transition: background-color 0.3s ease;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
}

.nav-container {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
  height: 40px;
  background-color: transparent !important;
}

/* --- TYPOGRAPHIE DU MENU --- */
.nav-item, .menu-trigger {
  font-family: 'Open Sans', sans-serif;
  font-size: 1.33em;
  text-transform: uppercase;
  color: var(--theme-color) !important;
  text-decoration: none;
  cursor: pointer;
  font-weight: 300;
  font-style: normal;
  transition: color 0.3s ease;
}

/* --- ANIMATION CONTINUELLE DU TEXTE MULTILINGUE --- */
.nav-item {
  position: relative;
  display: inline-block;
}

.nav-item .word-fr,
.nav-item .word-cat {
  display: block;
  width: 100%;
  text-align: center;
  animation: alternateLanguage 8s infinite ease-in-out;
}

.nav-item .word-cat {
  position: absolute;
  top: 4px;
  left: 0;
  animation-delay: -4s;
  font-style: italic;
}

@keyframes alternateLanguage {
  0%, 42% { opacity: 1; }
  50%, 92% { opacity: 0; }
  100% { opacity: 1; }
}

.nav-item:hover .word-fr,
.nav-item:hover .word-cat {
  font-weight: 600;
}

.nav-item::after {
  content: attr(data-text);
  display: block;
  font-weight: 600;
  height: 0;
  overflow: hidden;
  visibility: hidden;
}

/* --- DÉCLENCHEUR DU MENU (MENU-TRIGGER) --- */
.menu-trigger {
  padding: 4px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: none !important;
  background: transparent;
  outline: none !important;
  box-shadow: none !important;
}

/* L'élément texte "MENU" reste visible par défaut */
.menu-trigger .trigger-text {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.menu-trigger .arrow-close-desktop {
  display: none !important;
}

/* --- GRAPHISME ET FLÈCHES DESKTOP & MOBILE --- */
.nav-item-arrow {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-decoration: none;
  cursor: pointer;
  height: 100%;
  width: 103px;
  border: none !important;
}

.item-home {
  padding: 0 0 0 20px;
}

/* Flèche Accueil / Retour (Gauche) */
.arrow-icon-left {
  width: 73px !important;
  max-width: 73px !important;
  min-width: 73px !important;
  height: 1px !important;
  background-color: var(--theme-color) !important;
  position: relative;
  display: inline-block !important;
  border: none !important;
}

.arrow-icon-left::after {
  content: '';
  position: absolute;
  left: 0;
  top: -3px;
  width: 6px;
  height: 6px;
  border-bottom: 1px solid var(--theme-color) !important;
  border-left: 1px solid var(--theme-color) !important;
  transform: rotate(45deg);
}

/* Flèche Fermeture Desktop (Droite) */
.arrow-close-desktop {
  width: 73px !important;
  max-width: 73px !important;
  min-width: 73px !important;
  height: 1px !important;
  background-color: var(--theme-color) !important;
  position: relative;
  border: none !important;
}

.arrow-close-desktop::after {
  content: '';
  position: absolute;
  right: 0;
  top: -3px;
  width: 6px;
  height: 6px;
  border-top: 1px solid var(--theme-color) !important;
  border-right: 1px solid var(--theme-color) !important;
  transform: rotate(45deg);
}

/* ==========================================================================
   5. ÉTATS DESKTOP & GRAND ÉCRAN (>= 1024px)
   ========================================================================== */
@media (min-width: 1024px) {
  .nav-container {
    margin-top: 13px;
  }

  .menu-trigger {
    margin-left: auto;
    order: 2;
    min-width: 113px;
    box-sizing: border-box;
    border-left: 0.25px solid var(--theme-border) !important;
    border-right: 0.25px solid var(--theme-border) !important;
  }

  .menu-trigger.is-open {
    border-left: none !important;
    border-right: none !important;
  }

  /* Sur desktop uniquement : masque le texte MENU pour mettre la flèche au clic */
  .menu-trigger.is-open .trigger-text {
    display: none !important;
  }

  .menu-trigger.is-open .arrow-close-desktop {
    display: inline-block !important;
  }

  .nav-links {
    display: flex;
    width: 0;
    opacity: 0;
    overflow: hidden;
    transition: width 0.5s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease;
    flex-wrap: nowrap;
    order: 3;
    background-color: transparent !important;
  }

  .nav-links.is-open {
    width: max-content;
    max-width: 65vw;
    opacity: 1;
    z-index: 1000;
  }

  .nav-item {
    padding: 4px 20px;
    line-height: 1;
    white-space: nowrap;
    border-left: 0.25px solid var(--theme-border);
    background-color: transparent !important;
  }

  .nav-item:last-child {
    border-right: 0.25px solid var(--theme-border);
  }

  .menu-close-mobile {
    display: none !important;
  }
}

/* ==========================================================================
   6. ÉTATS MOBILE & TABLETTE (< 1024px)
   ========================================================================== */
@media (max-width: 1023px) {

  .site-header {
    background-color: var(--theme-bg) !important;
  }

  .nav-container {
    margin-top: 0;
    padding-top: 12px;
    padding-bottom: 12px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--theme-bg) !important;
    border-bottom: 0.25px solid var(--theme-border);
  }

  .nav-item-arrow {
    width: 93px;
  }

  .item-home {
    padding: 0 0 0 20px;
  }

  /* Nettoyage strict des bordures parasites sur le bouton menu mobile */
  .menu-trigger {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
  }

  /* Force la présence permanente du mot MENU en mobile */
  .menu-trigger .trigger-text {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .menu-trigger .arrow-close-desktop {
    display: none !important;
  }

  /* Panneau déroulant mobile opaque */
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0;
    border-top: none;
    background-color: var(--theme-bg) !important;
    z-index: 2500;
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.25);
  }

  .nav-links.is-open {
    display: flex !important;
  }

  .nav-item {
    width: 100%;
    text-align: left;
    padding: 14px 20px;
    border-bottom: 0.25px solid var(--theme-border);
    border-left: none;
    box-sizing: border-box;
    background-color: var(--theme-bg) !important;
  }

  .nav-item .word-fr {
    text-align: left;
  }

  .nav-item .word-cat {
    top: 14px;
    text-align: left;
    padding-left: 20px;
  }

  /* Flèche verticale de fermeture mobile en bas de liste */
  .menu-close-mobile {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    min-height: 55px !important;
    padding: 10px 0 !important;
    cursor: pointer;
    background-color: var(--theme-bg) !important;
    border-bottom: 0.25px solid var(--theme-border);
    box-sizing: border-box;
  }

  .arrow-close-vertical {
    width: 1px !important;
    height: 30px !important;
    background-color: var(--theme-color) !important;
    position: relative;
    display: block !important;
  }

  .arrow-close-vertical::after {
    content: '';
    position: absolute;
    top: 0;
    left: -3px;
    width: 6px;
    height: 6px;
    border-top: 1px solid var(--theme-color) !important;
    border-left: 1px solid var(--theme-color) !important;
    transform: rotate(45deg);
  }

  /* --- GESTION DU BOUTON DE LANGUE MOBILE --- */
  .mobile-lang-container {
    display: block;
  }

  .prologue-section {
    padding-top: 8rem !important;
  }

  .lang-fr {
    display: block !important;
  }

  .lang-cat {
    display: none !important;
  }

  .lang-toggle-btn .cat-label {
    display: inline-block !important;
  }

  .lang-toggle-btn .fr-label {
    display: none !important;
  }

  body.show-cat .lang-fr {
    display: none !important;
  }

  body.show-cat .lang-cat {
    display: block !important;
  }

  body.show-cat .lang-toggle-btn .cat-label {
    display: none !important;
  }

  body.show-cat .lang-toggle-btn .fr-label {
    display: inline-block !important;
  }
}
/* 1. Rendre le lien cliquable et prioritaire en Z-INDEX */
.nav-item-arrow.item-home {
    position: relative;
    z-index: 10001; /* Doit être au-dessus du header et du nav-links */
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: 60px;  /* Surface de tap confortable */
    min-height: 44px; /* Taille minimale recommandée par Apple/Google pour le touch */
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
}

/* 2. Étendre la zone tactile autour du trait fin de la flèche */
.arrow-icon-left {
    pointer-events: none; /* Laisse le clic traverser vers la balise <a> */
    position: relative;
}

/* 3. Assurer que nav-links ne bloque pas les clics quand il est FERMÉ en mobile */
@media (max-width: 1023px) {
    .nav-links:not(.is-open) {
        display: none !important;
        pointer-events: none !important;
    }
}