/**
 * recipes.css — style du catalogue (/recettes/) et des fiches recettes.
 *
 * Les fiches sont générées par `scripts/build-recipes.mjs` depuis Supabase.
 * Ce fichier est écrit à la main : le script ne le touche jamais.
 *
 * La fiche transpose l'écran `app/recipe/[slug].tsx` du repo mobile
 * (hero → chip catégorie → titre/tagline → 3 stats → encart Réglages
 * Woodfire → ingrédients → aperçu des étapes → CTA). Garder les deux
 * alignés : le mobile reste la source de vérité du design.
 */

/* ============================================
   DESIGN TOKENS — alignés sur index.html
   ============================================ */
:root {
  --braise:      #D2502A;
  --braise-deep: #A93D1F;
  --braise-tint: #FCEBE0;
  --spark:       #F5D45B;
  --spark-deep:  #C99B17;
  --cream:       #F4EAD4;
  --paper:       #FBF7F2;
  --paper-2:     #F2EBE1;
  --paper-3:     #E6DDD0;
  --ink:         #1F1A17;
  --ink-soft:    #6B5F55;
  --ink-faint:   #A89B8E;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Inter', -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}

img { max-width: 100%; }

/* ============================================
   NAV — reprise de la landing
   ============================================ */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 247, 242, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(31, 26, 23, 0.06);
  padding: 14px 0;
}
.nav-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.05em;
  line-height: 0.95;
}
.logo-flame-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.74em;
  height: 1em;
  margin: 0 -0.04em;
  transform: translateY(0.02em);
}
.logo-flame-slot svg { width: 100%; height: auto; }
.logo-bbq { color: var(--braise); font-weight: 700; margin-left: 0.22em; letter-spacing: -0.02em; }

.nav-cta {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  padding: 8px 16px;
  border: 1.5px solid var(--ink);
  border-radius: 100px;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.nav-cta:hover { background: var(--ink); color: var(--paper); }

.crumb { font-size: 13px; font-weight: 500; color: var(--ink-soft); text-decoration: none; white-space: nowrap; }
.crumb:hover { color: var(--braise); }

/* ============================================
   CATALOGUE — /recettes/
   ============================================ */
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 22px; }

.catalog-head { padding: 44px 0 26px; text-align: center; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--braise-deep);
  margin-bottom: 12px;
}
.eyebrow::before { content: '── '; opacity: 0.7; }

.catalog-head h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 600;
  line-height: 1.03;
  letter-spacing: -0.03em;
  max-width: 16ch;
  margin: 0 auto;
}
.catalog-lead { margin: 14px auto 0; font-size: 17px; color: var(--ink-soft); max-width: 56ch; }

/* Recherche du catalogue — la landing y envoie via ?q= */
.catalog-search { position: relative; margin: 26px auto 0; max-width: 520px; }
.catalog-search input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  padding: 14px 44px 14px 20px;
  border: 1.5px solid var(--paper-3);
  border-radius: 100px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.2s ease;
}
.catalog-search input::placeholder { color: var(--ink-faint); }
.catalog-search input:focus { outline: none; border-color: var(--braise); }
.catalog-search button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 100px;
  background: var(--paper-2);
  color: var(--ink-soft);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}
.catalog-search button:hover { background: var(--paper-3); color: var(--ink); }

.filters { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 22px 0 0; }
.filters:last-of-type { margin-bottom: 26px; }

/* Rangées suivantes : mode Woodfire et durée. Chaque critère a son
   libellé — les trois répondent à des questions différentes (quoi,
   comment, combien de temps) et se cumulent. */
.filters-mode,
.filters-duree { margin-top: 12px; align-items: center; }
.filters-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-right: 2px;
}
.filter-mode.on,
.filter-duree.on { background: var(--braise); border-color: var(--braise); color: #fff; }
.filter {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 100px;
  border: 1.5px solid var(--paper-3);
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s ease;
}
.filter:hover { border-color: var(--braise); color: var(--braise-deep); }
.filter.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* Sur mobile, trois rangées de filtres qui reviennent à la ligne
   repoussent la première recette hors de l'écran. Chaque rangée devient
   une bande défilable d'une seule ligne. */
@media (max-width: 760px) {
  .filters {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
    /* Le débord latéral compense le padding du conteneur, pour que la
       bande file jusqu'aux bords de l'écran. */
    margin-left: -22px;
    margin-right: -22px;
    padding: 2px 22px;
  }
  .filters::-webkit-scrollbar { display: none; }
  .filter { flex-shrink: 0; }
  .filters-label { flex-shrink: 0; }
}

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding-bottom: 70px; }
@media (max-width: 1000px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

.card {
  position: relative;
  background: #fff;
  border: 1px solid rgba(31, 26, 23, 0.08);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--braise); box-shadow: 0 8px 24px rgba(210, 80, 42, 0.12); }
.card:hover .card-img { transform: scale(1.04); }
.card[hidden] { display: none; }

.card-img {
  width: 100%;
  /* `height: auto` est indispensable : sans lui, l'attribut HTML
     height="600" fait autorité, la boîte devient un portrait étiré et
     `aspect-ratio` est ignoré (il ne s'applique que si une seule
     dimension est contrainte). object-fit: cover recadrait alors une
     photo 4/3 dans un cadre 264×600 — d'où des images tronquées.
     Les attributs width/height restent dans le HTML : ils réservent
     la place au chargement et évitent le décalage de mise en page. */
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: var(--cream);
  transition: transform 0.4s ease;
}
.card-body { padding: 12px 14px 16px; flex: 1; display: flex; flex-direction: column; }
.card-cat { font-size: 9.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--braise-deep); }
.card-t {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-top: 4px;
  flex: 1;
}
.card-m { font-size: 11px; color: var(--ink-soft); margin-top: 8px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.dot { width: 3px; height: 3px; border-radius: 100px; background: var(--ink-faint); flex-shrink: 0; }

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--spark);
  box-shadow: 2px 2px 0 var(--spark-deep);
  border-radius: 7px;
  padding: 3px 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.probe-pin {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 100px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty { grid-column: 1 / -1; padding: 40px 0; text-align: center; color: var(--ink-soft); font-size: 15px; }

/* ============================================
   FICHE RECETTE
   ============================================ */
body.recipe { padding-bottom: 96px; }

.hero-wrap { max-width: 1100px; margin: 0 auto; }
.hero { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: var(--cream); }
.hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 35%;
  background: linear-gradient(to top, rgba(31, 26, 23, 0.35), transparent);
  pointer-events: none;
}
@media (min-width: 900px) { .hero { border-radius: 20px; margin-top: 22px; aspect-ratio: 21 / 9; } }

.recipe-wrap { max-width: 760px; margin: 0 auto; padding: 0 22px; }
.recipe-head { padding-top: 22px; }

.chip {
  display: inline-block;
  background: var(--spark);
  box-shadow: 2px 2px 0 var(--spark-deep);
  border-radius: 8px;
  padding: 4px 11px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}

.recipe-head h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  margin-top: 14px;
}
.tagline { margin-top: 10px; font-size: 16px; color: var(--ink-soft); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 22px; }
.stat { background: var(--paper-2); border-radius: 14px; padding: 12px 10px; text-align: center; }
.stat-l { font-size: 9.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }
.stat-v { font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin-top: 2px; }
.stat-s { font-size: 9.5px; color: var(--ink-faint); margin-top: 1px; }

/* Encart Réglages Ninja Woodfire */
.settings {
  margin-top: 28px;
  background: var(--braise-tint);
  border: 1.5px solid rgba(210, 80, 42, 0.18);
  border-radius: 20px;
  padding: 16px;
}
.settings-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.settings-h span {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--braise-deep);
}
.row { display: flex; align-items: center; gap: 12px; }
.row-ic { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.row-ic.fn { background: var(--braise); }
.row-ic.probe { background: var(--paper); border: 1px solid var(--paper-3); }
.row-l { font-size: 9.5px; font-weight: 700; letter-spacing: 0.11em; text-transform: uppercase; color: var(--ink-soft); }
.row-v { font-size: 15px; font-weight: 600; margin-top: 1px; }
.row-sub { font-size: 11px; color: var(--ink-faint); }
.sep { height: 1px; background: rgba(210, 80, 42, 0.18); margin: 13px 0; }

/* Sections ingrédients / étapes */
.sec { margin-top: 34px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.sec-h h2 { font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.sec-h .hint { font-size: 11px; color: var(--ink-soft); }

.portions {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1.5px solid var(--paper-3);
  border-radius: 100px;
  overflow: hidden;
  flex-shrink: 0;
}
.portions button {
  width: 30px;
  height: 30px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}
.portions button.plus { background: var(--braise); color: #fff; }
.portions span { font-size: 12px; font-weight: 700; min-width: 56px; text-align: center; }

.ing-group {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--braise-deep);
  margin-top: 16px;
  margin-bottom: 4px;
}
.ing { display: flex; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--paper-3); }
.ing::before { content: ''; width: 6px; height: 6px; border-radius: 100px; background: var(--braise); margin-right: 12px; flex-shrink: 0; }
.ing-n { flex: 1; font-size: 14px; }
.ing-q { font-size: 12px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }

.step { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--paper-3); }
.step-n {
  width: 28px;
  height: 28px;
  border-radius: 100px;
  background: var(--paper-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--braise-deep);
  flex-shrink: 0;
}
.step-t { font-size: 13px; font-weight: 600; line-height: 1.3; }
.step-d { font-size: 10.5px; color: var(--ink-faint); margin-top: 1px; }

.locked {
  margin-top: 16px;
  background: var(--paper-2);
  border: 1.5px dashed var(--paper-3);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.locked svg { flex-shrink: 0; margin-top: 2px; }
.locked-t { font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.locked-p { font-size: 13.5px; color: var(--ink-soft); margin-top: 3px; line-height: 1.5; }

/* Recettes voisines */
.more { margin-top: 40px; }
.more h2 { font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 14px; }
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 620px) { .more-grid { grid-template-columns: repeat(2, 1fr); } }

/* ============================================
   CTA STICKY — conversion vers le Play Store
   ============================================ */
.cta-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--paper);
  box-shadow: 0 -4px 18px rgba(31, 26, 23, 0.08);
  padding: 12px 22px;
}
.cta-inner { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 16px; justify-content: space-between; }
.cta-txt { font-size: 13px; color: var(--ink-soft); line-height: 1.35; }
.cta-txt strong { display: block; color: var(--ink); font-size: 14.5px; font-weight: 600; }

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 11px 22px 11px 16px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  border-radius: 14px;
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.store-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(31, 26, 23, 0.22); }
.store-btn svg { width: 22px; height: 24px; flex-shrink: 0; }
.store-btn-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.store-btn-small {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.7;
}
.store-btn-big { font-size: 16px; font-weight: 600; margin-top: 1px; }

@media (max-width: 620px) {
  .cta-txt { display: none; }
  .cta-inner { justify-content: center; }
  .store-btn { width: 100%; justify-content: center; }
}

/* ============================================
   FOOTER
   ============================================ */
footer {
  margin-top: 48px;
  padding: 26px 22px;
  border-top: 1px solid var(--paper-3);
  text-align: center;
  font-size: 12px;
  color: var(--ink-faint);
  line-height: 1.7;
}
footer a { color: var(--ink-soft); text-decoration: none; }
footer a:hover { color: var(--braise); }

/* ============================================
   GUIDES — /guides/
   Pages dérivées du catalogue : tableaux de
   températures et fiches de modes.
   ============================================ */

.guide { max-width: 760px; margin: 0 auto 72px; }

.guide p {
  font-size: 17px;
  line-height: 1.72;
  color: var(--ink-soft);
  margin: 0 0 18px;
}
.guide p em { color: var(--braise-deep); font-style: italic; }
.guide p a { color: var(--braise-deep); font-weight: 600; }

.guide h2 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 46px 0 14px;
}
.guide h3 {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--braise-deep);
  margin: 34px 0 10px;
}

/* Encadré « d'où viennent ces chiffres » — l'argument d'autorité de la page */
.guide-note {
  background: var(--braise-tint);
  border-left: 3px solid var(--braise);
  border-radius: 0 12px 12px 0;
  padding: 16px 20px;
  margin: 26px 0 34px;
  font-size: 15.5px;
  line-height: 1.62;
  color: var(--ink);
}

/* Les tableaux débordent sur mobile : on les fait défiler seuls plutôt que
   de laisser la page partir en travers. */
.guide-scroll { overflow-x: auto; margin: 0 0 12px; }
.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  min-width: 420px;
}
.guide-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 0 12px 8px 0;
  border-bottom: 2px solid var(--paper-3);
}
.guide-table td {
  padding: 11px 12px 11px 0;
  border-bottom: 1px solid var(--paper-3);
  vertical-align: top;
}
.guide-table td a { color: var(--ink); text-decoration: none; font-weight: 500; }
.guide-table td a:hover { color: var(--braise-deep); text-decoration: underline; }
.guide-table .guide-t {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--braise-deep);
  white-space: nowrap;
}
.guide-table .guide-lv { color: var(--ink-faint); font-size: 13.5px; }

/* Bandeau de chiffres sous chaque mode */
.guide-stats { display: flex; gap: 10px; margin: 18px 0 14px; flex-wrap: wrap; }
.guide-stats .stat { flex: 1; min-width: 120px; }
.guide-ex { font-size: 15px; color: var(--ink-faint); }
.guide-ex a { color: var(--braise-deep); font-weight: 600; }

/* Sommaire */
.guide-cards { display: grid; gap: 14px; max-width: 760px; margin: 0 auto 72px; }
.guide-card {
  display: block;
  background: #fff;
  border: 1px solid var(--paper-3);
  border-radius: 16px;
  padding: 22px 24px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.guide-card:hover { border-color: var(--braise-soft); transform: translateY(-2px); }
.guide-card-t {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.guide-card-l { font-size: 15px; line-height: 1.6; color: var(--ink-soft); }

@media (max-width: 760px) {
  .guide h2 { font-size: 25px; }
  .guide p { font-size: 16px; }
}

/* Deux éléments à droite de la barre de nav : .nav-inner est en
   space-between, sans conteneur ils se sépareraient aux deux bords. */
.nav-right { display: flex; align-items: center; gap: 18px; }

/* Lien contextuel sous une valeur de réglage — posé là où la question
   « et pour les autres ? » se pose, plutôt qu'en pied de page. */
.row-guide {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--braise-deep);
  text-decoration: none;
}
.row-guide:hover { text-decoration: underline; }

/* Instruction d'étape — affichée uniquement sur les fiches du test de
   publication des instructions complètes. Le balisage schema.org ne porte
   `text` que lorsque ce bloc est présent : jamais de contenu balisé mais
   invisible. */
.step-i {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.62;
  color: var(--ink-soft);
  max-width: 62ch;
}
