/* Thème (phase 7g) : couleurs du site en variables, redéfinies pour le thème sombre de Bootstrap
   (data-bs-theme="dark" sur <html>, posé par base.html et js/theme.js). Utiliser ces variables, ou celles de
   Bootstrap (--bs-body-bg, --bs-border-color…), plutôt qu'une couleur fixe. */
:root,
[data-bs-theme=light] {
  /* Refonte (lot 1, 2026-10-12) : palette « terre cuite et sauge » de la visite guidée, sur fond crème */
  --mrf-texte: #3B2A20;                 /* encre brune */
  --mrf-fond: #F7F1E6;                  /* crème */
  --mrf-carte: #FFFDF8;                 /* cartes, polaroïds, fiches */
  --mrf-barre: #FFFDF8;                 /* barre de menu */
  --mrf-bordure: #E6DAC4;
  --mrf-terre: #B5562F;                 /* couleur principale (boutons, liens, accents) */
  --mrf-terre-rgb: 181, 86, 47;
  --mrf-terre-fonce: #93431F;
  --mrf-sur-terre: #FFFDF8;             /* texte posé sur la terre cuite */
  --mrf-sauge: #5F7050;                 /* couleur secondaire (noms, sous-titres manuscrits) */
  --mrf-legende: #E9DCC6;
  --mrf-encadre: #EFE6D6;               /* blocs ingrédients / étapes */
  --mrf-ligne: #FBF6EC;                 /* ligne d'ingrédient, étape */
  --mrf-surligne: #F6E3D5;              /* ligne déplacée par glisser-déposer */
  --mrf-ombre: rgba(59, 42, 32, 0.16);
  --mrf-vert: #3F7A3A;                  /* icônes « modifier » */
  --mrf-rouge: #B3261E;                 /* icônes « supprimer » */
  --mrf-bleu: #2F6690;                  /* icône « ma version » */
  --mrf-orange: #D9661F;                /* icône « proposer » */
}

[data-bs-theme=dark] {
  --mrf-texte: #F0E4D3;
  --mrf-fond: #1D1712;
  --mrf-carte: #2A221C;
  --mrf-barre: #251E18;
  --mrf-bordure: #3D3128;
  --mrf-terre: #E28A63;
  --mrf-terre-rgb: 226, 138, 99;
  --mrf-terre-fonce: #F0A483;
  --mrf-sur-terre: #1D1611;
  --mrf-sauge: #A7BA92;
  --mrf-legende: #3A2E25;
  --mrf-encadre: #2A221C;
  --mrf-ligne: #312720;
  --mrf-surligne: #4A2F22;
  --mrf-ombre: rgba(0, 0, 0, 0.45);
  --mrf-vert: #7FBF75;
  --mrf-rouge: #FF7B72;
  --mrf-bleu: #7FB3DD;
  --mrf-orange: #F4A261;
}

/* Couleurs de Bootstrap ramenées à la palette (boutons, liens, champs, pastilles, pagination…), dans les deux thèmes */
:root,
[data-bs-theme=light],
[data-bs-theme=dark] {
  --bs-body-bg: var(--mrf-fond);
  --bs-body-color: var(--mrf-texte);
  --bs-border-color: var(--mrf-bordure);
  --bs-primary: var(--mrf-terre);
  --bs-primary-rgb: var(--mrf-terre-rgb);
  --bs-link-color: var(--mrf-terre);
  --bs-link-color-rgb: var(--mrf-terre-rgb);
  --bs-link-hover-color: var(--mrf-terre-fonce);
  --bs-link-hover-color-rgb: var(--mrf-terre-rgb);
  --bs-focus-ring-color: rgba(var(--mrf-terre-rgb), 0.25);
}

[data-bs-theme=light] {
  --bs-secondary-bg: #EFE6D6;
  --bs-tertiary-bg: #F2EADC;
  --bs-primary-text-emphasis: #6E3218;
  --bs-primary-bg-subtle: #F6E3D5;
  --bs-primary-border-subtle: #E8B9A1;
}

[data-bs-theme=dark] {
  --bs-secondary-bg: #2F261F;
  --bs-tertiary-bg: #261F19;
  --bs-primary-text-emphasis: #F0A483;
  --bs-primary-bg-subtle: #3A2419;
  --bs-primary-border-subtle: #7A3F25;
}

main {
  margin-top: 68px;
}

body {
  background: var(--mrf-fond);
  color: var(--mrf-texte);
  margin-top: 6rem;
  font-family: 'Lora', Georgia, serif;  /* refonte : Lora pour le texte (Montserrat avant), à changer ici seulement */
}

legend {
  background-color: var(--mrf-legende);
  color: var(--bs-body-color);
}

.badge{
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
}

h1 {
  font-size: clamp(1.4rem, 2.5vw, 2.4rem);
}

h2 {
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
}

h3 {
  font-size: clamp(1rem, 2vw, 1.5rem);
}

h4 {
  font-size: clamp(0.8rem, 2vw, 1.2rem);
}

h5 {
  font-size: clamp(0.7rem, 1.5vw, 1.1rem);
}

p {
  font-size: clamp(0.8rem, 1.8vw, 1rem);
}

header p{
  font-size: clamp(0.7rem, 1.5vw, 1rem);
}

#info,
#info-2 {
  margin-left: 6vw;
  font-size: clamp(0.7rem, 1.8vw, 1rem);
}

.recipe-title-text{
  font-size: clamp(1.2rem, 3vw, 3rem);
}

.recipe-description-text{
  font-size: clamp(1rem, 2vw, 1.8rem);
}

label, span, .textinput, .select, .input-group-text, .form-control, .form-text {
  font-size: clamp(0.8rem, 1.4vw, 1rem);
}

.tree .badge{
  font-size: clamp(0.8rem, 1vw, 1rem);
}

small{
  font-size: clamp(0.7rem, 1.2vw, 0.9rem);
}

.btn{
  font-size: clamp(0.8rem, 1.6vw, 1.1rem);
}

#welcome .btn{
  font-size: clamp(0.7rem, 1.2vw, 1rem);
  padding: 0.2rem;
}

.form-control a{
  font-size: clamp(0.8rem, 1.4vw, 0.9rem);
}


.ingredients_card_body {
  background-color: var(--mrf-encadre);
  border-radius: 10px;
}

.instructions_card_body {
  background-color: var(--mrf-encadre);
  border-radius: 10px;
}

.card-title{
    font-weight: 700;
    font-size: clamp(0.8rem, 1.4vw, 1.2rem);
}

.card-text{
  font-size: clamp(0.8rem, 1.4vw, 1.2rem);
}

.account-heading {
  font-size: clamp(1.4rem, 2.5vw, 2.4rem);
}


.max_width_500 {
  max-width: 500px;
}

.max_width_700 {
  max-width: 700px;
}

.max_width_290 {
  max-width: 290px;
}

.max_height_150 {
  max-height: 150px;

  background-size: contain;
}

.container-fluid {
  padding-left: 15%;
  padding-right: 15%;
}

.navbar {
  padding : 0;
}

.logo_navbar{
  height: clamp(40px, 8vw, 70px);
  margin: 0 5px;
  padding: 0;
}
.nav-img {
  height: clamp(60px, 8vw, 70px);
  margin: 0;
  padding: 0;
}

.navbar-brand {
  font-size: clamp(0.8rem, 2.5vw, 1rem);
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 700;
}

.align-right {
  text-align: right;
}

.align-left {
  text-align: left;
}

.block-person {
  margin-left: 15px;
  margin-right: 15px;
}

#title {
  max-height: 400px;
  min-height: 150px;
}

#last {
  background-color: var(--mrf-fond);
  position: relative;
}

#last .container-fluid {
  margin: 0;
}

#family_tree {
  background-color: var(--mrf-fond);
  position: relative;
  z-index: 1;
}

#title img {
  width: 100%;
  z-index: -1;
}


.text-over-img {
  z-index: 1;
  top: 150px;
  color: rgb(145, 12, 12);
  position: absolute;
}

.account-card {
  border: none;
}

.account-img {
  height: clamp(70px, 16vw, 140px);
  margin-right: 20px;
  background-size: contain;
}

.recipes-img {
  height: 90px;
  margin-right: 20px;
  background-size: contain;
}

.selectable-instruction-img:hover {
  cursor: pointer;
}

.selectable-comment-img:hover {
  cursor: pointer;
}

.display_none {
  display: none;
}

.ingredient-form,
.instruction-form,
.member-form {
  display: block;
}

.img-recipe {
  width: 50%;
}

.img-thumb {
  height: clamp(140px, 16vw, 200px);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  justify-content: center;
}

.img-comment {
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  justify-content: center;
}

.hero-banner-img-main {
  height: clamp(200px, 30vw, 375px);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  justify-content: center;
  margin-bottom: 2em;
  border-radius: 10px;
}

.video-link {
  z-index: 2;
  padding: 8px;
  margin: 5px;
  color: rgba(255, 255, 255, 0.6);
}

.page-item{
  z-index:1;
}

.card .favorite-btn {
  z-index: 2;
  position: absolute;
  background-color: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  padding: 8px;
  margin: 5px;
  right: 0;
}

.hero-banner-main {
  height: clamp(160px, 30vw, 250px);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  justify-content: center;
  margin-bottom: 2em;
}

.recipe-width {
  max-width: 1000px;
}

.ingredients-group-item {
  background-color: var(--mrf-ligne);
  border-radius: 5px;
  padding: 0.8em 1em;
  box-shadow: 0 0 14px 0 rgba(0, 0, 0, .1);
  /* nom à gauche (peut passer à la ligne), quantité à droite sur une seule ligne */
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75em;
}

.ingredients-group-item .text-description {
  flex: 1 1 auto;
  min-width: 0;
}

.ingredients-group-item .text-quantity {
  flex: 0 0 auto;
  white-space: nowrap;
  text-align: right;
}

/* phase 11 : la précision (« par personne », « à adapter ») sous la quantité, alignée à droite */
.ingredients-group-item .bloc-quantite {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex: 0 0 auto;
  max-width: 50%;
  text-align: right;
}

/* Formulaire de recette : glisser-déposer des lignes */
.drag-handle {
  cursor: grab;
  color: var(--bs-secondary-color);
  user-select: none;
  font-size: 1.3rem;
  line-height: 1;
  touch-action: none;
}

.formset-row {
  border-bottom: 1px solid var(--bs-border-color);
  margin-bottom: 0.5rem;
}

.sortable-ghost {
  opacity: 0.4;
  background-color: var(--mrf-surligne);
}

.ingredients-group {
  padding-left: 1em;
}

.instructions-group-item {
  background-color: var(--mrf-ligne);
  border-radius: 5px;
  padding-top: 1em;
  padding-bottom: 1em;
  margin-bottom: 1em;
  /* la classe .row de Bootstrap met des marges négatives : on les annule pour aligner les étapes sur les ingrédients */
  margin-left: 0;
  margin-right: 0;
  box-shadow: 0 0 14px 0 rgba(0, 0, 0, .1);
}

.instructions-group {
  margin-left: 0;
}

.alignText {
  text-align: left;
}

.card-textarea {
  border: none;
  background-color: transparent;
  color: var(--bs-body-color);  /* un <textarea> n'hérite pas de la couleur : sans cela, texte presque invisible */
  font-family: inherit;
  font-size: inherit;
  width: 100%;
  height: 85%;
  outline: none;
  resize: none;
}

.dialog {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: display;
  background-color: rgba(0, 0, 0, 0.4);
}

.dialog-content {
  background-color: var(--bs-body-bg);
  margin: 80px 0 0 0;
  padding: 20px;
  border: 1px solid var(--bs-border-color);
  width: 80%;
  height: auto;
  max-height: calc(100vh - 100px);
  max-width: 500px;
  overflow-y: auto;
}

.instruction-img-modal-dialog,
.comment-img-modal-dialog {
  position: fixed;
  z-index: 2;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: display;
  background-color: rgba(0, 0, 0, 0.6);
}

.instruction-img-modal-content,
.comment-img-modal-content {
  background-color: rgba(0, 0, 0, 0.6);
  margin: 80px auto;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 90%;
  max-height: 90vh;
  overflow: display;
}

.instruction-img-modal-header,
.comment-img-modal-header {
  background-color: var(--bs-body-bg);
  width: 100%;
}

.instruction-img-modal,
.comment-img-modal {
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
}

.text-description {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
}

.text-quantity {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
}

#site_activities table {
  border-collapse: collapse;
  width: 95%;
  margin: auto;
}

#site_activities th, td {
  border: 1px solid var(--bs-border-color);
  text-align: left;
  padding: 4px;
  font-size: clamp(0.7rem, 1.5vw, 1rem);
}

#site_activities input, select {
  font-size: clamp(0.8rem, 1.5vw, 1rem);
  min-height: 28px;
}

#site_activities th {
  background-color: var(--bs-tertiary-bg);
}

#site_activities tr:nth-child(even) {
  background-color: var(--bs-tertiary-bg);
}

@media (max-height: 700px) {

  .instruction-img-modal,
  .comment-img-modal {
    max-height: 60vh;
  }
}

@media (max-width: 300px) {

  .account-img {
    display: none;
  }

}

@media (max-width: 500px) {

  body {
    margin-top: 4rem;
  }


}


@media (max-width: 788px) {
  .container-fluid {
    padding-left: 2%;
    padding-right: 2%;
  }

}


@media (max-width: 991.98px) {
  .alignText {
    text-align: center;
  }

  #info,
  #info-2 {
    margin-left: 1vw;
  }
}

@media (max-width: 1298px) {
  .container-fluid {
    padding-left: 5%;
    padding-right: 5%;
  }
}

@media print {
  body {
    font-size: 12pt;
    margin-top: 0px;
  }

  main {
    margin-top: 0px;
  }


  .ingredients-group-item,
  .instructions-group-item {
    margin-top: 0px;
    margin-bottom: 0.4rem;
  }

  .ingredients-group-item {
    padding: 0.5em 0.6em;
  }

  .no-container {
    width: 100%;
    margin: 0;
    padding: 4%;
    max-width: 100%;
  }

  .recipe-width {
    width: 100%;
    max-width: 100%;
  }

  #header,
  #footer,
  #navigation {
    display: none;
  }

  .print-only {
    display: block;
  }

  .no-print,
  main > .alert {
    display: none !important;  /* !important : l'emportent sur les classes d-flex… de Bootstrap */
  }

  .ingredients-group-item,
  .instructions-group-item,
  .ingredients h3 {
    break-inside: avoid;
  }

  .ingredients_card_body,
  .instructions_card_body,
  .ingredients-group-item,
  .instructions-group-item {
    box-shadow: none !important;
  }

  .page-break {
    page-break-before: always;
  }

  .col-print-6 {
    width: 50%;
    display: block;
  }

  .ingredients_card_body {
    background-color: rgba(255, 255, 255, 0);
    border-radius: 10px;
  }

  .instructions_card_body {
    background-color: rgba(255, 255, 255, 0);
    border-radius: 10px;
  }

  .ingredients-group-item {
    background-color: rgba(255, 255, 255, 0);
  }

  .instructions-group-item {
    background-color: rgba(255, 255, 255, 0);
  }
}

.max_width_800 {
  max-width: 800px;
}

/* ------------------------------------------------------------ Mode cuisine (plein écran) */
.mode-cuisine {
  --mc-fond: #1f2428;
  --mc-texte: #f8f9fa;
  --mc-barre: #111417;
  --mc-panneau: #2b3136;
  --mc-secondaire: #adb5bd;
  --mc-accent: #ffc107;
  --mc-bouton-texte: #f8f9fa;
  --mc-bouton-bord: #adb5bd;
  --mc-minuteur-fond: #2b3136;
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  background: var(--mc-fond);
  color: var(--mc-texte);
  font-family: 'Ubuntu', sans-serif;
}

.mode-cuisine.clair {
  --mc-fond: #fdfcf8;
  --mc-texte: #1f2428;
  --mc-barre: #efe9dc;
  --mc-panneau: #f3efe5;
  --mc-secondaire: #6c757d;
  --mc-accent: #b45309;
  --mc-bouton-texte: #1f2428;
  --mc-bouton-bord: #6c757d;
  --mc-minuteur-fond: #fff4d6;
}

body.mode-cuisine-ouvert {
  overflow: hidden;
}

.mode-cuisine-bouton {
  color: var(--mc-bouton-texte);
  border: 1px solid var(--mc-bouton-bord);
  background: transparent;
}

.mode-cuisine-bouton:hover,
.mode-cuisine-bouton:focus {
  color: var(--mc-bouton-texte);
  background: rgba(128, 128, 128, 0.2);
}

.mode-cuisine-bouton:disabled {
  opacity: 0.4;
}

.mode-cuisine-barre,
.mode-cuisine-pied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: var(--mc-barre);
}

/* Bandeau du bas : boutons de minuteur ou minuteur ouvert, puis navigation */
.mode-cuisine-pied {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

.mode-cuisine-durees {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mode-cuisine-durees:empty {
  display: none;
}

.mode-cuisine-navigation {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.mode-cuisine-titre {
  font-weight: 700;
  max-width: 45%;
}

.mode-cuisine-progression {
  font-size: 0.95rem;
  color: var(--mc-secondaire);
}

.mode-cuisine-corps {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.mode-cuisine-ingredients {
  background: var(--mc-panneau);
  padding: 0.5rem 1rem;
}

.mode-cuisine-ingredients summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 1.1rem;
}

.mode-cuisine-ingredient-section {
  margin-top: 0.6rem;
  font-weight: 700;
  color: var(--mc-accent);
}

.mode-cuisine-ingredient {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0;
  font-size: 1.1rem;
  cursor: pointer;
}

.mode-cuisine-ingredient input {
  width: 1.4rem;
  height: 1.4rem;
}

.mode-cuisine-ingredient span {
  flex: 1 1 auto;
}

.mode-cuisine-ingredient.coche span,
.mode-cuisine-ingredient.coche strong {
  text-decoration: line-through;
  color: var(--mc-secondaire);
}

.mode-cuisine-etape {
  flex: 1 1 auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Tâche 20 : toucher la moitié gauche ou droite de l'étape change d'étape ; deux chevrons discrets le rappellent */
.mode-cuisine-etape {
  position: relative;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  padding-left: 2rem;
  padding-right: 2rem;
}

.mode-cuisine-etape::before,
.mode-cuisine-etape::after {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  color: var(--mc-secondaire);
  opacity: 0.35;
  pointer-events: none;
}

.mode-cuisine-etape::before {
  content: "\2039";
  left: 0.5rem;
}

.mode-cuisine-etape::after {
  content: "\203A";
  right: 0.5rem;
}

.mode-cuisine-lire {
  flex: 0 0 auto;
  white-space: nowrap;
}

#mode-cuisine-lecture-auto.actif {
  border-color: var(--mc-accent);
  color: var(--mc-accent);
}

.mode-cuisine-reglages {
  background: var(--mc-panneau);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--mc-bouton-bord);
}

.mode-cuisine-reglages .form-select {
  margin-top: 0.2rem;
}

.mode-cuisine-note {
  color: var(--mc-secondaire);
}

.mode-cuisine-section {
  color: var(--mc-accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mode-cuisine-texte {
  font-size: clamp(1.4rem, 3.5vw, 2.2rem);
  line-height: 1.4;
  margin: 0;
}

.mode-cuisine-image {
  max-height: 35vh;
  max-width: 100%;
  object-fit: contain;
  border-radius: 8px;
  align-self: flex-start;
}

/* Minuteur ouvert : dans le bandeau du bas, à la place des boutons de lancement */
@keyframes mode-cuisine-clignote {
  50% { opacity: 0.3; }
}

@media (min-width: 992px) {
  .mode-cuisine-corps {
    flex-direction: row;
  }

  .mode-cuisine-ingredients {
    flex: 0 0 32%;
    overflow: auto;
  }

  .mode-cuisine-ingredients summary {
    pointer-events: none;
    list-style: none;
  }

}

/* Formulaire de la famille : barre d'actions qui reste visible en bas de l'écran */
.barre-actions-famille {
  position: sticky;
  bottom: 0;
  z-index: 100;
  background: rgba(var(--bs-body-bg-rgb), 0.96);
  border-top: 1px solid var(--bs-border-color);
  padding: 0.5rem 0.6rem;
  margin-top: 1rem;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
  /* mobile : grille de 2 colonnes bornées à la largeur de l'écran (1fr seul laisse les boutons déborder à droite) */
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.4rem;
  max-width: 100%;
  box-sizing: border-box;
}

.barre-actions-famille .btn {
  min-width: 0;
  white-space: normal;
  font-size: 0.9rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.barre-actions-famille #family_create_spinner {
  grid-column: 1 / -1;
  justify-self: center;
}

@media (min-width: 576px) {
  .barre-actions-famille {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
  }

  .barre-actions-famille .btn {
    white-space: nowrap;
  }

  .barre-actions-famille #family_create_cancel_btn {
    margin-left: auto;
  }

  .barre-actions-famille #family_create_spinner {
    justify-self: auto;
  }
}

/* Thème sombre (phase 7g) : icônes monochromes des informations de la recette (tracées en noir) */
[data-bs-theme=dark] #info svg,
[data-bs-theme=dark] #info-2 svg {
  filter: invert(0.88);
}

/* bordure marquée qui suit le thème (noire en clair, claire en sombre) */
.bordure-forte {
  border-color: var(--bs-emphasis-color) !important;
}

/* sélecteur de langue (phase 8) */
.drapeau {
  width: 21px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

/* phase 10 : aperçu d'un message aux membres (texte brut de l'email) */
.message-apercu {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* phase 10 : page Nouveautés */
.nouveautes h2 {
  font-size: 1.4rem;
  margin-top: 2.2rem;
}

.nouveautes-telephone {
  max-width: 300px;
}

/* phase 9d : choix de la photo de la page de garde du livre (livre/choix.html) */
.garde-choix {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: .6rem;
  max-height: 22rem;
  overflow-y: auto;
  padding: .2rem;
}

.garde-option {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: .3rem;
  border: 2px solid transparent;
  border-radius: .4rem;
  cursor: pointer;
  font-size: .8rem;
  line-height: 1.2;
}

.garde-option:has(input:checked) {
  border-color: var(--bs-primary);
  background: var(--bs-primary-bg-subtle);
}

.garde-option input {
  position: absolute;
  top: .6rem;
  left: .6rem;
}

.garde-option img,
.garde-option .garde-vide {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: .3rem;
}

.garde-option .garde-vide {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bs-tertiary-bg);
  color: var(--bs-secondary-color);
  font-size: 1.6rem;
  font-weight: 700;
}

/* phase 11 : une ligne « titre de section » n'a ni quantité, ni unité, ni précision */
.formset-row-inner:has(input[name$="-is_section"]:checked) .champ-quantite {
  visibility: hidden;
}

/* phase 11 : précision d'un ingrédient (« bien mûres », « à adapter »), sous la quantité */
.text-precision {
  line-height: 1.2;
  color: var(--bs-secondary-color);
  font-size: .85em;
  font-style: italic;
}

/* phase 11b : dans tous les formulaires, ce que l'on a tapé ou choisi ressort nettement ; les exemples (placeholder)
   et la valeur vide d'une liste (« — sans unité — ») restent pâles, en italique */
.form-control,
.form-select {
  color: var(--bs-emphasis-color);
  font-weight: 500;
}

.form-control::placeholder {
  color: var(--bs-secondary-color);
  opacity: .55;
  font-style: italic;
  font-weight: 400;
}

.form-select:has(option[value=""]:checked) {
  color: var(--bs-secondary-color);
  font-style: italic;
  font-weight: 400;
}

.form-select option {
  color: var(--bs-body-color);
  font-style: normal;
  font-weight: 400;
}

/* phase 11b : image actuelle d'une étape sur une ligne (widget ImageEnLigne) : vignette et nom tronqué */
.image-en-ligne {
  flex-wrap: nowrap;
}

.image-en-ligne-actuelle {
  flex: 1 1 auto;
  min-width: 0;
  gap: .35rem;
  text-decoration: none;
  overflow: hidden;
}

.image-en-ligne-actuelle img {
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  object-fit: cover;
  border-radius: .2rem;
}

/* min-width: 0 : sans lui, un nom de fichier long (« WhatsApp_Image_2024-01-02_à_14.09.14_… ») refuse de rétrécir et
   élargit toute la page sur un téléphone */
.image-en-ligne {
  min-width: 0;
  max-width: 100%;
}

.image-en-ligne-actuelle span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .8rem;
}



/* une ligne de formulaire (poignée ☰ + champs) : le bloc des champs peut rétrécir sous la largeur de son contenu
   (sinon un long nom de fichier d'image élargit la page sur un téléphone) */
.formset-row-inner > .flex-grow-1 {
  min-width: 0;
}

/* Phase 12a : ligne de la recette d'origine remise dans une proposition */
.formset-row.ligne-remise {
  background-color: var(--mrf-surligne);
  border-radius: 0.375rem;
}

/* Phase 13 : fenêtre de recadrage commune (recipes/_recadrage.html, js/recadrage.js) */
.recadrage-zone {
  height: min(60vh, 520px);
  background-color: var(--bs-tertiary-bg);
}

.recadrage-zone img {
  display: block;
  max-width: 100%;
}

@media (max-width: 575.98px) {
  .recadrage-zone {
    height: calc(100vh - 230px);
  }
}

/* Phase 12c : pastille discrète d'un compteur dans le menu du profil (votes en attente) */
.pastille-menu {
  font-size: 0.65em;
  vertical-align: text-top;
}

/* Pastille discrète en bas à gauche de la photo d'une vignette : autres versions (« +2 ») ou « variante » */
.img-thumb {
  position: relative;
}

.pastille-vignette {
  position: absolute;
  left: 0.5rem;
  bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Tâches 18 et 19 : minuteurs de cuisine (js/minuteurs.js) — pastille flottante sur toutes les pages, et liste en
   grand dans le bandeau du mode cuisine */
.minuteurs-pastille {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  width: min(26rem, calc(100vw - 2rem));
  pointer-events: none;
}

.minuteurs-pastille > * {
  pointer-events: auto;
}

.minuteurs-resume {
  background-color: var(--bs-dark);
  color: var(--bs-light);
  border-radius: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0.25rem 0.75rem rgba(var(--bs-dark-rgb), 0.35);
}

.minuteurs-resume:hover,
.minuteurs-resume:focus {
  background-color: var(--bs-dark);
  color: var(--bs-light);
}

.minuteurs-pastille.termine .minuteurs-resume {
  background-color: var(--bs-danger);
  color: var(--bs-white);
  animation: mode-cuisine-clignote 1s infinite;
}

.minuteurs-panneau {
  width: 100%;
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.25rem 0.5rem;
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  border: 1px solid var(--bs-border-color);
  border-radius: 0.75rem;
  box-shadow: 0 0.25rem 1rem rgba(var(--bs-dark-rgb), 0.25);
}

.minuteur-ligne {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.15rem 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--bs-border-color);
}

.minuteur-ligne:last-child {
  border-bottom: 0;
}

.minuteur-nom {
  grid-column: 1 / -1;
  font-size: 0.85rem;
  color: var(--bs-secondary-color);
}

.minuteur-temps {
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.minuteur-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.25rem;
}

.minuteur-ligne.en-pause .minuteur-temps {
  opacity: 0.55;
}

.minuteur-ligne.termine .minuteur-temps {
  color: var(--bs-danger);
  animation: mode-cuisine-clignote 1s infinite;
}

/* dans le mode cuisine : en grand, aux couleurs du mode (--mc-*) */
.mode-cuisine-minuteurs:empty {
  display: none;
}

.mode-cuisine-minuteurs {
  margin-bottom: 0.5rem;
}

.mode-cuisine-minuteurs .minuteur-ligne {
  border-color: var(--mc-bouton-bord);
}

.mode-cuisine-minuteurs .minuteur-nom {
  font-size: 1rem;
  color: var(--mc-secondaire);
}

.mode-cuisine-minuteurs .minuteur-temps {
  font-size: clamp(2rem, 8vw, 3rem);
  color: var(--mc-accent);
}

.mode-cuisine-minuteurs .btn {
  color: var(--mc-texte);
  border-color: var(--mc-bouton-bord);
  font-size: 1.1rem;
  min-width: 2.75rem;
}

@media print {
  .minuteurs-pastille {
    display: none !important;
  }
}

/* Icônes d'action de l'en-tête d'une recette : mêmes cases et même écart partout, alignées à droite,
   retour à la ligne régulier sur un écran étroit */
.actions-recette {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem 1rem;
}

.actions-recette .action-recette {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
}

.actions-recette .action-recette svg,
.actions-recette .action-recette img {
  width: 30px;
  max-width: 30px;
  height: 30px;
}


/* ------------------------------------------------------------ Refonte, lot 1 (2026-10-12) : boutons, champs, titres,
   barre de menu et cartes de recettes au style de la visite guidée. Seule l'apparence change. */
.btn-primary {
  --bs-btn-color: var(--mrf-sur-terre);
  --bs-btn-bg: var(--mrf-terre);
  --bs-btn-border-color: var(--mrf-terre);
  --bs-btn-hover-color: var(--mrf-sur-terre);
  --bs-btn-hover-bg: var(--mrf-terre-fonce);
  --bs-btn-hover-border-color: var(--mrf-terre-fonce);
  --bs-btn-active-color: var(--mrf-sur-terre);
  --bs-btn-active-bg: var(--mrf-terre-fonce);
  --bs-btn-active-border-color: var(--mrf-terre-fonce);
  --bs-btn-disabled-color: var(--mrf-sur-terre);
  --bs-btn-disabled-bg: var(--mrf-terre);
  --bs-btn-disabled-border-color: var(--mrf-terre);
  --bs-btn-focus-shadow-rgb: var(--mrf-terre-rgb);
}

.btn-outline-primary {
  --bs-btn-color: var(--mrf-terre);
  --bs-btn-border-color: var(--mrf-terre);
  --bs-btn-hover-color: var(--mrf-sur-terre);
  --bs-btn-hover-bg: var(--mrf-terre);
  --bs-btn-hover-border-color: var(--mrf-terre);
  --bs-btn-active-color: var(--mrf-sur-terre);
  --bs-btn-active-bg: var(--mrf-terre-fonce);
  --bs-btn-active-border-color: var(--mrf-terre-fonce);
  --bs-btn-disabled-color: var(--mrf-terre);
  --bs-btn-disabled-border-color: var(--mrf-terre);
  --bs-btn-focus-shadow-rgb: var(--mrf-terre-rgb);
}

.form-control,
.form-select {
  background-color: var(--mrf-carte);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--mrf-terre);
  box-shadow: 0 0 0 .25rem rgba(var(--mrf-terre-rgb), .2);
}

.form-check-input:checked {
  background-color: var(--mrf-terre);
  border-color: var(--mrf-terre);
}

.form-check-input:focus {
  border-color: var(--mrf-terre);
  box-shadow: 0 0 0 .25rem rgba(var(--mrf-terre-rgb), .2);
}

.pagination {
  --bs-pagination-color: var(--mrf-terre);
  --bs-pagination-hover-color: var(--mrf-terre-fonce);
  --bs-pagination-focus-color: var(--mrf-terre-fonce);
  --bs-pagination-active-bg: var(--mrf-terre);
  --bs-pagination-active-border-color: var(--mrf-terre);
  --bs-pagination-active-color: var(--mrf-sur-terre);
  --bs-pagination-bg: var(--mrf-carte);
}

.dropdown-menu {
  --bs-dropdown-bg: var(--mrf-carte);
  --bs-dropdown-link-active-bg: var(--mrf-terre);
  --bs-dropdown-link-active-color: var(--mrf-sur-terre);
}

.card {
  --bs-card-bg: var(--mrf-carte);
}

/* Grands titres manuscrits (Caveat, police plus petite à taille égale : agrandie) */
/* (le livre et l'impression gardent leurs propres titres : .livre exclu ; :where() garde une spécificité minimale,
   pour que les classes des pages, .carnet-titre, .accueil-salut…, l'emportent) */
h1:not(:where(.livre *)), .titre-manuscrit {
  font-family: 'Caveat', cursive;
  font-weight: 700;
  line-height: 1;
}

h1:not(:where(.livre *)) {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
}

/* Barre de menu */
.barre-site {
  background: var(--mrf-barre);
  border-bottom: 1px solid var(--mrf-bordure);
}

.barre-site .navbar-brand {
  display: flex;
  align-items: center;
  gap: .4rem;
  color: var(--mrf-texte);
}

.barre-site .nom-site {
  font-family: 'Caveat', cursive;
  font-weight: 700;
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  line-height: 1;
  /* ligne de base de Caveat remontée au niveau de celle du menu (Montserrat), mesurée sur capture d'écran */
  position: relative;
  top: -.08em;
}

.barre-site .nav-link {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  color: var(--mrf-texte);
  line-height: 1.2;
}

.barre-site .nav-link:hover,
.barre-site .nav-link:focus-visible {
  color: var(--mrf-terre);
}

/* page en cours soulignée sans bordure (une bordure décalerait le texte vers le haut) */
.barre-site .nav-link.active {
  color: var(--mrf-terre);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: .45em;
}

.bouton-creer {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  border-radius: 999px;
  white-space: nowrap;
}

.photo-profil {
  position: relative;
  display: inline-block;
}

.photo-profil .pastille-photo {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: .7rem;
}

/* Cartes de recettes : polaroïds légèrement penchés, qui se redressent et se soulèvent au survol */
.carte-recette {
  --angle: -1deg;
  background: var(--mrf-carte);
  border: none;
  border-radius: 2px;
  padding: 8px 8px 0;
  box-shadow: 0 10px 22px var(--mrf-ombre) !important;
  transform: rotate(var(--angle));
  transition: transform .25s ease, box-shadow .25s ease;
}

.col:nth-child(2n) > .carte-recette { --angle: 1deg; }
.col:nth-child(3n) > .carte-recette { --angle: -.5deg; }
.col:nth-child(5n) > .carte-recette { --angle: 1.3deg; }

.carte-recette:hover,
.carte-recette:focus-within {
  transform: rotate(0deg) translateY(-6px) scale(1.02);
  box-shadow: 0 18px 32px var(--mrf-ombre) !important;
}

.carte-recette .card-img-top {
  border-radius: 0;
}

.carte-recette .card-title {
  font-family: 'Montserrat', sans-serif;
}

@media (prefers-reduced-motion: reduce) {
  .carte-recette { transition: none; }
  .carte-recette:hover, .carte-recette:focus-within { transform: rotate(var(--angle)); }
}

/* Éléments d'interface (boutons, menus, pastilles) en Montserrat, plus nette que Lora en petite taille */
.btn,
.badge,
.dropdown-item,
.page-link {
  font-family: 'Montserrat', sans-serif;
}

.barre-site .nav-img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border: 2px solid var(--mrf-sauge);
}

.barre-site .logo_navbar {
  height: clamp(40px, 6vw, 56px);
}

.barre-site .bouton-creer {
  font-size: .85rem;
  padding: .3rem .85rem;
}

/* ------------------------------------------------------------ Refonte, lot 2 (2026-10-12) : page d'une recette (aussi
   la page publique et celle d'une proposition, qui reprennent les mêmes blocs). Écran seulement : l'impression ne change
   pas. Le mode cuisine lit toujours les mêmes listes (#Ingredients, #instructions) : seule leur apparence change ici. */
@media screen {
  /* En-tête : titre manuscrit, auteur en vert sauge, actions en boutons ronds */
  .recipe-title-text {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    line-height: .95;
  }

  .recipe-description-text {
    font-style: italic;
    color: var(--mrf-texte);
    opacity: .9;
    margin-top: .3rem;
  }

  .auteur-recette {
    font-family: 'Caveat', cursive;
    font-weight: 700 !important;
    font-style: normal !important;
    font-size: clamp(1.25rem, 2.2vw, 1.6rem);
    margin-top: .4rem;
  }

  .auteur-recette.text-secondary {
    color: var(--mrf-sauge) !important;
  }

  .actions-recette .action-recette {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1.5px solid var(--mrf-bordure);
    background: var(--mrf-carte);
    transition: transform .15s ease, box-shadow .15s ease;
  }

  .actions-recette .action-recette:hover,
  .actions-recette .action-recette:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px var(--mrf-ombre);
  }

  .actions-recette .action-recette svg,
  .actions-recette .action-recette img {
    width: 24px;
    max-width: 24px;
    height: 24px;
  }

  .actions-recette .action-recette i.bi {
    font-size: 22px !important;
  }

  /* Photo principale en polaroïd */
  .hero-banner-img-main {
    border: 10px solid var(--mrf-carte);
    border-bottom-width: 18px;
    border-radius: 2px;
    box-shadow: 0 14px 30px var(--mrf-ombre);
    transform: rotate(-.4deg);
  }

  /* Bandeaux d'informations : petites cartes */
  #info,
  #info-2 {
    margin-left: 0;
    background: var(--mrf-carte);
    border: 1px solid var(--mrf-bordure);
    border-radius: 14px;
    padding: .8rem .6rem;
    margin-bottom: .8rem;
  }

  #info-2 > .row {
    margin-top: 0 !important;
  }

  /* Ingrédients et étapes : fiches lignées */
  /* pas de lignes de cahier en fond : elles tombaient au milieu du texte (hauteurs de lignes variables) ; chaque
     ingrédient et chaque étape est séparé par un pointillé */
  .ingredients_card_body,
  .instructions_card_body {
    background-color: var(--mrf-carte);
    border: none;
    border-radius: 2px;
    box-shadow: 0 12px 26px var(--mrf-ombre) !important;
  }

  #Ingredients h2,
  #instructions h2,
  #comments h2,
  #documents h2 {
    font-family: 'Caveat', cursive;
    font-weight: 700 !important;
    font-size: clamp(2rem, 3.5vw, 2.6rem);
  }

  #Ingredients .ingredients h3,
  #instructions .ingredients h3 {
    font-family: 'Caveat', cursive;
    font-size: clamp(1.5rem, 2.6vw, 1.9rem);
    color: var(--mrf-sauge);
  }

  #Ingredients .ingredients h3.text-primary,
  #instructions .ingredients h3.text-primary {
    color: var(--bs-primary) !important;  /* ligne nouvelle d'une proposition : reste repérable */
  }

  .ingredients-group-item {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    border-bottom: 1px dashed var(--mrf-bordure);
  }

  #Ingredients .text-quantity {
    color: var(--mrf-terre);
  }

  /* Étapes numérotées à la main (les titres de section ne comptent pas) */
  #instructions ol.ingredients {
    counter-reset: etape;
  }

  #instructions .instructions-group {
    counter-increment: etape;
    position: relative;
    padding-left: 2.6rem;
  }

  #instructions .instructions-group::before {
    content: counter(etape);
    position: absolute;
    left: 0;
    top: .55rem;
    width: 2rem;
    text-align: center;
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 2.1rem;
    line-height: 1;
    color: var(--mrf-terre);
  }

  .instructions-group-item {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    border-bottom: 1px dashed var(--mrf-bordure);
  }

  /* Photo d'une étape en polaroïd */
  .selectable-instruction-img {
    border: 6px solid var(--mrf-carte);
    border-bottom-width: 12px;
    border-radius: 2px !important;
    box-shadow: 0 8px 18px var(--mrf-ombre);
    transform: rotate(1.5deg);
    transition: transform .2s ease;
  }

  .selectable-instruction-img:hover {
    transform: rotate(0deg) scale(1.03);
  }

  /* Commentaires : cartes claires, nom en vert sauge */
  #comments .card {
    background: var(--mrf-carte) !important;
    border: 1px solid var(--mrf-bordure);
    border-radius: 12px;
  }

  #comments .card-header {
    background: transparent;
    border-bottom: 1px dashed var(--mrf-bordure);
  }
}

@media screen and (prefers-reduced-motion: reduce) {
  .actions-recette .action-recette,
  .selectable-instruction-img { transition: none; }
}

/* ------------------------------------------------------------ Refonte, lot 3 : accueil réorganisé */
.titre-section {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
}

.accueil-salut {
  font-size: clamp(2.4rem, 5vw, 4rem);
  margin-bottom: 1rem;
}

.accueil-salut-suite {
  color: var(--mrf-terre);
}

.recherche-rapide {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  max-width: 720px;
}

.recherche-rapide .form-control {
  flex: 1 1 260px;
  min-height: 48px;
  border-radius: 999px;
  padding-left: 1.1rem;
}

.recherche-rapide .btn {
  min-height: 48px;
  border-radius: 999px;
  padding: 0 1.4rem;
}

.pastilles-repas {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.pastille-repas {
  font-family: 'Montserrat', sans-serif;
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--mrf-texte);
  background: var(--mrf-legende);
  padding: .4rem .95rem;
  border-radius: 999px;
}

.pastille-repas:hover,
.pastille-repas:focus-visible {
  background: var(--mrf-terre);
  color: var(--mrf-sur-terre);
}

.pastille-repas.pastille-detail {
  background: transparent;
  border: 1.5px dashed var(--mrf-sauge);
}

.bandeau-famille {
  border: 10px solid var(--mrf-carte);
  border-bottom-width: 16px;
  border-radius: 2px;
  box-shadow: 0 12px 26px var(--mrf-ombre);
  height: clamp(130px, 20vw, 200px);
  margin-bottom: 0;
}

.encadre-famille {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: var(--mrf-carte);
  border-top: 2px dashed var(--mrf-bordure);
  border-bottom: 2px dashed var(--mrf-bordure);
  padding: 1.4rem 1.2rem;
}

/* ------------------------------------------------------------ Refonte, lot 3 : recette sur grand écran, ingrédients
   à gauche (colonne qui reste visible au défilement) et étapes à droite ; téléphone et impression inchangés */
@media screen and (min-width: 992px) {
  .recette-colonnes {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: 1.6rem;
    align-items: start;
  }

  .recette-colonnes > #Ingredients {
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 110px);  /* une longue liste défile dans sa colonne au lieu d'être coupée */
    overflow-y: auto;
  }

  .recette-colonnes > #Ingredients .row.my-3 {
    margin-top: 0 !important;
  }

  .recette-colonnes > #instructions > .my-5 {
    margin-top: 1rem !important;
  }

  .recette-colonnes .ingredients > li.col-lg-6 {
    width: 100%;
  }
}


/* ------------------------------------------------------------ Refonte, lot 3 : autres pages (formulaires, listes, profil,
   famille, propositions, conseils, connexion). Apparence seulement. Le livre (.livre) garde ses titres. */
h2:not(:where(.h4, .h5, .h6, .carnet-titre, .livre *)) {
  font-family: 'Caveat', cursive;
  font-weight: 700;
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  line-height: 1.05;
}

h2.fs-4:not(:where(.livre *)),
h2.fs-5:not(:where(.livre *)) {
  font-size: clamp(1.6rem, 2.8vw, 2rem) !important;
}

/* Bandeaux de titre des formulaires (« Créer une recette », « Proposer une modification »…) : titre manuscrit */
h2.bg-secondary.text-light {
  background: transparent !important;
  color: var(--mrf-texte) !important;
  padding: 0 !important;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  border-bottom: 2px dashed var(--mrf-bordure);
  padding-bottom: .4rem !important;
  border-radius: 0 !important;
}

/* Légendes des blocs de formulaire : sous-titres manuscrits vert sauge */
legend.badge {
  background: transparent !important;
  font-family: 'Caveat', cursive;
  font-weight: 700;
  font-size: clamp(1.6rem, 2.6vw, 2rem) !important;
  color: var(--mrf-sauge) !important;
  text-align: left;
  white-space: normal;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Blocs de formulaire et encadrés : cartes claires */
fieldset.border,
.border.rounded.bg-body-tertiary,
.account-card {
  background: var(--mrf-carte) !important;
  border-color: var(--mrf-bordure) !important;
  border-radius: 14px !important;
}

.form-label,
.col-form-label {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
}

/* Boutons secondaires en accord avec la palette */
.btn-secondary {
  --bs-btn-bg: var(--mrf-sauge);
  --bs-btn-border-color: var(--mrf-sauge);
  --bs-btn-hover-bg: #4d5c41;
  --bs-btn-hover-border-color: #4d5c41;
  --bs-btn-color: var(--mrf-sur-terre);
  --bs-btn-hover-color: var(--mrf-sur-terre);
}

.btn-outline-secondary {
  --bs-btn-color: var(--mrf-texte);
  --bs-btn-border-color: var(--mrf-bordure);
  --bs-btn-hover-bg: var(--mrf-legende);
  --bs-btn-hover-border-color: var(--mrf-bordure);
  --bs-btn-hover-color: var(--mrf-texte);
}

/* Fenêtres (modales), listes et tableaux */
.modal-content {
  background: var(--mrf-carte);
  border-radius: 14px;
}

.list-group {
  --bs-list-group-bg: var(--mrf-carte);
  --bs-list-group-border-color: var(--mrf-bordure);
}

.table {
  --bs-table-bg: transparent;
}

.alert-info {
  --bs-alert-bg: #E8EEDF;
  --bs-alert-border-color: #CBD7BC;
  --bs-alert-color: #3d4a32;
}

[data-bs-theme=dark] .alert-info {
  --bs-alert-bg: #26301f;
  --bs-alert-border-color: #3d4a32;
  --bs-alert-color: #cfe0bf;
}

/* ------------------------------------------------------------ Refonte, lot 3 : ajustements après essai (2026-10-13) :
   tailles plus mesurées, comme sur la maquette (les anciennes tailles en vw grossissaient tout sur grand écran) */
.btn {
  font-size: .95rem;
}

.btn-sm {
  font-size: .85rem;
}

/* Accueil */
.accueil-salut .accueil-salut-suite {
  font-size: inherit;  /* sinon la règle générale des <span> la réduit à la taille du texte */
}

.recherche-rapide .form-control {
  min-height: 46px;
  font-size: 1rem;
}

.recherche-rapide .btn {
  min-height: 46px;
}

.pastille-repas {
  font-size: .85rem;
  padding: .35rem .85rem;
}

.bandeau-famille {
  height: clamp(110px, 14vw, 170px);
}

.encadre-famille p {
  font-size: 1rem;
}

.encadre-famille .btn {
  border-radius: 999px;
  font-size: .9rem;
}

/* Cartes de recettes : titre net, résumé discret, cœur plus petit */
.carte-recette .card-body {
  padding: .8rem .45rem .9rem;
}

.carte-recette .card-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: .35rem;
}

.carte-recette .card-text {
  font-size: .9rem;
  font-style: italic;
  line-height: 1.4;
  color: var(--bs-secondary-color);
}

.card .favorite-btn {
  padding: 5px;
  margin: 8px;
  line-height: 0;
}

.card .favorite-icon {
  width: 26px;
  height: 26px;
}

/* Recette en deux colonnes : colonnes alignées en haut, ingrédients serrés, pas de barre de défilement horizontale */
@media screen and (min-width: 992px) {
  .recette-colonnes > #Ingredients {
    overflow-x: hidden;
  }

  .recette-colonnes > #Ingredients > .row.my-3 {
    margin: 0 !important;
  }

  .recette-colonnes > #Ingredients > .row.my-3 > .col-md-12 {
    padding: 0;
  }

  .recette-colonnes > #instructions > .my-5 {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }

  .recette-colonnes #Ingredients .btn {
    font-size: .82rem;
    padding: .3rem .7rem;
  }

  .recette-colonnes .ingredients-group-item {
    padding: .5rem .25rem;
  }

  .recette-colonnes .text-description,
  .recette-colonnes .text-quantity {
    font-size: 1rem;
  }

  .recette-colonnes .instructions-group-item {
    padding-top: .7rem;
    padding-bottom: .7rem;
    margin-bottom: .2rem;
  }

  .recette-colonnes #instructions .instructions-group::before {
    top: .45rem;
    font-size: 1.9rem;
  }
}

/* Refonte, lot 3 : ajustements après essai (2) */
/* Téléphone : les boutons d'action passent sous le titre, alignés à gauche, au lieu de s'empiler dans une colonne étroite */
@media (max-width: 767.98px) {
  .actions-recette {
    justify-content: flex-start;
    margin-bottom: .6rem;
  }
}

/* Bandeaux d'informations : chaque icône à gauche de son libellé, alignés au centre, même écart partout */
@media screen {
  #info > .row,
  #info-2 > .row {
    row-gap: .8rem;
  }

  #info .col-3,
  #info-2 .col-3 {
    min-width: 0;
  }

  #info .col-3 > .row,
  #info-2 .col-3 > .row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: .6rem;
    margin: 0;
    padding: 0 !important;
    width: 100%;
  }

  #info .col-3 > .row > svg,
  #info-2 .col-3 > .row > svg {
    flex: 0 0 30px;
    width: 30px !important;
    max-width: 30px !important;
    height: 32px !important;
    padding: 0 !important;
  }

  #info .col-3 > .row > span,
  #info-2 .col-3 > .row > span {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    padding: 0 !important;
    text-align: left;
  }

  #info strong,
  #info-2 strong {
    font-family: 'Montserrat', sans-serif;
    font-size: .78rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
  }

  #info .lh-1,
  #info-2 .lh-1 {
    font-size: .98rem;
    line-height: 1.25 !important;
  }
}

/* Téléphone : deux informations par ligne plutôt que quatre trop serrées */
@media screen and (max-width: 575.98px) {
  #info .col-3,
  #info-2 .col-3 {
    width: 50%;
  }
}

/* Refonte, lot 3 : ajustements après essai (3) : comme sur la maquette, chaque information devient une petite carte de
   même hauteur (les deux bandeaux ne sont plus que des grilles), libellés alignés en haut */
@media screen {
  #info,
  #info-2 {
    background: transparent;
    border: none;
    padding: 0;
    margin-bottom: .6rem;
  }

  #info > .row,
  #info-2 > .row {
    --bs-gutter-x: .6rem;
    margin-left: 0;
    margin-right: 0;
    padding: 0;
    width: 100%;
    row-gap: .6rem;
  }

  #info .col-3,
  #info-2 .col-3 {
    display: flex;
    padding-left: calc(var(--bs-gutter-x) / 2);
    padding-right: calc(var(--bs-gutter-x) / 2);
  }

  #info .col-3 > .row,
  #info-2 .col-3 > .row {
    align-items: flex-start;
    background: var(--mrf-carte);
    border: 1px solid var(--mrf-bordure);
    border-radius: 12px;
    padding: .65rem .75rem !important;
    height: 100%;
  }
}

/* Refonte, lot 3 : ajustements après essai (4) : toutes les cartes d'information à la même hauteur, contenu centré,
   valeur limitée à deux lignes (la suite est coupée par « … ») */
@media screen {
  #info .col-3 > .row,
  #info-2 .col-3 > .row {
    align-items: center;
    justify-content: center;
    height: 76px;
  }

  #info .col-3 > .row > span,
  #info-2 .col-3 > .row > span {
    flex: 0 1 auto;
  }

  #info strong,
  #info-2 strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #info .lh-1,
  #info-2 .lh-1 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
  }
}

/* Téléphone : « Imprimer / PDF » et « Mode cuisine » côte à côte, centrés sur la largeur */
@media (max-width: 767.98px) {
  #Ingredients .card-body > .d-flex > .d-flex.no-print {
    width: 100%;
    justify-content: center;
    flex-wrap: nowrap;
  }

  #Ingredients .card-body > .d-flex > .d-flex.no-print .btn {
    font-size: .85rem;
    padding: .35rem .7rem;
    white-space: nowrap;
  }
}

/* Refonte, lot 3 : ajustements après essai (5) : alignement à gauche, centré en hauteur ; l'icône dans une pastille
   ronde, à la même place dans toutes les cartes, pour que icônes et textes s'alignent d'une carte à l'autre */
@media screen {
  #info .col-3 > .row,
  #info-2 .col-3 > .row {
    justify-content: flex-start;
    gap: .8rem;
    padding: .6rem 1rem !important;
  }

  #info .col-3 > .row > svg,
  #info-2 .col-3 > .row > svg {
    flex: 0 0 44px;
    width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    padding: 9px !important;
    border-radius: 50%;
    background: var(--mrf-legende);
  }
}

@media screen and (max-width: 575.98px) {
  #info .col-3 > .row,
  #info-2 .col-3 > .row {
    gap: .55rem;
    padding: .5rem .6rem !important;
  }

  #info .col-3 > .row > svg,
  #info-2 .col-3 > .row > svg {
    flex-basis: 36px;
    width: 36px !important;
    max-width: 36px !important;
    height: 36px !important;
    padding: 7px !important;
  }
}

/* Refonte, lot 3 : ajustements après essai (6) : un seul bandeau « fiche technique », sans cartes : les 8 informations
   sur deux lignes, séparées par de fins traits ; alignées à gauche (le !important l'emporte sur la classe
   justify-content-center du gabarit, qui centrait tout malgré les règles précédentes) */
@media screen {
  #info,
  #info-2 {
    background: var(--mrf-carte);
    border: 1px solid var(--mrf-bordure);
    border-radius: 14px;
    padding: .2rem 0;
    margin-bottom: .8rem;
  }

  #info + #info-2 {
    border-top: 1px dashed var(--mrf-bordure);
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    margin-top: -.8rem;
  }

  #info:has(+ #info-2) {
    border-bottom: none;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  #info > .row,
  #info-2 > .row {
    --bs-gutter-x: 0;
    row-gap: 0;
  }

  #info .col-3,
  #info-2 .col-3 {
    padding: 0;
    border-left: 1px solid var(--mrf-bordure);
  }

  #info .col-3:first-child,
  #info-2 .col-3:first-child {
    border-left: none;
  }

  #info .col-3 > .row,
  #info-2 .col-3 > .row {
    justify-content: flex-start !important;
    align-items: center;
    background: transparent;
    border: none;
    border-radius: 0;
    height: 64px;
    gap: .65rem;
    padding: .3rem 1rem !important;
  }

  #info .col-3 > .row > svg,
  #info-2 .col-3 > .row > svg {
    flex: 0 0 30px;
    width: 30px !important;
    max-width: 30px !important;
    height: 30px !important;
    padding: 0 !important;
    border-radius: 0;
    background: transparent;
  }
}

/* Téléphone : deux informations par ligne, séparées aussi par un trait horizontal */
@media screen and (max-width: 575.98px) {
  #info .col-3:nth-child(odd),
  #info-2 .col-3:nth-child(odd) {
    border-left: none;
  }

  #info .col-3:nth-child(n+3),
  #info-2 .col-3:nth-child(n+3) {
    border-top: 1px dashed var(--mrf-bordure);
  }

  #info .col-3 > .row,
  #info-2 .col-3 > .row {
    gap: .5rem;
    padding: .3rem .6rem !important;
  }

  #info .col-3 > .row > svg,
  #info-2 .col-3 > .row > svg {
    flex-basis: 26px;
    width: 26px !important;
    max-width: 26px !important;
    height: 26px !important;
  }
}

/* Refonte, lot 3 : ajustements après essai (7) : plus d'air à gauche et à droite dans le bandeau d'informations */
@media screen {
  #info,
  #info-2 {
    padding-left: .8rem;
    padding-right: .8rem;
  }

  #info .col-3 > .row,
  #info-2 .col-3 > .row {
    padding-left: 1.4rem !important;
    padding-right: 1rem !important;
  }
}

@media screen and (max-width: 575.98px) {
  #info,
  #info-2 {
    padding-left: .3rem;
    padding-right: .3rem;
  }

  #info .col-3 > .row,
  #info-2 .col-3 > .row {
    padding-left: .8rem !important;
    padding-right: .6rem !important;
  }
}

/* Fenêtres des commentaires et des réponses : fond crème de la page, sur lequel les champs clairs ressortent mieux
   (choix de l'éditeur), et mêmes coins arrondis */
#commentReplyModal .modal-content,
#modifyCommentReplyModal .modal-content {
  background-color: var(--bs-body-bg);
}

.dialog-content {
  background-color: var(--bs-body-bg);
  border-color: var(--mrf-bordure);
  border-radius: 14px !important;
}

/* Section des commentaires : de l'air au-dessus du bouton « Ajouter un commentaire » (collé aux fiches sinon) */
#comments {
  margin-top: 2rem;
}

/* Refonte, lot 3 : accueil, ajustements après essai : photo de la famille dans ses vraies proportions (recadrée en 3,5
   pour 1), sans cadre blanc ; sur téléphone, recherche et bouton sur une ligne, pastilles sur une ligne qui défile */
.bandeau-famille {
  border: none;
  border-radius: 16px;
  box-shadow: 0 10px 24px var(--mrf-ombre);
  height: auto;
  aspect-ratio: 3.5 / 1;
  max-width: 1000px;
  margin: 0 auto;
}

@media (max-width: 575.98px) {
  .recherche-rapide {
    flex-wrap: nowrap;
  }

  .recherche-rapide .form-control {
    flex: 1 1 auto;
    min-width: 0;
  }

  .recherche-rapide .btn {
    flex: 0 0 auto;
    padding: 0 1rem;
  }

  .pastilles-repas {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: .4rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .pastilles-repas::-webkit-scrollbar {
    display: none;
  }

  .pastille-repas {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

/* Refonte : encadré « La famille » de l'accueil : carte arrondie, icône d'arbre, boutons en pilules vert sauge */
.encadre-famille {
  border: 1px solid var(--mrf-bordure);
  border-radius: 16px;
  box-shadow: 0 8px 20px var(--mrf-ombre);
  padding: 1.3rem 1.5rem;
}

.encadre-famille-texte {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.encadre-famille-icone {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--mrf-legende);
  color: var(--mrf-sauge);
  font-size: 1.6rem;
}

.encadre-famille-boutons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}

.bouton-pilule {
  border-radius: 999px;
  padding: .4rem 1rem;
  font-size: .9rem;
}

.encadre-famille .btn-outline-secondary {
  --bs-btn-color: var(--mrf-sauge);
  --bs-btn-border-color: var(--mrf-sauge);
  --bs-btn-hover-color: var(--mrf-sur-terre);
  --bs-btn-hover-bg: var(--mrf-sauge);
  --bs-btn-hover-border-color: var(--mrf-sauge);
}

@media (max-width: 575.98px) {
  .encadre-famille {
    padding: 1.1rem;
  }

  .encadre-famille-boutons {
    width: 100%;
    justify-content: center;
  }

  .encadre-famille-boutons .bouton-pilule {
    flex: 1 1 auto;
    text-align: center;
  }
}

/* « Qui cuisine ? » : portraits ronds des membres qui ont des recettes, nombre de recettes en pastille ; la rangée
   passe à la ligne sur PC et défile au doigt sur téléphone */
.encadre-famille {
  flex-direction: column;
  align-items: stretch;
}

.cuisiniers {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.2rem;
}

.cuisinier {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  width: 84px;
  text-decoration: none;
  color: var(--mrf-texte);
}

.cuisinier-photo {
  position: relative;
  display: block;
  width: 68px;
  height: 68px;
}

.cuisinier-photo img {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--mrf-carte);
  box-shadow: 0 0 0 2px var(--mrf-sauge), 0 6px 14px var(--mrf-ombre);
  transition: transform .2s ease;
}

.cuisinier:hover .cuisinier-photo img,
.cuisinier:focus-visible .cuisinier-photo img {
  transform: translateY(-3px) scale(1.05);
}

.cuisinier-nombre {
  position: absolute;
  right: -4px;
  bottom: -2px;
  background: var(--mrf-terre) !important;
  color: var(--mrf-sur-terre) !important;
  font-size: .72rem !important;
  border: 2px solid var(--mrf-carte);
}

.cuisinier-nom {
  font-family: 'Caveat', cursive;
  font-weight: 700;
  font-size: 1.25rem !important;
  line-height: 1.05;
  text-align: center;
  max-width: 84px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 575.98px) {
  .cuisiniers {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: .4rem;
    scrollbar-width: none;
  }

  .cuisiniers::-webkit-scrollbar {
    display: none;
  }

  .cuisinier {
    flex: 0 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cuisinier-photo img { transition: none; }
}

/* Correctif : en colonne, un conteneur flex qui « passe à la ligne » prend la largeur de son plus long contenu : la
   rangée des portraits élargissait toute la page sur téléphone. Pas de retour à la ligne, et des enfants qui
   peuvent rétrécir : la rangée défile alors dans sa propre largeur. */
.encadre-famille {
  flex-wrap: nowrap;
  min-width: 0;
  max-width: 100%;
}

.encadre-famille > * {
  min-width: 0;
  max-width: 100%;
}

/* ------------------------------------------------------------ Refonte, lot 4 (2026-10-13) : page de la famille, et
   photos de recette sans cadre blanc (demande de l'éditeur) */
@media screen {
  .hero-banner-img-main {
    border: none;
    border-radius: 16px;
    transform: none;
    box-shadow: 0 12px 28px var(--mrf-ombre);
  }

  .selectable-instruction-img {
    border: none;
    border-radius: 10px !important;
    transform: none;
    box-shadow: 0 6px 14px var(--mrf-ombre);
  }

  .selectable-instruction-img:hover {
    transform: scale(1.04);
  }
}

/* En-tête de la page de la famille : carte claire, nom manuscrit, administrateur en vert sauge */
.entete-famille {
  background: var(--mrf-carte);
  border: 1px solid var(--mrf-bordure);
  border-radius: 16px;
  box-shadow: 0 10px 24px var(--mrf-ombre);
  padding: 1.6rem 1.4rem 1.4rem;
}

.entete-famille h1 {
  font-size: clamp(2.6rem, 5vw, 4rem);
}

.admin-famille {
  font-family: 'Caveat', cursive;
  font-weight: 700;
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
  color: var(--mrf-sauge);
  margin-top: .4rem;
}

.bouton-rond-action {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1.5px solid var(--mrf-bordure);
  background: var(--mrf-carte);
  transition: transform .15s ease, box-shadow .15s ease;
}

.bouton-rond-action:hover,
.bouton-rond-action:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px var(--mrf-ombre);
}

.bouton-rond-action svg {
  width: 22px !important;
  height: 22px;
}

/* Blocs dépliables (inviter, sages, liste des membres, partager par lien) : titres manuscrits vert sauge */
details.border.rounded > summary,
.arbre-liste > summary {
  font-family: 'Caveat', cursive;
  font-weight: 700 !important;
  font-size: 1.5rem;
  color: var(--mrf-sauge);
  line-height: 1.2;
}

details.border.rounded > summary .badge,
.arbre-liste > summary .badge {
  font-size: .75rem;
  vertical-align: middle;
}

/* Cartes de recettes : la photo prend toute la largeur de la carte, sans cadre blanc en haut ni sur les côtés */
.carte-recette {
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
}

.carte-recette .card-img-top {
  border-radius: 0;
}

.carte-recette .card-body {
  padding: .8rem .9rem .9rem;
}

/* ------------------------------------------------------------ Refonte, lot 5 (2026-10-13) : mode cuisine aux couleurs du
   site, plus chaleureux. Sombre : brun profond, texte crème, terre cuite et sauge ; clair : crème. Titre et numéros
   d'étape manuscrits, texte de l'étape en Lora, interface en Montserrat, barre d'avancement, gros bouton « Suivante ». */
.mode-cuisine {
  --mc-fond: #1D1712;
  --mc-texte: #F6EBDD;
  --mc-barre: #15100C;
  --mc-panneau: #2A211B;
  --mc-carte: #241C16;
  --mc-secondaire: #C9B49C;
  --mc-accent: #E28A63;
  --mc-accent-texte: #1D1611;
  --mc-sauge: #A7BA92;
  --mc-bouton-texte: #F6EBDD;
  --mc-bouton-bord: #5A4838;
  --mc-minuteur-fond: #2A211B;
  font-family: 'Montserrat', sans-serif;
}

.mode-cuisine.clair {
  --mc-fond: #FBF6EC;
  --mc-texte: #3B2A20;
  --mc-barre: #F2E8D8;
  --mc-panneau: #F4EBDD;
  --mc-carte: #FFFDF8;
  --mc-secondaire: #7A6452;
  --mc-accent: #B5562F;
  --mc-accent-texte: #FFFDF8;
  --mc-sauge: #5F7050;
  --mc-bouton-texte: #3B2A20;
  --mc-bouton-bord: #D9C8AE;
  --mc-minuteur-fond: #FFF4E6;
}

.mode-cuisine .mode-cuisine-bouton {
  border-radius: 999px;
  border-color: var(--mc-bouton-bord);
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
}

.mode-cuisine .mode-cuisine-bouton:hover,
.mode-cuisine .mode-cuisine-bouton:focus-visible {
  background: color-mix(in srgb, var(--mc-accent) 18%, transparent);
  color: var(--mc-bouton-texte);
}

.mode-cuisine-barre {
  border-bottom: 1px solid var(--mc-bouton-bord);
}

.mode-cuisine-titre {
  font-family: 'Caveat', cursive;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  line-height: 1;
}

.mode-cuisine-progression {
  font-size: .85rem;
  font-weight: 600;
  color: var(--mc-secondaire);
  background: var(--mc-panneau);
  border-radius: 999px;
  padding: .25rem .8rem;
  white-space: nowrap;
}

.mode-cuisine-avancement {
  height: 4px;
  background: var(--mc-bouton-bord);
}

.mode-cuisine-avancement > span {
  display: block;
  height: 100%;
  width: var(--avancement, 0%);
  background: var(--mc-accent);
  transition: width .35s ease;
}

#mode-cuisine-lecture-auto.actif {
  border-color: var(--mc-sauge);
  color: var(--mc-sauge);
}

/* Ingrédients : panneau doux, cases vert sauge, quantités terre cuite */
.mode-cuisine-ingredients {
  background: var(--mc-panneau);
  padding: 1rem 1.2rem;
}

.mode-cuisine-ingredients summary {
  font-family: 'Caveat', cursive;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
}

#mode-cuisine-compteur {
  font-family: 'Montserrat', sans-serif;
  font-size: .8rem;
  vertical-align: middle;
  background: var(--mc-sauge) !important;
  color: var(--mc-accent-texte);
}

.mode-cuisine-ingredient-section {
  font-family: 'Caveat', cursive;
  font-size: 1.5rem;
  color: var(--mc-sauge);
  margin-top: .9rem;
}

.mode-cuisine-ingredient {
  padding: .55rem .2rem;
  border-bottom: 1px dashed var(--mc-bouton-bord);
  font-size: 1.05rem;
}

.mode-cuisine-ingredient input {
  accent-color: var(--mc-sauge);
  width: 1.35rem;
  height: 1.35rem;
}

.mode-cuisine-ingredient strong {
  color: var(--mc-accent);
  font-weight: 600;
  text-align: right;
}

.mode-cuisine-ingredient.coche span,
.mode-cuisine-ingredient.coche strong {
  opacity: .55;
}

/* Étape : grand numéro manuscrit, texte en Lora, photo arrondie */
.mode-cuisine-etape {
  padding: 1.6rem 2.4rem 1.2rem;
  max-width: 60rem;
  width: 100%;
  margin: 0 auto;
}

.mode-cuisine-section {
  font-family: 'Caveat', cursive;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: var(--mc-sauge);
}

.mode-cuisine-texte {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(1.45rem, 3.2vw, 2.3rem);
  line-height: 1.45;
}

.mode-cuisine-texte[data-numero]::before {
  content: attr(data-numero);
  display: block;
  font-family: 'Caveat', cursive;
  font-weight: 700;
  font-size: clamp(3rem, 7vw, 4.6rem);
  line-height: .9;
  color: var(--mc-accent);
  margin-bottom: .3rem;
}

.mode-cuisine-image {
  border-radius: 16px;
  max-height: 42vh;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .25);
}

/* Pied : minuteurs, puis navigation (« Suivante » en grand) */
.mode-cuisine-pied {
  border-top: 1px solid var(--mc-bouton-bord);
}

.mode-cuisine-durees .btn-warning {
  --bs-btn-bg: var(--mc-accent);
  --bs-btn-border-color: var(--mc-accent);
  --bs-btn-color: var(--mc-accent-texte);
  --bs-btn-hover-bg: var(--mc-accent);
  --bs-btn-hover-border-color: var(--mc-accent);
  --bs-btn-hover-color: var(--mc-accent-texte);
  border-radius: 999px;
  font-weight: 600;
}

.mode-cuisine-navigation {
  align-items: center;
}

#mode-cuisine-suivant {
  background: var(--mc-accent);
  border-color: var(--mc-accent);
  color: var(--mc-accent-texte);
  font-weight: 700;
  padding: .7rem 1.8rem;
  font-size: 1.1rem;
}

#mode-cuisine-suivant:hover,
#mode-cuisine-suivant:focus-visible {
  filter: brightness(1.08);
  color: var(--mc-accent-texte);
}

#mode-cuisine-suivant:disabled {
  opacity: .35;
}

#mode-cuisine-precedent {
  padding: .7rem 1.4rem;
}

#mode-cuisine-recommencer {
  border-color: transparent;
  color: var(--mc-secondaire);
  font-size: .9rem;
}

.mode-cuisine-minuteurs .minuteur-ligne {
  background: var(--mc-minuteur-fond);
  border: 1px solid var(--mc-bouton-bord);
  border-radius: 14px;
  padding: .5rem .9rem;
  margin-bottom: .4rem;
}

.mode-cuisine-minuteurs .btn {
  border-radius: 999px;
}

.mode-cuisine-reglages {
  background: var(--mc-panneau);
  border-bottom: 1px solid var(--mc-bouton-bord);
}

/* Téléphone : boutons de navigation sur toute la largeur, « Suivante » le plus large */
@media (max-width: 575.98px) {
  .mode-cuisine-etape {
    padding: 1.1rem 1.4rem .8rem;
  }

  .mode-cuisine-navigation > * {
    padding-left: .6rem !important;
    padding-right: .6rem !important;
  }

  #mode-cuisine-suivant {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mode-cuisine-avancement > span { transition: none; }
}

/* Mode cuisine, ajustements : cases rondes vert sauge (plus de carré blanc en sombre), boutons sur une ligne */
.mode-cuisine-ingredient input[type=checkbox] {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 1.4rem;
  height: 1.4rem;
  border: 2px solid var(--mc-sauge);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: inline-grid;
  place-content: center;
}

.mode-cuisine-ingredient input[type=checkbox]::after {
  content: "";
  width: .7rem;
  height: .7rem;
  border-radius: 50%;
  background: var(--mc-sauge);
  transform: scale(0);
  transition: transform .15s ease;
}

.mode-cuisine-ingredient input[type=checkbox]:checked::after {
  transform: scale(1);
}

.mode-cuisine-ingredient input[type=checkbox]:focus-visible {
  outline: 2px solid var(--mc-accent);
  outline-offset: 2px;
}

.mode-cuisine .mode-cuisine-bouton,
.mode-cuisine-navigation .btn {
  white-space: nowrap;
}

.mode-cuisine-barre .mode-cuisine-titre {
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 575.98px) {
  .mode-cuisine-barre {
    gap: .4rem;
    padding: .5rem .6rem;
  }

  .mode-cuisine-barre .d-flex {
    gap: .3rem !important;
  }

  .mode-cuisine-barre .mode-cuisine-bouton {
    padding: .25rem .5rem;
    font-size: .8rem;
  }

  .mode-cuisine-progression {
    padding: .2rem .55rem;
    font-size: .75rem;
  }

  .mode-cuisine-navigation {
    gap: .4rem;
  }

  .mode-cuisine-navigation .btn {
    font-size: .9rem;
    padding: .55rem .7rem !important;
  }

  #mode-cuisine-recommencer {
    font-size: .78rem;
    padding-left: .2rem !important;
    padding-right: .2rem !important;
  }
}

/* Mode cuisine, ajustements (2) : boutons de la barre plus grands avec des icônes lisibles ; sur téléphone, le titre
   de la recette a sa propre ligne (jusqu'à deux lignes), étape et boutons dessous */
.mode-cuisine-barre .mode-cuisine-bouton {
  min-height: 40px;
  min-width: 40px;
  padding: .3rem .8rem;
  font-size: .95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
}

.mode-cuisine-barre .mode-cuisine-bouton .bi {
  font-size: 1.15rem;
  line-height: 1;
}

@media (max-width: 575.98px) {
  .mode-cuisine-barre {
    flex-wrap: wrap;
    row-gap: .35rem;
  }

  .mode-cuisine-barre .mode-cuisine-titre {
    flex: 1 1 100%;
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: 1.5rem;
  }

  .mode-cuisine-barre > .d-flex {
    margin-left: auto;
  }

  .mode-cuisine-barre .mode-cuisine-bouton {
    min-height: 38px;
    min-width: 38px;
    padding: .25rem .6rem;
    font-size: .85rem;
  }
}

/* Mode cuisine, ajustements (2) : boutons de la barre plus grands avec des icônes lisibles ; sur téléphone, le titre
   de la recette a sa propre ligne (jusqu'à deux lignes), étape et boutons dessous */
.mode-cuisine-barre .mode-cuisine-bouton {
  min-height: 40px;
  min-width: 40px;
  padding: .3rem .8rem;
  font-size: .95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
}

.mode-cuisine-barre .mode-cuisine-bouton .bi {
  font-size: 1.15rem;
  line-height: 1;
}

@media (max-width: 575.98px) {
  .mode-cuisine-barre {
    flex-wrap: wrap;
    row-gap: .35rem;
  }

  .mode-cuisine-barre .mode-cuisine-titre {
    flex: 1 1 100%;
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: 1.5rem;
  }

  .mode-cuisine-barre > .d-flex {
    margin-left: auto;
  }

  .mode-cuisine-barre .mode-cuisine-bouton {
    min-height: 38px;
    min-width: 38px;
    padding: .25rem .6rem;
    font-size: .85rem;
  }
}

/* l'engrenage de Bootstrap Icons est dessiné plus petit que les autres icônes : agrandi à part */
.mode-cuisine-barre .mode-cuisine-bouton .bi-gear {
  font-size: 1.4rem;
}

/* Barre du site : langue, thème et photo restent visibles sur téléphone (hors du menu ☰) ; leurs menus se déroulent
   en surimpression, alignés à droite, comme sur grand écran */
.barre-droite .navbar-nav .dropdown-menu {
  position: absolute;
}

.barre-droite .nav-link {
  padding-left: .4rem;
  padding-right: .4rem;
}

@media (max-width: 991.98px) {
  .barre-site .navbar-collapse .navbar-nav {
    padding-top: .4rem;
  }

  .barre-site .nav-img {
    width: 40px;
    height: 40px;
  }
}

/* Petites commandes natives des champs (flèches des nombres, calendrier, cases) dans les couleurs du thème du site,
   et non dans celles de l'appareil : en thème clair, les flèches des champs numériques s'affichaient sur fond noir */
[data-bs-theme=light] input,
[data-bs-theme=light] select,
[data-bs-theme=light] textarea {
  color-scheme: light;
}

[data-bs-theme=dark] input,
[data-bs-theme=dark] select,
[data-bs-theme=dark] textarea {
  color-scheme: dark;
}
