/* Print-specific styles for single-page optimization */

@media print {
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body {
    padding: 0;
    font-size: 10pt;
    line-height: 1.3;
  }

  .container {
    max-width: 100%;
  }

  .header {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #000;
  }

  .song-title-main {
    font-size: 16pt;
    margin-bottom: 0.25rem;
  }

  .song-artist {
    font-size: 12pt;
    margin-bottom: 0.5rem;
  }

  .song-metadata {
    font-size: 9pt;
    gap: 1rem;
  }

  .song-content {
    padding: 0.5rem 0;
    border: none;
    margin-bottom: 0;
    page-break-inside: avoid;
  }

  .structure-overview {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: #f0f0f0 !important;
    font-size: 9pt;
  }

  .song-body {
    font-size: 9pt;
    line-height: 1.2;
  }

  .song-content .chord {
    font-size: 8pt;
    font-weight: bold;
  }

  .song-content .lyrics {
    font-size: 9pt;
  }

  .song-content table {
    margin: 0;
    padding: 0;
  }

  .song-content td {
    padding: 0.05rem 0.15rem;
  }

  /* Compact spacing for single page */
  .song-content tr {
    page-break-inside: avoid;
  }

  /* Hide all controls and navigation */
  .controls,
  .nav-back,
  .header-actions,
  .footer,
  button,
  .no-print {
    display: none !important;
  }

  /* Remove backgrounds and borders for ink saving */
  .song-content,
  .artist-group,
  .song-link {
    background: white !important;
    border: none !important;
    box-shadow: none !important;
  }

  /* Ensure single page */
  @page {
    margin: 0.5in;
    size: letter portrait;
  }

  /* Prevent page breaks */
  .song-content,
  .song-body {
    page-break-after: avoid;
    page-break-before: avoid;
  }

  /* Make everything fit */
  html, body {
    height: auto;
    overflow: visible;
  }
}

/* Print preview optimization */
@media print and (max-height: 10in) {
  body {
    font-size: 9pt;
  }

  .song-body {
    font-size: 8pt;
  }

  .song-content .chord {
    font-size: 7pt;
  }
}
