/* Popote — feuille de style. Sobre, « photo d'abord », lisible en cuisine.
   Clair par défaut, sombre automatique (RNF-3/4). Cibles tactiles ≥ 44 px. */
:root {
  --bg: #fbf7f2;
  --surface: #ffffff;
  --surface-2: #f3ede4;
  --ink: #241f1b;
  --ink-soft: #6b615a;
  --line: #e5dcd0;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --ink-faint: #8a7e73;  /* mentions discrètes (estimations, notes) */
  --numeral: #dcc9b4;    /* chiffres des étapes */
  --brand: #b4451f;      /* terre cuite */
  --brand-ink: #ffffff;
  --brand-soft: #f6e3d8;
  --accent: #2f7d55;     /* vert herbe */
  --danger: #b3261e;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(60,40,20,.08), 0 6px 20px rgba(60,40,20,.05);
  --tap: 44px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17130f; --surface: #211b16; --surface-2: #2b241d;
    --ink-faint: #9a8c7e; --numeral: #4a3b2e;
    --ink: #f3ece3; --ink-soft: #b6a99c; --line: #3a2f26;
    --brand: #e0703f; --brand-soft: #3a241a; --accent: #57b483;
  }
}
/* Bascule manuelle du thème (bouton en-tête), prioritaire sur la préférence système */
:root[data-theme="dark"] {
  --bg: #17130f; --surface: #211b16; --surface-2: #2b241d;
  --ink-faint: #9a8c7e; --numeral: #4a3b2e;
    --ink: #f3ece3; --ink-soft: #b6a99c; --line: #3a2f26;
  --brand: #e0703f; --brand-soft: #3a241a; --accent: #57b483;
}
/* Fraunces (OFL) servie depuis le site : pas d'appel à un tiers, pas de traçage.
   Deux sous-ensembles suffisent au français ; l'italique n'est pas chargé. */
@font-face {
  font-family: "Fraunces"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/fraunces-latin.5d2835174326.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/fraunces-latin-ext.3592119408ee.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

* { box-sizing: border-box; }
/* `hidden` doit gagner même sur un .btn en inline-flex (boutons révélés par le JS). */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.wrap { width: min(1100px, 92vw); margin-inline: auto; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.18;
  letter-spacing: -.015em; color: var(--ink); }
h1 { font-weight: 700; letter-spacing: -.025em; }
img { max-width: 100%; height: auto; display: block; }

.skip { position: absolute; left: -999px; top: 0; background: var(--brand); color: #fff; padding: .6rem 1rem; }
.skip:focus { left: 8px; top: 8px; z-index: 100; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* En-tête */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; gap: 1rem; padding: .5rem 0; flex-wrap: wrap; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 1.4rem; color: var(--ink); letter-spacing: -.02em; }
.brand-mark { font-size: 1.3rem; }
.site-search { display: flex; flex: 1 1 240px; min-width: 180px; }
.site-search input { flex: 1; min-height: var(--tap); border: 1px solid var(--line); border-right: 0;
  border-radius: 999px 0 0 999px; padding: 0 1rem; background: var(--bg); color: var(--ink); font-size: 1rem; }
.site-search button { min-width: var(--tap); min-height: var(--tap); border: 1px solid var(--line);
  border-radius: 0 999px 999px 0; background: var(--brand); color: #fff; cursor: pointer; font-size: 1.1rem; }
.site-nav { display: flex; align-items: center; gap: .35rem; }
.site-nav a { padding: .55rem .7rem; border-radius: 10px; color: var(--ink); min-height: var(--tap); display: inline-flex; align-items: center; }
.site-nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav-cta { background: var(--brand); color: var(--brand-ink) !important; }
.nav-cta:hover { filter: brightness(1.05); }
.theme-toggle { background: none; border: 1px solid var(--line); border-radius: 999px;
  min-width: var(--tap); min-height: var(--tap); cursor: pointer; font-size: 1.15rem; color: var(--ink); }
.theme-toggle:hover { background: var(--surface-2); }

/* Menu utilisateur */
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; padding: .55rem .7rem; border-radius: 10px; min-height: var(--tap); display: inline-flex; align-items: center; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu[open] summary { background: var(--surface-2); }
.usermenu-panel { position: absolute; right: 0; top: 110%; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); min-width: 200px; padding: .35rem; display: grid; gap: .15rem; }
.usermenu-panel a, .usermenu-panel button { padding: .6rem .7rem; border-radius: 8px; text-align: left; }
.usermenu-panel a:hover, .usermenu-panel button:hover { background: var(--surface-2); }

/* Messages */
.messages { margin-top: 1rem; display: grid; gap: .5rem; }
.msg { padding: .8rem 1rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.msg-success { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.msg-error, .msg-danger { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, var(--surface)); }
.msg-warning { border-color: #c98a1a; }

main { padding: 1.5rem 0 3rem; }

/* Boutons & formulaires */
.btn { display: inline-flex; align-items: center; gap: .4rem; min-height: var(--tap); padding: .55rem 1.1rem;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; font-size: 1rem; font-weight: 600; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { filter: brightness(1.05); background: var(--brand); }
.btn-ghost { background: transparent; }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-sm { min-height: 36px; padding: .3rem .7rem; font-size: .9rem; }
.linklike { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; }

label { font-weight: 600; display: block; margin-bottom: .25rem; }
input, select, textarea {
  width: 100%; min-height: var(--tap); padding: .5rem .7rem; font-size: 1rem;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink);
}
textarea { min-height: 5rem; resize: vertical; }
/* Cases à cocher / boutons radio : taille naturelle + alignement avec le libellé */
input[type="checkbox"], input[type="radio"] {
  width: 20px; height: 20px; min-height: 0; padding: 0; margin: 0; flex: 0 0 auto;
  accent-color: var(--brand); vertical-align: middle; cursor: pointer;
}
label:has(> input[type="checkbox"]), label:has(> input[type="radio"]) {
  display: inline-flex; align-items: center; gap: .5rem; font-weight: 400; margin: .15rem 0;
  min-height: 32px; cursor: pointer;
}
.field { margin-bottom: 1rem; }
.help { color: var(--ink-soft); font-size: .88rem; }
.errorlist { color: var(--danger); list-style: none; padding: 0; margin: .25rem 0; font-size: .9rem; }

/* Cartes & grilles */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.8rem 1.4rem; }
.recipe-card { display: flex; flex-direction: column; }
.recipe-card .thumb { aspect-ratio: 4 / 3; background: var(--surface-2); object-fit: cover; width: 100%; }
.recipe-card .thumb-fallback { display: grid; place-items: center; font-size: 2.5rem; color: var(--ink-soft); aspect-ratio: 4/3; background: var(--surface-2); }
.recipe-card .body { padding: .8rem .9rem 1rem; display: flex; flex-direction: column; gap: .4rem; }
.recipe-card h3 { margin: 0; font-size: 1.12rem; color: var(--ink); }
.recipe-card:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.recipe-card .meta { color: var(--ink-soft); font-size: .78rem; letter-spacing: .05em;
  text-transform: uppercase; display: flex; gap: .7rem; flex-wrap: wrap; }

/* Suggestion du jour : une carte large pour casser le rythme de la grille */
.suggestion { display: flex; flex-wrap: wrap; align-items: stretch; color: inherit; }
.suggestion > img { flex: 1 1 380px; min-width: 0; width: 100%; min-height: 260px; object-fit: cover; }
.suggestion-txt { flex: 1 1 320px; min-width: 0; padding: 2rem 2.2rem;
  display: flex; flex-direction: column; justify-content: center; gap: .55rem; }
.suggestion-txt h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.4rem); }
.suggestion:hover h2 { text-decoration: underline; text-underline-offset: 4px; }
.kicker { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brand); font-weight: 700; }
.suggestion .meta { color: var(--ink-soft); font-size: .78rem; letter-spacing: .05em;
  text-transform: uppercase; display: flex; gap: .9rem; flex-wrap: wrap; }

/* Badges */
.badges { display: flex; flex-wrap: wrap; gap: .35rem; }
.badge { font-size: .78rem; padding: .18rem .55rem; border-radius: 999px; background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line); }
.badge-brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }

/* Étoiles */
.stars { --pct: 0%; display: inline-block; font-size: 1.1rem; line-height: 1; position: relative; color: var(--line); }
.stars::before { content: "★★★★★"; }
.stars .fill { position: absolute; inset: 0; width: var(--pct); overflow: hidden; color: #e0a52b; white-space: nowrap; }
.stars .fill::before { content: "★★★★★"; }
.star-input button { background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--line); min-width: 40px; min-height: 40px; }
.star-input button.on { color: #e0a52b; }

/* Fiche recette */
.hero { position: relative; display: flex; align-items: flex-end; overflow: hidden;
  border-radius: var(--radius); background: var(--ink); min-height: clamp(230px, 34vw, 420px); }
.hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top,
  rgba(20,14,10,.9) 0%, rgba(20,14,10,.45) 38%, rgba(20,14,10,0) 72%); }
.hero-txt { position: relative; z-index: 1; width: 100%; padding: 1.5rem 1.7rem; color: #fff;
  /* Le dégradé ne suffit pas sur une photo claire : l'ombre rend le texte
     lisible quelle que soit l'image, sans assombrir le plat. */
  text-shadow: 0 1px 12px rgba(20, 14, 10, .55), 0 1px 3px rgba(20, 14, 10, .5); }
.hero-txt h1 { margin: .5rem 0 .3rem; font-size: clamp(1.9rem, 4.6vw, 3.5rem); color: #fff; }
.hero-meta { margin: 0; color: #f3e7da; }
.hero .badge { background: rgba(255,255,255,.18); color: #fff; border-color: rgba(255,255,255,.4); }
/* Sans photo : même bloc, mais sur fond clair et en encre */
.hero-plain { background: var(--surface-2); min-height: 0; }
.hero-plain::after { display: none; }
.hero-plain .hero-txt { color: var(--ink); text-shadow: none; }
.hero-plain .hero-txt h1 { color: var(--ink); }
.hero-plain .hero-meta { color: var(--ink-soft); }
.hero-plain .badge { background: var(--surface); color: var(--ink-soft); border-color: var(--line); }

/* Barre d'actions : une action principale, le reste replié */
.actions-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 1.1rem 0 .4rem; }
.actions-bar .spacer { flex: 1 1 auto; }
.more-menu { position: relative; }
.more-menu > summary { list-style: none; cursor: pointer; min-width: var(--tap); min-height: var(--tap);
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-soft);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.more-menu > summary::-webkit-details-marker { display: none; }
.more-menu[open] > summary { background: var(--surface-2); }
.more-panel { position: absolute; right: 0; top: 110%; z-index: 30; min-width: 230px; padding: .35rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); display: grid; gap: .15rem; }
.more-panel a, .more-panel button { padding: .6rem .7rem; border-radius: 8px; text-align: left;
  background: none; border: 0; color: var(--ink); font: inherit; cursor: pointer; width: 100%;
  min-height: var(--tap); display: flex; align-items: center; }
.more-panel a:hover, .more-panel button:hover { background: var(--surface-2); text-decoration: none; }
.more-panel .danger { color: var(--danger); }

/* Filtres rapides */
.pills { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1.2rem; }
.pill { display: inline-flex; align-items: center; min-height: 40px; padding: 0 .95rem;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font-size: .95rem; }
.pill:hover { background: var(--surface-2); text-decoration: none; }
.pill.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.recipe-cols { display: grid; grid-template-columns: 320px 1fr; gap: 2rem; margin-top: 2rem; }
.ingredients li { padding: .35rem 0; border-bottom: 1px dashed var(--line); }
.ingredients .adjust { color: var(--ink-soft); font-style: italic; }
.steps { list-style: none; padding: 0; counter-reset: etape; display: grid; gap: 1.5rem; }
.steps li { counter-increment: etape; display: flex; gap: 1.1rem; margin: 0; }
.steps li::before { content: counter(etape); flex: none; width: 2ch; text-align: right;
  font-family: var(--serif); font-weight: 600; font-size: 2.3rem; line-height: 1; color: var(--numeral); }
.steps li > div { padding-top: .3rem; font-size: 1.05rem; line-height: 1.7; }
.serv-select { display: flex; align-items: center; gap: .5rem; }
.serv-select input { width: 5rem; text-align: center; }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }

.aisle-group { margin-bottom: 1.4rem; }
.aisle-group h3 { border-bottom: 2px solid var(--brand-soft); padding-bottom: .3rem; }
.check-item { display: flex; align-items: center; gap: .7rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.check-item input[type=checkbox] { width: 24px; height: 24px; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1.2rem; }
.filters .row { display: flex; flex-wrap: wrap; gap: .8rem; }
.filters .row > div { flex: 1 1 160px; }

.section { margin-bottom: 2.4rem; }
.section > h2 { display: flex; align-items: baseline; gap: .6rem; }
.muted { color: var(--ink-soft); }
.empty { text-align: center; color: var(--ink-soft); padding: 3rem 1rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); color: var(--ink-soft); padding: 1.5rem 0; margin-top: auto; }
.site-footer .wrap { display: flex; justify-content: space-between; font-size: .9rem; }

/* Auth centré */
.auth-card { max-width: 420px; margin: 3rem auto; }
.auth-card .card { padding: 2rem; }

@media (max-width: 760px) {
  .recipe-hero, .recipe-cols { grid-template-columns: 1fr; }
  .site-search { order: 3; flex-basis: 100%; }
}

/* Statistiques */
.stat-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .5rem .3rem; border-bottom: 1px solid var(--line); }
.stat-row:last-child { border-bottom: 0; }
.stat-label { flex: 1; }
.stat-bar-row { display: flex; align-items: center; gap: .8rem; margin: .4rem 0; }
.stat-bar-label { flex: 0 0 40%; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-bar { flex: 1; height: 18px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.stat-bar-fill { display: block; height: 100%; background: var(--brand); border-radius: 999px; min-width: 2px; }
.stat-bar-num { flex: 0 0 2.5rem; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* Aide dépliable par écran */
.aide-box { border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  padding: .3rem .9rem; margin-bottom: 1.2rem; }
.aide-box > summary { cursor: pointer; font-weight: 400; font-size: .92rem; color: var(--ink-soft);
  padding: .45rem 0; list-style: none; }
.aide-box > summary::-webkit-details-marker { display: none; }
.aide-box > summary::before { content: "❔ "; }
.aide-box[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: .5rem; }
.aide-box ul { margin: .3rem 0 .6rem; padding-left: 1.2rem; }
.aide-box li { margin: .2rem 0; }

/* Mode cuisine (RF-9) — pensé pour la tablette posée sur le plan de travail */
.cook-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.cook-head h1 { margin: 0; font-size: 1.3rem; flex: 1; text-align: center; }
.cook-layout { display: grid; gap: 1rem; margin-top: 1rem; }
.cook-ingredients { padding: 1rem; }
.cook-ingredients summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center;
  gap: .3rem; list-style: none; }
.cook-ingredients summary::-webkit-details-marker { display: none; }
.cook-ingredients summary::before { content: "▸"; color: var(--brand); width: 1.1em; }
.cook-ingredients[open] summary::before { content: "▾"; }
.cook-ingredients ul { list-style: none; padding: 0; margin: .6rem 0 0; }
.cook-ingredients li { border-bottom: 1px dashed var(--line); }
.cook-ingredients li:last-child { border-bottom: 0; }
.cook-ingredients label { display: flex; align-items: baseline; gap: .6rem; font-size: 1.15rem;
  font-weight: 400; padding: .45rem 0; margin: 0; }
.cook-ingredients label:has(input:checked) > span { color: var(--ink-faint); text-decoration: line-through; }
.cook-ingredients .cook-group { padding-top: .7rem; border-bottom: 0; }
.cook-dots { list-style: none; padding: 0; margin: 0 0 .8rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.cook-dots button { min-width: var(--tap); min-height: var(--tap); border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
  font: 600 1rem/1 system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.cook-dots button.vue { background: var(--surface-2); }
.cook-dots button.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.cook-stepbox { padding: 1.5rem; margin: 0 0 1rem; }
.cook-progress { color: var(--ink-soft); font-weight: 700; margin-bottom: .5rem; }
.cook-text { font-size: 1.5rem; line-height: 1.5; margin: 0 0 1rem; }
.cook-font-large .cook-text { font-size: 1.9rem; }
.cook-font-xlarge .cook-text { font-size: 2.4rem; line-height: 1.4; }
.cook-font-large .cook-ingredients label { font-size: 1.3rem; }
.cook-font-xlarge .cook-ingredients label { font-size: 1.5rem; }
.cook-next-preview { margin: 1.2rem 0 0; padding-top: .8rem; border-top: 1px dashed var(--line); font-size: 1rem; }
.cook-next-preview:empty { display: none; }
.cook-nav { display: flex; gap: .8rem; }
.cook-nav .btn { min-height: 72px; font-size: 1.25rem; justify-content: center; }
.cook-prev { flex: 1; }
.cook-next { flex: 2; }
.cook-custom { margin-top: 1rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.cook-custom label { font-weight: 400; display: inline-flex; align-items: center; gap: .4rem; margin: 0; }
.cook-custom input { width: 6rem; }
.cook-timers { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.timer-card { display: inline-flex; align-items: center; gap: .6rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: .4rem .5rem .4rem .9rem;
  font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.timer-card.done { background: var(--brand-soft); color: var(--brand); animation: blink 1s step-start infinite; }
@keyframes blink { 50% { opacity: .35; } }
/* Tablette en paysage : ingrédients à gauche (fixes, défilables), étape à droite. */
@media (orientation: landscape) and (min-width: 1000px) {
  .cook-layout { grid-template-columns: minmax(300px, 34%) 1fr; align-items: start; }
  .cook-ingredients { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; }
  .cook-ingredients summary { pointer-events: none; }
  .cook-ingredients summary::before { display: none; }
  .cook-text { font-size: clamp(1.5rem, 2.2vw, 2rem); }
  .cook-font-large .cook-text { font-size: clamp(1.9rem, 2.8vw, 2.5rem); }
  .cook-font-xlarge .cook-text { font-size: clamp(2.3rem, 3.4vw, 3rem); }
}

/* Application installée (PWA) : ce qui n'a de sens que sans barre d'adresse */
.app-seulement { display: none; }
@media (display-mode: standalone) {
  .app-seulement { display: inline-flex; align-items: center; justify-content: center; }
}
.bandeau-hors-ligne { background: #5c4a1e; color: #fff8e6; padding: .55rem 0; font-size: .95rem; }
.bandeau-hors-ligne .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.bandeau-hors-ligne.alerte { background: var(--danger); }
.bandeau-hors-ligne .btn { background: transparent; color: inherit; border-color: currentColor; }

/* Menus de fêtes */
.menu-fete { padding: 1.25rem; margin: 1rem 0 1.5rem; }
.menu-rubrique { margin: 1.2rem 0 .4rem; }
.menu-plats { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.menu-plat { display: flex; align-items: center; gap: .6rem; }
.menu-plat-lien { display: flex; align-items: center; gap: .8rem; flex: 1; min-width: 0; color: var(--ink);
  font-family: var(--serif); font-size: 1.08rem; }
.menu-plat-lien:hover { text-decoration: none; }
.menu-plat-lien img, .menu-plat-vignette { width: 56px; height: 56px; flex: none; object-fit: cover;
  border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; }
.menu-ajout { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.4rem 0 .6rem; }
.menu-ajout select { width: auto; }
.menu-ajout input { flex: 1 1 220px; width: auto; }
.menu-reprise { display: flex; gap: .5rem; }
.menu-reprise select { width: auto; }
.menu-reglages { margin: .6rem 0; }
.menu-reglages > summary { cursor: pointer; color: var(--brand); }
.menu-reglages form { display: grid; gap: .4rem; margin-top: .6rem; max-width: 560px; }
.fetes-colonnes { display: grid; gap: 0 1.5rem; align-items: start; }
.fetes-candidates { padding: 1.25rem; margin: 1rem 0 1.5rem; }
.fetes-candidates h2 { margin-top: 0; }
.candidate { display: grid; gap: .45rem; padding-bottom: .7rem; border-bottom: 1px solid var(--line); }
.candidate:last-child { border-bottom: 0; }
.candidate-places { font-family: system-ui, sans-serif; font-size: .82rem; }
.candidate-affecter { display: flex; flex-wrap: wrap; gap: .4rem; }
.candidate-affecter select { width: auto; flex: 1 1 8rem; min-height: 36px; padding: .3rem .5rem; font-size: .92rem; }
@media (min-width: 1000px) {
  .fetes-colonnes { grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr); }
  .fetes-candidates { position: sticky; top: 5rem; max-height: calc(100vh - 6rem); overflow: auto; }
}

/* « Sur cette tablette » */
.tablette-liste { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.tablette-item { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding-right: .7rem; }
.tablette-lien { display: flex; align-items: center; gap: .9rem; flex: 1 1 240px; min-width: 0; color: var(--ink); }
.tablette-lien:hover { text-decoration: none; }
.tablette-lien img, .tablette-sans-photo { width: 84px; height: 84px; object-fit: cover; flex: none;
  background: var(--surface-2); display: grid; place-items: center; font-size: 2rem; }
.tablette-lien > span:last-child { display: grid; gap: .15rem; min-width: 0; }
.tablette-lien strong { font-family: var(--serif); font-size: 1.08rem; }
.tablette-actions { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }

/* Doigt plutôt que souris (tablette, téléphone) : cibles plus larges, pas de délai au toucher. */
@media (pointer: coarse) {
  :root { --tap: 48px; }
  a, button, summary, label, input, select { touch-action: manipulation; }
  .btn-sm { min-height: var(--tap); padding: .4rem .9rem; }
  input[type="checkbox"], input[type="radio"] { width: 26px; height: 26px; }
  label:has(> input[type="checkbox"]), label:has(> input[type="radio"]) { min-height: var(--tap); }
  .ingredients li { padding: .5rem 0; }
  .usermenu-panel a, .usermenu-panel button, .more-panel a, .more-panel button { min-height: var(--tap); }
  .star-input button { min-width: var(--tap); min-height: var(--tap); }
}

/* Tablette en paysage (Galaxy Tab : ~1280 px CSS) : un peu plus large, ingrédients fixes. */
@media (orientation: landscape) and (min-width: 1000px) {
  .wrap { width: min(1200px, 94vw); }
  .recipe-cols { grid-template-columns: 360px 1fr; gap: 2.5rem; }
  .recipe-cols > div:first-child { position: sticky; top: 76px; align-self: start;
    max-height: calc(100vh - 96px); overflow-y: auto; padding-right: .3rem; }
}
/* Tablette en portrait (~800 px CSS) : une seule colonne, la recherche sur sa propre ligne. */
@media (orientation: portrait) and (max-width: 900px) {
  .recipe-hero, .recipe-cols { grid-template-columns: 1fr; }
  .site-search { order: 3; flex-basis: 100%; }
  .nav-aide { display: none !important; }   /* aussi dans le menu du compte : le menu tient sur une ligne */
}

/* Impression (RF-7.4) */
@media print {
  .site-header, .site-footer, .toolbar, .actions-bar, .theme-toggle, .serv-select, .filters,
  .messages, form, .cook-nav, .cook-timers, .skip, .bandeau-hors-ligne, .cook-dots,
  .cook-custom { display: none !important; }
  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: none; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  .hero { min-height: 0; display: block; border: 1px solid #ccc; }
  .hero > img { position: static; height: 180px; }
  .hero::after, .more-menu, .pills { display: none !important; }
  .hero-txt { position: static; color: #000; padding: .6rem 0 0; }
  .hero-txt h1, .hero-meta { color: #000; }
  .recipe-cols { grid-template-columns: 38% 1fr; gap: 1.5rem; }
  .badge { border: 1px solid #999; }
}
