/* ==========================================================================
   0. IMPORTS & CONFIGURATION
   ========================================================================== */
/* CETTE LIGNE DOIT ÊTRE LA PREMIÈRE (Aucun code CSS avant) */
@import url("components/recipe-card.css");

:root {
  /* --- Palette de Couleurs --- */
  --clr-text-main: #2e2e2e;
  --clr-text-soft: #1c1c1c;
  --clr-text-inverse: #fafafa;

  --clr-bg-body: #f5f3f0;
  --clr-bg-white: #fafafa;

  --clr-accent-green: #58641d;
  --clr-accent-gold: #f7c548;

  /* --- Typographie --- */
  --font-serif: "Lora", serif;
  --font-sans: "Open Sans", sans-serif;

  /* --- Espacements --- */
  --space-xs: 8px;
  --space-s: 16px;
  --space-m: 24px;
  --space-l: 32px;
  --space-xl: 48px;
  --space-xxl: 64px;
  --space-hero: 80px;

  /* --- Bordures --- */
  --radius-s: 4px;
  --radius-m: 8px;
  --radius-l: 16px;
  --radius-full: 48px;

  /* --- Layout --- */
  --container-width: 1280px;
}

/* ==========================================================================
   1. RESET & BASES
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent; /* Retire le flash bleu sur mobile */
}

body {
  background-color: var(--clr-bg-body);
  color: var(--clr-text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-bottom: 1rem;
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.2;
}

a {
  color: var(--clr-text-main);
  text-decoration: none;
  transition: color 0.2s ease;
}

.lucide {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
  stroke-width: 1.5px;
}

/* Classe Screen Reader Only - Accessibilité */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.container-main,
.container {
  max-width: var(--container-width);
  margin-right: auto;
  margin-left: auto;
  padding-right: 32px;
  padding-left: 32px;
}

/* Responsive Container */
@media (max-width: 768px) {
  .container-main,
  .container {
    padding-right: 20px;
    padding-left: 20px;
  }
}

/* ==========================================================================
   2. EN-TÊTE (HEADER) & NAVIGATION
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; height: var(--space-hero);
  background-color: var(--clr-bg-white);
  transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease, background-color 0.4s ease;
}

.site-header.scrolled {
  height: 64px; background-color: rgba(250, 250, 250, 0.95);
  box-shadow: 0 4px 24px color-mix(in srgb, var(--clr-text-soft), transparent 88%);
}

.header-shadow { box-shadow: 0 4px 16px color-mix(in srgb, var(--clr-text-soft), transparent 84%); }
.site-header .container { width: 100%; }

.navigation-principale {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
}

/* --- Logo --- */
.logo {
  display: flex; flex-shrink: 0; align-items: center; height: 48px; width: auto; padding-right: 8px;
  color: var(--clr-text-main); transition: height 0.4s ease;
}
.logo:hover { color: var(--clr-text-soft); }
.logo svg { display: block; width: auto; height: 100%; }
.site-header.scrolled .logo { height: 40px; }

/* --- Bouton Burger (Mobile) --- */
#mobile-menu-btn {
  display: none; background: none; border: none; cursor: pointer; padding: 8px; margin-right: -8px; color: var(--clr-text-main);
}

/* --- Menu Principal (Desktop) --- */
.nav-links {
  display: flex; align-items: center; gap: var(--space-xl); list-style: none; transition: gap 0.4s ease;
}
.site-header.scrolled .nav-links { gap: var(--space-l); }

.nav-links > li > a {
  position: relative; z-index: 1; display: flex; align-items: center; font-size: 1.125rem;
  transition: color 0.2s ease, transform 0.2s ease;
}
.nav-links > li > a::before {
  content: ""; position: absolute; bottom: 0; left: 0; right: 0; z-index: -1; height: 4px;
  background-color: var(--clr-accent-gold); transform: scaleY(0); transform-origin: bottom; transition: transform 0.3s ease;
}
.nav-links > li > a:not(.active):hover { transform: translateY(-2px); }
.nav-links > li > a:not(.active):hover::before { transform: scaleY(1); }
.nav-links > li > a.active { font-weight: 600; color: var(--clr-text-main); }
.nav-links > li > a.active::before { transform: scaleY(1); }
.nav-links .lucide-chevron-down { flex-shrink: 0; width: 1rem; height: 1rem; margin-left: 4px; transition: transform 0.3s ease; }

/* --- Sous-menu Déroulant (Desktop) --- */
.nav-item-dropdown { position: relative; }

.sous-menu {
  position: absolute; top: 100%; left: 50%; z-index: 101;
  transform: translateX(-50%) translateY(8px);
  min-width: 224px; margin-top: 16px; padding: 8px;
  background-color: rgba(250, 250, 250, 0.96); border-radius: var(--radius-m);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--clr-text-soft), transparent 84%);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  list-style: none; opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.nav-item-dropdown:hover .sous-menu, .nav-item-dropdown:focus-within .sous-menu {
  transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible;
}
.nav-item-dropdown:hover .lucide-chevron-down, .nav-item-dropdown:focus-within .lucide-chevron-down {
  transform: rotate(180deg);
}

.sous-menu a {
  position: relative; display: block; padding: 12px 16px;
  color: var(--clr-text-main); font-size: 1rem; white-space: nowrap; border-radius: 4px;
  transition: padding-left 0.3s ease, background-color 0.2s ease, font-weight 0.2s ease;
}
.sous-menu a::before {
  content: ""; position: absolute; top: 0; left: 0; display: block; width: 4px; height: 100%;
  background-color: var(--clr-accent-gold); transform: scaleX(0); transform-origin: left; transition: transform 0.3s ease;
}
.sous-menu a:not(.active-sous-menu):hover { padding-left: 24px; background-color: rgba(46, 46, 46, 0.04); }
.sous-menu a:not(.active-sous-menu):hover::before, .sous-menu a.active-sous-menu::before { transform: scaleX(1); }
.sous-menu a.active-sous-menu { padding-left: 24px; font-weight: 600; background-color: rgba(247, 197, 72, 0.16); }


/* =========================================================
   --- RESPONSIVE MENU (MOBILE & LOGO GAUCHE) ---
   ========================================================= */
@media (max-width: 1024px) {
  
  /* 1. Header Layout : Logo Gauche - Burger Droite */
  .navigation-principale {
    display: flex;
    justify-content: space-between; /* La clé : sépare les éléments aux extrémités */
    align-items: center;
    min-height: 48px;
    width: 100%;
  }

  .logo {
    /* On annule le positionnement absolu précédent */
    position: static; 
    transform: none;
    left: auto;
    top: auto;
    
    /* Ajustement de sécurité pour l'encoche (Notch) */
    padding-left: env(safe-area-inset-left); 
  }

  #mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Ajustement de sécurité pour l'encoche (Notch) */
    padding-right: env(safe-area-inset-right);
  }

  /* 2. Menu Latéral (Drawer) */
  .nav-links {
    position: fixed; top: 0; right: -100%; width: 85%; max-width: 400px; height: 100vh;
    padding: 24px; flex-direction: column; align-items: flex-start; gap: 0;
    background-color: var(--clr-bg-white); box-shadow: -4px 0 24px rgba(0,0,0,0.15);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto; z-index: 1001;
  }
  .nav-links.open { right: 0; }

  /* Bouton Fermer Mobile */
  .mobile-close-container {
    display: flex; justify-content: flex-end; width: 100%; margin-bottom: 24px; border-bottom: none !important;
  }
  #close-mobile-menu {
    display: flex; align-items: center; justify-content: center; width: 40px; height: 40px;
    background: transparent; border: 1px solid color-mix(in srgb, var(--clr-text-main), transparent 80%);
    border-radius: 50%; color: var(--clr-text-main); cursor: pointer;
  }

  .nav-links > li { width: 100%; border-bottom: 1px solid color-mix(in srgb, var(--clr-text-main), transparent 90%); }
  .nav-links > li > a { padding: 16px 0; font-size: 1.125rem; font-weight: 600; width: 100%; justify-content: space-between; }
  
  /* Reset Desktop Effects */
  .nav-links > li > a::before { display: none; }
  .nav-links > li > a:hover { transform: none; }

  /* 3. SOUS-MENU MOBILE (CORRECTIF BUG) */
  .nav-item-dropdown { display: flex; flex-direction: column; }

  .sous-menu {
    /* Reset total des styles desktop pour éviter les décalages */
    position: static !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    box-shadow: none !important;
    background-color: #f9f9f9 !important;
    border: none !important;
    
    padding: 0;
    margin-top: 0;
    display: none; /* Caché par défaut */
    width: 100% !important;
    border-radius: var(--radius-m);
  }
  
  .nav-item-dropdown.active .sous-menu {
    display: block; /* Affiché via JS toggle */
    margin-bottom: 16px;
  }
  
  .sous-menu a {
      padding: 12px 16px 12px 24px !important; /* Indentation forcée */
      padding-left: 24px !important; /* Force l'alignement */
      font-size: 1rem;
      font-weight: 400;
      white-space: normal; /* Autorise le retour à la ligne */
      background-color: transparent !important; /* Évite le flash gris/blanc */
  }

  /* Désactivation des effets hover desktop sur mobile */
  .sous-menu a::before { display: none !important; } /* Supprime la barre dorée verticale */
  .sous-menu a:hover { padding-left: 24px !important; background-color: transparent !important; }
  .sous-menu a:active, .sous-menu a.active-sous-menu {
      background-color: rgba(0,0,0,0.05) !important; color: var(--clr-accent-green); font-weight: 600;
  }

  /* Animation flèche */
  .lucide-chevron-down { transition: transform 0.3s ease; }
  .nav-item-dropdown.active > a .lucide-chevron-down { transform: rotate(180deg); }

  /* Overlay */
  #mobile-menu-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5); z-index: 1000;
    opacity: 0; visibility: hidden; transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
  }
  #mobile-menu-overlay.active { opacity: 1; visibility: visible; }
}

@media (min-width: 1025px) {
    .mobile-close-container { display: none !important; }
}

/* ==========================================================================
   3. COMPOSANTS UI GLOBAUX (Reste inchangé)
   ========================================================================== */
.cta-button {
  display: inline-flex; align-items: center; height: 32px; padding: 0 16px;
  font-family: var(--font-sans); font-size: 1rem; font-weight: 600; color: var(--clr-text-inverse);
  background-color: var(--clr-accent-green); border-radius: var(--radius-m);
  box-shadow: 0 4px 8px color-mix(in srgb, var(--clr-text-soft), transparent 76%);
  user-select: none; transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.cta-button:hover {
  background-color: color-mix(in srgb, var(--clr-accent-green), black 10%);
  box-shadow: 0 8px 16px color-mix(in srgb, var(--clr-text-soft), transparent 76%); transform: scale(1.02);
}
.cta-button .lucide { width: 1.5rem; height: 1.5rem; margin-left: 8px; transition: transform 0.2s ease; }

.action-btn { display: flex; align-items: center; gap: 16px; padding: 0; font-family: var(--font-sans); font-size: 1rem; font-weight: 600; color: var(--clr-text-main); background: none; border: none; cursor: pointer; transition: color 0.2s ease; }
.action-btn .circle-icon { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border: 1px solid color-mix(in srgb, var(--clr-text-main), transparent 80%); border-radius: 50%; transition: border-color 0.2s ease, background-color 0.2s ease; }
.action-btn:hover { color: var(--clr-text-main); }
.action-btn:hover .circle-icon { background-color: var(--clr-accent-gold); border-color: var(--clr-accent-gold); color: var(--clr-text-soft); box-shadow: 0 4px 12px rgba(247, 197, 72, 0.3); transform: scale(1.1); }

.tag { display: inline-block; padding: 6px 16px; font-family: var(--font-sans); font-size: 0.875rem; font-weight: 600; color: var(--clr-accent-green); text-decoration: none; border: 1px solid var(--clr-accent-green); border-radius: var(--radius-full); transition: all 0.2s ease; }
.tag:hover { background-color: color-mix(in srgb, var(--clr-accent-green), transparent 96%); }

.tag-pill { display: inline-flex; align-items: center; justify-content: center; height: 28px; padding: 0 12px; font-family: var(--font-sans); font-size: 0.8rem; font-weight: 600; color: var(--clr-text-main); text-decoration: none; white-space: nowrap; background-color: transparent; border: 1px solid color-mix(in srgb, var(--clr-text-main), transparent 80%); border-radius: var(--radius-full); transition: all 0.2s ease; cursor: pointer; }
.tag-pill:hover, .tag-pill:focus { background-color: rgba(0, 0, 0, 0.05); border-color: var(--clr-text-main); color: var(--clr-text-main); }
button.tag-pill { appearance: none; -webkit-appearance: none; -moz-appearance: none; }
.tag-pill.small { height: 24px; padding: 0 10px; font-size: 0.75rem; }

input[type="email"], input[type="search"] { font-family: var(--font-sans); font-size: 0.875rem; border-radius: var(--radius-m); transition: border-color 0.2s ease, box-shadow 0.2s ease; }

/* ... (Reste inchangé : Breadcrumbs, Search Overlay, Footer) ... */
.breadcrumbs-container { padding-top: var(--space-m); padding-bottom: var(--space-m); }
.breadcrumbs { font-family: var(--font-sans); font-size: 0.875rem; color: color-mix(in srgb, var(--clr-text-main), transparent 40%); }
.breadcrumbs a:hover { color: var(--clr-text-main); text-decoration: underline; }
.breadcrumbs .current { font-weight: 700; color: var(--clr-text-main); }

/* ==========================================================================
   5. MODULE : RECHERCHE GLOBALE
   ========================================================================== */

/* --- Bouton Flottant (FAB) --- */
#floating-search-btn {
  position: fixed;
  right: 32px;
  bottom: 32px;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  color: var(--clr-text-soft);
  background-color: var(--clr-accent-gold);
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 20px
    color-mix(in srgb, var(--clr-accent-gold), transparent 50%);
  cursor: pointer;
  opacity: 0;
  transform: translateY(120px) scale(0.8);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.4s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

#floating-search-btn.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

#floating-search-btn:hover {
  background-color: color-mix(in srgb, var(--clr-accent-gold), white 20%);
  box-shadow: 0 8px 30px
    color-mix(in srgb, var(--clr-accent-gold), transparent 40%);
  transform: scale(1.1);
}

#floating-search-btn .lucide {
  width: 28px;
  height: 28px;
}

/* --- Overlay Plein Écran (Amélioré) --- */
#search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  height: 100%;
  padding-top: 140px;
  
  /* Fond semi-transparent */
  background-color: rgba(28, 28, 28, 0); /* Commence transparent */
  
  /* Flou d'arrière-plan (Géré par transition) */
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  
  opacity: 0;
  visibility: hidden;
  
  /* Transition douce sur le fond et le flou */
  transition: 
    opacity 0.3s ease, 
    visibility 0.3s ease, 
    background-color 0.3s ease,
    backdrop-filter 0.3s ease,
    -webkit-backdrop-filter 0.3s ease;
}

#search-overlay.active {
  opacity: 1;
  visibility: visible;
  background-color: rgba(28, 28, 28, 0.4); /* S'assombrit */
  backdrop-filter: blur(12px); /* Devient flou */
  -webkit-backdrop-filter: blur(12px);
}

/* Bouton Fermer */
#close-search-btn {
  position: absolute;
  top: 40px;
  right: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  color: var(--clr-text-inverse);
  background: color-mix(in srgb, var(--clr-bg-white), transparent 90%);
  border: 1px solid color-mix(in srgb, var(--clr-bg-white), transparent 90%);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
}

#close-search-btn:hover {
  background-color: var(--clr-accent-gold);
  border-color: var(--clr-accent-gold);
  color: var(--clr-text-soft);
  transform: rotate(90deg);
}

/* --- Conteneur Search (Animation Pop) --- */
.search-container {
  position: relative;
  width: 100%;
  max-width: 700px;
  padding: 0 24px;
  
  /* État initial : légèrement plus petit et décalé */
  opacity: 0;
  transform: scale(0.92) translateY(20px);
  
  /* Animation "Rebond" (Cubic Bezier) */
  transition: 
    opacity 0.3s ease,
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Quand l'overlay est actif, la barre "Pop" */
#search-overlay.active .search-container {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.search-input-wrapper {
  position: relative;
  margin-bottom: 64px;
}

.search-input-wrapper .search-icon {
  position: absolute;
  top: 50%;
  left: 0;
  width: 40px;
  height: 40px;
  color: var(--clr-accent-gold);
  pointer-events: none;
  transform: translateY(-50%);
}

#global-search-input {
  width: 100%;
  height: 80px;
  padding-left: 64px;
  font-family: var(--font-sans);
  font-size: 2rem;
  font-weight: 600;
  color: var(--clr-text-inverse);
  background: transparent;
  border: none;
  border-bottom: 2px solid
    color-mix(in srgb, var(--clr-bg-white), transparent 80%);
  border-radius: 0;
  outline: none;
  transition: border-color 0.3s ease;
}

#global-search-input::placeholder {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 300;
  color: color-mix(in srgb, var(--clr-bg-white), transparent 70%);
  transform: translateY(-4px);
}

#global-search-input:focus {
  border-color: var(--clr-accent-gold);
}

/* Grille Résultats */
.search-results-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  max-height: calc(100vh - 300px);
  padding-right: 8px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--clr-bg-white), transparent 80%)
    transparent;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px;
  background-color: color-mix(in srgb, var(--clr-bg-white), transparent 97%);
  border: 1px solid color-mix(in srgb, var(--clr-bg-white), transparent 95%);
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.search-result-item:focus,
.search-result-item:hover {
  background-color: color-mix(in srgb, var(--clr-bg-white), transparent 90%);
  border-color: var(--clr-accent-gold);
  outline: none;
  transform: translateX(8px);
}

.result-image {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  object-fit: cover;
  background-color: var(--clr-text-soft);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.result-image.is-fallback {
  object-fit: contain;
  padding: 20px;
  background-color: var(--clr-bg-body);
  color: var(--clr-text-main);
  opacity: 1;
}

.result-content {
  flex-grow: 1;
}

.result-title {
  margin-bottom: 8px;
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--clr-text-inverse);
}

.result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.result-tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--clr-text-inverse);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--clr-text-inverse), transparent 80%);
  border-radius: var(--radius-full);
}

.search-result-item:hover .result-tag {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--clr-text-inverse);
}

#search-empty-state {
  padding-top: 40px;
  text-align: center;
  color: color-mix(in srgb, var(--clr-bg-white), transparent 50%);
}

#search-empty-state p {
  font-size: 1.1rem;
}

/* Responsive Mobile (Search Overlay) */
@media (max-width: 768px) {
  #search-overlay {
    padding-top: 80px;
  }

  .search-container {
    padding: 0 16px;
  }

  #global-search-input {
    height: 60px;
    padding-left: 20px;
    padding-right: 20px;
    font-size: 1.1rem; /* Police réduite (Critique pour que ça rentre) */
  }
  
  #global-search-input::placeholder {
      font-size: 1.1rem;
  }
  
  /* Ajustement icône search si elle gêne */
  .search-input-wrapper .search-icon {
      display: none; /* On peut cacher la petite loupe décorative sur mobile pour gagner de la place, car il y a déjà le placeholder */
  }

  .search-result-item {
    gap: 12px;
    padding: 8px;
  }

  .result-image {
    width: 56px;
    height: 56px;
  }
  
  .result-title {
      font-size: 1rem;
  }
}

/* ==========================================================================
   6. OVERRIDES : CARROUSEL GLOBAL
   ========================================================================== */
.carousel-track .smart-card,
.carousel-track .recipe-card {
  flex-shrink: 0;
  width: 384px;
  min-width: 384px;
  height: 480px;
  min-height: 0;
  margin-bottom: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.5s ease;
}

.carousel-track .smart-card .smart-card-image {
  height: 232px;
}

.recipe-card.faded {
  opacity: 0.48;
}

/* ==========================================================================
   7. GESTION DU "LOAD MORE"
   ========================================================================== */
.hidden-recipe {
  display: none;
}

.load-more-container {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 48px;
}

.load-more-container .cta-button {
  height: 48px;
  padding: 0 32px;
  font-size: 1rem;
}

.load-more-container .cta-button:hover .lucide {
  transform: translateY(2px);
}

/* Animations */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.spin {
  animation: spin 1s linear infinite;
}

/* ==========================================================================
   8. PIED DE PAGE (FOOTER)
   ========================================================================== */
.site-footer {
  padding-top: 40px;
  padding-bottom: 24px;
  font-size: 0.875rem;
  color: color-mix(in srgb, var(--clr-bg-body), transparent 24%);
  background-color: var(--clr-text-main);
}

.footer-grid {
  display: grid;
  grid-template-columns: 336px 128px 128px 336px;
  column-gap: var(--space-hero);
  justify-content: center;
  margin-bottom: var(--space-xxl);
}

/* Colonne Logo */
.logo-footer {
  display: block;
  width: 176px;
  margin-bottom: 24px;
  color: var(--clr-bg-body);
  transition: color 0.2s ease;
}

.logo-footer:hover {
  color: var(--clr-accent-gold);
}

.logo-footer svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Colonnes Liens */
.footer-titre {
  margin-bottom: 24px;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--clr-bg-body);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 16px;
}

.footer-links a {
  display: inline-block;
  color: color-mix(in srgb, var(--clr-bg-body), transparent 24%);
  transition: color 0.2s ease, transform 0.2s ease;
}

.footer-links a:hover {
  color: var(--clr-bg-body);
  transform: translateX(4px);
}

/* Colonne Infolettre */
.footer-col-infolettre .footer-description {
  display: block;
  margin-bottom: 24px;
}

.form-infolettre {
  position: relative;
  width: 336px;
  margin-bottom: 32px;
}

.form-infolettre input[type="email"] {
  width: 100%;
  height: 48px;
  padding-left: 16px;
  padding-right: 56px;
  color: var(--clr-bg-body);
  background-color: var(--clr-text-soft);
  border: 1px solid rgba(245, 243, 240, 0.8);
  box-shadow: inset 0 2px 8px rgba(28, 28, 28, 0.08);
}

.form-infolettre input[type="email"]::placeholder {
  opacity: 1;
  color: color-mix(in srgb, var(--clr-bg-body), transparent 24%);
}

.form-infolettre input[type="email"]:hover {
  border-color: var(--clr-bg-body);
}

.form-infolettre input[type="email"]:focus {
  border-color: var(--clr-accent-gold);
  box-shadow: inset 0 2px 8px rgba(28, 28, 28, 0.08),
    0 0 0 2px color-mix(in srgb, var(--clr-accent-gold), transparent 72%);
  outline: none;
}

/* Autofill Hack */
.form-infolettre input[type="email"]:-webkit-autofill,
.form-infolettre input[type="email"]:-webkit-autofill:hover,
.form-infolettre input[type="email"]:-webkit-autofill:active,
.form-infolettre input[type="email"]:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--clr-bg-body);
  caret-color: var(--clr-bg-body);
  box-shadow: inset 0 0 0 100px var(--clr-text-soft);
  border: 1px solid rgba(245, 243, 240, 0.8);
  transition: background-color 5000s ease-in-out 0s;
}

.form-infolettre button {
  position: absolute;
  top: 8px;
  right: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  background-color: rgba(245, 243, 240, 0.8);
  border: none;
  border-radius: var(--radius-m);
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.form-infolettre button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.form-infolettre button:hover:not(:disabled) {
  transform: scale(1.1);
}

.form-infolettre button:hover:not(:disabled) .lucide-arrow-right {
  animation: pulseArrow 0.8s ease-in-out infinite;
}

.form-infolettre button.is-valid {
  background-color: var(--clr-bg-body);
}

/* Réseaux Sociaux */
.social-links {
  display: flex;
  gap: 16px;
  list-style: none;
}

.social-links a {
  display: block;
  color: color-mix(in srgb, var(--clr-bg-body), transparent 24%);
  transition: color 0.2s ease, transform 0.2s ease;
}

.social-links a:hover {
  color: var(--clr-accent-gold);
  transform: scale(1.1);
}

/* Copyright */
.footer-copyright {
  font-weight: 400;
  text-align: center;
  color: color-mix(in srgb, var(--clr-bg-body), transparent 40%);
}

.footer-copyright strong {
  font-weight: 600;
}

/* --- RESPONSIVE FOOTER (MOBILE) --- */
@media (max-width: 1200px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 0 20px;
  }
  .footer-col-logo,
  .footer-col-infolettre {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  /* On aligne tout à gauche pour la lisibilité */
  .footer-grid {
    display: flex;
    flex-direction: column;
    gap: 40px; /* Écart réduit (était 48px) */
    text-align: left; /* Plus propre que le centré */
  }

  .footer-col {
    align-items: flex-start; /* Aligne les items à gauche */
    width: 100%;
  }

  /* Logo plus petit sur mobile */
  .logo-footer {
      width: 140px;
      margin-bottom: 16px;
  }

  /* Infolettre : prend toute la largeur disponible */
  .form-infolettre {
      width: 100%;
      max-width: 100%;
      margin-bottom: 24px;
  }

  /* Liens : Zones de touche plus grandes */
  .footer-links li {
      margin-bottom: 12px;
      border-bottom: 1px solid rgba(255,255,255,0.05); /* Ligne de séparation subtile */
      padding-bottom: 8px;
      width: 100%;
  }
  .footer-links li:last-child {
      border-bottom: none;
  }
  
  /* Copyright avec marge pour le bouton flottant */
  .footer-copyright {
      text-align: center; /* On garde le copyright centré */
      padding-bottom: 80px; /* Espace pour le bouton loupe flottant ! */
      font-size: 0.8rem;
  }
}

/* ==========================================================================
   9. STYLE GÉNÉRIQUE : PAGES DE TEXTE (Légal, Politique, 404)
   ========================================================================== */

.text-page-container {
  max-width: 800px; /* Lecture confortable */
  margin: 0 auto;
  padding: var(--space-xl) var(--space-m);
}

.text-page-container h1 {
  font-size: 2.5rem;
  margin-bottom: var(--space-l);
  color: var(--clr-text-main);
}

.text-page-container h2 {
  font-size: 1.75rem;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-s);
  color: var(--clr-text-soft);
  border-bottom: 2px solid var(--clr-accent-gold);
  display: inline-block;
  padding-bottom: 4px;
}

.text-page-container p {
  margin-bottom: 1rem;
  font-size: 1rem;
  line-height: 1.8;
  color: #444;
}

.text-page-container ul {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.text-page-container li {
  margin-bottom: 0.5rem;
}

/* --- Responsive Mobile --- */
@media (max-width: 768px) {
  .text-page-container {
    padding: var(--space-l) 20px;
  }

  .text-page-container h1 {
    font-size: 2rem;
    line-height: 1.2;
  }

  .text-page-container h2 {
    font-size: 1.5rem;
    margin-top: var(--space-l);
  }
}

/* ==========================================================================
   10. FINITIONS PREMIUM (POLISH)
   ========================================================================== */

/* --- A. Scrollbar Personnalisée (Webkit - Chrome/Safari/Edge) --- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px; /* Pour le scroll horizontal */
}

::-webkit-scrollbar-track {
  background: var(--clr-bg-body);
}

::-webkit-scrollbar-thumb {
  background-color: #d1cfcc; /* Gris pierre léger */
  border-radius: 10px;
  border: 2px solid var(--clr-bg-body); /* Crée une marge invisible */
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--clr-accent-green); /* Devient vert au survol */
}

/* Version Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #d1cfcc var(--clr-bg-body);
}

/* --- B. Couleur de Sélection (Highlight) --- */
::selection {
  background-color: var(--clr-accent-gold);
  color: var(--clr-text-soft);
}

/* --- C. Animation d'Entrée de Page --- */
main {
  animation: pageFadeIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  opacity: 0; /* Départ invisible */
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- D. Focus Accessible (Navigation Clavier) --- */
*:focus-visible {
  outline: 2px solid var(--clr-accent-gold);
  outline-offset: 4px;
  border-radius: 2px;
}

/* --- E. Amélioration des Liens dans le texte --- */
/* Pour tous les paragraphes standards, on souligne les liens discrètement */
p a:not(.cta-button):not(.action-btn):not(.privacy-link):not(.tag):not(.tag-pill) {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--clr-accent-gold), transparent 40%);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

p a:not(.cta-button):not(.action-btn):hover {
  color: var(--clr-accent-green);
  text-decoration-color: var(--clr-accent-green);
}

/* --- F. Sécurité Bouton Flottant (Mobile) --- */
@media (max-width: 768px) {
  main {
    padding-bottom: 100px; /* Espace pour le bouton de recherche flottant */
  }
  
  .about-hero {
    padding-bottom: 40px; /* Évite que le titre ne colle au bas */
  }
}

/* ==========================================================================
   RESPONSIVE - BREAKPOINT TABLETTE (768px - 1199px)
   ========================================================================== */
@media (max-width: 1199px) and (min-width: 769px) {
  /* --- Layout Grilles --- */
  .recipes-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  /* --- Page Recette Détail --- */
  .recipe-body-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .recipe-sidebar {
    position: static;
    top: auto;
  }

  /* --- Cartes --- */
  .smart-card {
    min-height: 420px;
  }

  /* --- Typographie --- */
  .section-title {
    font-size: 1.75rem;
    line-height: 1.3;
  }

  .hero-title {
    font-size: 2.25rem;
  }

  /* --- Espacements --- */
  .section {
    padding-block: 48px;
  }

  .container {
    padding-inline: 24px;
  }
}
