/* ============================================
   PRINT - Template image + impression propre
   Nos Recettes V3
   ============================================ */

@media print {
  /* Masquer tout sauf le contenu recette */
  .site-header,
  .site-footer,
  .search-bar,
  .filters-section,
  .stats-bar,
  .recipe-toolbar-mobile,
  .toast-container,
  .modal-overlay,
  .lightbox-overlay,
  .recipe-back-btn,
  .sidebar-tools,
  .portions-control,
  .btn-primary,
  .btn-secondary,
  .btn-icon {
    display: none !important;
  }

  body {
    background: white;
    color: #1C1917;
    font-size: 11pt;
    line-height: 1.5;
  }

  .app-container {
    min-height: auto;
  }

  .main-content {
    padding: 0;
    max-width: none;
  }

  /* Template image en fond */
  .recipe-print-wrapper {
    position: relative;
    width: 210mm;
    height: 297mm;
    margin: 0;
    padding: 0;
    overflow: hidden;
    page-break-after: always;
  }

  .recipe-print-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--print-template-url);
    background-size: cover;
    z-index: 0;
    opacity: 0.15;
  }

  .recipe-print-content {
    position: relative;
    z-index: 1;
    padding: 20mm 15mm;
  }

  /* Titre */
  .recipe-title {
    font-size: 18pt;
    color: #1C1917;
    margin-bottom: 8pt;
    border-bottom: 2px solid #F97316;
    padding-bottom: 6pt;
  }

  /* Meta */
  .recipe-meta {
    font-size: 9pt;
    color: #57534E;
    margin-bottom: 12pt;
  }

  /* Image recette */
  .recipe-hero-image {
    max-width: 200px;
    max-height: 150px;
    float: right;
    margin: 0 0 8pt 12pt;
    border-radius: 4pt;
  }

  .recipe-hero-fallback {
    display: none;
  }

  /* Ingredients en 2 colonnes */
  .ingredients-section {
    box-shadow: none;
    padding: 0;
    background: transparent;
  }

  .ingredients-list {
    columns: 2;
    column-gap: 20px;
  }

  .ingredient-item {
    break-inside: avoid;
    border-bottom: none;
    padding: 2pt 0;
    font-size: 10pt;
  }

  .ingredient-emoji {
    display: none;
  }

  /* Etapes */
  .step-item {
    break-inside: avoid;
  }

  .step-number {
    background: #F97316;
    color: white;
    width: 20px;
    height: 20px;
    font-size: 9pt;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .step-content {
    font-size: 10pt;
    color: #292524;
  }

  /* Footer URL */
  .recipe-detail::after {
    content: 'cuisine.bastou.dev';
    display: block;
    text-align: center;
    font-size: 8pt;
    color: #A8A29E;
    margin-top: 16pt;
    padding-top: 8pt;
    border-top: 1px solid #E7E5E4;
  }

  /* Sidebar visible en print */
  .recipe-sidebar {
    display: block;
  }

  .sidebar-card {
    box-shadow: none;
    padding: 0;
    background: transparent;
  }

  /* Tags */
  .tag {
    border: 1px solid #E7E5E4;
    background: transparent;
  }

  /* Liens */
  a {
    color: #1C1917;
    text-decoration: none;
  }

  /* Pas de coupure */
  .recipe-markdown h2,
  .recipe-markdown h3 {
    break-after: avoid;
  }

  .recipe-markdown ul li {
    break-inside: avoid;
  }

  /* Cacher la modale */
  .modal-overlay {
    display: none !important;
  }

  /* Desactiver ces regles quand la preview est active */
  body.print-preview-active .recipe-detail::after {
    display: none;
  }
}
