/* Site public des recettes. Polices auto-hébergées (aucune requête vers un tiers). */

@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #fbf7f0;
  --paper-2: #f3ebdf;
  --card: #fffdf9;
  --ink: #2a211b;
  --ink-2: #5b4f45;
  --ink-3: #8a7c70;
  --line: #e8ddcf;
  --accent: #c2502a;
  --accent-hover: #a8411f;
  --accent-ink: #ffffff;
  --accent-soft: #f6e1d5;
  --olive: #5d6d36;
  --olive-soft: #e7ebd6;
  --shadow: 0 1px 2px rgb(60 40 20 / 0.05), 0 8px 24px -8px rgb(60 40 20 / 0.12);
  --shadow-lg: 0 2px 4px rgb(60 40 20 / 0.06), 0 24px 48px -16px rgb(60 40 20 / 0.22);
  --ph-l1: 88%;
  --ph-l2: 74%;
  --ph-ink: 32%;

  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 18px;
  --r-lg: 28px;
  --wrap: 1180px;
  --h: 24;
  --mast-h: 68px;
  --gutter: clamp(16px, 4vw, 32px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #18140f;
    --paper-2: #211b15;
    --card: #231d17;
    --ink: #f2eae0;
    --ink-2: #cdbfb1;
    --ink-3: #9a8b7d;
    --line: #382f26;
    --accent: #ec8a5f;
    --accent-hover: #f4a07a;
    --accent-ink: #1b130d;
    --accent-soft: #3d261b;
    --olive: #b8c78c;
    --olive-soft: #2a301e;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px -8px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / 0.3), 0 24px 48px -16px rgb(0 0 0 / 0.6);
    --ph-l1: 30%;
    --ph-l2: 20%;
    --ph-ink: 70%;
  }
}

/* Teinte de chaque catégorie (slugs de recipes.CATEGORIES). */
.cat-none { --h: 26; }
.cat-aperitif { --h: 42; }
.cat-entree { --h: 92; }
.cat-plat { --h: 14; }
.cat-accompagnement { --h: 140; }
.cat-dessert { --h: 342; }
.cat-petit-dejeuner { --h: 32; }
.cat-boulangerie { --h: 36; }
.cat-sauce { --h: 2; }
.cat-boisson { --h: 195; }

/* --- Base ------------------------------------------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -0.015em; margin: 0; font-variation-settings: "SOFT" 60, "WONK" 0; }
p { margin: 0; }
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left)); }
a, button, label, summary, [role="button"] { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.narrow { max-width: 820px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }

.display { overflow-wrap: break-word; hyphens: auto; font-size: clamp(2.2rem, 5.4vw, 4.1rem); font-weight: 560; letter-spacing: -0.025em; line-height: 1.04; font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144; text-wrap: balance; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--ink-2); max-width: 56ch; text-wrap: pretty; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 600 0.78rem/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--olive); margin-bottom: 18px; }
.eyebrow-link { text-decoration: none; padding: 7px 12px; border-radius: 999px; background: hsl(var(--h) 60% 50% / 0.12); color: hsl(var(--h) 55% 34%); }
.eyebrow-link:hover { color: hsl(var(--h) 55% 26%); }
@media (prefers-color-scheme: dark) { .eyebrow-link, .eyebrow-link:hover { color: hsl(var(--h) 65% 72%); } }
.eyebrow-sm { font: 600 0.72rem/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.accent-italic { font-style: italic; color: var(--accent); font-weight: 500; }

.button, .searchbar button {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font: 600 0.95rem/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.button:hover, .searchbar button:hover { background: var(--accent-hover); color: var(--accent-ink); }
.button:active, .searchbar button:active { transform: scale(0.97); }

/* --- En-tête et pied ------------------------------------------------------------------------------------------- */

.masthead { position: sticky; top: 0; z-index: 20; padding-top: env(safe-area-inset-top); background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; transition: border-color 0.2s ease; }
.masthead.is-scrolled { border-bottom-color: var(--line); }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: var(--mast-h); }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: 0; }
.logo:hover { color: var(--ink); }
.logo-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--accent); color: var(--accent-ink); flex: none; transform: rotate(-6deg); }
.logo-mark .icon { width: 20px; height: 20px; }
.logo-text { font: 650 1.28rem/1 var(--serif); letter-spacing: -0.02em; font-variation-settings: "SOFT" 100, "WONK" 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mainnav { display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.mainnav a { padding: 8px 13px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 0.94rem; white-space: nowrap; }
.mainnav a:hover, .mainnav a[aria-current] { color: var(--ink); background: var(--paper-2); }
.nav-search { display: grid; place-items: center; width: 40px; height: 40px; padding: 0 !important; margin-left: 6px; background: var(--card); border: 1px solid var(--line); flex: none; }

.site-footer { margin-top: clamp(64px, 10vw, 120px); background: var(--paper-2); border-top: 1px solid var(--line); }
.footer-grid { display: grid; gap: 32px; grid-template-columns: 1.6fr 1fr 1fr; padding-top: 48px; padding-bottom: 32px; }
.footer-brand p { margin-top: 14px; color: var(--ink-2); max-width: 36ch; }
.site-footer h2 { font: 600 0.78rem/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer ul a { color: var(--ink-2); text-decoration: none; }
.site-footer ul a:hover { color: var(--accent); }
.footer-bottom { padding-top: 18px; padding-bottom: 28px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 0.88rem; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* --- Composants ------------------------------------------------------------------------------------------------ */

.searchbar { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); color: var(--ink-3); transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.searchbar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.searchbar input { flex: 1; min-width: 0; border: 0; outline: none; background: none; color: var(--ink); font: inherit; font-size: 1rem; padding: 10px 0; }
.searchbar input::placeholder { color: var(--ink-3); }
.searchbar-lg { padding: 8px 8px 8px 22px; margin-top: 30px; max-width: 540px; }
.searchbar-lg .icon { width: 22px; height: 22px; }
.searchbar-lg input { font-size: 1.06rem; }

.chips, .hero-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 0.92rem; transition: all 0.15s ease; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip-sm { padding: 5px 12px; font-size: 0.85rem; }
.chip .icon { width: 0.95em; height: 0.95em; }
.chip-count { font-size: 0.78em; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chip.is-active .chip-count { color: inherit; opacity: 0.7; }

.level { display: inline-flex; gap: 2px; align-items: flex-end; margin-right: 6px; vertical-align: -1px; }
.level i { width: 4px; border-radius: 2px; background: currentColor; opacity: 0.25; }
.level i:nth-child(1) { height: 6px; }
.level i:nth-child(2) { height: 9px; }
.level i:nth-child(3) { height: 12px; }
.level-1 i:nth-child(-n+1), .level-2 i:nth-child(-n+2), .level-3 i { opacity: 1; }

.avatar { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font: italic 600 1.25rem/1 var(--serif); }
.avatar-sm { width: 30px; height: 30px; font-size: 0.95rem; }
.avatar-lg { width: 84px; height: 84px; font-size: 2.4rem; }

/* Visuel de remplacement quand une recette n'a pas de photo. */
.ph { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; background: radial-gradient(120% 100% at 15% 0%, hsl(var(--h) 70% var(--ph-l1)), hsl(var(--h) 42% var(--ph-l2))); }
.ph::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(hsl(var(--h) 45% var(--ph-ink) / 0.13) 1.4px, transparent 1.6px); background-size: 16px 16px; }
.ph span { position: relative; font: italic 500 clamp(3.5rem, 9vw, 6.5rem)/1 var(--serif); color: hsl(var(--h) 45% var(--ph-ink) / 0.6); font-variation-settings: "SOFT" 100, "WONK" 1; transition: transform 0.5s cubic-bezier(.2, .7, .2, 1); }

/* Cartes */
.grid { display: grid; gap: clamp(20px, 3vw, 34px) clamp(16px, 2.4vw, 28px); grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.card-link { display: flex; flex-direction: column; gap: 14px; height: 100%; color: inherit; text-decoration: none; }
.card-link:hover { color: inherit; }
.card-media { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: var(--r); overflow: hidden; background: var(--paper-2); box-shadow: var(--shadow); isolation: isolate; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s cubic-bezier(.2, .7, .2, 1); }
@media (hover: hover) { .card-link:hover .card-media img, .card-link:hover .ph span { transform: scale(1.05); } }
.pill { position: absolute; left: 12px; top: 12px; padding: 6px 11px; border-radius: 999px; background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: var(--ink); font: 600 0.74rem/1 var(--sans); letter-spacing: 0.02em; box-shadow: 0 1px 3px rgb(0 0 0 / 0.08); }
.card-body { display: grid; gap: 6px; padding: 0 2px; }
.card-title { font: 600 1.24rem/1.22 var(--serif); letter-spacing: -0.01em; font-variation-settings: "SOFT" 60; text-wrap: balance; transition: color 0.15s ease; }
.card-link:hover .card-title { color: var(--accent); }
.card-summary { color: var(--ink-2); font-size: 0.93rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 4px; color: var(--ink-3); font-size: 0.84rem; font-weight: 500; }
.card-meta > span { display: inline-flex; align-items: center; gap: 6px; }

/* Sections */
.section { margin-top: clamp(56px, 8vw, 96px); }
.section-tight { margin-top: 32px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); font-variation-settings: "SOFT" 100, "WONK" 1; }
.more { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 0.94rem; text-decoration: none; }
.more .icon { transition: transform 0.15s ease; }
.more:hover .icon { transform: translateX(3px); }
.band { padding: clamp(48px, 7vw, 80px) 0; background: var(--paper-2); border-block: 1px solid var(--line); }
main:has(> .band:last-child) + .site-footer { margin-top: 0; border-top: 0; }

.empty-state { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 72px 16px; color: var(--ink-2); }
.empty-state h2 { font-size: 1.7rem; color: var(--ink); }
.empty-state .display { color: var(--ink); }
.empty-state-lg { padding: 110px 16px 40px; }
.empty-state-lg .lead { margin-bottom: 20px; }
.empty-icon { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 22px; background: var(--accent-soft); color: var(--accent); margin-bottom: 8px; transform: rotate(-6deg); }
.empty-icon .icon { width: 34px; height: 34px; }

.crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; font-size: 0.88rem; color: var(--ink-3); }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }

/* --- Accueil --------------------------------------------------------------------------------------------------- */

.hero { position: relative; isolation: isolate; padding: clamp(36px, 6vw, 80px) 0 0; overflow: hidden; }
.hero::before { content: ""; position: absolute; z-index: -1; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px; right: -18vw; top: -26vw; border-radius: 50%; background: radial-gradient(closest-side, var(--accent-soft), transparent); }
.hero-grid { display: grid; gap: clamp(36px, 5vw, 72px); grid-template-columns: 1.05fr 1fr; align-items: center; padding-bottom: 32px; }
.hero-grid > *, .recipe-hero-grid > *, .recipe-main > * { min-width: 0; }
.hero-text .display { font-size: clamp(2.5rem, 7vw, 5.4rem); }
.hero-text .lead { margin-top: 20px; }
.hero-tags { margin-top: 20px; color: var(--ink-3); font-size: 0.88rem; }
.hero-tags > span { margin-right: 4px; }
.hero-feature { position: relative; display: block; color: inherit; text-decoration: none; }
.hero-feature:hover { color: inherit; }
.hero-media { position: relative; display: block; aspect-ratio: 4 / 4.4; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-lg); transform: rotate(1.5deg); transition: transform 0.4s ease; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-feature:hover .hero-media { transform: rotate(0deg) scale(1.01); }
.hero-caption { position: absolute; left: -28px; bottom: 28px; right: 22%; display: grid; gap: 8px; padding: 20px 22px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow-lg); }
.hero-caption-title { font: 600 1.45rem/1.15 var(--serif); letter-spacing: -0.015em; font-variation-settings: "SOFT" 100, "WONK" 1; }
.go { color: var(--accent); font-weight: 600; margin-left: auto; }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-media { aspect-ratio: 4 / 3; transform: none; }
  .hero-caption { position: relative; left: auto; right: auto; bottom: auto; margin: -48px 16px 0; }
}

/* Flex plutôt que grille : la dernière ligne s'étire au lieu de laisser une tuile orpheline. */
.tiles { display: flex; flex-wrap: wrap; gap: 14px; }
.tile { flex: 1 1 190px; height: clamp(150px, 16vw, 190px); position: relative; display: block; border-radius: var(--r); overflow: hidden; color: #fff; text-decoration: none; isolation: isolate; box-shadow: var(--shadow); }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s cubic-bezier(.2, .7, .2, 1); }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, hsl(var(--h) 45% 14% / 0.82)); }
.tile:hover { color: #fff; }
@media (hover: hover) { .tile:hover img { transform: scale(1.06); } }
.tile-label { position: absolute; z-index: 1; left: 18px; right: 18px; bottom: 16px; display: grid; gap: 2px; }
.tile-label strong { font: 600 1.32rem/1.1 var(--serif); letter-spacing: -0.01em; font-variation-settings: "SOFT" 100, "WONK" 1; }
.tile-label span { font-size: 0.84rem; opacity: 0.85; }

.cooks { display: flex; flex-wrap: wrap; gap: 12px; }
.cook { display: inline-flex; align-items: center; gap: 12px; padding: 10px 22px 10px 10px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: border-color 0.15s ease, transform 0.15s ease; }
.cook:hover { color: var(--ink); border-color: var(--accent); transform: translateY(-1px); }
.cook strong { display: block; font-weight: 600; }
.cook small { color: var(--ink-3); }

/* --- Listes ---------------------------------------------------------------------------------------------------- */

.page-head { padding-top: clamp(36px, 6vw, 72px); }
.page-head .lead { margin-top: 14px; }
.listing-head { padding-bottom: 24px; background: linear-gradient(180deg, hsl(var(--h) 60% 50% / 0.10), transparent); }
.author-head { display: flex; align-items: center; gap: 22px; }
.author-head .eyebrow { margin-bottom: 8px; }
.filters { display: grid; gap: 14px; margin-top: 28px; position: sticky; top: var(--mast-h); z-index: 5; padding-top: 12px; padding-bottom: 12px; background: var(--paper); }
.filters-top { display: flex; gap: 10px; flex-wrap: wrap; }
.filters-top .searchbar { flex: 1 1 320px; padding: 2px 18px; box-shadow: none; }
.selects { display: flex; gap: 8px; flex-wrap: wrap; }
.select select {
  appearance: none; -webkit-appearance: none; min-height: 48px; padding: 0 40px 0 16px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink); font: 500 0.92rem var(--sans); cursor: pointer;
  background-color: var(--card);
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 21px) 52%, calc(100% - 16px) 52%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.select select:hover { border-color: var(--ink-3); }
.result-count { color: var(--ink-3); font-size: 0.9rem; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-w2 { font-size: 1rem; }
.tag-w3 { font-size: 1.12rem; padding: 10px 18px; }
.tag-w4 { font-size: 1.25rem; padding: 11px 20px; background: var(--accent-soft); border-color: transparent; color: var(--accent); }

.prose { margin-top: 26px; display: grid; gap: 16px; font-size: 1.12rem; color: var(--ink-2); max-width: 64ch; }
.prose p:first-child::first-letter { float: left; font: 600 3.6rem/0.82 var(--serif); margin: 6px 10px 0 0; color: var(--accent); font-variation-settings: "SOFT" 100, "WONK" 1; }

/* --- Recette --------------------------------------------------------------------------------------------------- */

.recipe-hero { padding-top: clamp(28px, 4vw, 48px); background: linear-gradient(180deg, hsl(var(--h) 60% 50% / 0.09), transparent 75%); }
.recipe-hero-grid { display: grid; gap: clamp(32px, 5vw, 64px); grid-template-columns: 1.1fr 1fr; align-items: center; }
.recipe-hero-grid.no-photo { grid-template-columns: 1.6fr 1fr; }
.recipe-intro .display { font-size: clamp(2.4rem, 5.6vw, 4.3rem); }
.recipe-intro .eyebrow { margin-bottom: 20px; }
.recipe-intro .lead { margin-top: 18px; }
.recipe-figure { margin: 0; position: relative; aspect-ratio: 4 / 3.4; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.recipe-figure img { width: 100%; height: 100%; object-fit: cover; }
.no-photo .recipe-figure { aspect-ratio: 1; }
@media (max-width: 860px) {
  .recipe-hero-grid, .recipe-hero-grid.no-photo { grid-template-columns: 1fr; }
  .recipe-figure { order: -1; aspect-ratio: 4 / 3; }
  .no-photo .recipe-figure { display: none; }
}

.quickfacts, .timeline, .recipe-tabs, .next-tab, .tabbar, .filters-toggle { display: none; }

.stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 0; }
.stats div { display: grid; gap: 5px; min-width: 104px; padding: 12px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.stats dt { display: flex; align-items: center; gap: 6px; font: 600 0.7rem/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.stats dt .icon { width: 15px; height: 15px; color: var(--accent); }
.stats dd { margin: 0; font: 600 1.12rem/1.2 var(--serif); font-variation-settings: "SOFT" 60; }
.stats .level { color: var(--accent); }

.byline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 24px; color: var(--ink-2); font-size: 0.92rem; }
.byline a { color: var(--ink); font-weight: 600; text-decoration: none; }
.byline a:hover { color: var(--accent); }
.dot { color: var(--ink-3); }

.tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.tool { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink-2); font: 500 0.9rem/1 var(--sans); cursor: pointer; transition: all 0.15s ease; }
.tool:hover { border-color: var(--ink-3); color: var(--ink); background: var(--card); }
.tool[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.tool.is-done { border-color: var(--olive); color: var(--olive); }

.recipe-main { display: grid; gap: clamp(32px, 5vw, 64px); grid-template-columns: minmax(280px, 380px) 1fr; align-items: start; margin-top: clamp(40px, 6vw, 72px); }
.recipe-main > .method:only-child { grid-column: 1 / -1; max-width: 760px; }
@media (max-width: 860px) { .recipe-main { grid-template-columns: 1fr; } }
.recipe-main h2 { font-size: 1.85rem; font-variation-settings: "SOFT" 100, "WONK" 1; }

.ingredients { position: sticky; top: calc(var(--mast-h) + 20px); padding: 26px 26px 18px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
@media (max-width: 860px) { .ingredients { position: static; } }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 16px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.servings-static { color: var(--ink-3); font-size: 0.9rem; }
.js .servings-static[data-nojs] { display: none; }
.servings { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px; background: var(--paper-2); transition: background 0.2s ease; }
.servings button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--card); color: var(--ink); font: 500 1.15rem/1 var(--sans); cursor: pointer; box-shadow: 0 1px 2px rgb(0 0 0 / 0.08); }
.servings button:hover { background: var(--accent); color: var(--accent-ink); }
.servings-value { padding: 0 8px; font-size: 0.9rem; color: var(--ink-2); white-space: nowrap; }
.servings output { font: 600 1.05rem/1 var(--serif); color: var(--ink); font-variant-numeric: tabular-nums; }
.servings.is-changed { background: var(--accent-soft); }
.ingredients h3 { margin: 20px 0 4px; font: 600 0.76rem/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--olive); }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li + li { border-top: 1px dashed var(--line); }
.checklist label { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; cursor: pointer; line-height: 1.45; }
.checklist .qty { font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.checklist .qty.is-scaled { color: var(--accent); }
input[type="checkbox"] { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 20px; height: 20px; margin: 1px 0 0; border: 1.75px solid var(--ink-3); border-radius: 6px; background: var(--card); cursor: pointer; transition: all 0.15s ease; }
input[type="checkbox"]::after { content: ""; position: absolute; left: 5.5px; top: 2px; width: 5px; height: 10px; border: solid var(--card); border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform 0.15s ease; }
input[type="checkbox"]:checked { background: var(--olive); border-color: var(--olive); }
input[type="checkbox"]:checked::after { transform: rotate(45deg) scale(1); }
.checklist li:has(input:checked) span { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-3); }

.method h2 { margin-bottom: 22px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; }
.steps li { display: grid; grid-template-columns: 52px 1fr; gap: 18px; padding: 20px 0; border-top: 1px solid var(--line); }
.steps li:first-child { border-top: 0; padding-top: 0; }
.step-num { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1.75px solid var(--accent); color: var(--accent); font: 600 1.25rem/1 var(--serif); font-variation-settings: "SOFT" 100, "WONK" 1; cursor: pointer; transition: all 0.2s ease; }
.step-num input[type="checkbox"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; border: 0; border-radius: 50%; }
.step-num:hover { background: var(--accent-soft); }
.step-num:has(input:checked) { background: var(--olive); border-color: var(--olive); color: var(--card); }
.step-num:has(input:focus-visible) { outline: 2.5px solid var(--accent); outline-offset: 3px; }
.step-text { padding-top: 8px; font-size: 1.08rem; line-height: 1.72; color: var(--ink); text-wrap: pretty; transition: opacity 0.2s ease; }
.steps li:has(.step-num input:checked) .step-text { opacity: 0.45; }

.timer { display: inline-flex; align-items: center; gap: 5px; padding: 1px 10px 1px 8px; margin: 0 1px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font: 600 0.92em/1.6 var(--sans); white-space: nowrap; }
.timer .icon { width: 1em; height: 1em; }
.timer.is-live { cursor: pointer; transition: background 0.15s ease, color 0.15s ease; }
.timer.is-live:hover { background: var(--accent); color: var(--accent-ink); }

.tip { display: grid; grid-template-columns: auto 1fr; gap: 18px; margin-top: 36px; padding: 24px 26px; border-radius: var(--r); background: var(--olive-soft); color: var(--ink); }
.tip-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--olive); color: var(--olive-soft); }
.tip-icon .icon { width: 22px; height: 22px; }
.recipe-main .tip h2 { font-size: 1.3rem; font-style: italic; margin-bottom: 6px; }
.tip p + p { margin-top: 10px; }

.recipe-foot { display: grid; gap: 18px; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.source { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; color: var(--ink-2); font: italic 400 1.05rem/1.5 var(--serif); }
.source span { font: 600 0.72rem/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.related { margin-top: clamp(56px, 8vw, 96px); padding: clamp(48px, 7vw, 80px) 0 0; border-top: 1px solid var(--line); }

/* Mode cuisine : texte plus grand, l'essentiel seulement. */
.cook-mode .step-text { font-size: 1.34rem; }
.cook-mode .checklist label { font-size: 1.14rem; padding: 13px 0; }
.cook-mode .related, .cook-mode .site-footer { display: none; }

/* Minuteurs */
.timer-dock { position: fixed; right: 16px; bottom: 16px; z-index: 40; display: grid; gap: 10px; width: min(320px, calc(100vw - 32px)); }
.timer-card { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 6px 10px; padding: 14px 14px 14px 18px; border-radius: var(--r); background: var(--ink); color: var(--paper); box-shadow: var(--shadow-lg); animation: rise 0.25s ease; }
.timer-label { grid-column: 1 / -1; font: 600 0.72rem/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.65; }
.timer-time { font: 600 1.9rem/1 var(--serif); font-variant-numeric: tabular-nums; }
.timer-card button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: color-mix(in srgb, var(--paper) 14%, transparent); color: inherit; font: 600 0.9rem/1 var(--sans); cursor: pointer; }
.timer-card button:hover { background: color-mix(in srgb, var(--paper) 26%, transparent); }
.timer-card.is-paused .timer-time { opacity: 0.5; }
.timer-card.is-done { background: var(--accent); color: var(--accent-ink); animation: ring 0.9s ease-in-out infinite alternate; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes ring { from { transform: scale(1); } to { transform: scale(1.03); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}


/* === Téléphone =================================================================================================
   La cible principale : on lit (et on cuisine) surtout sur un téléphone. Cibles tactiles d'au moins 44 px, champs en
   16 px (pas de zoom automatique sur iPhone), navigation à portée de pouce. */

@media (max-width: 860px) {
  /* Page recette : photo en pleine largeur, puis onglets Ingrédients / Préparation. */
  .recipe-hero { padding-top: 0; }
  .recipe-hero .crumbs { display: none; }
  .recipe-hero-grid { gap: 22px; }
  .recipe-hero-grid.no-photo { padding-top: 28px; }
  .recipe-figure { margin: 0 calc(-1 * var(--gutter)); border-radius: 0; box-shadow: none; aspect-ratio: 4 / 3; }
  .stats { display: none; }
  .quickfacts { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin-top: 22px; padding: 14px 0; border-block: 1px solid var(--line); text-align: center; }
  .quickfacts span { display: grid; justify-items: center; gap: 3px; padding: 0 6px; }
  .quickfacts span + span { border-left: 1px solid var(--line); }
  .quickfacts .icon { width: 20px; height: 20px; color: var(--accent); margin-bottom: 2px; }
  .quickfacts strong { font: 650 1rem/1.15 var(--sans); }
  .quickfacts small { font-size: 0.74rem; color: var(--ink-3); }
  .timeline { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin-top: 10px; font-size: 0.84rem; color: var(--ink-3); }
  .timeline b { color: var(--ink-2); font-weight: 600; }
  .byline { margin-top: 18px; }

  .tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
  .tool { flex-direction: column; justify-content: center; gap: 6px; min-height: 64px; padding: 10px 4px; border-radius: 16px; background: var(--card); font-size: 0.8rem; }
  .tool .icon { width: 22px; height: 22px; }

  .recipe-main { margin-top: 26px; gap: 18px; }
  .recipe-tabs:not([hidden]) {
    display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px;
    background: var(--paper-2); position: sticky; top: calc(var(--mast-h) + 8px); z-index: 6;
    box-shadow: 0 0 0 8px var(--paper);
  }
  .recipe-tabs button {
    display: flex; justify-content: center; align-items: baseline; gap: 6px; min-height: 44px; padding: 10px 6px;
    border: 0; border-radius: 999px; background: none; color: var(--ink-2); font: 600 0.95rem/1.2 var(--sans); cursor: pointer;
  }
  .recipe-tabs button span { font-size: 0.74rem; font-weight: 500; color: var(--ink-3); }
  .recipe-tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }
  .recipe-main[data-tab="ingredients"] > .method, .recipe-main[data-tab="steps"] > .ingredients { display: none; }
  .recipe-main[data-tab] #ingredients-title, .recipe-main[data-tab] #steps-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .recipe-main[data-tab] .panel-head { padding-bottom: 12px; }
  .recipe-main[data-tab] .panel-head:not(:has(.servings:not([hidden]), .servings-static)) { display: none; }
  .recipe-main[data-tab] .next-tab {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; margin: 14px 0 6px;
    border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 600 1rem/1 var(--sans); cursor: pointer;
  }
  .ingredients { padding: 18px 18px 12px; border-radius: 22px; }
  .ingredients h3:first-of-type { margin-top: 12px; }
}

@media (max-width: 720px) {
  :root { --mast-h: 56px; }
  .mainnav { display: none; }
  .logo-text { font-size: 1.16rem; }
  .logo-mark { width: 32px; height: 32px; border-radius: 10px; }
  .logo-mark .icon { width: 18px; height: 18px; }

  /* Barre d'onglets en bas de l'écran. */
  .tabbar {
    position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr);
    padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background: color-mix(in srgb, var(--card) 90%, transparent); border-top: 1px solid var(--line);
    backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
  }
  .tabbar a { display: grid; justify-items: center; gap: 4px; min-height: 48px; padding: 6px 0 4px; border-radius: 14px; color: var(--ink-3); text-decoration: none; font: 600 0.7rem/1 var(--sans); }
  .tabbar .icon { width: 24px; height: 24px; }
  .tabbar a[aria-current] { color: var(--accent); }
  .tabbar a:active { background: var(--paper-2); }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  body:has(input[type="search"]:focus) .tabbar { display: none; }
  .cook-mode .tabbar { display: none; }
  body.cook-mode { padding-bottom: env(safe-area-inset-bottom); }
  .timer-dock { left: 12px; right: 12px; width: auto; bottom: calc(80px + env(safe-area-inset-bottom)); }
  .cook-mode .timer-dock { bottom: calc(12px + env(safe-area-inset-bottom)); }

  /* Liste et filtres. */
  .filters { position: static; margin-top: 22px; padding-top: 0; padding-bottom: 0; gap: 12px; }
  .filters-toggle {
    display: grid; place-items: center; position: relative; flex: none; width: 50px; height: 50px; border-radius: 50%;
    border: 1px solid var(--line); background: var(--card); color: var(--ink-2); cursor: pointer;
  }
  .filters-toggle .icon { width: 22px; height: 22px; }
  .filters-toggle[aria-expanded="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
  .filters-count { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 700 0.7rem/20px var(--sans); }
  .filters-top .searchbar { flex: 1 1 0; min-width: 0; }
  .selects { flex: 1 1 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .selects .select:last-child { grid-column: 1 / -1; }
  .filters:not(.is-open) .selects { display: none; }
  .select select { width: 100%; font-size: 16px; }
  .filters .chips, .hero-tags { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter); scroll-padding: 0 var(--gutter); }
  .filters .chips::-webkit-scrollbar, .hero-tags::-webkit-scrollbar { display: none; }
  .filters .chip, .hero-tags > * { flex: none; }
  .chip { min-height: 40px; }
  .chip-sm { min-height: 34px; }

  .site-footer { margin-top: 64px; }
  .footer-grid { padding-top: 36px; }
}

@media (max-width: 560px) {
  .section { margin-top: 48px; }
  .section-head { margin-bottom: 16px; }
  .section-head h2 { font-size: 1.55rem; }
  .band { padding: 40px 0; }
  .page-head { padding-top: 28px; }
  .page-head .lead { margin-top: 10px; }
  .lead { font-size: 1.02rem; }

  /* Accueil */
  .hero { padding-top: 22px; }
  .hero::before { width: 120vw; height: 120vw; right: -50vw; top: -60vw; }
  .hero-text .display { font-size: clamp(2.3rem, 11vw, 2.9rem); }
  .hero-text .lead { margin-top: 12px; }
  .searchbar-lg { margin-top: 22px; padding: 6px 6px 6px 16px; }
  .searchbar-lg button { padding: 12px 16px; }
  .hero-tags { margin-top: 14px; }
  .hero-caption { margin: -44px 12px 0; padding: 16px 18px; }
  .hero-caption-title { font-size: 1.22rem; }

  /* Cartes sur deux colonnes, sans résumé. */
  .grid, .grid-3 { grid-template-columns: 1fr 1fr; gap: 22px 12px; }
  .card-link { gap: 9px; }
  .card-media { border-radius: 14px; }
  .card-title { font-size: 1.03rem; line-height: 1.25; }
  .card-summary { display: none; }
  .card-meta { font-size: 0.76rem; gap: 2px 10px; margin-top: 0; }
  .pill { left: 8px; top: 8px; padding: 5px 8px; font-size: 0.66rem; }
  .ph span { font-size: 3rem; }

  /* Carrousels horizontaux (« Vite fait », « Dans le même esprit »). */
  .grid-4, .related .grid {
    display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 4px; scroll-padding: 0 var(--gutter);
  }
  .grid-4::-webkit-scrollbar, .related .grid::-webkit-scrollbar { display: none; }
  .grid-4 > .card, .related .grid > .card { flex: 0 0 62%; scroll-snap-align: start; }

  .tiles { gap: 10px; }
  .tile { flex-basis: 40%; height: 112px; border-radius: 16px; }
  .tiles-lg .tile { height: 132px; }
  .tile-label { left: 14px; right: 12px; bottom: 11px; }
  .tile-label strong { font-size: 1.08rem; }
  .tile-label span { font-size: 0.76rem; }

  .cooks { display: grid; grid-template-columns: 1fr; }
  .author-head { gap: 16px; }
  .avatar-lg { width: 64px; height: 64px; font-size: 1.9rem; }
  .tag-w3, .tag-w4 { font-size: 1.05rem; }
  .prose { font-size: 1.04rem; }

  /* Recette */
  .recipe-intro .display { font-size: clamp(2rem, 9.5vw, 2.5rem); }
  .recipe-intro .eyebrow { margin-bottom: 14px; }
  .recipe-intro .lead { margin-top: 12px; }
  .recipe-main h2 { font-size: 1.5rem; }
  .servings button { width: 40px; height: 40px; }
  .servings-value { font-size: 0.92rem; }
  .checklist label { padding: 12px 0; font-size: 1rem; }
  input[type="checkbox"] { width: 22px; height: 22px; }
  input[type="checkbox"]::after { left: 6.5px; top: 2.5px; width: 5.5px; height: 11px; }
  .steps li { grid-template-columns: 38px 1fr; gap: 12px; padding: 18px 0; }
  .step-num { width: 38px; height: 38px; font-size: 1.08rem; }
  .step-text { padding-top: 5px; font-size: 1.06rem; line-height: 1.68; }
  .timer { padding: 3px 11px 3px 9px; line-height: 1.7; }
  .tip { gap: 14px; margin-top: 28px; padding: 18px; }
  .tip-icon { width: 38px; height: 38px; border-radius: 12px; }
  .recipe-foot { margin-top: 28px; }
  .related { margin-top: 48px; padding-top: 40px; }

  .cook-mode .step-text { font-size: 1.24rem; }
  .cook-mode .checklist label { font-size: 1.1rem; }
  .timer-card { padding: 12px 12px 12px 16px; }
  .timer-card button { width: 44px; height: 44px; }
}

/* --- Impression ------------------------------------------------------------------------------------------------ */

@media print {
  :root { --paper: #fff; --paper-2: #fff; --card: #fff; --ink: #000; --ink-2: #333; --ink-3: #666; --line: #ccc; --accent: #000; --accent-soft: #fff; --olive: #000; --olive-soft: #f2f2f2; --shadow: none; --shadow-lg: none; }
  body { font-size: 11pt; }
  .masthead, .site-footer, .crumbs, .tools, .related, .chips, .timer-dock, .servings, .skip, .tabbar, .recipe-tabs, .next-tab, .quickfacts, .timeline { display: none !important; }
  body { padding-bottom: 0 !important; }
  .stats { display: flex !important; }
  .recipe-main[data-tab] > .method, .recipe-main[data-tab] > .ingredients { display: block !important; }
  .recipe-figure { margin: 0 !important; }
  .js .servings-static[data-nojs] { display: block; }
  .recipe-hero { background: none; padding-top: 0; }
  .recipe-hero-grid { grid-template-columns: 1fr 200px !important; }
  .recipe-figure { order: 0; aspect-ratio: 1; border-radius: 8px; }
  .no-photo .recipe-figure { display: none; }
  .display { font-size: 26pt !important; }
  .recipe-main { grid-template-columns: 34% 1fr !important; margin-top: 20px; }
  .ingredients { position: static; padding: 14px; }
  .step-text { font-size: 11pt; }
  .steps li { break-inside: avoid; padding: 10px 0; }
  .timer { background: none; padding: 0; }
  .timer .icon, .checklist input[type="checkbox"] { display: none; }
  .step-num { width: 30px; height: 30px; font-size: 13pt; }
  .tip { break-inside: avoid; }
}
