/* ============================================================
   Pizca Isarelli — Print / PDF
   Se activa con window.print(). El "PDF" se genera usando
   "Guardar como PDF" en el diálogo de impresión del navegador.
   ============================================================ */

@media print {
  /* ---- Reset para impresión ---- */
  *,
  *::before,
  *::after {
    box-shadow: none !important;
    text-shadow: none !important;
    color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  /* ---- Ocultar elementos UI ---- */
  .site-header,
  .site-footer,
  .breadcrumbs,
  .recipe-actions,
  .portions-control,
  .recipe-card__fav,
  .btn--primary,
  .btn--secondary,
  .btn--olive,
  .header-nav,
  .filters-bar,
  .pagination,
  .search-hero,
  .toast-container,
  .cook-mode,
  .unit-toggle,
  .skip-link,
  #js-cook-mode-btn,
  #js-share-btn,
  #js-add-shopping-btn,
  .no-print {
    display: none !important;
  }

  /* ---- Tipografía de impresión ---- */
  body {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 11pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }

  h1, h2, h3 {
    font-family: Georgia, serif;
    color: #000;
  }

  a {
    color: #000;
    text-decoration: none;
  }

  /* ---- Layout de impresión ---- */
  .recipe-detail {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  /* ---- Cabecera de receta ---- */
  .recipe-header__title {
    font-size: 24pt;
    margin-bottom: 8pt;
    border-bottom: 2pt solid #C65D3B;
    padding-bottom: 6pt;
  }

  .recipe-header__category {
    font-size: 9pt;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #C65D3B;
    display: block;
    margin-bottom: 4pt;
  }

  .recipe-header__summary {
    font-size: 11pt;
    color: #444;
    margin-bottom: 12pt;
  }

  /* ---- Meta bar ---- */
  .recipe-meta-bar {
    display: flex;
    gap: 20pt;
    background: #F5F0E5;
    padding: 8pt 12pt;
    border-radius: 0;
    margin-bottom: 16pt;
    border: 1pt solid #ccc;
  }

  .recipe-meta-stat__value {
    font-family: Georgia, serif;
    font-size: 18pt;
    font-weight: bold;
    color: #C65D3B;
  }

  .recipe-meta-stat__label {
    font-size: 8pt;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  /* ---- Portada de receta ---- */
  .recipe-cover {
    break-after: avoid;
    aspect-ratio: 16 / 6;
    margin-bottom: 16pt;
    page-break-after: avoid;
  }

  /* ---- Ingredientes (dos columnas si caben) ---- */
  .recipe-print-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24pt;
    margin-bottom: 24pt;
  }

  @media (max-width: 500pt) {
    .recipe-print-columns {
      grid-template-columns: 1fr;
    }
  }

  .ingredients-section h3,
  .steps-section h3 {
    font-size: 14pt;
    border-bottom: 1pt solid #C65D3B;
    padding-bottom: 4pt;
    margin-bottom: 10pt;
    color: #C65D3B;
    break-after: avoid;
    page-break-after: avoid;
  }

  .ingredient-list {
    list-style: none;
    padding: 0;
  }

  .ingredient-item {
    padding: 3pt 0;
    border-bottom: 0.5pt solid #eee;
    font-size: 10pt;
    display: flex;
    gap: 6pt;
  }

  .ingredient-item__qty {
    font-weight: bold;
    color: #C65D3B;
    min-width: 2.5rem;
  }

  .ingredient-item__unit {
    color: #666;
    min-width: 2.5rem;
  }

  .ingredient-item__note {
    color: #888;
    font-style: italic;
  }

  /* ---- Pasos ---- */
  .step-item {
    display: grid;
    grid-template-columns: 2rem 1fr;
    gap: 10pt;
    padding: 8pt 0;
    border-bottom: 0.5pt solid #eee;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .step-item__number {
    font-family: Georgia, serif;
    font-size: 20pt;
    font-weight: bold;
    color: #ddd;
    line-height: 1;
  }

  .step-item__body {
    font-size: 10.5pt;
    line-height: 1.6;
  }

  .step-item__timer {
    display: inline-block;
    font-size: 9pt;
    font-weight: bold;
    color: #666;
    margin-top: 4pt;
    background: none;
    border: none;
    padding: 0;
  }

  .step-item__timer::before {
    content: '⏱ ';
  }

  /* ---- Tips ---- */
  .recipe-tips {
    background: #F5F0E5;
    border-left: 3pt solid #E0A526;
    padding: 8pt 12pt;
    margin-top: 16pt;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .recipe-tips h3 {
    font-size: 12pt;
    color: #B8841A;
    margin-bottom: 6pt;
  }

  /* ---- Tags ---- */
  .tags-list {
    margin-top: 12pt;
  }

  .tag-chip {
    display: inline-block;
    border: 0.5pt solid #ccc;
    padding: 1pt 6pt;
    border-radius: 20pt;
    font-size: 8pt;
    color: #666;
    margin: 2pt;
    background: none;
  }

  /* ---- URL al pie ---- */
  .recipe-print-url {
    margin-top: 20pt;
    padding-top: 10pt;
    border-top: 1pt solid #ccc;
    font-size: 8pt;
    color: #888;
  }

  /* ---- Cortes de página ---- */
  h1, h2, h3, h4 {
    break-after: avoid;
    page-break-after: avoid;
  }

  img {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .ingredient-group {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* ---- Página ---- */
  @page {
    size: A4 portrait;
    margin: 18mm 20mm 22mm 20mm;
  }

  @page :first {
    margin-top: 14mm;
  }
}
