/* ═══════════════════════════════════════════════════════════
   PAGE RECETTES — refonte lisibilité (11 oct 2026)
   Fichier chargé uniquement par recettes.html.
   Les cartes utilisent des classes neuves (rc-*) pour ne pas
   se battre avec les anciennes règles de style.css.
═══════════════════════════════════════════════════════════ */

:root { --rc-topbar: 0px; }
@media (max-width: 768px) { :root { --rc-topbar: 54px; } }
@media (max-width: 480px) { :root { --rc-topbar: 50px; } }

/* ── En-tête ── */
.rc-header { padding-bottom: 6px; }
@media (max-width: 768px) {
  .rc-header { padding: 12px 18px 4px !important; }
}
@media (max-width: 480px) {
  .rc-header { padding: 10px 14px 2px !important; }
}

/* ── Barre collante : recherche + filtres ── */
.rc-sticky {
  position: sticky;
  top: var(--rc-topbar);
  z-index: 60;
  background: rgba(255,249,242,.92);
  backdrop-filter: blur(8px);
  max-width: 1080px;
  padding: 10px 44px 0;
  box-shadow: 0 8px 14px -12px rgba(31,42,90, .22);
}
.rc-sticky-inner { display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; }
@media (max-width: 768px) { .rc-sticky { padding: 8px 18px 0; } }
@media (max-width: 480px) { .rc-sticky { padding: 8px 14px 0; } .rc-sticky-inner { gap: 8px; padding-bottom: 10px; } }

.rc-search { max-width: none; width: 100%; }
.rc-search .recipe-search-input { width: 100%; }
@media (min-width: 769px) { .rc-search { max-width: 420px; } }
/* masque la croix native du champ type=search (on a la nôtre) */
.rc-search input[type="search"]::-webkit-search-cancel-button { display: none; }

/* ── Filtres : une seule rangée qui défile ── */
body .rc-chips {
  display: flex; flex-wrap: nowrap; align-items: center; gap: 7px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  margin: 0 -44px !important; padding: 2px 44px 2px !important;
  scroll-snap-type: none;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent 100%);
          mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent 100%);
}
body .rc-chips::-webkit-scrollbar { display: none; }
@media (max-width: 768px) { body .rc-chips { margin: 0 -18px !important; padding: 2px 18px !important; } }
@media (max-width: 480px) { body .rc-chips { margin: 0 -14px !important; padding: 2px 14px !important; } }

/* ordinateur / tablette : deux lignes nettes — 1) type de repas  2) options cumulables */
@media (min-width: 769px) {
  body .rc-chips { -webkit-mask-image: none; mask-image: none; flex-wrap: wrap; overflow: visible; row-gap: 8px; }
  .rc-sep { flex: 0 0 100%; height: 0; margin: 0; background: none; }
}

body .rc-chip {
  flex: 0 0 auto; height: 38px; padding: 0 15px; border-radius: 20px;
  font-size: 13px; font-weight: 600; transform: none;
  background: var(--bg2); color: var(--text-muted); border: 1.5px solid transparent;
  scroll-snap-align: none;
}
body .rc-chip:hover { transform: none; background: var(--bg3); }
body .rc-chip.active { background: var(--primary); color: #fff; box-shadow: 0 3px 10px var(--primary-sh); transform: none; }

/* filtres « options » (cumulables) : contour au lieu de plein, + coche quand actifs */
body .rc-tag { background: transparent; border-color: var(--bg3); }
body .rc-tag.active { background: var(--sage); border-color: var(--sage); box-shadow: none; }
body .rc-tag.active::after { content: '✓'; font-size: 12px; margin-left: 2px; }
.rc-sep { flex: 0 0 1px; align-self: stretch; margin: 8px 3px; background: var(--bg3); }

/* ── Barre résultat / tri ── */
.rc-content { padding-top: 14px !important; }
.rc-toolbar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 14px; }
.rc-count { font-size: 14px; font-weight: 700; color: var(--text); margin-right: auto; }
.rc-count small { font-weight: 500; color: var(--text-muted); font-size: 12px; }
.rc-reset {
  background: none; border: none; color: var(--primary); font-size: 12.5px; font-weight: 700;
  padding: 6px 4px; text-decoration: underline; text-underline-offset: 3px;
}
.rc-sort { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); font-weight: 600; }
.rc-sort select {
  font-size: 13px; font-weight: 600; color: var(--text);
  background: var(--card); border: 1.5px solid var(--border); border-radius: 12px; padding: 7px 10px;
}
.rc-cal { margin: 0; font-size: 12px; color: var(--text-muted); font-weight: 600; gap: 8px; }
@media (max-width: 480px) {
  .rc-sort-lbl { display: none; }
  .rc-toolbar { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; align-items: center; }
  .rc-count { grid-column: 1; margin: 0; }
  .rc-reset { grid-column: 2; grid-row: 1; justify-self: end; }
  .rc-sort { grid-column: 1; grid-row: 2; }
  .rc-sort select { width: 100%; font-size: 13px; padding: 8px 10px; }
  .rc-cal { grid-column: 2; grid-row: 2; }
}

/* ── Grille ── */
body .rc-content .recipes-grid {
  display: grid; margin-top: 0 !important;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
  gap: 18px !important;
}
@media (max-width: 768px) {
  body .rc-content .recipes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px !important; }
}

/* ── Carte ── */
.rc-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--card); border-radius: 18px; overflow: hidden; cursor: pointer;
  box-shadow: 0 2px 14px rgba(31,42,90, .07);
  animation: cardIn .4s cubic-bezier(.22, 1, .36, 1) both;
  -webkit-tap-highlight-color: transparent;
  transition: transform .25s ease, box-shadow .25s ease;
}
@media (hover: hover) { .rc-card:hover { transform: translateY(-3px); box-shadow: 0 12px 34px rgba(31,42,90, .12); } }
.rc-card:active { transform: scale(.975); }
.rc-card:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

.rc-thumb { position: relative; aspect-ratio: 4 / 3; background: var(--bg2); overflow: hidden; }
.rc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rc-thumb::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(31,42,90, .32) 100%); }
.rc-emoji { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; font-size: 46px; }
.rc-thumb.no-photo .rc-emoji { display: flex; }

.rc-time {
  position: absolute; left: 8px; bottom: 8px; z-index: 2;
  font-size: 11.5px; font-weight: 700; color: var(--text); line-height: 1;
  background: rgba(255, 255, 255, .94); padding: 6px 10px; border-radius: 20px;
}
.rc-free {
  position: absolute; left: 8px; top: 8px; z-index: 2;
  font-size: 10.5px; font-weight: 700; color: #fff; line-height: 1;
  background: var(--sage); padding: 5px 9px; border-radius: 20px;
}

/* boutons ronds : icône seule, zone de toucher confortable */
.rc-btn {
  position: absolute; right: 8px; z-index: 3;
  width: 36px; height: 36px; padding: 0; border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1; color: var(--text-muted);
  background: rgba(255, 255, 255, .94); box-shadow: 0 1px 6px rgba(31,42,90, .16);
  transition: transform .15s ease, background .2s;
}
.rc-btn:active { transform: scale(.88); }
.rc-fav { top: 8px; }
.rc-fav.active { background: #fff; }

.rc-body { padding: 11px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.rc-title {
  font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 700; line-height: 1.3; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0;
  min-height: 2.6em;
}
.rc-desc { display: none; font-size: 12px; line-height: 1.5; color: var(--text-muted); margin: 0;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 769px) {
  .rc-desc { display: -webkit-box; }
  .rc-title { font-size: 15px; min-height: 0; }
  .rc-body { padding: 14px 16px 16px; }
}
.rc-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-top: auto;
  font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
.rc-kcal { color: var(--primary); }

/* carte verrouillée (compte gratuit) */
.rc-card.rc-locked .rc-thumb img { filter: blur(3px) brightness(.8); transform: scale(1.06); }
.rc-lock { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center;
  font-size: 30px; background: rgba(31,42,90, .32); }
.rc-locked .rc-cta { color: var(--primary); font-weight: 700; font-size: 12px; margin-top: auto; }

/* ── Aucun résultat ── */
.rc-empty { grid-column: 1 / -1; text-align: center; padding: 44px 18px; }
.rc-empty .emoji { font-size: 44px; margin-bottom: 8px; }
.rc-empty h3 { font-size: 17px; margin-bottom: 6px; }
.rc-empty p { color: var(--text-muted); font-size: 14px; margin-bottom: 16px; }
.rc-empty button { background: var(--primary); color: #fff; border: none; border-radius: 20px; padding: 11px 22px; font-size: 14px; font-weight: 700; }

/* le bouton flottant « Pause douce » ne doit pas masquer la dernière rangée */
.rc-content { padding-bottom: 120px !important; }

@media (prefers-reduced-motion: reduce) {
  .rc-card { animation: none; transition: none; }
}

/* ═══ Style « carnet gourmand » (inspiré Jow / Intermarché) ═══ */
.rc-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--primary); margin: 0 0 4px; }
.rc-tagpill {
  position: absolute; left: 8px; bottom: 8px; z-index: 2;
  font-size: 11.5px; font-weight: 700; color: var(--primary-dark); line-height: 1;
  background: rgba(255, 253, 249, .95); padding: 6px 10px; border-radius: 20px;
}
.rc-title { font-family: 'Fraunces', Georgia, serif; font-size: 18px; font-weight: 700; line-height: 1.18; letter-spacing: -.1px; }
@media (min-width: 769px) { .rc-title { font-size: 20px; } }
.rc-meta { margin-top: 2px; }
.rc-meta > span { white-space: nowrap; }
.rc-add {
  margin-top: 8px; width: 100%; height: 40px; border: none; border-radius: 14px;
  font-size: 13.5px; font-weight: 700; color: var(--primary-dark);
  background: rgba(239,106,91, .12); transition: background .2s, transform .15s;
}
.rc-add:active { transform: scale(.97); }
@media (hover: hover) { .rc-add:hover { background: rgba(239,106,91, .2); } }
.rc-add.active { background: var(--sage); color: #fff; }
.rc-card { border-radius: 22px; }

/* ── Bandeau menu de la semaine (bas de liste) ── */
.rc-promo {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 28px; padding: 22px 20px; border-radius: 24px; color: #fff;
  background: linear-gradient(135deg, var(--primary-dark), #6b3326);
  box-shadow: 0 10px 30px rgba(107, 51, 38, .25);
}
.rc-promo-text { display: flex; flex-direction: column; gap: 6px; }
.rc-promo-eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: #FBD5CC; }
.rc-promo strong { font-family: 'Fraunces', Georgia, serif; font-size: 25px; line-height: 1.12; font-weight: 700; }
.rc-promo-sub { font-size: 13px; line-height: 1.45; color: rgba(255, 255, 255, .82); max-width: 380px; }
.rc-promo-btn { flex: 0 0 auto; background: #fff; color: var(--primary-dark); font-weight: 700; font-size: 14px;
  padding: 13px 18px; border-radius: 16px; white-space: nowrap; }
@media (max-width: 480px) {
  .rc-promo { flex-direction: column; align-items: flex-start; }
  .rc-promo-btn { align-self: stretch; text-align: center; }
}
