/* --- HEADER & NAV --- */
header {
  position: sticky;
  top: 0;
  z-index: 10000;
  /* Utilisation de la variable RGB pour la transparence (Glassmorphism) */
  background-color: rgba(var(--white-rgb), 0.95); 
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 70px; /* Hauteur fixe pour caler le menu mobile */
}

.logo img {
  height: 40px;
  width: auto;
  display: block;
}

/* Navigation Desktop */
.header-nav {
  display: flex;
  gap: 32px;
}

.header-nav a {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s ease;
  text-decoration: none;
  padding: 8px 0;
}

.header-nav a:hover {
  color: var(--text-main);
}

/* Focus pour l'accessibilité */
.header-nav a:focus-visible,
.footer-links a:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
  border-radius: var(--radius-sm);
  color: var(--text-main);
}

.header-mobile { display: none; }

/* Bouton Burger */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  color: var(--text-main);
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* --- MOBILE MENU (Correction avec Variables) --- */
.mobile-nav {
    position: fixed;
    top: 70px; /* Doit être égal à la hauteur de .header-inner */
    left: 0;
    right: 0;
    bottom: 0;
    
    height: calc(100vh - 70px);
    width: 100%;
    
    /* Utilisation de la variable système pour le fond */
    background-color: var(--bg-card); 
    z-index: 9999; 
    
    display: flex;
    flex-direction: column;
    padding: 0;
    
    /* Utilisation de la variable système pour la bordure */
    border-top: 1px solid var(--border);
    
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav.active {
    transform: translateX(0);
    /* Utilisation de l'ombre système (un peu renforcée pour le menu) */
    box-shadow: -5px 0 15px rgba(var(--black-rgb), 0.1);
}

/* Liens du menu mobile */
.mobile-nav a {
  padding: 20px;
  /* Bordure système */
  border-bottom: 1px solid var(--border);
  font-weight: 500;
  font-size: 18px;
  /* Texte système */
  color: var(--text-main);
  text-decoration: none;
}

.mobile-nav a:active {
    /* Feedback visuel au toucher sur mobile */
    background-color: var(--gray-50);
}

/* --- SECTIONS & GRID --- */
section { padding: clamp(40px, 5vw, 72px) 0; }

.section-header { 
  text-align: center; 
  margin-bottom: clamp(32px, 5vw, 48px); 
  max-width: 800px; 
  margin-left: auto; 
  margin-right: auto; 
}

.section-title { 
  font-size: clamp(24px, 4vw, 36px); 
  line-height: 1.2; 
  font-weight: 700; 
  margin-bottom: 16px; 
  color: var(--text-main); 
}

.section-subtitle { 
  font-size: clamp(18px, 3vw, 20px); 
  font-weight: 600; 
  margin-bottom: 12px; 
  color: var(--text-main); 
}

.section-lead { 
  font-size: clamp(16px, 2vw, 18px); 
  color: var(--text-muted); 
  max-width: 680px; 
  margin: 0 auto; 
}

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 2rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 1.5rem; }

/* --- FOOTER --- */
.footer {
  background-color: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: clamp(40px, 8vw, 80px);
  font-size: 13px;
  color: var(--text-muted);
}

.footer-content { 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  gap: 20px; 
  text-align: center; 
}

.footer-links { 
  display: flex; 
  gap: 24px; 
  flex-wrap: wrap; 
  justify-content: center; 
}

.footer-links a { 
  font-size: 14px; 
  color: var(--text-muted); 
  transition: color 0.2s; 
  text-decoration: none; 
}

.footer-links a:hover { 
  color: var(--primary); 
  text-decoration: underline; 
}

.footer-copyright { 
  color: var(--text-muted); 
  font-size: 14px; 
}

/* --- MEDIA QUERIES --- */
@media (min-width: 769px) {
  .footer-content { flex-direction: row; justify-content: space-between; text-align: left; }
  .mobile-nav { display: none !important; }
}

@media (max-width: 768px) {
  .header-nav { display: none; }
  .header-mobile { display: block; }
  .menu-toggle { display: flex; }
  .header-inner { height: 70px; } /* On garde la même hauteur pour éviter les sauts */
  .mobile-nav { top: 70px; height: calc(100vh - 70px); }
}