/**
 * Print Stylesheet - Jazelous Productions LLC Corporate Website
 *
 * Optimized for professional PDF export of privacy policy page
 * Ensures clean, readable output when printed or saved as PDF
 */

@media print {
  /* ============================================================================
     Page Setup
     ========================================================================== */

  @page {
    size: letter; /* US Letter size: 8.5in x 11in */
    margin: 1in 1in 1in 1in; /* Top, Right, Bottom, Left margins */
  }

  /* ============================================================================
     Base Print Styles
     ========================================================================== */

  * {
    background: transparent !important;
    color: #000 !important; /* Black text for print */
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    font-family: Georgia, 'Times New Roman', serif; /* Serif fonts for print readability */
    font-size: 11pt; /* Optimal print font size */
    line-height: 1.6;
    color: #000;
    background: #fff;
  }

  /* ============================================================================
     Hide Non-Essential Elements
     ========================================================================== */

  /* Hide navigation, header, footer, and interactive elements */
  .site-header,
  .site-footer,
  .skip-to-main,
  .breadcrumb,
  nav,
  aside,
  button,
  .no-print {
    display: none !important;
  }

  /* ============================================================================
     Typography for Print
     ========================================================================== */

  h1, h2, h3, h4, h5, h6 {
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: bold;
    color: #000;
    page-break-after: avoid; /* Avoid page breaks immediately after headings */
    page-break-inside: avoid; /* Keep headings together */
  }

  h1 {
    font-size: 24pt;
    margin-top: 0;
    margin-bottom: 12pt;
    text-align: center;
  }

  h2 {
    font-size: 18pt;
    margin-top: 20pt;
    margin-bottom: 10pt;
    border-bottom: 1px solid #000;
    padding-bottom: 4pt;
  }

  h3 {
    font-size: 14pt;
    margin-top: 16pt;
    margin-bottom: 8pt;
  }

  h4 {
    font-size: 12pt;
    margin-top: 12pt;
    margin-bottom: 6pt;
  }

  p {
    font-size: 11pt;
    line-height: 1.6;
    margin-bottom: 10pt;
    orphans: 3; /* Minimum lines at bottom of page */
    widows: 3; /* Minimum lines at top of page */
    text-align: justify;
  }

  strong {
    font-weight: bold;
  }

  em {
    font-style: italic;
  }

  /* ============================================================================
     Links - Show URLs in Print
     ========================================================================== */

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

  /* Display URL after external links in parentheses */
  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    font-style: italic;
    color: #666;
  }

  /* Don't show URLs for anchor links (internal page jumps) */
  a[href^="#"]:after {
    content: "";
  }

  /* Don't show URLs for email links (already visible) */
  a[href^="mailto:"]:after {
    content: "";
  }

  /* ============================================================================
     Lists
     ========================================================================== */

  ul, ol {
    margin-left: 20pt;
    margin-bottom: 10pt;
  }

  li {
    margin-bottom: 6pt;
    page-break-inside: avoid;
  }

  /* ============================================================================
     Tables
     ========================================================================== */

  table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12pt;
    page-break-inside: auto;
  }

  thead {
    display: table-header-group; /* Repeat table headers on each page */
  }

  tfoot {
    display: table-footer-group;
  }

  tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }

  th, td {
    padding: 8pt 6pt;
    border: 1px solid #000;
    text-align: left;
    font-size: 10pt;
  }

  th {
    background-color: #f0f0f0 !important;
    font-weight: bold;
    -webkit-print-color-adjust: exact; /* Ensure background color prints */
    print-color-adjust: exact;
  }

  /* ============================================================================
     Privacy Policy Specific Styles
     ========================================================================== */

  .privacy-policy {
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  .privacy-policy__header {
    margin-bottom: 24pt;
    padding-bottom: 12pt;
    border-bottom: 2px solid #000;
    page-break-after: avoid;
  }

  .privacy-policy__title {
    font-size: 24pt;
    text-align: center;
    margin-bottom: 10pt;
  }

  .privacy-policy__version {
    font-size: 10pt;
    font-style: italic;
    text-align: center;
    color: #666 !important;
    margin-bottom: 0;
  }

  .privacy-policy__toc {
    background-color: #f9f9f9 !important;
    border: 1px solid #000;
    padding: 12pt;
    margin-bottom: 20pt;
    page-break-inside: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .privacy-policy__toc-title {
    font-size: 12pt;
    font-weight: bold;
    margin-bottom: 8pt;
  }

  .privacy-policy__toc-list {
    list-style: decimal;
    margin-left: 20pt;
  }

  .privacy-policy__toc-list li {
    margin-bottom: 4pt;
    font-size: 10pt;
  }

  .privacy-policy__section {
    margin-bottom: 20pt;
    page-break-inside: avoid;
  }

  .privacy-policy__section-title {
    font-size: 16pt;
    font-weight: bold;
    margin-top: 16pt;
    margin-bottom: 10pt;
    border-bottom: 1px solid #000;
    padding-bottom: 4pt;
    page-break-after: avoid;
  }

  .privacy-policy__changelog {
    margin-top: 24pt;
    padding-top: 20pt;
    border-top: 2px solid #000;
    page-break-before: auto;
  }

  .privacy-policy__changelog-title {
    font-size: 16pt;
    font-weight: bold;
    margin-bottom: 12pt;
  }

  .privacy-policy__changelog-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12pt;
    page-break-inside: auto;
  }

  .privacy-policy__changelog-table th,
  .privacy-policy__changelog-table td {
    padding: 8pt 6pt;
    border: 1px solid #000;
    text-align: left;
    font-size: 10pt;
  }

  .privacy-policy__changelog-table th {
    background-color: #f0f0f0 !important;
    font-weight: bold;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* ============================================================================
     Page Breaks
     ========================================================================== */

  /* Force page break before major sections if needed */
  .page-break-before {
    page-break-before: always;
  }

  /* Force page break after element if needed */
  .page-break-after {
    page-break-after: always;
  }

  /* Avoid breaking inside specific elements */
  blockquote,
  pre,
  .keep-together {
    page-break-inside: avoid;
  }

  /* ============================================================================
     Header/Footer for Each Printed Page (if supported by browser)
     ========================================================================== */

  @page {
    /* Add page number in footer (browser support varies) */
    @bottom-right {
      content: "Page " counter(page) " of " counter(pages);
      font-family: Georgia, 'Times New Roman', serif;
      font-size: 9pt;
      color: #666;
    }

    /* Add document title in header (browser support varies) */
    @top-center {
      content: "Privacy Policy - IQ Macros";
      font-family: Georgia, 'Times New Roman', serif;
      font-size: 9pt;
      color: #666;
      border-bottom: 1px solid #ccc;
      padding-bottom: 4pt;
    }
  }

  /* First page should not have header */
  @page :first {
    @top-center {
      content: none;
    }
  }

  /* ============================================================================
     Utilities
     ========================================================================== */

  /* Images (if any) */
  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  /* Code blocks (if any) */
  code {
    font-family: 'Courier New', monospace;
    font-size: 10pt;
    background-color: #f5f5f5 !important;
    padding: 2pt 4pt;
    border: 1px solid #ccc;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  pre {
    font-family: 'Courier New', monospace;
    font-size: 9pt;
    background-color: #f5f5f5 !important;
    border: 1px solid #ccc;
    padding: 10pt;
    overflow: visible;
    white-space: pre-wrap;
    word-wrap: break-word;
    page-break-inside: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Hide decorative elements */
  .decorative {
    display: none !important;
  }

  /* Ensure sufficient contrast for monochrome printing */
  * {
    color-adjust: exact;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ============================================================================
   Print Preview Optimization
   ========================================================================== */

/* These styles ensure consistent rendering in browser print preview */
@media print {
  html, body {
    width: 100%;
    height: auto;
    overflow: visible;
  }

  .privacy-policy {
    width: 100%;
    height: auto;
  }
}
