/* ============================================
   OFFGRID.QC - OVERRIDE.CSS RESTRUCTURÉ
   Surcharges spécifiques (charge APRÈS style.css)
   Version: 2.3.0 - RESTRUCTURÉ
   ============================================ */

/* ============================================
   NOTE IMPORTANTE
   ============================================

   Ce fichier charge APRÈS style.css (dépendance dans functions.php)
   Spécificité CSS plus élevée pour garantir les surcharges

   STRUCTURE RESTRUCTURÉE:
   1. Header & Navigation (TOUT regroupé + media queries)
   2. Liens spéciaux
   3. Autres surcharges

============================================ */


/* ================================================
   1. HEADER & NAVIGATION OVERRIDES - TOUT REGROUPÉ
   
   Surcharges pour .site-header, .main-nav, .main-menu,
   .menu-toggle, .hamburger
   
   ⚡ REGROUPÉ: Base + Toutes media queries
================================================ */

/* Header principal - Spécificité augmentée */
body header.site-header {
  background: rgba(14, 14, 14, 0.95);
  backdrop-filter: blur(10px);
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  width: 100%;
  overflow: hidden;
  padding: 1rem 0;
}

/* Conteneur du header */
body header.site-header .header-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
  overflow: visible !important;
}

/* Navigation principale */
body header.site-header .main-nav {
  margin: 0 auto;
  flex: 0 1 auto;
  display: flex;
  justify-content: center;
}

/* Menu principal */
body header.site-header .main-nav .main-menu,
body header.site-header .main-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 0;
  padding: 0;
  max-width: 100%;
}

/* Liens de navigation */
body header.site-header .main-nav a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: color .2s ease, background .2s ease;
  padding: 0.5rem 0.65rem;
  border-radius: 4px;
  display: inline-block;
  white-space: nowrap;
}

body header.site-header .main-nav a:hover,
body header.site-header .main-nav a:focus {
  color: #7cd97c;
  background: rgba(124,217,124,0.1);
  text-decoration: none;
}

/* Bouton burger */
body header.site-header .menu-toggle {
  display: none !important;
  position: absolute !important;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 11 !important;
}

/* Lignes du hamburger */
body header.site-header .menu-toggle .hamburger {
  display: block;
  width: 26px;
  height: 2px;
  background: #ffffff;
  margin: 5px 0;
  transition: all .3s ease;
  border-radius: 2px;
}

/* Animations burger actif */
body header.site-header .menu-toggle.active .hamburger:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body header.site-header .menu-toggle.active .hamburger:nth-child(2) {
  opacity: 0;
}

body header.site-header .menu-toggle.active .hamburger:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================
   2. SURCHARGES HEADER (CENTRAGE, BOUTON ACCUEIL)
============================================ */

/* Sécurité anti-débordement - CRITIQUE */
body header.site-header {
  width: 100% !important;
  overflow: hidden !important;
}

/* Conteneur centré - Overflow visible CRITIQUE pour menu burger */
body header.site-header .header-container {
  overflow: visible !important;
}

/* ============================================
   3. MENU 1 LIGNE (NOWRAP, COMPACTAGE)
============================================ */

/* Forcer 1 ligne globalement */
body header.site-header .main-nav .main-menu,
body header.site-header .main-nav ul {
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
}

/* ============================================
   4. BURGER MOBILE
============================================ */

/* Styles de base burger (déjà définis ci-dessus) */

/* ============================================
   5. LIENS "MON SYSTÈME"
============================================ */

/* Liens emphase (libellés +50%) */
.spec-link-strong {
  font-size: 1.5em;
  font-weight: 800;
  color: #7cd97c;
  text-decoration: none;
  line-height: 1.15;
  display: inline-block;
  border-bottom: 2px solid rgba(124,217,124,0.35);
  padding-bottom: 2px;
  transition: color .15s ease, border-color .15s ease, transform .15s ease;
}

.spec-link-strong:hover,
.spec-link-strong:focus {
  color: #b9ffb9;
  border-bottom-color: rgba(124,217,124,0.7);
  transform: translateY(-1px);
  text-decoration: none;
}

/* Valeurs (à droite) — discret mais cliquable */
.spec-link-subtle {
  color: #f8f9fa;
  text-decoration: none;
  border-bottom: 1px dashed rgba(255,255,255,0.25);
  padding-bottom: 2px;
  transition: color .15s ease, border-color .15s ease;
}

.spec-link-subtle:hover,
.spec-link-subtle:focus {
  color: #7cd97c;
  border-bottom-color: rgba(124,217,124,0.6);
  text-decoration: none;
}

/* ============================================
   6. MEDIA QUERIES RESPONSIVE
============================================ */

/* ===== DESKTOP (≥1201px) ===== */
@media (min-width: 1201px) {
  /* Bouton Accueil décalé */
  body header.site-header .header-container .btn-back-home {
    position: absolute !important;
    left: -70px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.38rem 0.68rem;
    font-size: 0.9em;
    border-radius: 6px;
    gap: 0.3rem;
    box-shadow: 0 3px 8px rgba(124,217,124,0.26);
    z-index: 12 !important;
  }

  /* Zone tampon visuelle */
  body header.site-header .header-container::after {
    content: '';
    position: absolute;
    right: 0.5rem;
    top: 50%;
    width: 90px;
    height: 1px;
    transform: translateY(-50%);

/* ===== MEDIA QUERIES HEADER - TOUTES REGROUPÉES ===== */
    pointer-events: none;
  }

  body header.site-header .main-nav .main-menu,
  body header.site-header .main-nav ul {
    gap: 0.9rem;
  }

  body header.site-header .main-nav a {
    font-size: 1.1rem;
    padding: 0.5rem 0.65rem;
    white-space: nowrap;
  }
}

/* ===== TABLETTES (769–1024px) ===== */
@media (min-width: 769px) and (max-width: 1024px) {
  body header.site-header .header-container {
    max-width: 100%;
    width: 100%;
    padding: 0.5rem 0.6rem;
    overflow: visible !important;
    justify-content: center;
  }

  body header.site-header .header-container .btn-back-home {
    position: absolute !important;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.29rem 0.51rem;
    font-size: 0.73em;
    border-radius: 5px;
    gap: 0.24rem;
    z-index: 12 !important;
    box-shadow: 0 2px 6px rgba(124,217,124,0.22);
  }

  body header.site-header .header-container .main-nav {
    margin: 0 auto;
    flex: 0 1 auto;
  }

  body header.site-header .header-container .main-nav .main-menu,
  body header.site-header .header-container .main-nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.3rem 0.4rem;
    margin: 0;
    padding: 0;
    max-width: 100%;
  }

  body header.site-header .header-container .main-nav a {
    font-size: 0.88rem;
    line-height: 1.1;
    padding: 0.3rem 0.4rem;
    white-space: nowrap;
  }
}

/* ===== TABLETTES (768–1200px) : Compacter pour tenir sur 1 ligne ===== */
@media (min-width: 768px) and (max-width: 1200px) {
  body header.site-header .main-nav {
    margin: 0 auto;
    flex: 0 1 auto;
    display: flex;
    justify-content: center;
  }

  body header.site-header .main-nav .main-menu,
  body header.site-header .main-nav ul {
    gap: 0.6rem;
  }

  body header.site-header .main-nav a {
    font-size: 1.0rem;
    padding: 0.4rem 0.5rem;
    white-space: nowrap;
  }
}

/* ===== iPad PORTRAIT (affinage) ===== */
@media (max-width: 1024px) and (orientation: portrait) {
  body header.site-header .header-container {
    padding: 0.45rem 0.5rem;
  }

  body header.site-header .header-container .main-nav .main-menu,
  body header.site-header .header-container .main-nav ul {
    gap: 0.25rem 0.35rem;
  }

  body header.site-header .header-container .main-nav a {
    font-size: 0.86rem;
    padding: 0.28rem 0.38rem;
  }
}

/* ===== MOBILE (≤980px) : BURGER ===== */
@media (max-width: 980px) {
  /* Bouton Accueil en mobile */
  body header.site-header .header-container .btn-back-home {
    left: 0.25rem;
    font-size: 0.88em;
    padding: 0.34rem 0.6rem;
    border-radius: 5px;
    z-index: 10001 !important;
  }

  /* Afficher le burger - CRITIQUE */
  body header.site-header .menu-toggle {
    display: block !important;
  }

  body header.site-header .header-container {
    justify-content: center;
  }

  /* Nav fermée par défaut - CRITIQUE */
  body header.site-header .header-container nav.main-nav {
    position: absolute !important;
    top: 100% !important;
    left: 0;
    right: 0;
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    background: rgba(14,14,14,0.98);
    backdrop-filter: blur(8px);
    padding: 1rem;
    z-index: 9999 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  }

  /* Nav ouverte - CRITIQUE */
  body header.site-header .header-container nav.main-nav.open {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* Liste verticale centrée */
  body header.site-header .header-container nav.main-nav .main-menu,
  body header.site-header .header-container nav.main-nav ul {
    display: flex !important;
    flex-direction: column !important;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    margin: 0;
    padding: 0.5rem 0;
    min-height: 10px;
    overflow: visible;
    width: 100%;
  }

  /* Liens mobiles */
  body header.site-header .header-container nav.main-nav a {
    display: block;
    width: 100%;
    text-align: center;
    color: #fff;
    padding: 0.85rem 1rem;
    border-radius: 6px;
    background: transparent;
    text-decoration: none;
    font-size: 1.05rem;
  }

  body header.site-header .header-container nav.main-nav a:hover,
  body header.site-header .header-container nav.main-nav a:focus {
    background: rgba(255,255,255,0.08);
    color: #7cd97c;
  }

  /* Sécurités anti-masquage - CRITIQUE */
  html, body {
    overflow-x: hidden !important;
  }
}

/* ===== MOBILE (≤767px) : Burger alternatif ===== */
@media (max-width: 767px) {
  body header.site-header .menu-toggle {
    display: block !important;
  }

  body header.site-header .header-container {
    justify-content: center;
  }

  body header.site-header .main-nav {
    position: absolute !important;
    top: 100% !important;
    left: 0;
    right: 0;
    background: rgba(14,14,14,0.98);
    backdrop-filter: blur(8px);
    display: none !important;
    padding: 1rem;
    z-index: 9 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  }

  body header.site-header .main-nav.open {
    display: block !important;
  }

  body header.site-header .main-menu {
    flex-direction: column !important;
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem 0;
  }

  body header.site-header .main-nav a {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.75rem 1rem;
    font-size: 1.05rem;
  }
}

/* ===== TRÈS PETIT MOBILE (≤480px) ===== */
@media (max-width: 480px) {
  body header.site-header .header-container {
    padding: 0.5rem 0.75rem;
  }

  body header.site-header .menu-toggle {
    right: 0.75rem;
  }

  body header.site-header .menu-toggle .hamburger {
    width: 22px;
  }
}

/* ===== DESKTOP (≥981px) : Forcer 1 ligne et compacter si nécessaire ===== */
@media (min-width: 981px) {
  body header.site-header .main-nav .main-menu {
    flex-wrap: nowrap;
    gap: 0.9rem;
  }

  body header.site-header .main-nav a {
    font-size: 1.06rem;
    padding: 0.45rem 0.55rem;
    white-space: nowrap;
  }
}

/* ===== HOTFIX BURGER (z-index/overflow) - CRITIQUE ===== */
@media (max-width: 980px) {

/* ================================================
   2. LIENS SPÉCIAUX & AUTRES SURCHARGES
================================================ */

  body header.site-header,
  body header.site-header .header-container {
    overflow: visible !important;
    position: relative !important;
    z-index: 1000 !important;
  }

  body header.site-header .header-container nav.main-nav {
    z-index: 100000 !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  }

  #wpadminbar {
    z-index: 100001 !important;
    position: fixed !important;
  }
}

/* ===== NAV CENTRÉE GLOBALEMENT (sécurité) ===== */
body header.site-header .header-container .main-nav {
  margin: 0 auto;
  flex: 0 1 auto;
}

body header.site-header .header-container .main-nav .main-menu,
body header.site-header .header-container .main-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 0;
  max-width: 100%;
}

body header.site-header .header-container .main-nav a {
  display: inline-block;
  white-space: nowrap;
  max-width: 100%;
}

/* ===== MENU ACTIF - PAGE COURANTE ===== */
.nav-links .current-menu-item a,
.nav-links .current_page_item a,
.main-navigation .current-menu-item a,
.main-navigation .current_page_item a {
  color: #7cd97c;
  text-shadow: 0 0 15px #7cd97c, 0 0 30px #7cd97c, 0 0 45px #7cd97c;
}

/* ===== CENTRAGE DU LOGO (si nécessaire) ===== */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  flex: 1;
  text-align: center;
}
