/* MYLLKA. Édition papier du livre de vie
   Document A4 destiné à l'impression ou à l'enregistrement en PDF. */

#print-root { display: none; }

@media print {

  /* L'application cède la place au document. */
  #app, .bottomnav, .sheet, .sheet-back, .toast, .mode-badge { display: none !important; }
  #print-root { display: block !important; }

  html, body {
    height: auto; overflow: visible;
    background: #fff; color: #1C2835;
    font-family: 'DM Sans', -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 10.5pt; line-height: 1.5;
  }

  @page { size: A4; margin: 15mm 16mm 14mm; }

  .p-doc { max-width: 100%; }

  /* ── En-tête ── */
  .p-entete {
    display: flex; align-items: flex-start; gap: 14mm;
    padding-bottom: 6mm; margin-bottom: 7mm;
    border-bottom: 1.4pt solid #181614;
  }
  .p-mark { width: 16mm; height: 16mm; flex-shrink: 0; }
  .p-titre-bloc { flex: 1; }
  .p-surtitre {
    font-size: 8pt; letter-spacing: .22em; text-transform: uppercase;
    color: #ED694B; font-weight: 600; margin-bottom: 1.5mm;
  }
  .p-entete h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 27pt; font-weight: 600; line-height: 1.05; margin: 0 0 1.5mm; color: #1C2835;
  }
  .p-soustitre { font-size: 10.5pt; color: #4A5A6B; }
  .p-portrait {
    width: 32mm; height: 32mm; object-fit: cover;
    border-radius: 2.5mm; flex-shrink: 0; border: .5pt solid #D8D0C4;
  }

  /* ── Encadré urgence ── */
  .p-urgence {
    border: 1pt solid #ED694B; border-left-width: 3.5pt;
    border-radius: 1.5mm; padding: 4.5mm 5mm; margin-bottom: 7mm;
    background: #FDF6F1;
    break-inside: avoid; page-break-inside: avoid;
  }
  .p-urgence-titre {
    font-size: 8pt; letter-spacing: .16em; text-transform: uppercase;
    color: #B4602F; font-weight: 700; margin-bottom: 2.5mm;
  }
  .p-urgence-ligne { font-size: 10pt; line-height: 1.55; margin-bottom: 1.8mm; }
  .p-urgence-ligne:last-child { margin-bottom: 0; }
  .p-urgence-ligne b { color: #1C2835; }

  /* ── Sections ── */
  .p-section { margin-bottom: 7mm; break-inside: auto; }
  .p-section h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 14pt; font-weight: 600; color: #181614;
    margin: 0 0 3.5mm; padding-bottom: 1.8mm;
    border-bottom: .5pt solid #D8D0C4;
    break-after: avoid; page-break-after: avoid;
  }

  .p-rubrique { margin-bottom: 4.5mm; break-inside: avoid; page-break-inside: avoid; }
  .p-rubrique h3 {
    font-size: 8.5pt; letter-spacing: .1em; text-transform: uppercase;
    color: #6E7C8A; font-weight: 600; margin: 0 0 1.8mm;
    font-family: 'DM Sans', sans-serif;
  }

  .p-texte { margin: 0 0 2mm; font-size: 10pt; line-height: 1.55; color: #2C3A48; }
  .p-liste { margin: 0 0 2mm; padding-left: 5mm; font-size: 10pt; }
  .p-liste li { margin-bottom: .8mm; break-inside: avoid; }

  /* ── Identité ── */
  .p-grille {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 0 10mm; break-inside: avoid;
  }
  .p-champ {
    display: flex; justify-content: space-between; gap: 4mm;
    padding: 2mm 0; border-bottom: .4pt solid #E8E2D8; font-size: 10pt;
  }
  .p-label { color: #6E7C8A; }
  .p-valeur { font-weight: 500; text-align: right; }

  .p-galerie { display: flex; gap: 3mm; margin-top: 4mm; break-inside: avoid; }
  .p-galerie img {
    width: 34mm; height: 34mm; object-fit: cover;
    border-radius: 2mm; border: .5pt solid #D8D0C4;
  }

  /* ── Pied ── */
  .p-pied {
    margin-top: 9mm; padding-top: 4mm;
    border-top: .5pt solid #D8D0C4;
    font-size: 8pt; color: #6E7C8A; line-height: 1.5;
    break-inside: avoid; page-break-inside: avoid;
  }
  .p-pied b { color: #181614; }
  .p-avert { margin-top: 2mm; font-size: 7.5pt; color: #8A94A0; }

  /* Les couleurs de fond doivent survivre à l'impression. */
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
