/* CSS Custom Properties & Variables */
:root {
  --primary: #6B4226;
  --primary-hover: #573620;
  --secondary: #4A5D3A;
  --accent: #C8852B;
  --accent-hover: #B0731F;
  --bg-main: #F4EFE6; /* Sable très clair, chaud et organique */
  --bg-card: #FFFFFF;
  --text-main: #2A211A; /* Marine profond contrasté */
  --text-muted: #5A4F45;
  --border-color: #DED4C2;
  --success: #4A5D3A;
  --warning: #E76F51;
  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans: 'Source Sans 3', system-ui, -apple-system, sans-serif;
  --shadow: 0 4px 20px rgba(42, 33, 26, 0.08);
  --shadow-hover: 0 8px 30px rgba(42, 33, 26, 0.15);
  --radius: 12px;
  --max-width: 1200px;
}

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

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

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4, .brand-font {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

h1 { font-size: 2.5rem; margin-bottom: 1.5rem; }
h2 { font-size: 2rem; margin-bottom: 1.25rem; }
h3 { font-size: 1.5rem; margin-bottom: 1rem; }

p {
  margin-bottom: 1.25rem;
  color: var(--text-muted);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

.text-center { text-align: center; }

/* Header & Navigation */
header.site-header {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 45px;
  height: 45px;
  background-color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: bold;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  box-shadow: 0 4px 10px rgba(0, 119, 182, 0.3);
}

.brand-text {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.brand-tagline {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  display: block;
  font-weight: 600;
  margin-top: -3px;
}

nav.main-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

nav.main-nav a {
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.95rem;
  position: relative;
  padding: 0.5rem 0;
}

nav.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent);
  transition: width 0.3s ease;
}

nav.main-nav a:hover::after,
nav.main-nav a.active::after {
  width: 100%;
}

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

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hero Section */
.hero {
  position: relative;
  background-size: cover;
  background-position: center;
  padding: 8rem 0;
  color: #fff;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(42, 33, 26, 0.92) 30%, rgba(0, 119, 182, 0.45) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
}

.hero-tag {
  background-color: var(--accent);
  color: var(--text-main);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  display: inline-block;
  margin-bottom: 1.5rem;
}

.hero h1 {
  color: #fff;
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
}

.hero p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 2rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius);
  transition: all 0.25s ease;
  cursor: pointer;
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 119, 182, 0.25);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 119, 182, 0.35);
}

.btn-accent {
  background-color: var(--accent);
  color: var(--text-main);
  box-shadow: 0 4px 15px rgba(212, 163, 115, 0.25);
}

.btn-accent:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 163, 115, 0.35);
}

.btn-outline {
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: #fff;
}

.btn-outline:hover {
  border-color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-outline-dark {
  border: 2px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline-dark:hover {
  background-color: rgba(42, 33, 26, 0.05);
  border-color: var(--text-main);
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem;
  align-items: center;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

/* Product Cards */
.card {
  background-color: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

.card-img-wrapper {
  position: relative;
  height: 220px;
  overflow: hidden;
  background-color: #eee;
}

.card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card:hover .card-img-wrapper img {
  transform: scale(1.05);
}

.card-tag {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background-color: rgba(255, 255, 255, 0.95);
  color: var(--text-main);
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border-left: 3px solid var(--accent);
}

.card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  flex-grow: 1;
  margin-bottom: 1.5rem;
}

.card-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.card-season {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
  font-weight: 600;
}

.card-link {
  font-weight: 700;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Edito / Intro block */
.edito-block {
  background-color: #EDE6D8;
  border-radius: var(--radius);
  padding: 3.5rem;
  border-left: 6px solid var(--accent);
  margin-bottom: 4rem;
}

.edito-title {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--text-main);
}

/* Interactive Widget: Test d'authenticité de la charcuterie corse */
.widget-box {
  background-color: var(--bg-card);
  border-radius: var(--radius);
  padding: 3rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  max-width: 800px;
  margin: 3rem auto;
}

.widget-step {
  display: none;
}

.widget-step.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

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

.widget-progress {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  position: relative;
}

.widget-progress::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--border-color);
  z-index: 1;
}

.progress-bar-fill {
  position: absolute;
  top: 50%;
  left: 0;
  height: 2px;
  background-color: var(--primary);
  z-index: 2;
  transition: width 0.4s ease;
}

.progress-step {
  width: 35px;
  height: 35px;
  background-color: var(--bg-main);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
  z-index: 3;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.progress-step.active {
  border-color: var(--primary);
  background-color: var(--primary);
  color: #fff;
}

.progress-step.completed {
  border-color: var(--success);
  background-color: var(--success);
  color: #fff;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin: 2rem 0;
}

.option-card {
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.option-card:hover {
  border-color: var(--primary);
  background-color: rgba(0, 119, 182, 0.02);
}

.option-card.selected {
  border-color: var(--primary);
  background-color: rgba(0, 119, 182, 0.05);
}

.option-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.option-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.widget-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
}

.result-card {
  text-align: center;
  padding: 2rem;
}

.result-badge {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  border-radius: 50px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.result-badge.authentic {
  background-color: rgba(42, 157, 143, 0.15);
  color: var(--success);
}

.result-badge.suspicious {
  background-color: rgba(231, 111, 81, 0.15);
  color: var(--warning);
}

.result-score {
  font-size: 3rem;
  font-family: var(--font-serif);
  color: var(--text-main);
  margin-bottom: 1rem;
}

.result-tips {
  text-align: left;
  background-color: var(--bg-main);
  padding: 1.5rem;
  border-radius: var(--radius);
  margin-top: 1.5rem;
}

.result-tips h4 {
  margin-bottom: 0.75rem;
}

.result-tips li {
  margin-left: 1.25rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Seasonality Timeline */
.saison-timeline {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  position: relative;
  margin: 3rem 0;
}

.saison-timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20px;
  width: 4px;
  background-color: var(--border-color);
}

.timeline-item {
  display: flex;
  gap: 2rem;
  position: relative;
  padding-left: 50px;
}

.timeline-marker {
  position: absolute;
  left: 10px;
  top: 5px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--accent);
  border: 4px solid var(--bg-main);
  box-shadow: 0 0 0 3px var(--accent);
  z-index: 2;
}

.timeline-item.active .timeline-marker {
  background-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary);
}

.timeline-content {
  background-color: var(--bg-card);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  width: 100%;
}

.timeline-month {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.timeline-products {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.tag-badge {
  background-color: var(--bg-main);
  color: var(--text-main);
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.tag-badge:hover {
  border-color: var(--primary);
  background-color: rgba(0, 119, 182, 0.05);
}

/* Detailed Page Styles (produit.php & producteur.php) */
.product-hero {
  background-color: #EDE6D8;
  padding: 4rem 0;
  border-bottom: 1px solid var(--border-color);
}

.meta-info {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
}

.meta-item.highlight {
  color: var(--accent);
}

.main-content-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  margin-top: 3rem;
}

.content-article {
  background-color: var(--bg-card);
  padding: 3rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.content-article h2 {
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
  margin-top: 2rem;
}

.content-article h2:first-of-type {
  margin-top: 0;
}

.criteria-list {
  list-style: none;
  margin-bottom: 1.5rem;
}

.criteria-list li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.criteria-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--success);
  font-weight: 900;
  font-size: 1.2rem;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar-widget {
  background-color: var(--bg-card);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.sidebar-widget h3 {
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.4rem;
}

.producer-mini-card {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

.producer-mini-card:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.producer-mini-img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  background-color: #eee;
}

.producer-mini-info h4 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.producer-mini-info p {
  margin-bottom: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Footer */
footer.site-footer {
  background-color: #2A211A;
  color: rgba(255, 255, 255, 0.8);
  padding: 4rem 0 2rem;
  border-top: 4px solid var(--primary);
}

footer.site-footer h3, footer.site-footer h4 {
  color: #fff;
  margin-bottom: 1.5rem;
}

footer.site-footer a {
  color: rgba(255, 255, 255, 0.7);
}

footer.site-footer a:hover {
  color: var(--accent);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  margin-top: 1rem;
}

.footer-links-list {
  list-style: none;
}

.footer-links-list li {
  margin-bottom: 0.75rem;
}

.footer-links-list a {
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  flex-wrap: wrap;
  gap: 1rem;
}

/* Scroll Animation System */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.165, 0.84, 0.44, 1), transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Responsiveness */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .main-content-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
  .hero { padding: 5rem 0; }
  .hero h1 { font-size: 2.2rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 2rem; }
  nav.main-nav { display: none; } /* On pourra l'adapter si menu mobile en JS */
  .mobile-menu-toggle { display: block; }
  .edito-block { padding: 2rem; }
  .widget-box { padding: 1.5rem; }
  .options-grid { grid-template-columns: 1fr; }
}
/* ============================================================
 * Sous-menu « Outils » (header) + colonne Outils (footer)
 * ============================================================ */
.nav-dropdown { position: relative; display: inline-flex; align-items: center; }
.nav-dropdown > .nav-dropdown-toggle { cursor: pointer; display: inline-flex; align-items: center; gap: 0.3rem; }
.nav-dropdown > .nav-dropdown-toggle .caret { font-size: 0.7em; transition: transform 0.2s ease; }
.nav-dropdown.open > .nav-dropdown-toggle .caret { transform: rotate(180deg); }
.nav-dropdown-menu {
  position: absolute; top: 100%; left: 0; margin-top: 0.5rem; min-width: 250px;
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 0.5rem; display: none; flex-direction: column; z-index: 1000;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu { display: flex; }
.nav-dropdown-menu a { padding: 0.6rem 0.9rem; border-radius: 8px; white-space: nowrap; font-size: 0.9rem; color: var(--text-main); }
.nav-dropdown-menu a::after { display: none !important; }
.nav-dropdown-menu a:hover { background: var(--bg-main); color: var(--primary); }

@media (max-width: 768px) {
  nav.main-nav .nav-dropdown { display: block; width: 100%; }
  nav.main-nav .nav-dropdown-menu {
    position: static; box-shadow: none; border: none; padding: 0.25rem 0 0 1rem;
    margin-top: 0.25rem; background: transparent; min-width: 0;
  }
}
