/* Carnet de recettes : mobile d'abord. Seuils : 768 px (tablette) et 992 px (desktop). */
:root {
  --bg: #fbfaf7; --surface: #fff; --ink: #1f2933; --muted: #5c6773; --line: #e3e0d8;
  --accent: #b4491f; --accent-ink: #fff; --accent-soft: #fbe9e1; --focus: #0b57d0;
  --radius: 8px; --gap: 16px; --wrap: 960px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.55; font-size: 16px; }
img { max-width: 100%; height: auto; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gap); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 20; }
.skip-link:focus { left: 8px; top: 8px; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; padding-top: 12px; padding-bottom: 12px; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.tagline { color: var(--muted); font-size: .9rem; }
main { padding-top: 20px; padding-bottom: 40px; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; padding: 16px 0; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 12px; }
h2 { font-size: 1.25rem; margin: 0 0 8px; }
h3 { font-size: 1.05rem; margin: 16px 0 6px; }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 16px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--ink); }
.btn--primary, .btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: #7a2e10; font-size: .8rem; font-weight: 600; }
.badge--time, .badge--servings { background: #eef1f4; color: var(--ink); }

/* Liste */
.search__row { display: flex; flex-direction: column; gap: 8px; }
.search input[type="search"], .filters select { width: 100%; min-height: 46px; padding: 8px 12px; border: 1px solid #c9c5ba; border-radius: var(--radius); background: var(--surface); font: inherit; color: inherit; }
.filters { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 8px 0 0; }
.count { margin: 16px 0 8px; color: var(--muted); }
.cards { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.card { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.card:last-child { border-bottom: 0; }
.card[hidden] { display: none; }
.card__main { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.card__title { margin: 0; font-size: 1.05rem; }
.card__title a { color: var(--ink); text-decoration: none; }
.card__title a:hover { color: var(--accent); text-decoration: underline; }
.card__summary { margin: 6px 0; color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card__meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.card__cta { display: flex; width: 100%; }
.empty { padding: 24px 0; text-align: center; }
.pagination { margin: 20px 0; }
.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.pager__item { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; }
.pager__item.is-current { background: var(--ink); color: #fff; border-color: var(--ink); }
.pager__item.is-disabled, .pager__item.is-gap { opacity: .5; border-color: transparent; background: transparent; }
.notice { color: var(--muted); }

/* Recette */
.back { margin: 0 0 8px; }
.lead { font-size: 1.05rem; color: var(--muted); margin: 0 0 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.chip { padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: .85rem; text-decoration: none; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0 0 16px; }
.facts div { padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.facts dt { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.facts dd { margin: 0; font-weight: 600; }
.quick { display: flex; gap: 8px; margin: 0 0 16px; }
.quick .btn { flex: 1; min-width: 0; padding: 8px; }
.cook-status { display: none; margin: 0 0 12px; padding: 10px 12px; border-left: 3px solid var(--ink); background: #f1efe9; font-size: .9rem; }
.cook-mode .cook-status { display: block; }
.cook-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 16px; }
.cook-controls[hidden] { display: none; }
.block { margin: 0 0 28px; scroll-margin-top: 72px; }
.ingredients, .equipment { list-style: none; margin: 0; padding: 0; }
.ingredients li, .equipment li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.ing__qty { font-weight: 700; }
.ing__note, .step__ingredients { color: var(--muted); font-size: .9rem; }
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; }
.step { position: relative; counter-increment: step; margin: 0 0 12px; padding: 14px 14px 14px 52px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.step[hidden] { display: none; }
.step::before { content: counter(step); position: absolute; left: 12px; top: 12px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.step--tip::before { content: "i"; background: var(--muted); }
.step__title { display: block; margin-bottom: 4px; }
.step__text p { margin: 0 0 8px; }
.step__ingredients { margin: 8px 0 0; padding: 8px 10px; list-style: none; background: #f6f4ee; border-radius: 6px; display: grid; grid-template-columns: 1fr; gap: 2px; }
.step__image { display: block; margin-top: 8px; border-radius: 6px; }
.cook-mode .step { font-size: 1.1rem; line-height: 1.65; }
.cook-mode .article, .cook-mode .back { display: none; }
.rich img { display: block; margin: 8px auto; border-radius: 6px; }
.rich table { border-collapse: collapse; max-width: 100%; display: block; overflow-x: auto; }
.rich td, .rich th { border: 1px solid var(--line); padding: 4px 8px; }
.rich figure { margin: 12px 0; }
.rich figcaption { color: var(--muted); font-size: .85rem; text-align: center; }
.rich .gallery { list-style: none; margin: 12px 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.rich .gallery img { margin: 0; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

@media (min-width: 768px) {
  h1 { font-size: 2rem; }
  .search__row { flex-direction: row; }
  .search input[type="search"] { flex: 1; }
  .filters { grid-template-columns: repeat(4, 1fr) auto; }
  .card { display: grid; grid-template-columns: 28% 1fr auto auto; align-items: center; gap: 12px; padding: 12px 16px; }
  .card__summary, .card__meta { margin: 0; }
  .card__cta { width: auto; }
  .facts { grid-template-columns: repeat(4, 1fr); }
  .quick { max-width: 560px; }
  .step__ingredients { grid-template-columns: 1fr 1fr; }
  .rich .gallery { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 992px) {
  :root { --wrap: 1040px; }
}
@media (max-width: 767px) {
  .quick { position: sticky; top: 0; z-index: 5; padding: 8px 0; background: var(--bg); }
  .cook-controls .btn { padding: 8px; font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media print {
  .site-header, .site-footer, .quick, .cook-controls, .cook-status, .back, .skip-link, .article { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .step, .facts div { border-color: #999; break-inside: avoid; }
  .step[hidden] { display: block !important; }
}
