/* ==========================================================================
   Print Stylesheet
   Optimized for printing articles from the Israeli Tax Guide
   Usage: <link rel="stylesheet" href="styles/print.css" media="print">
   ========================================================================== */

@media print {

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

  .site-header,
  .main-nav,
  .mobile-menu__toggle,
  .mobile-menu__label,
  .mobile-menu__overlay,
  .breadcrumb,
  .sidebar,
  .lang-selector,
  .site-footer,
  .back-to-top,
  .article-nav,
  .search-form,
  .pagination,
  .skip-link,
  .tag--new,
  .tag--updated {
    display: none !important;
  }

  /* ==========================================================================
     2. Base Reset for Print
     ========================================================================== */

  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  html {
    font-size: 12pt;
  }

  body {
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.6;
    color: #000000;
    margin: 0;
    padding: 0;
  }

  /* ==========================================================================
     3. Layout
     ========================================================================== */

  .page-layout {
    display: block;
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

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

  /* ==========================================================================
     4. Typography
     ========================================================================== */

  h1, h2, h3, h4, h5, h6 {
    font-family: Georgia, "Times New Roman", serif;
    page-break-after: avoid;
    break-after: avoid;
    orphans: 3;
    widows: 3;
  }

  h1 { font-size: 22pt; }
  h2 { font-size: 18pt; margin-top: 18pt; }
  h3 { font-size: 14pt; margin-top: 14pt; }
  h4 { font-size: 12pt; }

  p, li, td, th {
    orphans: 3;
    widows: 3;
  }

  p {
    margin-bottom: 8pt;
  }

  /* ==========================================================================
     5. Links - Show URLs
     ========================================================================== */

  a[href] {
    text-decoration: underline;
    color: #000000 !important;
  }

  /* Show URL after external links */
  .article__body a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    font-weight: normal;
    color: #555555 !important;
    word-break: break-all;
  }

  /* Do not show URL for anchor links or javascript */
  a[href^="#"]::after,
  a[href^="javascript"]::after {
    content: "" !important;
  }

  /* ==========================================================================
     6. Tables
     ========================================================================== */

  table {
    border-collapse: collapse;
    width: 100%;
    page-break-inside: avoid;
    break-inside: avoid;
  }

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

  thead {
    display: table-header-group;
  }

  th {
    font-weight: bold;
    border-bottom-width: 2px !important;
  }

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

  /* ==========================================================================
     7. Blockquotes & Notes
     ========================================================================== */

  blockquote,
  blockquote.note,
  blockquote.note--warning,
  blockquote.note--success,
  blockquote.note--info {
    border-left: 3pt solid #000000 !important;
    padding: 6pt 12pt;
    margin: 12pt 0;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* ==========================================================================
     8. Images
     ========================================================================== */

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

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

  /* ==========================================================================
     9. Code Blocks
     ========================================================================== */

  pre, code {
    font-family: "Courier New", Courier, monospace;
    font-size: 9pt;
  }

  pre {
    border: 1px solid #cccccc !important;
    padding: 8pt;
    page-break-inside: avoid;
    break-inside: avoid;
    white-space: pre-wrap;
    word-wrap: break-word;
  }

  /* ==========================================================================
     10. Page Breaks
     ========================================================================== */

  .article__header {
    page-break-after: avoid;
    break-after: avoid;
  }

  .article__body h2 {
    page-break-before: auto;
    break-before: auto;
  }

  /* ==========================================================================
     11. Print-Specific Header
     ========================================================================== */

  /* Optional print header showing site name */
  .article::before {
    content: "Israeli Tax Guide";
    display: block;
    font-size: 10pt;
    color: #999999 !important;
    border-bottom: 1pt solid #cccccc;
    padding-bottom: 6pt;
    margin-bottom: 12pt;
  }

  /* ==========================================================================
     12. Page Margins
     ========================================================================== */

  @page {
    margin: 2cm;
    size: A4;
  }

  @page :first {
    margin-top: 3cm;
  }

  /* New interactive elements - hide in print */
  .back-to-top,
  .reading-progress,
  .hero-search,
  .article-toc { display: none !important; }

  .callout {
    border: 1px solid #cccccc !important;
    padding: 6pt 12pt;
    page-break-inside: avoid;
  }

  .example-box {
    border: 1px solid #cccccc !important;
    padding: 6pt 12pt;
    page-break-inside: avoid;
  }
}
