/**
 * Xionic — Print Stylesheet
 * Clean, ink-friendly layout for printed articles.
 */

@media print {
  /* Reset background and colors */
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* Hide non-essential elements */
  .xionic-header,
  .xionic-nav,
  header nav,
  .reading-progress,
  .skip-link,
  .sidebar,
  .widget-area,
  .xionic-related-posts,
  .xionic-author-bio-box,
  footer .xionic-footer-bottom,
  .navigation.posts-navigation,
  .comments-area,
  .xionic-subscribe-cta,
  #wpadminbar,
  .wp-block-buttons,
  button,
  form,
  .xionic-pagination,
  video,
  audio,
  iframe {
    display: none !important;
  }

  /* Page */
  body {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 12pt;
    line-height: 1.65;
    margin: 0;
    padding: 0;
  }

  /* Container — full width */
  .site-content,
  .container,
  .xionic-container,
  .col-lg-9,
  .col-md-8 {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
  }

  /* Article header */
  article header h1 {
    font-size: 22pt;
    line-height: 1.2;
    margin-bottom: 0.5cm;
    font-style: italic;
  }

  /* Typography */
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    font-family: Georgia, 'Times New Roman', serif;
  }

  p, blockquote, figure {
    page-break-inside: avoid;
    orphans: 3;
    widows: 3;
  }

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

  /* Show href after links */
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #444;
  }

  /* Don't show href for internal / anchor links */
  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  /* Blockquote */
  blockquote {
    border-left: 3pt solid #555;
    padding-left: 1em;
    margin-left: 0;
    font-style: italic;
  }

  /* Table */
  table {
    border-collapse: collapse;
    width: 100%;
  }

  th, td {
    border: 1pt solid #999;
    padding: 6pt 8pt;
    font-size: 10pt;
  }

  /* Code */
  pre, code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 10pt;
    border: 1pt solid #ccc;
    padding: 0.25em 0.5em;
    white-space: pre-wrap;
    word-wrap: break-word;
  }

  /* Page breaks */
  h2, h3 {
    page-break-before: auto;
  }

  article {
    page-break-after: always;
  }

  /* Article footer / tags visible */
  .entry-footer,
  .tags-links {
    display: block !important;
    font-size: 9pt;
    margin-top: 1cm;
    border-top: 1pt solid #ccc;
    padding-top: 0.5em;
  }

  /* Print URL at bottom */
  body::after {
    content: "Printed from: " attr(data-url);
    display: block;
    margin-top: 1cm;
    font-size: 8pt;
    color: #666;
    text-align: center;
  }
}
