/* La Pantry — couche éditoriale 2026.08.23 */
:root {
  --pantry-cream: #fbf4e9;
  --pantry-paper: #fffdf8;
  --pantry-paper-deep: #f3e8d9;
  --pantry-terracotta: #bd4933;
  --pantry-terracotta-hover: #963724;
  --pantry-ink: #302722;
  --pantry-muted: #746962;
  --pantry-border: #dfd1c2;
  --pantry-sage: #dce5d3;
  --pantry-sage-ink: #30422f;
  --pantry-warning: #9b651d;
  --pantry-error: #9f3125;
  --pantry-shadow: 0 18px 46px rgba(67, 43, 30, .09);
  --pantry-radius-sm: 8px;
  --pantry-radius-md: 14px;
  --pantry-radius-lg: 22px;
  --pantry-serif: "Fraunces", Georgia, serif;
  --pantry-sans: "DM Sans", Inter, ui-sans-serif, system-ui, sans-serif;
  --pantry-fast: 160ms cubic-bezier(.2, .7, .2, 1);
  --red: var(--pantry-terracotta);
  --red-dark: var(--pantry-terracotta-hover);
  --cream: var(--pantry-cream);
  --paper: var(--pantry-paper);
  --ink: var(--pantry-ink);
  --muted: var(--pantry-muted);
  --line: var(--pantry-border);
  --sage: var(--pantry-sage);
  --sage-ink: var(--pantry-sage-ink);
  font-family: var(--pantry-sans);
}

body {
  background:
    linear-gradient(90deg, transparent calc(100% - 18px), color-mix(in srgb, var(--line) 35%, transparent) calc(100% - 18px), color-mix(in srgb, var(--line) 35%, transparent) calc(100% - 17px), transparent calc(100% - 17px)),
    var(--cream);
  font-family: var(--pantry-sans);
  text-rendering: optimizeLegibility;
}

h1, h2, h3,
.brand b,
.recipe-copy > b,
.ricardo-discoveries h4,
.planner article.empty button,
.pantry-grid article b {
  font-family: var(--pantry-serif);
  font-variation-settings: "opsz" 72;
}

h1 { font-weight: 600; letter-spacing: -.045em; }
h2, h3 { font-weight: 500; letter-spacing: -.025em; }

.eyebrow,
.recipe-category {
  font-family: var(--pantry-sans);
  font-weight: 700;
  letter-spacing: .19em;
}

button, input, select, textarea { font-family: var(--pantry-sans); }
button, a, input, select, textarea { transition: color var(--pantry-fast), background-color var(--pantry-fast), border-color var(--pantry-fast), box-shadow var(--pantry-fast), transform var(--pantry-fast); }
:where(button, a, input, select, textarea):focus-visible { outline: 3px solid color-mix(in srgb, var(--red) 45%, transparent); outline-offset: 3px; }

.topbar {
  min-height: 82px;
  border-bottom-color: color-mix(in srgb, var(--line) 82%, transparent);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(14px);
}

.brand { gap: 11px; }
.brand b { display: flex; align-items: baseline; gap: 5px; font-size: 24px; font-weight: 600; letter-spacing: -.045em; }
.brand-la { color: var(--red-dark); font: 700 9px/1 var(--pantry-sans); letter-spacing: .16em; text-transform: uppercase; }

.mark {
  position: relative;
  display: block;
  width: 38px;
  height: 40px;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  color: var(--red);
  box-shadow: none;
}
.mark-letter {
  position: absolute;
  z-index: 2;
  top: -3px;
  left: 9px;
  color: currentColor;
  font: 600 42px/1 var(--pantry-serif);
  letter-spacing: -.08em;
}
.mark-handle {
  position: absolute;
  z-index: 1;
  top: 14px;
  left: 5px;
  width: 8px;
  height: 17px;
  border: 1.5px solid currentColor;
  border-right: 0;
  border-radius: 9px 0 0 9px;
  opacity: .76;
}
.mark-ticks {
  position: absolute;
  z-index: 4;
  top: 18px;
  left: 11px;
  display: grid;
  width: 7px;
  gap: 5px;
  justify-items: end;
}
.mark-ticks i { display: block; width: 7px; height: 2px; background: var(--paper); }
.mark-ticks i:last-child { width: 5px; }
@media (max-width: 520px) {
  .mark { width: 34px; height: 36px; }
  .mark-letter { top: -2px; left: 8px; font-size: 38px; }
  .mark-handle { top: 13px; left: 4px; width: 8px; height: 16px; border-width: 1px; }
  .mark-ticks { top: 17px; left: 10px; width: 6px; gap: 4px; }
  .mark-ticks i { width: 6px; height: 1.5px; }
  .mark-ticks i:last-child { width: 4px; }
}

.topbar nav { gap: 14px; }
.topbar nav button {
  position: relative;
  padding: 10px 3px 8px;
  border-radius: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.topbar nav button.active { background: transparent; color: var(--ink); }
.topbar nav button.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 2px;
  background: var(--red);
}

.top-actions > :not(.primary) { box-shadow: none; }
.top-actions .ai-budget,
.top-actions .account-button,
.top-actions .theme-toggle { background: transparent; border-color: color-mix(in srgb, var(--line) 75%, transparent); color: var(--muted); }
.top-actions .primary { padding-inline: 17px; }

.primary { border-radius: var(--pantry-radius-sm); font-weight: 600; box-shadow: 0 5px 14px rgba(155, 55, 37, .14); }
.primary:hover { transform: translateY(-1px); }

main { width: min(1240px, calc(100% - 48px)); padding-top: 54px; }
.page-head { position: relative; margin-bottom: 36px; }
.page-head::after {
  content: "";
  position: absolute;
  top: -8px;
  bottom: 3px;
  left: -40px;
  width: 24px;
  opacity: .3;
  background-image:
    linear-gradient(to bottom, var(--red) 0 1px, transparent 1px),
    linear-gradient(to bottom, var(--red) 0 1px, transparent 1px),
    linear-gradient(to bottom, var(--red) 0 1px, transparent 1px),
    linear-gradient(to right, color-mix(in srgb, var(--red) 25%, transparent) 0 1px, transparent 1px);
  background-position: left top;
  background-repeat: repeat-y;
  background-size: 24px 48px, 15px 24px, 8px 12px, 1px 100%;
}
.page-head h1 { max-width: 780px; }
.page-head p { font-size: 14px; }

.search {
  border-radius: 3px 14px 14px 14px;
  box-shadow: inset 3px 0 0 var(--red);
}
.search:focus-within { border-color: color-mix(in srgb, var(--red) 58%, var(--line)); box-shadow: inset 3px 0 0 var(--red), 0 0 0 4px color-mix(in srgb, var(--red) 9%, transparent); }

.section-head { padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.section-head h2 { font-size: 28px; }
.section-head > span { font-variant-numeric: tabular-nums; }

.recipe-grid { gap: 22px 18px; }
.recipe-card {
  position: relative;
  border: 0;
  border-radius: 4px 18px 18px 18px;
  background: transparent;
  overflow: visible;
  isolation: isolate;
}
.recipe-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 10px -1px -1px 10px;
  border: 1px solid var(--line);
  border-radius: 4px 18px 18px 18px;
  background: var(--paper);
  transition: transform var(--pantry-fast), box-shadow var(--pantry-fast), border-color var(--pantry-fast);
}
.recipe-card:hover { transform: none; box-shadow: none; }
.recipe-card:hover::after { transform: translate(-3px, -3px); border-color: color-mix(in srgb, var(--red) 32%, var(--line)); box-shadow: var(--pantry-shadow); }
.recipe-card:focus-visible { outline-offset: 7px; }

.food-photo {
  height: 205px;
  border-radius: 3px 15px 3px 3px;
  filter: saturate(.92) contrast(1.02);
  box-shadow: 0 1px 0 rgba(255,255,255,.35);
}
.food-photo.placeholder {
  background:
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(255,255,255,.12) 18px 19px),
    var(--red);
  font-family: var(--pantry-serif);
}

.recipe-copy { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0; padding: 18px 18px 19px 22px; }
.recipe-category { flex: 0 0 100%; margin: 0 0 7px; color: var(--red-dark); font-size: 8px; }
.recipe-copy > b { flex: 0 0 100%; margin-bottom: 12px; font-size: clamp(21px, 2.2vw, 27px); font-weight: 600; line-height: 1.04; letter-spacing: -.035em; }
.recipe-copy small { margin: 0; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.recipe-card-facts { display: block; }
.recipe-copy .recipe-duration, .recipe-copy .recipe-price, .recipe-copy .recipe-source { display: none; }
.card-tags { order: 6; flex: 0 0 100%; margin-top: 11px; gap: 8px; }
.card-tags i { padding: 0; border-radius: 0; background: transparent; color: var(--muted); font-size: 9px; font-style: italic; }
.card-tags i + i { padding-left: 8px; border-left: 1px solid color-mix(in srgb, var(--red) 42%, transparent); }

.week {
  position: relative;
  border-radius: 3px 22px 22px 22px;
  background: var(--sage);
  overflow: hidden;
}
.week::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 22px;
  width: 18px;
  height: 88px;
  opacity: .22;
  background: repeating-linear-gradient(to bottom, var(--sage-ink) 0 1px, transparent 1px 12px);
}
.week h2 { font-size: 32px; }

.tag-filters button,
.recipe-tags button,
.recipe-tags .fixed-tag { border-radius: 7px; }
.tag-filters button { background: transparent; }
.tag-filters button[aria-pressed="true"] { box-shadow: inset 0 -2px 0 rgba(0,0,0,.12); }
.view-toggle { border-radius: var(--pantry-radius-sm); }
.view-toggle button { border-radius: 5px; }

.recipe-sheet { border-top: 1px solid var(--line); }
.recipe-hero { padding-top: 30px; }
.recipe-intro h1 { font-weight: 600; }
.recipe-facts { font-variant-numeric: tabular-nums; }
.recipe-facts > span + span::before { content: " · "; color: var(--muted); }
.recipe-jump-nav { border-radius: 3px 14px 14px 14px; }
.ingredients li { border-bottom-color: color-mix(in srgb, var(--line) 88%, transparent); }
.direction-card { border-radius: 3px 18px 18px 18px; }
.step-number { font-family: var(--pantry-serif); font-variant-numeric: oldstyle-nums; }

/* Quantités — un contrôle compact qui reste dans la colonne des ingrédients. */
.ingredients-section .section-title-row { align-items: stretch; flex-direction: column; gap: 16px; }
.portion-control { width: 100%; min-width: 0; text-align: left; }
.portion-control > span { display: block; margin-bottom: 7px; color: var(--muted); }
.portion-control > span::after { content: none; }
.scale-buttons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: color-mix(in srgb, var(--paper) 72%, transparent);
}
.scale-buttons button {
  min-width: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.scale-buttons button::before { content: none; }
.scale-buttons button:hover { color: var(--ink); background: color-mix(in srgb, var(--sage) 45%, transparent); }
.scale-buttons button.active { border-radius: 7px; background: var(--red); color: #fff; box-shadow: 0 4px 10px rgba(155,55,37,.14); }

/* Mode cuisine — l’écran signature */
.cooking-mode { background: var(--cream); }
.cooking-header { border-bottom: 0; box-shadow: inset 0 -1px 0 var(--line); }
.cooking-header strong { font-family: var(--pantry-serif); font-weight: 600; }
.cooking-utilities button { border-radius: 4px 9px 9px 9px; color: var(--muted); }
.cooking-utilities #toggleVoice[aria-pressed="true"] { box-shadow: inset 3px 0 0 var(--sage-ink); }
.cooking-progress { align-items: end; }
.cooking-progress > span:first-child { min-width: 112px; color: var(--red-dark); font-weight: 700; letter-spacing: .14em; }
.progress-track { position: relative; height: 12px; border-radius: 0; overflow: visible; background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 5%); }
.progress-track::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 1px; background: var(--line); }
.progress-track i { position: relative; z-index: 1; height: 3px; margin-top: 9px; border-radius: 0; }
.cooking-step { grid-template-columns: 132px minmax(0, 1fr); gap: clamp(28px, 5vw, 68px); }
.cooking-step-number { display: block; width: auto; height: auto; border-radius: 0; background: transparent; color: var(--ink); text-align: right; }
.cooking-step-number small { display: block; margin-bottom: -5px; color: var(--red-dark); font: 700 9px/1 var(--pantry-sans); letter-spacing: .2em; }
.cooking-step-number b { display: block; font: 600 clamp(68px, 9vw, 118px)/.9 var(--pantry-serif); letter-spacing: -.08em; font-variant-numeric: lining-nums tabular-nums; }
.cooking-step > div { padding-top: 8px; }
.cooking-step h1 { max-width: 760px; }
.cooking-step aside { border-radius: 3px 14px 14px 14px; }
.cooking-footer { box-shadow: 0 -12px 34px rgba(67,43,30,.04); }
.cooking-footer button { border-radius: 4px 10px 10px 10px; }

dialog { border: 1px solid var(--line); border-radius: 4px 22px 22px 22px; }
dialog::backdrop { backdrop-filter: blur(3px); }

.planner article,
.deal-planner,
.grocery-section,
.planner-secondary { border-radius: 3px 18px 18px 18px; }

.recipe-grid.list-view .recipe-card { border-radius: 2px 12px 12px 2px; background: var(--paper); overflow: hidden; }
.recipe-grid.list-view .recipe-card::after { display: none; }
.recipe-grid.list-view .recipe-card:hover { transform: translateX(3px); box-shadow: 0 8px 24px rgba(67,43,30,.08); }
.recipe-grid.list-view .food-photo { height: 64px; border-radius: 0; box-shadow: none; }
.recipe-grid.list-view .recipe-copy { display: grid; padding: 9px 14px; }
.recipe-grid.list-view .recipe-copy > b { margin: 0; font-size: 16px; }
.recipe-grid.list-view .recipe-card-facts { display: none; }
.recipe-grid.list-view .recipe-copy .recipe-duration, .recipe-grid.list-view .recipe-copy .recipe-price, .recipe-grid.list-view .recipe-copy .recipe-source { display: block; }
.recipe-grid.list-view .card-tags { order: initial; margin: 0; }

:root[data-theme="dark"] {
  --pantry-cream: #17130f;
  --pantry-paper: #211c17;
  --pantry-paper-deep: #2a231d;
  --pantry-terracotta: #d36a52;
  --pantry-terracotta-hover: #f08a72;
  --pantry-ink: #f3e9df;
  --pantry-muted: #b9aaa0;
  --pantry-border: #4a3d33;
  --pantry-sage: #2e3a2c;
  --pantry-sage-ink: #dce9d5;
  --pantry-shadow: 0 18px 50px rgba(0,0,0,.32);
}
:root[data-theme="dark"] .food-photo { filter: saturate(.88) brightness(.9) contrast(1.04); }

@media (max-width: 900px) {
  main { width: min(100% - 32px, 720px); }
  .page-head::after { display: none; }
  .home-grid { gap: 22px; }
  .recipe-copy > b { font-size: 22px; }
}

@media (max-width: 780px) {
  .topbar { min-height: 70px; }
  .topbar nav { order: 3; border-top: 1px solid var(--line); }
  .topbar nav button { flex: 1; }
  main { padding-top: 34px; }
  .page-head { margin-bottom: 28px; }
  .food-photo { height: 160px; }
}

@media (max-width: 520px) {
  body { background: var(--cream); }
  main { width: min(100% - 24px, 480px); }
  h1 { line-height: .96; }
  .recipe-grid { grid-template-columns: 1fr; gap: 25px; }
  .food-photo { height: clamp(185px, 58vw, 260px); }
  .recipe-copy { padding: 17px 17px 19px 20px; }
  .recipe-copy > b { font-size: 25px; }
  .week { padding: 20px; }
  .top-actions { gap: 6px; }
  .brand b { font-size: 21px; }
  .brand-la { font-size: 7px; }
  .portion-control { min-width: 0; width: 100%; }
  .scale-buttons button { min-height: 42px; padding: 7px 4px; }
  .cooking-step { grid-template-columns: 1fr; gap: 14px; margin-top: 24px; }
  .cooking-step-number { display: flex; align-items: baseline; gap: 8px; text-align: left; }
  .cooking-step-number small { margin: 0; }
  .cooking-step-number b { font-size: 62px; }
  .cooking-step > div { padding-top: 0; }
  .cooking-step h1 { margin-top: 0; font-size: 31px; }
  .cooking-progress > span:first-child { min-width: 96px; font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* La provenance remplace la catégorie; sa colonne dédiée devient redondante. */
.recipe-list-head { grid-template-columns: 58px minmax(190px,1.45fr) minmax(150px,1fr) minmax(115px,.75fr) minmax(100px,.7fr); }
.recipe-grid.list-view .recipe-copy { grid-template-columns: minmax(190px,1.45fr) minmax(150px,1fr) minmax(115px,.75fr) minmax(100px,.7fr); }
.recipe-grid.list-view .recipe-price { grid-column: 4; }
.recipe-grid.list-view .recipe-copy .recipe-source { display: none; }
@media(max-width:760px){.recipe-list-head{grid-template-columns:54px minmax(0,1fr) auto auto}.recipe-grid.list-view .recipe-copy{grid-template-columns:1fr auto auto}}
