/* =========================================================
   CSS dédié à la page d'impression d'une recette - sō tasty
   Couleur principale (bandeau) : #f44336
   ========================================================= */
:root {
  --main-color: #f44336;
  --main-color-light: #fdecea;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 14px;
  color: #2c2c2c;
  background: #eceae4;
  line-height: 1.4;
  padding: 30px 15px;
}
/* ---------- Boutons (écran uniquement) ---------- */
.print-actions {
  max-width: 820px;
  margin: 0 auto 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.btn-print,
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 400;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s;
}
.btn-print {
  background: var(--main-color);
  color: #fff;
}
.btn-back {
  background: #fff;
  color: #555;
  border: 1px solid #ccc;
}
.btn-print:hover,
.btn-back:hover {
  opacity: 0.85;
}
/* ---------- Carte recette ---------- */
.print-wrapper {
  max-width: 820px;
  margin: 0 auto;
}
.print-card {
  background: #fff;
  padding: 35px 40px;
  border-radius: 12px;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
}
/* ---------- En-tête / marque + titre ---------- */
.print-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--main-color);
  margin-bottom: 20px;
}
.print-brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-shrink: 0;
}
.brand-kanji {
  font-size: 28px;
  color: var(--main-color);
  font-weight: 700;
}
.brand-name {
  font-family: "Dancing Script", cursive;
  font-size: 26px;
  color: #2c2c2c;
}
.print-title {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 22px;
  color: #1f1f1f;
  text-align: right;
  line-height: 1.2;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}
/* ---------- Ligne photo (1/3) + ingrédients (2/3) ---------- */
.print-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.print-col-photo {
  flex: 0 0 33.333%;
  text-align: center;
}
.print-col-photo img {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}
.print-col-ingredients {
  flex: 1 1 66.666%;
  min-width: 0;
}
.print-row:not(:has(.print-col-photo)) .print-col-ingredients {
  flex: 1 1 100%;
}
/* ---------- Sections ---------- */
.print-section {
  margin-bottom: 14px; /* espace conservé, réduit (avant 18px) */
}
.print-section h2 {
  font-family: "Poppins", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--main-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.print-section h2 i {
  margin-right: 6px;
  font-size: 13px;
}
.print-content {
  font-size: 14px;
  color: #333;
  line-height: 1.35;
  padding-left: 2px;
}
.print-content p {
  margin: 0 0 4px; /* espace conservé entre paragraphes */
  padding: 0;
}
.print-content p:last-child {
  margin-bottom: 0;
}
/* ---------- Section conseil ---------- */
.print-notes {
  background: var(--main-color-light);
  border-left: 4px solid var(--main-color);
  padding: 12px 16px;
  border-radius: 6px;
}
.print-notes h2 {
  border-bottom: none;
  margin-bottom: 6px;
}
/* ---------- Pied de page ---------- */
.print-footer {
  margin-top: 25px;
  padding-top: 12px;
  border-top: 1px solid #eee;
  text-align: center;
}
.footer-text {
  font-size: 11px;
  color: #999;
  font-style: italic;
  letter-spacing: 0.5px;
}
/* =========================================================
   RÈGLES D'IMPRESSION
   ========================================================= */
@media print {
  @page {
    size: A4;
    margin: 12mm 14mm;
  }
  body {
    background: #fff;
    padding: 0;
    font-size: 11pt;
    color: #000;
    line-height: 1.3;
  }
  .no-print,
  .print-actions {
    display: none !important;
  }
  /* Reset pagination */
  * {
    page-break-inside: auto !important;
    break-inside: auto !important;
  }
  /* Protections utiles */
  img,
  .print-section h2 {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
  .print-section h2 {
    page-break-after: avoid !important;
    break-after: avoid !important;
  }
  .print-wrapper {
    max-width: 100%;
    margin: 0;
  }
  .print-card {
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    overflow: visible;
  }
  /* En-tête */
  .print-header {
    margin-bottom: 12px;
    gap: 15px;
  }
  .brand-kanji {
    font-size: 20pt;
  }
  .brand-name {
    font-size: 16pt;
  }
  .print-title {
    font-size: 15pt;
  }
  /* Ligne photo + ingrédients */
  .print-row {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    margin-bottom: 10px;
  }
  .print-col-photo {
    flex: 0 0 33%;
  }
  .print-col-photo img {
    max-height: 160px;
    box-shadow: none;
  }
  .print-col-ingredients {
    flex: 1 1 67%;
    min-width: 0;
  }
  /* Sections */
  .print-section {
    margin-bottom: 10px;
  }
  /* Titres : ORANGE conservé + FILET NOIR conservé */
  .print-section h2 {
    font-size: 12pt;
    color: var(--main-color) !important;
    border-bottom: 0px solid #000 !important;
    padding-bottom: 4px;
    margin-bottom: 6px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .print-content {
    font-size: 10.5pt;
    color: #000;
    line-height: 1.3;
  }
  .print-content p {
    margin: 0 0 3px; /* espace conservé entre paragraphes */
  }
  .print-content p:last-child {
    margin-bottom: 0;
  }
  /* Conseil */
  .print-notes {
    background: var(--main-color-light) !important;
    border: none;
    border-left: 3px solid var(--main-color) !important;
    padding: 10px 14px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .print-notes h2 {
    border-bottom: none !important;
  }
  /* Pied de page */
  .print-footer {
    margin-top: 15px;
    padding-top: 10px;
  }
  .footer-text {
    color: #555;
    font-size: 9pt;
  }
}
/* Paragraphe normal */
.print-content p {
  margin: 0 0 4px;
  padding: 0;
}
/* Ligne vide = respiration */
.print-content p.vide {
  margin: 0;
  line-height: 0.6; /* plus court qu'une ligne normale */
}
@media print {
  .print-content p {
    margin: 0 0 3px;
  }
  .print-content p.vide {
    margin: 0;
    line-height: 0.5;
  }
}
