/*!
Theme Name: Moulin d'Opio
Theme URI: https://moulin-opio.fr
Author: MAIA pour SCIC Les Ferrages & neede
Author URI: https://scic-ferrages.fr
Description: Thème moderne pour le Moulin d'Opio, démonstrateur international des transitions
Version: 2.0.0
License: GPL v2 or later
Text Domain: moulin-opio
*/

/* ==========================================================================
   Variables CSS Modernes
   ========================================================================== */
:root {
  /* Couleurs principales */
  --color-olive: #5c5c4d;
  --color-olive-light: #7a7a6b;
  --color-olive-dark: #3d3d33;
  --color-beige: #e8e4d9;
  --color-beige-light: #f5f2ea;
  --color-noir: #1a1a1a;
  --color-gris: #6b6b6b;
  --color-gris-light: #9a9a9a;

  /* Couleurs secondaires */
  --color-bronze: #8b7355;
  --color-bronze-light: #a08866;
  --color-vert-scic: #2d5a27;
  --color-blanc-casse: #fafaf8;
  --color-blanc: #ffffff;

  /* Couleurs fonctionnelles */
  --color-succes: #4a7c4e;
  --color-alerte: #c9a227;
  --color-erreur: #8b3a3a;

  /* Semantic Colors - for easy theming */
  --primary: #5c5c4d;
  --secondary: #8b7355;
  --accent: #cdc6a3;
  --text-primary: #2a2a2a;
  --text-secondary: #6b6b6b;
  --text-light: #ffffff;
  --text-dark: #1a1a1a;
  --bg-light: #ffffff;
  --bg-dark: #1a1a1a;
  --bg-surface: #f5f2ea;

  /* Typographie moderne */
  --font-titre: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-sous-titre: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-texte: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;

  /* Tailles fluides */
  --fs-h1: clamp(2rem, 5vw, 3.5rem);
  --fs-h2: clamp(1.5rem, 4vw, 2.5rem);
  --fs-h3: clamp(1.25rem, 3vw, 1.75rem);
  --fs-h4: clamp(1.125rem, 2vw, 1.375rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.9375rem;

  /* Espacements */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 3rem;
  --spacing-xl: 4rem;
  --spacing-xxl: 6rem;
  --spacing-section: clamp(3rem, 8vw, 6rem);

  /* Design moderne */
  --border-radius: 12px;
  --border-radius-lg: 24px;
  --border-radius-xl: 32px;
  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.2s ease;
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 40px 80px rgba(0, 0, 0, 0.15);
  --max-width: 1400px;
}

/* ==========================================================================
   Reset Modern & Base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-texte);
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-light);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection {
  background: var(--color-olive);
  color: white;
}

/* ==========================================================================
   Typographie Moderne
   ========================================================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 0 0 var(--spacing-md);
}

h1 {
  font-family: var(--font-titre);
  font-size: var(--fs-h1);
  color: var(--text-primary);
  font-weight: 700;
}

h2 {
  font-family: var(--font-titre);
  font-size: var(--fs-h2);
  color: var(--text-primary);
  margin-bottom: var(--spacing-lg);
}

h3 {
  font-family: var(--font-sous-titre);
  font-size: var(--fs-h3);
  color: var(--color-noir);
}

h4 {
  font-family: var(--font-sous-titre);
  font-size: var(--fs-h4);
  color: var(--color-bronze);
}

p {
  margin: 0 0 var(--spacing-sm);
  color: var(--color-gris);
}

.lead {
  font-size: 1.25rem;
  line-height: 1.8;
  color: var(--color-gris);
  font-weight: 300;
}

a {
  color: var(--color-olive);
  text-decoration: none;
  transition: var(--transition-fast);
  position: relative;
}

a:hover {
  color: var(--color-bronze);
}

/* ==========================================================================
   Layout Moderne
   ========================================================================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  width: 100%;
}

.section {
  padding: var(--spacing-section) 0;
  position: relative;
}

/* ==========================================================================
   Header Modern Design
   ========================================================================== */
#masthead.site-header {
  background: transparent;
  position: relative;
  z-index: 10;
  padding: 2rem 0;
}

/* Header sans navbar - complètement masqué */
#masthead.site-header.no-navbar {
  padding: 0;
  height: 0;
  min-height: 0;
  margin: 0;
  overflow: visible;
  background: transparent;
  border: none;
}

/* Quand pas de navbar, le contenu principal commence en haut */
body:has(.site-header.no-navbar) .site-main,
.site-header.no-navbar ~ .site-main {
  padding-top: 0;
  margin-top: 0;
}

/* Sur les autres pages sans navbar, pas d'espace en haut */
body:has(.site-header.no-navbar) #primary,
.site-header.no-navbar ~ #primary {
  padding-top: 0;
  margin-top: 0;
}

/* Logo qui se superpose (45% de hauteur viewport) */
/* Note: Using high specificity to ensure logo positioning works with any WordPress setup */
.hero-wrapper .brand-logo-container,
#page .brand-logo-container {
  position: absolute;
  top: 0;
  left: 5%;
  height: 45vh;
  min-height: 400px;
  z-index: 50;
  filter: drop-shadow(0px 10px 20px rgba(0, 0, 0, 0.8));
  pointer-events: none;
}

.brand-logo-container a {
  pointer-events: auto;
  display: block;
  height: 100%;
  width: auto;
}

/* Override WordPress custom-logo default sizing */
.brand-logo-container .custom-logo-link,
.brand-logo-container .custom-logo-link img,
.brand-logo-container img {
  height: 100%;
  width: auto;
  max-width: none;
  max-height: none;
  object-fit: contain;
  display: block;
}

/* Mobile logo (simple en haut à gauche) */
.mobile-logo {
  display: none;
}

/* Navigation à droite */
.main-navigation {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
  padding: 0 3rem;
  position: relative;
  z-index: 10;
  background: transparent;
}

.desktop-menu {
  display: flex;
  justify-content: flex-end;
  background: transparent;
}

.modern-nav {
  width: 100%;
}

.site-branding {
  display: none;
}

.site-logo img {
  height: 50px;
  transition: var(--transition);
}

.site-title {
  font-family: var(--font-titre);
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
}

.site-title a {
  color: var(--color-olive);
  text-decoration: none;
}

.tagline {
  font-size: 0.8rem;
  color: var(--color-bronze);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0;
  font-weight: 500;
}

/* Navigation moderne - styles moved to header.php for better control */

/* ==========================================================================
   Hero Section Moderne
   ========================================================================== */
main {
  margin-top: 0;
  position: relative;
  z-index: 10;
}

.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  background: transparent;
  overflow: hidden;
  padding-top: 0;
  z-index: 10;
}

/* Effet de dégradé désactivé car nous avons maintenant une image de fond */
/* .hero-section::before { ... } */

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.hero-section h1 {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  margin-bottom: var(--spacing-md);
  animation: fadeInUp 0.8s ease;
  font-weight: 700;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  color: var(--color-bronze);
  margin-bottom: var(--spacing-md);
  animation: fadeInUp 0.8s ease 0.2s both;
  font-weight: 300;
}

.hero-description {
  color: var(--color-gris);
  animation: fadeInUp 0.8s ease 0.4s both;
  margin-bottom: var(--spacing-lg);
  line-height: 1.8;
}

.hero-buttons {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease 0.6s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Zone d'urgence Moderne
   ========================================================================== */
.urgences-banner {
  background: linear-gradient(90deg, var(--color-alerte) 0%, #d4a935 100%);
  color: white;
  padding: var(--spacing-sm) 0;
  position: relative;
  overflow: hidden;
}

.urgences-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  to {
    left: 100%;
  }
}

.urgences-banner h3 {
  display: none;
}

.urgences-list {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-xl);
  list-style: none;
  margin: 0;
  padding: 0;
}

.urgence-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-weight: 500;
  animation: fadeIn 0.5s ease;
}

.urgence-icon {
  font-size: 1.25rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* ==========================================================================
   Boutons Modernes
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  border: none;
  border-radius: 50px;
  font-family: var(--font-texte);
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 400px;
  height: 400px;
}

.btn-primary {
  background: var(--color-olive);
  color: white;
  box-shadow: 0 10px 30px rgba(92, 92, 77, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(92, 92, 77, 0.4);
  color: white;
}

.btn-secondary {
  background: transparent;
  color: var(--color-olive);
  border: 2px solid var(--color-olive);
}

.btn-secondary:hover {
  background: var(--color-olive);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(92, 92, 77, 0.3);
}

.btn-don {
  background: linear-gradient(
    135deg,
    var(--color-vert-scic) 0%,
    var(--color-succes) 100%
  );
  color: white;
  font-size: 1rem;
  padding: 1rem 2.5rem;
  box-shadow: 0 10px 30px rgba(45, 90, 39, 0.3);
}

.btn-don:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 15px 40px rgba(45, 90, 39, 0.4);
  color: white;
}

.btn-bronze {
  background: var(--color-bronze);
  color: white;
  box-shadow: 0 10px 30px rgba(139, 115, 85, 0.3);
}

.btn-bronze:hover {
  background: white;
  color: var(--color-bronze);
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(139, 115, 85, 0.4);
}

.btn-gold {
  background: #cdc6a3;
  color: #2a2a2a;
  box-shadow: 0 10px 30px rgba(205, 198, 163, 0.3);
  border-radius: 8px;
}

.btn-gold::before {
  display: none; /* Désactive l'animation circulaire */
}

.btn-gold:hover {
  background: white;
  color: #2a2a2a;
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(205, 198, 163, 0.4);
}

.btn-outline-olive {
  background: transparent;
  color: var(--color-olive);
  border: 2px solid var(--color-olive);
}

.btn-outline-olive:hover {
  background: white;
  color: var(--color-olive);
  border-color: var(--color-olive);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(92, 92, 77, 0.3);
}

/* ==========================================================================
   Cards Modernes
   ========================================================================== */
.card {
  background: white;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  transition: var(--transition);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  position: relative;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--color-olive) 0%,
    var(--color-bronze) 100%
  );
  transform: scaleX(0);
  transition: var(--transition);
  transform-origin: left;
}

.card:hover::before {
  transform: scaleX(1);
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.card-image-wrapper {
  overflow: hidden;
  height: 220px;
  position: relative;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.card:hover .card-image {
  transform: scale(1.1);
}

.card-content {
  padding: var(--spacing-md);
}

.card-meta {
  font-size: var(--fs-small);
  color: var(--color-bronze);
  margin-bottom: var(--spacing-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-title {
  margin: 0 0 var(--spacing-sm);
  color: var(--color-noir);
  font-size: 1.25rem;
}

.card-title a {
  color: inherit;
  text-decoration: none;
}

.card-title a:hover {
  color: var(--color-olive);
}

.card-excerpt {
  color: var(--color-gris);
  margin-bottom: var(--spacing-md);
  line-height: 1.6;
}

/* ==========================================================================
   Sections Modernes
   ========================================================================== */
.section-title {
  text-align: center;
  margin-bottom: var(--spacing-xl);
  position: relative;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--color-olive) 0%,
    var(--color-bronze) 100%
  );
  border-radius: 2px;
}

/* Actualités Section */
.actualites-section {
  background: linear-gradient(
    180deg,
    var(--color-blanc) 0%,
    var(--color-beige-light) 100%
  );
  position: relative;
}

.actualites-section h2 {
  text-align: center;
  position: relative;
  padding-bottom: var(--spacing-md);
}

.actualites-section h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--color-olive) 0%,
    var(--color-bronze) 100%
  );
  border-radius: 2px;
}

/* Piliers Section */
.piliers-section {
  background: var(--color-blanc);
  position: relative;
}

.piliers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-xl);
}

.pilier-item {
  text-align: center;
  padding: var(--spacing-lg);
  background: var(--color-beige-light);
  border-radius: var(--border-radius-lg);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.pilier-item::before {
  content: "";
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, transparent 0%, var(--color-olive) 100%);
  opacity: 0.05;
  transition: var(--transition);
}

.pilier-item:hover::before {
  top: 0;
}

.pilier-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.pilier-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--color-olive) 0%,
    var(--color-olive-light) 100%
  );
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: var(--spacing-md);
  box-shadow: 0 10px 20px rgba(92, 92, 77, 0.3);
}

.pilier-item h3 {
  color: var(--color-olive);
  margin-bottom: var(--spacing-sm);
  font-size: 1.25rem;
}

.pilier-item p {
  color: var(--color-gris);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Boutique Section */
.boutique-section {
  background: linear-gradient(
    135deg,
    var(--color-olive) 0%,
    var(--color-olive-dark) 100%
  );
  color: white;
  position: relative;
  overflow: hidden;
}

.boutique-section::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.05) 0%,
    transparent 70%
  );
  border-radius: 50%;
  animation: float 15s ease-in-out infinite reverse;
}

.boutique-section h2 {
  color: white;
  text-align: center;
  position: relative;
  z-index: 1;
}

.boutique-section > .container > p {
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.125rem;
  max-width: 700px;
  margin: 0 auto var(--spacing-lg);
  position: relative;
  z-index: 1;
}

.boutique-item {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: var(--spacing-lg);
  border-radius: var(--border-radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
  transition: var(--transition);
  position: relative;
  z-index: 1;
}

.boutique-item:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.boutique-item h3 {
  color: white;
  margin-bottom: var(--spacing-sm);
}

.boutique-item p {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
}

/* Grilles Modernes */
.grid {
  display: grid;
  gap: var(--spacing-lg);
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* ==========================================================================
   Footer Moderne
   ========================================================================== */
.site-footer {
  background: linear-gradient(
    180deg,
    var(--color-olive) 0%,
    var(--color-olive-dark) 100%
  );
  color: white;
  padding: var(--spacing-xl) 0 var(--spacing-md);
  position: relative;
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-lg);
}

.footer-section h3 {
  color: white;
  font-size: 1.125rem;
  margin-bottom: var(--spacing-md);
  position: relative;
  padding-bottom: var(--spacing-sm);
}

.footer-section h3::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--color-bronze);
}

.footer-section a {
  color: rgba(255, 255, 255, 0.8);
  transition: var(--transition-fast);
  display: inline-block;
  padding: 0.25rem 0;
}

.footer-section a:hover {
  color: white;
  transform: translateX(5px);
}

.footer-section p {
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0.5rem;
}

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-section li {
  margin-bottom: 0.5rem;
}

.partners-logos {
  display: flex;
  gap: var(--spacing-lg);
  align-items: center;
  flex-wrap: wrap;
  margin-top: var(--spacing-md);
}

.partners-logos a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.partners-logos a:hover {
  transform: translateY(-5px);
}

.partners-logos img {
  height: 50px;
  filter: brightness(0) invert(1);
  opacity: 0.8;
  transition: var(--transition);
}

.partners-logos a:hover img {
  opacity: 1;
}

.footer-bottom {
  text-align: center;
  padding-top: var(--spacing-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: var(--fs-small);
  color: rgba(255, 255, 255, 0.6);
}

/* Social Links */
.social-links {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
  margin: var(--spacing-lg) 0;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transition: var(--transition);
}

.social-links a:hover {
  background: var(--color-bronze);
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(139, 115, 85, 0.3);
}

.social-links svg {
  fill: white;
}

/* ==========================================================================
   Formulaires Modernes
   ========================================================================== */
.form-group {
  margin-bottom: var(--spacing-md);
}

label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-weight: 600;
  color: var(--color-olive);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 0.875rem 1.25rem;
  border: 2px solid transparent;
  background: var(--color-beige-light);
  border-radius: var(--border-radius);
  font-family: var(--font-texte);
  font-size: var(--fs-body);
  transition: var(--transition);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-olive);
  background: white;
  box-shadow: 0 0 0 4px rgba(92, 92, 77, 0.1);
}

textarea {
  min-height: 150px;
  resize: vertical;
}

/* ==========================================================================
   Animations & Effets
   ========================================================================== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition);
}

.fade-in-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Scroll reveal */
[data-aos] {
  transition: opacity 0.8s ease, transform 0.8s ease;
}

/* ==========================================================================
   Mobile Menu Moderne
   ========================================================================== */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  position: relative;
  width: 30px;
  height: 30px;
}

.menu-toggle span {
  display: block;
  width: 25px;
  height: 2px;
  background: var(--color-olive);
  margin: 6px 0;
  transition: var(--transition);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.menu-toggle span:first-child {
  top: 6px;
}

.menu-toggle span:nth-child(2) {
  top: 50%;
  transform: translate(-50%, -50%);
}

.menu-toggle span:last-child {
  bottom: 6px;
}

.menu-toggle.active span:first-child {
  transform: translateX(-50%) translateY(8px) rotate(45deg);
  top: 50%;
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:last-child {
  transform: translateX(-50%) translateY(-8px) rotate(-45deg);
  bottom: 50%;
}

/* ==========================================================================
   Mobile Menu Overlay
   ========================================================================== */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 400px;
  height: 100vh;
  background: white;
  z-index: 1000;
  transition: right 0.3s ease;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
  padding: 5rem 2rem 2rem;
  overflow-y: auto;
}

.mobile-menu-overlay.menu-visible {
  right: 0;
}

.mobile-menu-overlay.menu-hidden {
  right: -100%;
}

.close-menu-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--color-olive);
  transition: var(--transition-fast);
}

.close-menu-btn:hover {
  color: var(--color-bronze);
  transform: rotate(90deg);
}

.mobile-menu-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-menu-list li {
  list-style: none;
}

.mobile-menu-list a {
  display: block;
  padding: 1rem 0;
  color: var(--color-olive);
  font-size: 1.25rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  border-bottom: 1px solid var(--color-beige);
  transition: var(--transition-fast);
}

.mobile-menu-list a:hover {
  color: var(--color-bronze);
  padding-left: 0.5rem;
}

/* Body scroll lock when menu is open */
body.menu-open {
  overflow: hidden;
}

/* Mobile menu backdrop */
.mobile-menu-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-backdrop.visible {
  opacity: 1;
  visibility: visible;
}

/* ==========================================================================
   Responsive Design - Un seul breakpoint : 1024px (lg de Tailwind)
   ========================================================================== */
@media (max-width: 1023px) {
  :root {
    --spacing-section: 3rem;
  }

  .menu-toggle {
    display: block;
  }

  .main-navigation {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: white;
    transition: right 0.3s ease;
    z-index: 1001;
    padding: var(--spacing-xxl) var(--spacing-lg) var(--spacing-lg);
    overflow-y: auto;
  }

  .main-navigation.active {
    right: 0;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
  }

  .main-navigation ul {
    flex-direction: column;
    gap: var(--spacing-sm);
    align-items: flex-start;
  }

  .main-navigation a {
    font-size: 1.25rem;
    padding: var(--spacing-sm) 0;
  }

  /* Logo en haut sur mobile */
  .brand-logo-container {
    display: none;
  }

  .mobile-logo {
    display: block;
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 50;
    width: 6rem;
  }

  .mobile-logo img {
    width: 100%;
    height: auto;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border-radius: 0 0 0.5rem 0.5rem;
  }

  .hero-section {
    padding-top: var(--spacing-lg);
  }

  .main-navigation {
    padding: 0 1rem;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: flex-start;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .piliers-grid {
    grid-template-columns: 1fr;
  }

  .urgences-list {
    flex-direction: column;
    gap: var(--spacing-sm);
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--spacing-sm);
  }

  .hero-section {
    min-height: calc(100vh - 60px);
    padding: var(--spacing-lg) 0;
  }

  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
  }
}

/* ==========================================================================
   Dark Mode Support (optionnel)
   ========================================================================== */
@media (prefers-color-scheme: dark) {
  /* Vous pouvez ajouter des styles dark mode ici si nécessaire */
}

/* ==========================================================================
   Styles spécifiques pour la page d'accueil
   ========================================================================== */
body.home,
body.page-template-front-page {
  background: #ffffff;
  color: #2a2a2a;
}

/* Navigation sur la page d'accueil avec fond transparent */
body.home #site-navigation.main-navigation a,
body.page-template-front-page #site-navigation.main-navigation a {
  color: #2a2a2a;
  font-weight: 600;
}

body.home #site-navigation.main-navigation a:hover,
body.page-template-front-page #site-navigation.main-navigation a:hover {
  color: #2a2a2a;
}

body.home #site-navigation.main-navigation a::after,
body.page-template-front-page #site-navigation.main-navigation a::after {
  background: #cdc6a3;
}

body.home #site-navigation.main-navigation .current-menu-item a,
body.page-template-front-page #site-navigation.main-navigation .current-menu-item a {
  color: #2a2a2a;
}

/* Logo sur page d'accueil avec drop-shadow amélioré */
body.home .hero-wrapper .brand-logo-container,
body.page-template-front-page .hero-wrapper .brand-logo-container {
  filter: drop-shadow(0px 10px 20px rgba(0, 0, 0, 0.5));
}

/* Pas de barre d'annonce sur la page d'accueil (gérée dans front-page.php) */
body.home .announcement-strip,
body.page-template-front-page .announcement-strip {
  display: none;
}

/* Homepage hero section has DARK background, so main title must be WHITE */
body.home .hero-bg-modern h1,
body.page-template-front-page .hero-bg-modern h1 {
  color: var(--text-light);
}
