/**
 * fdv_recipes — mise en page front (préfixe .fdv-r).
 * Boutons, champs, titres, badges et pagination utilisent les classes du thème
 * (btn btn-primary / btn-outline-primary / btn-sm, form-control, h1/h2, product-flag, pagination)
 * communes à classic (BS4) et Hummingbird (BS5) : aucune couleur, typo ni arrondi de bouton ici.
 * Accent (numéros d'étapes, badge catégorie) : couleur primaire du thème (--bs-primary sous Hummingbird).
 */
.fdv-r {
  --fdv-r-accent: var(--bs-primary, #2d5335);
  --fdv-r-muted: #7a7a7a;
  --fdv-r-border: #e5e5e5;
  --fdv-r-soft: #f6f6f6;
}
.fdv-r *, .fdv-r *::before, .fdv-r *::after { box-sizing: border-box; }
.fdv-r img { max-width: 100%; height: auto; display: block; }
.fdv-r-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.fdv-r-icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.fdv-r [hidden] { display: none !important; }
.fdv-r .btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
.fdv-r .btn .fdv-r-icon { width: 1.1em; height: 1.1em; }
.fdv-r-count { font-weight: 400; opacity: .8; }
.fdv-r-h2 { margin: 0 0 1rem; }

/* ---------- Liste ---------- */
.fdv-r-list { padding-bottom: 2rem; }
.fdv-r-list__head { margin-bottom: 1.25rem; }
.fdv-r-list__intro { max-width: 75ch; margin-bottom: 1rem; }
.fdv-r-list__intro p:last-child { margin-bottom: 0; }
.fdv-r-search { display: flex; gap: .5rem; max-width: 560px; }
.fdv-r-search__input { flex: 1 1 auto; min-width: 0; width: auto; }
.fdv-r-search__btn { flex: none; }
.fdv-r-filters { margin: 0 0 1.25rem; }
.fdv-r-filters__list { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.fdv-r-list__status { color: var(--fdv-r-muted); margin: 0 0 1rem; }

.fdv-r-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 1.5rem; }
.fdv-r-grid--3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.fdv-r-grid--4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }

.fdv-r-card { background: #fff; }
.fdv-r-card__link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none !important; }
.fdv-r-card__media { position: relative; aspect-ratio: 4 / 3; background: var(--fdv-r-soft); overflow: hidden; }
.fdv-r-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.fdv-r-card:hover .fdv-r-card__media img { transform: scale(1.03); }
.fdv-r-card__placeholder { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--fdv-r-muted); font-size: 3rem; }
.fdv-r-card__flags { position: absolute; top: 0; left: 0; margin: 0; padding: 0; list-style: none; z-index: 1; }
.fdv-r .fdv-r-card__flags li.product-flag.fdv-r-flag { margin-top: .5rem; background-color: var(--fdv-r-accent); color: #fff; }
.fdv-r-card__video { position: absolute; right: .6rem; bottom: .6rem; color: var(--fdv-r-accent); font-size: 1.9rem; line-height: 0; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .5)); }
.fdv-r-card__body { padding: .8rem .25rem 1rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.fdv-r-card__title { margin: 0; text-transform: none; }
.fdv-r-card__meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; list-style: none; margin: auto 0 0; padding: 0; color: var(--fdv-r-muted); font-size: .875rem; }
.fdv-r-card__meta li { display: inline-flex; align-items: center; gap: .3rem; }

.fdv-r-level { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; vertical-align: -1px; margin-right: .15rem; }
.fdv-r-level i { display: block; width: 4px; background: #d5d5d5; }
.fdv-r-level i:nth-child(1) { height: 5px; }
.fdv-r-level i:nth-child(2) { height: 8px; }
.fdv-r-level i:nth-child(3) { height: 12px; }
.fdv-r-level--1 i:nth-child(-n+1), .fdv-r-level--2 i:nth-child(-n+2), .fdv-r-level--3 i { background: var(--fdv-r-accent); }

.fdv-r-pagination { margin: 2rem 0 0; }
.fdv-r-pagination .pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem; width: auto; margin: 0; padding: 0; list-style: none; }
.fdv-r-empty { text-align: center; padding: 3rem 1rem; background: var(--fdv-r-soft); }

/* ---------- Fiche recette ---------- */
.fdv-r-recipe { padding-bottom: 2rem; }
.fdv-r-notice { background: #fff4d6; border: 1px solid #e8c25a; padding: .6rem 1rem; }
.fdv-r-head { display: grid; gap: 1.5rem; margin-bottom: 2rem; }
.fdv-r-head__cats { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .75rem; }
.fdv-r-head__title { margin: 0 0 1rem; }
.fdv-r-facts { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 0 0 1.25rem; padding: 0; }
.fdv-r-facts li {
  display: grid; grid-template-columns: auto 1fr; column-gap: .5rem; align-items: center;
  background: var(--fdv-r-soft); padding: .5rem .8rem; min-width: 7.5rem;
}
.fdv-r-facts .fdv-r-icon { grid-row: span 2; color: var(--fdv-r-accent); width: 1.4rem; height: 1.4rem; }
.fdv-r-facts__label { font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--fdv-r-muted); }
.fdv-r-facts__value { font-weight: 700; }
.fdv-r-head__intro { margin-bottom: 1.25rem; }
.fdv-r-rich p { margin: 0 0 .75rem; }
.fdv-r-rich p:last-child { margin-bottom: 0; }
.fdv-r-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.fdv-r-head__media { min-width: 0; }
.fdv-r-head__picture img { width: 100%; object-fit: cover; max-height: 520px; }

.fdv-r-video { position: relative; }
.fdv-r-video__facade, .fdv-r-video iframe {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; padding: 0; margin: 0;
  overflow: hidden; background: #1d1d1d; cursor: pointer;
}
.fdv-r-video--portrait .fdv-r-video__facade, .fdv-r-video--portrait iframe { aspect-ratio: 9 / 16; max-width: 360px; margin: 0 auto; }
.fdv-r-video__facade picture { position: absolute; inset: 0; display: block; }
.fdv-r .fdv-r-video__poster { width: 100%; height: 100%; object-fit: cover; opacity: .9; transition: opacity .2s; }
.fdv-r-video__facade:hover .fdv-r-video__poster { opacity: 1; }
.fdv-r-video__facade:focus-visible { outline: 3px solid var(--fdv-r-accent); outline-offset: 2px; }
.fdv-r-video__play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--fdv-r-accent); }
.fdv-r-video__play .fdv-r-icon { width: 4.5rem; height: 4.5rem; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .4)); }
.fdv-r-video__label { position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%); background: rgba(0, 0, 0, .65); color: #fff; padding: .3rem .8rem; font-weight: 600; font-size: .875rem; white-space: nowrap; }
.fdv-r-video__consent { font-size: .75rem; color: var(--fdv-r-muted); text-align: center; margin: .4rem 0 0; }

.fdv-r-body { display: grid; gap: 2rem; }
.fdv-r-ingredients { background: #fff; border: 1px solid var(--fdv-r-border); padding: 1.25rem; align-self: start; }
.fdv-r-ingredients__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.fdv-r-ingredients__head .fdv-r-h2 { margin: 0; }
.fdv-r-servings { display: inline-flex; align-items: center; gap: .5rem; }
.fdv-r-servings__btn { width: 2rem; height: 2rem; padding: 0 !important; }
.fdv-r-servings__value { font-weight: 600; white-space: nowrap; }
.fdv-r-servings__value output { display: inline-block; min-width: 1.4em; text-align: center; font-weight: 700; }
.fdv-r-group { margin: 1rem 0 .4rem; }
.fdv-r-ing-list { list-style: none; margin: 0; padding: 0; }
.fdv-r-ing { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem .75rem; padding: .55rem 0; border-bottom: 1px solid var(--fdv-r-border); }
.fdv-r-ing:last-child { border-bottom: 0; }
.fdv-r-ing__text { flex: 1 1 12rem; }
.fdv-r-ing__qty { margin-right: .2rem; }
.fdv-r-ing__note { color: var(--fdv-r-muted); font-size: .9em; }
.fdv-r-ing__product { display: flex; align-items: center; gap: .5rem; flex: 1 1 100%; justify-content: flex-end; font-size: .875rem; }
.fdv-r-ing__pname { flex: 1; text-align: right; text-decoration: underline; text-underline-offset: 2px; }
.fdv-r-ing__price { font-weight: 700; white-space: nowrap; }
.fdv-r-ing__oos { color: var(--fdv-r-muted); font-style: italic; white-space: nowrap; }
.fdv-r-addform { margin: 0; display: inline-flex; }
.fdv-r-cartall { margin-top: 1.25rem; }
.fdv-r-cartall__btn { white-space: normal; text-align: center; }
.fdv-r-cartall__msg { margin: .6rem 0 0; font-size: .9rem; font-weight: 600; }
.fdv-r-cartall__msg.is-error { color: #b0302a; }

.fdv-r-step-list { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.fdv-r-step { display: flex; gap: 1rem; padding: .25rem 0 1.25rem; scroll-margin-top: 6rem; }
.fdv-r-step__num {
  flex: none; width: 2.2rem; height: 2.2rem; background: var(--fdv-r-accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
}
.fdv-r-step__body { flex: 1; min-width: 0; padding-top: .25rem; }
.fdv-r-step__img img { margin-top: .75rem; max-height: 360px; width: auto; }
.fdv-r-tip { background: var(--fdv-r-soft); border-left: 4px solid var(--fdv-r-accent); padding: 1rem 1.25rem; margin: 0 0 1.5rem; }
.fdv-r-tip__title { display: flex; align-items: center; gap: .4rem; margin: 0 0 .4rem; }
.fdv-r-tags { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; color: var(--fdv-r-muted); }
.fdv-r-share { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: 1rem; }
.fdv-r-share__label { font-weight: 600; color: var(--fdv-r-muted); }
.fdv-r-share__link { width: 2.3rem; height: 2.3rem; padding: 0 !important; }
.fdv-r-share__copied { font-weight: 600; font-size: .875rem; }

.fdv-r-products, .fdv-r-similar { margin-top: 2.5rem; }
.fdv-r-products__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 1.5rem; list-style: none; padding: 0; margin: 0; }
.fdv-r-product { display: flex; flex-direction: column; gap: .5rem; align-items: center; text-align: center; background: #fff; padding: .75rem; }
.fdv-r-product__link { color: inherit; text-decoration: none !important; display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.fdv-r-product__link img { width: 100%; max-width: 200px; aspect-ratio: 1; object-fit: contain; }
.fdv-r-product__name { margin: 0; }
.fdv-r-similar__all { text-align: center; margin-top: 1.5rem; }

/* Bloc fiche produit */
.fdv-r-product-block { margin: 2rem 0; clear: both; }
.fdv-r-product-block__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: 1rem; }
.fdv-r-product-block__head .fdv-r-h2 { margin: 0; }

@media (min-width: 768px) {
  .fdv-r-ing__product { flex: 0 1 auto; }
}
@media (min-width: 992px) {
  .fdv-r-head { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); align-items: start; gap: 2.5rem; }
  .fdv-r-head--portrait { grid-template-columns: minmax(0, 1fr) 360px; }
  .fdv-r-body { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 2.5rem; }
  .fdv-r-ingredients { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; }
  .fdv-r-ing__product { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .fdv-r-card__media img, .fdv-r-video__poster { transition: none; }
}

/* ---------- Impression ---------- */
@media print {
  body.fdv-recipe-page #header, body.fdv-recipe-page #footer, body.fdv-recipe-page .breadcrumb, body.fdv-recipe-page nav[aria-label="breadcrumb"],
  body.fdv-recipe-page #left-column, body.fdv-recipe-page #right-column, body.fdv-recipe-page .header-top, body.fdv-recipe-page .header-nav,
  body.fdv-recipe-page #notifications, body.fdv-recipe-page header.header, body.fdv-recipe-page footer.footer,
  .fdv-r-noprint, .fdv-r-video, .fdv-r-video__consent, .fdv-r-head__media, .fdv-r-step__img { display: none !important; }
  body.fdv-recipe-page #wrapper, body.fdv-recipe-page main, body.fdv-recipe-page .container { padding: 0 !important; margin: 0 !important; max-width: none !important; width: auto !important; box-shadow: none !important; background: #fff !important; }
  .fdv-r { font-size: 11pt; color: #000; }
  .fdv-r a { color: #000 !important; text-decoration: none !important; }
  .fdv-r .btn { border: 0; padding: 0; background: none !important; color: #000 !important; }
  .fdv-r-head, .fdv-r-body { display: block; margin-bottom: 1rem; }
  .fdv-r-facts li { background: none; border: 1px solid #999; }
  .fdv-r-ingredients { position: static; max-height: none; overflow: visible; border: 1px solid #999; break-inside: avoid; margin-bottom: 1rem; }
  .fdv-r-step, .fdv-r-tip { break-inside: avoid; }
  .fdv-r-step__num { background: none; color: #000; border: 1px solid #000; }
  .fdv-r-tip { background: none; border-left-color: #000; }
}
.fdv-r-pagination .page-item.current .page-link { background-color: var(--fdv-r-accent); border-color: var(--fdv-r-accent); color: #fff; }
.fdv-r-filters .btn-sm { padding-top: .25rem; padding-bottom: .25rem; }
@media (max-width: 575px) { .fdv-r-search__label { display: none; } }
