/* ============================================
   EPICERIE GOURMANDE VILLANDRY - Design System
   ============================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=DM+Sans:wght@400;500;600;700&display=swap');

/* --- Variables --- */
:root {
  --primary:       #B8513B;
  --primary-light: #D4785E;
  --primary-pale:  #FFF1EC;
  --dark:          #2C1D12;
  --dark-deeper:   #1A110A;
  --text:          #3A2A1E;
  --text-light:    #7D6B5D;
  --bg:            #FFFBF7;
  --bg-alt:        #F5EBE0;
  --accent:        #6B8034;
  --accent-pale:   #F0F4E4;
  --border:        rgba(44, 29, 18, 0.12);
  --shadow:        rgba(44, 29, 18, 0.08);
  --white:         #FFFFFF;
  --radius:        8px;
  --radius-lg:     12px;
  --font-heading:  'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:     'DM Sans', system-ui, -apple-system, sans-serif;
}

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

html {
  font-size: 18px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-light); }

ul, ol { padding-left: 1.2em; }

/* --- Container --- */
.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================
   HEADER / NAV
   ============================================ */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.site-logo {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--dark);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.site-logo span {
  color: var(--primary);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.main-nav a {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.main-nav a:hover,
.main-nav a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Submenu dropdown */
.nav-submenu {
  position: relative;
}
.submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 180px;
  list-style: none;
  padding: 8px 0;
  margin: 8px 0 0;
  box-shadow: 0 4px 12px var(--shadow);
  z-index: 101;
}
.nav-submenu:hover .submenu {
  display: block;
}
.submenu li {
  margin: 0;
}
.submenu a {
  display: block;
  padding: 10px 16px;
  color: var(--text);
  font-size: 0.9rem;
  transition: background-color 0.2s, color 0.2s;
}
.submenu a:hover {
  background-color: var(--primary-pale);
  color: var(--primary);
}

/* Burger menu mobile */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--dark);
  margin: 5px 0;
  transition: transform 0.3s, opacity 0.3s;
}

/* ============================================
   HERO - PAGE STANDARD
   ============================================ */
.page-hero {
  position: relative;
  min-height: 300px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--dark);
}
.page-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.page-hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(44, 29, 18, 0.35), rgba(44, 29, 18, 0.7));
}
.page-hero-content {
  position: relative;
  z-index: 2;
  padding: 56px 0;
  color: var(--white);
}
.hero-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.8);
  margin-bottom: 12px;
}
.page-hero h1 {
  font-family: var(--font-heading);
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 12px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.hero-intro {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.9);
  max-width: 600px;
  line-height: 1.6;
}

/* ============================================
   HERO - HOME (plus grand)
   ============================================ */
.home-hero {
  min-height: 420px;
  text-align: center;
}
.home-hero .page-hero-content {
  padding: 80px 0;
}
.home-hero h1 {
  font-size: 3rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}
.home-hero .hero-intro {
  max-width: 560px;
  margin: 0 auto;
  font-size: 1.1rem;
}

/* ============================================
   RECIPE HERO OVERLAY (image fond + titre)
   ============================================ */
.recipe-hero {
  min-height: 340px;
}
.recipe-hero .hero-meta {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}
.recipe-hero .hero-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.85);
}
.recipe-hero .hero-meta-item svg {
  width: 18px;
  height: 18px;
  fill: rgba(255,255,255,0.7);
}

/* ============================================
   FIL D'ARIANE
   ============================================ */
.breadcrumb {
  padding: 16px 0;
  font-size: 0.8rem;
  color: var(--text-light);
}
.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
}
.breadcrumb li::after {
  content: '>';
  margin-left: 6px;
  color: var(--text-light);
  opacity: 0.5;
}
.breadcrumb li:last-child::after { display: none; }
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary); }

/* ============================================
   ARTICLE LAYOUT (contenu + sidebar)
   ============================================ */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  max-width: 1140px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.article-body h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--dark);
  margin: 48px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-pale);
}
.article-body h2:first-child { margin-top: 0; }

.article-body h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--dark);
  margin: 32px 0 12px;
}

.article-body p {
  margin-bottom: 18px;
  line-height: 1.9;
}

.article-body ul, .article-body ol {
  margin-bottom: 18px;
  line-height: 1.8;
}

.article-body li { margin-bottom: 6px; }

/* --- Info-box / Highlight-box --- */
.info-box {
  background: var(--primary-pale);
  border-left: 4px solid var(--primary);
  padding: 20px 24px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 28px 0;
}
.info-box h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 8px;
}
.info-box p:last-child { margin-bottom: 0; }

.highlight-box {
  background: var(--accent-pale);
  border-left: 4px solid var(--accent);
  padding: 20px 24px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 28px 0;
}
.highlight-box h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 8px;
}
.highlight-box p:last-child { margin-bottom: 0; }

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  position: sticky;
  top: 96px;
  align-self: start;
}

.sidebar-block {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}
.sidebar-block h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.sidebar-toc {
  list-style: none;
  padding: 0;
}
.sidebar-toc li { margin-bottom: 8px; }
.sidebar-toc a {
  font-size: 0.85rem;
  color: var(--text-light);
  display: block;
  padding: 4px 0;
  border-left: 2px solid transparent;
  padding-left: 12px;
  transition: color 0.2s, border-color 0.2s;
}
.sidebar-toc a:hover {
  color: var(--primary);
  border-left-color: var(--primary);
}

.sidebar-links {
  list-style: none;
  padding: 0;
}
.sidebar-links li { margin-bottom: 8px; }
.sidebar-links a {
  font-size: 0.85rem;
  color: var(--primary);
}

.sidebar-cta {
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}
.sidebar-cta h4 {
  font-family: var(--font-heading);
  color: var(--white);
  font-size: 1.05rem;
  margin-bottom: 8px;
  border: none;
  padding: 0;
}
.sidebar-cta p {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 14px;
}
.sidebar-cta a {
  color: var(--white);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: underline;
}

/* ============================================
   RECIPE CARD (grille de recettes)
   ============================================ */
.recipes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin: 40px 0;
}

.recipe-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}
.recipe-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--shadow);
}

.recipe-card-img {
  position: relative;
  height: 200px;
  overflow: hidden;
}
.recipe-card-img-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.3s;
}
.recipe-card:hover .recipe-card-img-bg {
  transform: scale(1.05);
}
.recipe-card-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(44,29,18,0.6), transparent 60%);
}
.recipe-card-img-title {
  position: absolute;
  bottom: 14px;
  left: 16px;
  right: 16px;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.3;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
  z-index: 1;
}
.recipe-card-category {
  position: absolute;
  top: 14px;
  left: 16px;
  background: var(--primary);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 4px;
  z-index: 1;
}

.recipe-card-body {
  padding: 18px 20px;
}
.recipe-card-desc {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 14px;
}
.recipe-card-meta {
  display: flex;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--text-light);
}
.recipe-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.recipe-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* ============================================
   RECIPE DETAIL - Fiche technique
   ============================================ */
.recipe-info-card {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 32px 0;
}
.recipe-info-item {
  background: var(--white);
  padding: 20px;
  text-align: center;
}
.recipe-info-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  margin-bottom: 6px;
}
.recipe-info-value {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--dark);
}

/* --- Liste d'ingredients --- */
.ingredients-list {
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin: 24px 0;
}
.ingredients-list h3 {
  font-family: var(--font-heading);
  margin: 0 0 16px;
}
.ingredients-list ul {
  list-style: none;
  padding: 0;
  columns: 2;
  column-gap: 32px;
}
.ingredients-list li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.92rem;
}
.ingredients-list li::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  margin-right: 10px;
  vertical-align: middle;
}

/* --- Etapes de preparation --- */
.steps-list {
  counter-reset: step-counter;
  padding: 0;
  list-style: none;
  margin: 24px 0;
}
.steps-list li {
  counter-increment: step-counter;
  position: relative;
  padding: 20px 0 20px 64px;
  border-bottom: 1px solid var(--border);
}
.steps-list li:last-child { border-bottom: none; }
.steps-list li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 18px;
  width: 42px;
  height: 42px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
}

/* ============================================
   CATEGORIES SECTION (home)
   ============================================ */
.section-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--dark);
  text-align: center;
  margin-bottom: 12px;
}
.section-subtitle {
  text-align: center;
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 40px;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 40px 0;
}

.category-card {
  position: relative;
  height: 220px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  text-decoration: none;
}
.category-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.3s;
}
.category-card:hover .category-card-bg { transform: scale(1.06); }
.category-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(44,29,18,0.7), transparent 70%);
}
.category-card-content {
  position: relative;
  z-index: 1;
  padding: 24px;
  color: var(--white);
  width: 100%;
}
.category-card h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--white);
  margin: 0 0 4px;
}
.category-card p {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.8);
  margin: 0;
}

/* ============================================
   SECTION SPACING
   ============================================ */
.section {
  padding: 64px 0;
}
.section-alt {
  background: var(--bg-alt);
}

/* ============================================
   RECIPE LISTING (page recettes)
   ============================================ */
.category-section { margin-bottom: 56px; }
.category-section h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--dark);
  padding-bottom: 12px;
  border-bottom: 3px solid var(--primary);
  display: inline-block;
  margin-bottom: 28px;
}

/* ============================================
   TABLEAU
   ============================================ */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.9rem;
}
.article-body th {
  background: var(--dark);
  color: var(--white);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
}
.article-body td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.article-body tr:nth-child(even) { background: var(--bg-alt); }
.article-body tr:hover { background: var(--primary-pale); }

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--dark);
  color: rgba(255,255,255,0.7);
  padding: 48px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-brand {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--white);
  margin-bottom: 12px;
}
.footer-brand span { color: var(--primary-light); }
.footer-desc {
  font-size: 0.85rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.6);
}

.footer-col h4 {
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.footer-links {
  list-style: none;
  padding: 0;
}
.footer-links li { margin-bottom: 10px; }
.footer-links a {
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--white); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.4);
}

/* ============================================
   404
   ============================================ */
.error-404 {
  padding: 80px 20px;
  text-align: center;
}
.error-404-inner {
  max-width: 560px;
  margin: 0 auto;
}
.error-code {
  display: block;
  font-family: var(--font-heading);
  font-size: 6rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 16px;
}
.error-404 h1 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  margin-bottom: 12px;
}
.error-404 p {
  color: var(--text-light);
  margin-bottom: 32px;
}
.btn-primary {
  display: inline-block;
  padding: 14px 32px;
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s;
}
.btn-primary:hover {
  background: var(--primary-light);
  color: var(--white);
}
.error-suggestions {
  margin-top: 48px;
}
.error-suggestions h2 {
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 12px;
}
.error-suggestions ul {
  list-style: none;
  padding: 0;
}
.error-suggestions li { margin-bottom: 8px; }
.error-suggestions a {
  color: var(--primary);
  text-decoration: underline;
}

/* ============================================
   BOUTONS
   ============================================ */
.btn-outline {
  display: inline-block;
  padding: 12px 28px;
  border: 2px solid var(--primary);
  color: var(--primary);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s, color 0.2s;
}
.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-white {
  display: inline-block;
  padding: 14px 32px;
  background: var(--white);
  color: var(--primary);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-white:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  color: var(--primary);
}

/* ============================================
   MENTIONS LEGALES
   ============================================ */
.legal-content {
  max-width: 780px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.legal-content h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  margin: 40px 0 12px;
  color: var(--dark);
}
.legal-content p {
  margin-bottom: 16px;
  line-height: 1.8;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablette */
@media (max-width: 992px) {
  .article-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .recipes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .recipe-info-card {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile */
@media (max-width: 768px) {
  html { font-size: 17px; }

  .header-inner { height: 60px; }
  .site-logo { font-size: 1.15rem; }

  .main-nav {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white);
    flex-direction: column;
    padding: 32px 24px;
    gap: 0;
    border-top: 1px solid var(--border);
    z-index: 99;
  }
  .main-nav.open { display: flex; }
  .main-nav a {
    font-size: 1.05rem;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
  }
  .nav-toggle { display: block; }

  .page-hero h1 { font-size: 1.8rem; }
  .home-hero h1 { font-size: 2.2rem; }
  .home-hero .page-hero-content { padding: 48px 0; }

  .categories-grid {
    grid-template-columns: 1fr;
  }
  .category-card { height: 180px; }

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

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

  .ingredients-list ul {
    columns: 1;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .recipe-info-card {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Petit mobile */
@media (max-width: 380px) {
  html { font-size: 16px; }
  .page-hero h1 { font-size: 1.5rem; }
  .recipe-info-card { grid-template-columns: 1fr; }
}
