/*
Theme Name: Le Restaurant — Mise en place
Theme URI: https://www.lerestaurant2022.fr
Author: Le Restaurant
Description: Thème premium gastronomique — mobile-first, ultra-léger, Core Web Vitals parfaits, Rich Snippets recettes, EEAT, Google Discover. Design éditorial 2026.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 8.1
License: GNU General Public License v2 or later
Text Domain: lerestaurant-mep
Tags: food-and-drink, blog, custom-logo, custom-menu, featured-images, sticky-post, threaded-comments, translation-ready
*/

/* ============================================================
   0. RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.75;
  color: var(--c-ink);
  background: var(--c-ivory);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100%;
}

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

a { color: inherit; text-decoration: none; }
a:hover { color: var(--c-terra); }

ul, ol { list-style: none; }

button, input, select, textarea {
  font: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
  /* Palette */
  --c-ink:      #0E0A07;
  --c-ivory:    #F5F0E8;
  --c-white:    #FFFFFF;
  --c-terra:    #C4622A;
  --c-braise:   #8B3D15;
  --c-truffe:   #3D2B1A;
  --c-cendre:   #B0A898;
  --c-herbe:    #1C2B1A;
  --c-smoke:    #F0EBE1;
  --c-border:   rgba(14,10,7,.1);
  --c-border-m: rgba(14,10,7,.18);

  /* Typography */
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing scale */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;

  /* Layout */
  --max-w:      1200px;
  --content-w:  720px;
  --sidebar-w:  260px;
  --gap:        1.5rem;

  /* Radius */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;

  /* Transitions */
  --ease: cubic-bezier(.4,0,.2,1);
  --t-fast: 150ms var(--ease);
  --t-med:  250ms var(--ease);
}

/* ============================================================
   2. TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.1;
  color: var(--c-ink);
  letter-spacing: -.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.2rem; }

.entry-content h2,
.entry-content h3 {
  margin-top: var(--sp-10);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 0.5px solid var(--c-border);
}

.label {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.entry-content p { margin-bottom: var(--sp-5); }
.entry-content ul, .entry-content ol {
  margin: var(--sp-4) 0 var(--sp-5) var(--sp-6);
  list-style: revert;
}
.entry-content li { margin-bottom: var(--sp-2); }
.entry-content strong { font-weight: 500; }
.entry-content em { font-style: italic; }

.entry-content blockquote {
  border-left: 2px solid var(--c-terra);
  padding: var(--sp-4) var(--sp-6);
  margin: var(--sp-8) 0;
}
.entry-content blockquote p {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--c-ink);
  margin-bottom: 0;
}

/* ============================================================
   3. LAYOUT CONTAINERS
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}

.container--narrow {
  max-width: calc(var(--content-w) + var(--sidebar-w) + var(--sp-8));
}

/* ============================================================
   4. HEADER & NAV
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-ivory);
  border-bottom: 0.5px solid var(--c-border);
  /* CLS fix: hauteur explicite */
  height: 60px;
  display: flex;
  align-items: center;
  will-change: transform;
}

.site-header.scrolled {
  background: rgba(245,240,232,.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.header-inner {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--sp-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
  height: 100%;
}

.site-logo {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-ink);
  letter-spacing: -.03em;
  flex-shrink: 0;
  text-decoration: none;
}
.site-logo em {
  font-style: italic;
  color: var(--c-terra);
}

.site-logo img {
  height: 36px;
  width: auto;
}

.primary-nav { display: flex; align-items: center; gap: var(--sp-6); }

.primary-nav a {
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-truffe);
  transition: color var(--t-fast);
  white-space: nowrap;
}
.primary-nav a:hover,
.primary-nav .current-menu-item > a { color: var(--c-terra); }

.header-actions { display: flex; align-items: center; gap: var(--sp-3); }

.btn-newsletter {
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-terra);
  border: 0.5px solid rgba(196,98,42,.5);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-sm);
  transition: background var(--t-fast), color var(--t-fast);
}
.btn-newsletter:hover {
  background: var(--c-terra);
  color: var(--c-ivory);
  border-color: var(--c-terra);
}

.btn-search,
.btn-menu {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-truffe);
  transition: color var(--t-fast);
}
.btn-search:hover, .btn-menu:hover { color: var(--c-terra); }

.btn-menu { display: none; }

/* Search overlay */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(14,10,7,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-med);
}
.search-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.search-form-wrap {
  width: min(600px, 90vw);
}
.search-form-wrap input[type="search"] {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid rgba(245,240,232,.5);
  padding: var(--sp-4) 0;
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--c-ivory);
  outline: none;
}
.search-form-wrap input::placeholder { color: rgba(245,240,232,.3); }

/* Mobile menu */
.mobile-nav {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  background: var(--c-ivory);
  border-bottom: 0.5px solid var(--c-border);
  z-index: 90;
  transform: translateY(-100%);
  transition: transform var(--t-med);
  padding: var(--sp-6) var(--sp-5);
}
.mobile-nav.open { transform: translateY(0); }
.mobile-nav a {
  display: block;
  padding: var(--sp-3) 0;
  font-size: .9rem;
  font-weight: 500;
  color: var(--c-ink);
  border-bottom: 0.5px solid var(--c-border);
}

/* ============================================================
   5. SINGLE POST — HERO IMAGE FIRST
   ============================================================ */
.single-hero {
  width: 100%;
  position: relative;
  /* CLS fix: ratio explicite, remplacé par vraies dimensions */
  aspect-ratio: 16 / 7;
  overflow: hidden;
  background: var(--c-truffe);
  max-height: 70vh;
}

.single-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  /* LCP: pas de lazy sur le hero */
  loading: eager;
}

/* Titre sous l'image */
.single-header {
  background: var(--c-white);
  border-bottom: 0.5px solid var(--c-border);
  padding: var(--sp-8) 0 var(--sp-6);
}

.single-header-inner {
  max-width: calc(var(--content-w) + var(--sidebar-w) + var(--sp-8));
  margin-inline: auto;
  padding-inline: var(--sp-5);
  width: 100%;
  box-sizing: border-box;
}

.single-cat {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.single-cat a {
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-terra);
}
.single-cat-sep { color: var(--c-cendre); font-size: .7rem; }

.single-title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--c-ink);
  line-height: 1.08;
  letter-spacing: -.025em;
  margin-bottom: var(--sp-5);
  max-width: 820px;
  overflow-wrap: break-word;
  word-break: break-word;
}
.single-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--c-terra);
}

.single-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.meta-author-block {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.meta-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--c-smoke);
  flex-shrink: 0;
}
.meta-avatar img { width: 100%; height: 100%; object-fit: cover; }
.meta-avatar-initials {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-braise), var(--c-terra));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 500;
  color: var(--c-ivory);
}
.meta-author-name { font-size: .85rem; font-weight: 500; color: var(--c-ink); }
.meta-author-role { font-size: .75rem; color: var(--c-cendre); }

.meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--c-cendre);
}
.meta-date,
.meta-read-time {
  font-size: .78rem;
  color: var(--c-cendre);
}

/* ============================================================
   6. SINGLE — BODY LAYOUT (TOC + CONTENT)
   ============================================================ */
.single-body {
  padding: var(--sp-10) 0 var(--sp-16);
}

.single-body-inner {
  max-width: calc(var(--content-w) + var(--sidebar-w) + var(--sp-8));
  margin-inline: auto;
  padding-inline: var(--sp-5);
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: var(--sp-8);
  align-items: start;
  width: 100%;
  box-sizing: border-box;
}

/* ---- TOC Sidebar ---- */
.toc-sidebar {
  position: sticky;
  top: calc(60px + var(--sp-6));
  min-width: 0;
  max-width: 100%;
}

.toc-widget {
  background: var(--c-white);
  border: 0.5px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.toc-header {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 0.5px solid var(--c-border);
  font-size: .6rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-cendre);
}

.toc-list {
  padding: var(--sp-3) 0;
}

.toc-item a {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-5);
  transition: background var(--t-fast);
  border-radius: 0;
}
.toc-item a:hover { background: var(--c-smoke); }
.toc-item.active a { background: var(--c-smoke); }

.toc-num {
  font-size: .65rem;
  font-weight: 500;
  color: var(--c-cendre);
  min-width: 18px;
  margin-top: 3px;
  transition: color var(--t-fast);
}
.toc-item.active .toc-num { color: var(--c-terra); }

.toc-text {
  font-size: .82rem;
  color: var(--c-truffe);
  line-height: 1.4;
  transition: color var(--t-fast);
}
.toc-item.active .toc-text { color: var(--c-ink); font-weight: 500; }

.toc-progress {
  height: 2px;
  background: var(--c-smoke);
  border-radius: 0;
}
.toc-progress-bar {
  height: 100%;
  background: var(--c-terra);
  width: 0%;
  transition: width .1s linear;
  border-radius: 0;
}

/* ---- Recipe Quick-stats ---- */
.recipe-stats-widget {
  margin-top: var(--sp-4);
  background: var(--c-white);
  border: 0.5px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.recipe-stats-header {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 0.5px solid var(--c-border);
  font-size: .6rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-cendre);
}
.recipe-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-3) var(--sp-5);
  border-bottom: 0.5px solid var(--c-border);
  font-size: .82rem;
}
.recipe-stat:last-child { border-bottom: none; }
.recipe-stat-label { color: var(--c-cendre); }
.recipe-stat-val { font-weight: 500; color: var(--c-ink); }
.recipe-stat-val.accent { color: var(--c-terra); }

/* ---- Content ---- */
.entry-content {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-wrap: break-word;
  word-break: break-word;
  font-size: 1rem;
  color: var(--c-truffe);
}

/* Blocs Gutenberg : listes, quotes, images — contraints à 100% */
.entry-content .wp-block-list,
.entry-content ul,
.entry-content ol {
  max-width: 100%;
  padding-left: var(--sp-6);
}
.entry-content .wp-block-quote,
.entry-content blockquote {
  max-width: 100%;
  margin-inline: 0;
  box-sizing: border-box;
}
.entry-content img,
.entry-content .wp-block-image img,
.entry-content figure img {
  max-width: 100%;
  height: auto;
}

.entry-content .section-anchor {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  scroll-margin-top: calc(60px + var(--sp-6));
}
.entry-content .section-anchor::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-terra);
  flex-shrink: 0;
}

.entry-content .wp-block-image,
.entry-content figure {
  margin: var(--sp-8) 0;
  border-radius: var(--r-md);
  overflow: hidden;
}
.entry-content figure img { width: 100%; }
.entry-content figcaption {
  font-size: .75rem;
  color: var(--c-cendre);
  font-style: italic;
  padding: var(--sp-2) var(--sp-3);
  text-align: center;
}

/* ---- Back to top ---- */
.back-to-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-5);
  border-top: 0.5px solid var(--c-border);
  margin-top: var(--sp-10);
}

.btn-back-top {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-terra);
  border: 0.5px solid rgba(196,98,42,.4);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-sm);
  transition: background var(--t-fast), color var(--t-fast);
}
.btn-back-top:hover {
  background: var(--c-terra);
  color: var(--c-ivory);
  border-color: var(--c-terra);
}
.btn-back-top svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }

.share-actions { display: flex; align-items: center; gap: var(--sp-3); }
.btn-share {
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .08em;
  color: var(--c-truffe);
  border: 0.5px solid var(--c-border-m);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-sm);
  transition: border-color var(--t-fast), color var(--t-fast);
}
.btn-share:hover { border-color: var(--c-terra); color: var(--c-terra); }

/* ---- Floating back-to-top button ---- */
.back-to-top-fab {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  width: 44px;
  height: 44px;
  background: var(--c-ink);
  color: var(--c-ivory);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--t-med), transform var(--t-med);
  z-index: 50;
  pointer-events: none;
  /* INP: pas de JS lourd, juste class toggle */
}
.back-to-top-fab.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}
.back-to-top-fab:hover { background: var(--c-terra); }
.back-to-top-fab svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ============================================================
   7. HOMEPAGE
   ============================================================ */
.hp-hero {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1px;
  background: var(--c-border);
  border-bottom: 0.5px solid var(--c-border);
}

.hp-hero-main {
  position: relative;
  overflow: hidden;
  background: var(--c-truffe);
  min-height: 520px;
}
.hp-hero-main img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.hp-hero-main-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(14,10,7,.85) 0%, rgba(14,10,7,.15) 50%, transparent 100%);
}
.hp-hero-main-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--sp-8);
}

.hp-hero-sidebar {
  display: flex;
  flex-direction: column;
  background: var(--c-white);
}
.hp-hero-sidebar-item {
  flex: 1;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0;
  border-bottom: 0.5px solid var(--c-border);
  overflow: hidden;
  transition: background var(--t-fast);
}
.hp-hero-sidebar-item:last-child { border-bottom: none; }
.hp-hero-sidebar-item:hover { background: var(--c-smoke); }
.hp-hero-sidebar-img {
  overflow: hidden;
  background: var(--c-smoke);
}
.hp-hero-sidebar-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-med);
}
.hp-hero-sidebar-item:hover .hp-hero-sidebar-img img { transform: scale(1.04); }
.hp-hero-sidebar-body { padding: var(--sp-5); display: flex; flex-direction: column; justify-content: center; }

/* Section grid */
.section-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-8) 0 var(--sp-5);
  border-bottom: 0.5px solid var(--c-border);
  margin-bottom: var(--sp-6);
}
.section-label-row .label { color: var(--c-ink); }
.section-label-row a.see-all {
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-terra);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}
.section-label-row a.see-all svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; }

/* Asymmetric grid */
.posts-grid-asym {
  display: grid;
  grid-template-columns: 5fr 3fr;
  gap: var(--sp-4);
  margin-bottom: var(--sp-10);
}
.posts-grid-stack { display: flex; flex-direction: column; gap: var(--sp-4); }

/* Cards */
.card {
  background: var(--c-white);
  border: 0.5px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color var(--t-fast);
}
.card:hover { border-color: var(--c-border-m); }

.card-img {
  overflow: hidden;
  background: var(--c-smoke);
}
.card-img img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  transition: transform var(--t-med);
}
.card:hover .card-img img { transform: scale(1.03); }

.card-body { padding: var(--sp-5); }

.card-cat {
  font-size: .62rem;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--c-terra);
  margin-bottom: var(--sp-2);
  display: block;
}

.card-title {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--c-ink);
  line-height: 1.2;
  margin-bottom: var(--sp-3);
}
.card--main .card-title { font-size: clamp(1.1rem, 2vw, 1.4rem); }
.card--small .card-title { font-size: 1rem; }

.card-excerpt {
  font-size: .88rem;
  color: var(--c-cendre);
  line-height: 1.6;
  margin-bottom: var(--sp-3);
}

.card-meta {
  font-size: .72rem;
  color: var(--c-cendre);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

/* Horizontal card */
.card--horizontal {
  display: grid;
  grid-template-columns: 100px 1fr;
}
.card--horizontal .card-img img { aspect-ratio: 3/4; height: 100%; }
.card--horizontal .card-body { padding: var(--sp-4); }

/* ============================================================
   8. ARCHIVE / CATEGORY
   ============================================================ */
.archive-header {
  padding: var(--sp-12) 0 var(--sp-8);
  border-bottom: 0.5px solid var(--c-border);
  margin-bottom: var(--sp-8);
}
.archive-kicker {
  font-size: .62rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-terra);
  margin-bottom: var(--sp-3);
  display: block;
}
.archive-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  margin-bottom: var(--sp-4);
}
.archive-desc {
  font-size: .95rem;
  color: var(--c-cendre);
  max-width: 520px;
  line-height: 1.7;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-6);
  margin-bottom: var(--sp-10);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-8) 0;
  border-top: 0.5px solid var(--c-border);
}
.page-num {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 500;
  border: 0.5px solid var(--c-border);
  border-radius: var(--r-sm);
  color: var(--c-truffe);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.page-num:hover, .page-num.current {
  background: var(--c-terra);
  color: var(--c-ivory);
  border-color: var(--c-terra);
}

/* ============================================================
   9. AUTHOR PAGE
   ============================================================ */
.author-header {
  padding: var(--sp-12) 0 var(--sp-8);
  border-bottom: 0.5px solid var(--c-border);
  margin-bottom: var(--sp-8);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-8);
  align-items: center;
}
.author-avatar-lg {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--c-smoke);
}
.author-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.author-kicker {
  font-size: .62rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-terra);
  margin-bottom: var(--sp-2);
  display: block;
}
.author-name { font-size: clamp(1.5rem, 3vw, 2.25rem); margin-bottom: var(--sp-3); }
.author-bio { font-size: .92rem; color: var(--c-cendre); line-height: 1.7; max-width: 560px; }

/* ============================================================
   10. SEARCH RESULTS
   ============================================================ */
.search-header {
  padding: var(--sp-10) 0 var(--sp-6);
  border-bottom: 0.5px solid var(--c-border);
  margin-bottom: var(--sp-8);
}
.search-query { font-style: italic; color: var(--c-terra); }

.search-form-inline {
  display: flex;
  gap: 0;
  border: 0.5px solid var(--c-border-m);
  border-radius: var(--r-md);
  overflow: hidden;
  max-width: 480px;
  margin-top: var(--sp-5);
}
.search-form-inline input[type="search"] {
  flex: 1;
  padding: var(--sp-3) var(--sp-4);
  font-size: .9rem;
  color: var(--c-ink);
  background: var(--c-white);
  outline: none;
  border: none;
}
.search-form-inline button {
  padding: var(--sp-3) var(--sp-5);
  background: var(--c-terra);
  color: var(--c-ivory);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: none;
  transition: background var(--t-fast);
}
.search-form-inline button:hover { background: var(--c-braise); }

/* ============================================================
   11. 404
   ============================================================ */
.error-404 {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-16) var(--sp-5);
}
.error-404-num {
  font-family: var(--font-serif);
  font-size: clamp(5rem, 15vw, 10rem);
  font-weight: 700;
  color: var(--c-smoke);
  line-height: 1;
  margin-bottom: var(--sp-4);
  letter-spacing: -.04em;
}
.error-404 h1 { font-size: clamp(1.25rem, 3vw, 2rem); margin-bottom: var(--sp-4); }
.error-404 p { color: var(--c-cendre); margin-bottom: var(--sp-8); max-width: 400px; }

/* ============================================================
   12. FOOTER
   ============================================================ */
.site-footer {
  background: var(--c-ink);
  color: var(--c-ivory);
  padding: var(--sp-16) 0 var(--sp-8);
  margin-top: var(--sp-16);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--sp-8);
  margin-bottom: var(--sp-12);
}

.footer-brand .site-logo { color: var(--c-ivory); }
.footer-brand .site-logo em { color: var(--c-terra); }
.footer-tagline {
  font-size: .82rem;
  color: rgba(245,240,232,.4);
  margin-top: var(--sp-3);
  line-height: 1.6;
  max-width: 260px;
}

.footer-col-title {
  font-size: .6rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(245,240,232,.35);
  margin-bottom: var(--sp-4);
}

.footer-links { display: flex; flex-direction: column; gap: var(--sp-2); }
.footer-links a {
  font-size: .82rem;
  color: rgba(245,240,232,.55);
  transition: color var(--t-fast);
}
.footer-links a:hover { color: var(--c-terra); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--sp-6);
  border-top: 0.5px solid rgba(245,240,232,.1);
  font-size: .72rem;
  color: rgba(245,240,232,.3);
  flex-wrap: wrap;
  gap: var(--sp-4);
}
.footer-bottom a { color: inherit; }
.footer-bottom a:hover { color: var(--c-terra); }

/* ============================================================
   13. RECIPE CARD BLOCK (rich snippet)
   ============================================================ */
.recipe-card-full {
  background: var(--c-white);
  border: 0.5px solid var(--c-border-m);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin: var(--sp-10) 0;
}
.recipe-card-full-header {
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 0.5px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.recipe-card-full-title { font-size: 1.1rem; margin-bottom: 0; }
.recipe-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-bottom: 0.5px solid var(--c-border);
}
.recipe-stats-grid .rs-item {
  padding: var(--sp-4) var(--sp-5);
  border-right: 0.5px solid var(--c-border);
  text-align: center;
}
.recipe-stats-grid .rs-item:last-child { border-right: none; }
.rs-val {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-ink);
  display: block;
}
.rs-label {
  font-size: .62rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-cendre);
  display: block;
  margin-top: var(--sp-1);
}
.recipe-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.recipe-col {
  padding: var(--sp-6);
  border-right: 0.5px solid var(--c-border);
}
.recipe-col:last-child { border-right: none; }
.recipe-col-title {
  font-size: .62rem;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--c-cendre);
  margin-bottom: var(--sp-4);
}
.recipe-ingredients { list-style: none; }
.recipe-ingredients li {
  padding: var(--sp-2) 0;
  border-bottom: 0.5px solid var(--c-border);
  font-size: .88rem;
  color: var(--c-truffe);
  display: flex;
  justify-content: space-between;
}
.recipe-ingredients li:last-child { border-bottom: none; }
.ingredient-qty { font-weight: 500; color: var(--c-ink); }

.recipe-steps { list-style: none; counter-reset: steps; }
.recipe-steps li {
  counter-increment: steps;
  padding: var(--sp-3) 0 var(--sp-3) var(--sp-8);
  border-bottom: 0.5px solid var(--c-border);
  font-size: .88rem;
  color: var(--c-truffe);
  line-height: 1.6;
  position: relative;
}
.recipe-steps li:last-child { border-bottom: none; }
.recipe-steps li::before {
  content: counter(steps);
  position: absolute;
  left: 0;
  top: var(--sp-3);
  width: 22px;
  height: 22px;
  background: var(--c-terra);
  color: var(--c-ivory);
  border-radius: 50%;
  font-size: .65rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   14. COMMENTS
   ============================================================ */
.comments-area {
  max-width: var(--content-w);
  margin: var(--sp-12) auto 0;
  padding-top: var(--sp-8);
  border-top: 0.5px solid var(--c-border);
}
.comments-title {
  font-size: 1.2rem;
  margin-bottom: var(--sp-6);
}
.comment {
  padding: var(--sp-5) 0;
  border-bottom: 0.5px solid var(--c-border);
}
.comment-author-info { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.comment-author-name { font-size: .88rem; font-weight: 500; }
.comment-date { font-size: .72rem; color: var(--c-cendre); }
.comment-content { font-size: .9rem; color: var(--c-truffe); line-height: 1.65; }

/* ============================================================
   15. UTILITIES
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.text-terra { color: var(--c-terra); }
.text-cendre { color: var(--c-cendre); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* ============================================================
   16. MOBILE — RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .hp-hero { grid-template-columns: 1fr; }
  .hp-hero-sidebar { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .btn-menu { display: flex; }
  .primary-nav { display: none; }
  .btn-newsletter { display: none; }

  .single-hero { aspect-ratio: 4/3; max-height: 55vw; }

  .single-body-inner {
    grid-template-columns: 1fr;
    max-width: 100%;
    gap: var(--sp-6);
    padding-inline: var(--sp-4);
  }
  .toc-sidebar {
    position: static;
    order: -1;
  }
  .toc-widget {
    /* Collapsible sur mobile */
    overflow: hidden;
  }

  .posts-grid-asym { grid-template-columns: 1fr; }
  .posts-grid { grid-template-columns: 1fr; }

  .recipe-cols { grid-template-columns: 1fr; }
  .recipe-col { border-right: none; border-bottom: 0.5px solid var(--c-border); }

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

  .author-header { grid-template-columns: 1fr; }
  .author-avatar-lg { width: 72px; height: 72px; }

  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: var(--sp-2); }

  .back-to-top-fab { bottom: var(--sp-4); right: var(--sp-4); }
}

@media (max-width: 480px) {
  .single-title { font-size: 1.6rem; }
  .recipe-stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   17. PRINT
   ============================================================ */
@media print {
  .site-header, .toc-sidebar, .site-footer,
  .back-to-top-fab, .back-to-top-bar, .comments-area { display: none; }
  .single-body-inner { grid-template-columns: 1fr; }
  body { font-size: 12pt; color: #000; background: #fff; }
  a { text-decoration: underline; }
  .single-hero { max-height: 40vh; }
}

/* ============================================================
   18. REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
}
/* ============================================================
   19. ADSENSE — affichage responsive garanti
   ============================================================ */
.mep-ad-wrap {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-align: center;
  clear: both;
  margin: 2rem auto;
}

.mep-ad-wrap ins.adsbygoogle {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

/* Empêche les pubs de déborder sur mobile */
@media (max-width: 768px) {
  .mep-ad-wrap {
    margin: 1.5rem -1rem; /* flush bords */
    width: calc(100% + 2rem);
  }
  .mep-ad-wrap ins.adsbygoogle {
    min-height: 50px;
  }
}

/* Sticky sidebar ad - optionnel */
.ad-sidebar-sticky {
  position: sticky;
  top: calc(60px + 1.5rem);
}

/* ============================================================
   20. MOBILE SCROLL HORIZONTAL — CORRECTIFS
   ============================================================ */

/* Garantir zéro overflow horizontal sur tout mobile */
html {
  overflow-x: hidden;
}

/* iOS Safari : empêcher le rubber-band horizontal */
body {
  touch-action: pan-y;
  overscroll-behavior-x: none;
}

/* mobile-nav : utiliser translateY (vertical) et non X */
.mobile-nav {
  contain: layout style;
}

/* Fixer l'image hero qui peut déborder */
.single-hero img,
.single-hero picture {
  max-width: 100%;
  width: 100%;
}

/* Blocs Gutenberg alignés wide/full sur mobile */
@media (max-width: 768px) {
  .alignwide,
  .alignfull {
    max-width: 100vw;
    margin-inline: calc(-1 * var(--sp-4));
    overflow: hidden;
  }
  
  /* Tableaux dans le contenu : scroll interne (pas du body) */
  .entry-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  
  /* Code blocks */
  .entry-content pre {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    white-space: pre;
  }
  
  /* Posts grid en related posts */
  .related-posts .posts-grid {
    grid-template-columns: 1fr !important;
  }
}
