/**
 * Clean A4 output for single articles.
 * This stylesheet is enqueued with media="print" only.
 */
@page {
  size: A4 portrait;
  margin: 16mm 15mm 18mm;
}

@media print {
  html,
  body.single-post {
    direction: rtl;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #fff !important;
    color: #172b3a !important;
    font-family: "IRANSansX", Tahoma, sans-serif !important;
    font-size: 10.5pt !important;
    line-height: 1.95 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.single-post > :not(main):not(script):not(style),
  body.single-post .site-header,
  body.single-post header#header,
  body.single-post .site-footer,
  body.single-post .home-announcement,
  body.single-post .campaign-bar,
  body.single-post .mobile-bottom-nav,
  body.single-post .bottom-nav,
  body.single-post .support-widget,
  body.single-post [class*="support-widget"],
  body.single-post [class*="taxyar"],
  body.single-post [id*="taxyar"],
  body.single-post [data-support-proxy],
  body.single-post .reader-tools,
  body.single-post .article-aside,
  body.single-post .mrtax-article-newsletter,
  body.single-post #next-step,
  body.single-post .article-editorial-note-wrap,
  body.single-post #mrtax-comments,
  body.single-post .article-favorite-action,
  body.single-post .mrtax-inline-lead-form-wrap,
  body.single-post iframe,
  body.single-post video,
  body.single-post audio,
  body.single-post .mrtax-legacy-video,
  body.single-post .wp-block-buttons,
  body.single-post .article-promo,
  body.single-post .no-print {
    display: none !important;
  }

  body.single-post main#top,
  body.single-post .reader-section,
  body.single-post .reader-section > div,
  body.single-post .reader-layout,
  body.single-post #article-content {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  body.single-post .mesh {
    margin: 0 0 9mm !important;
    padding: 0 0 6mm !important;
    overflow: visible !important;
    border-bottom: 1.5pt solid #0167ad !important;
    background: #fff !important;
    color: #172b3a !important;
  }

  body.single-post .mesh > div:first-child {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.single-post .mesh > div:last-child,
  body.single-post .mesh nav,
  body.single-post .article-hero-media,
  body.single-post .mesh .inline-flex.bg-white\/10,
  body.single-post .mesh .article-avatar,
  body.single-post .mesh .hidden.sm\:block {
    display: none !important;
  }

  body.single-post .mesh .grid,
  body.single-post .mesh .lg\:col-span-7 {
    display: block !important;
    width: 100% !important;
    text-align: right !important;
  }

  body.single-post .article-hero-title {
    margin: 0 0 4mm !important;
    color: #04223b !important;
    font-family: "Morabba", "IRANSansX", Tahoma, sans-serif !important;
    font-size: 22pt !important;
    font-weight: 800 !important;
    line-height: 1.55 !important;
  }

  body.single-post .mesh .flex.flex-wrap {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 2mm 6mm !important;
    color: #526777 !important;
    font-size: 8.5pt !important;
  }

  body.single-post .mesh .flex.flex-wrap > * {
    color: #526777 !important;
  }

  body.single-post #article-content {
    color: #172b3a !important;
    font-size: 10.5pt !important;
    line-height: 1.95 !important;
  }

  body.single-post #article-content h2,
  body.single-post #article-content h3,
  body.single-post #article-content h4,
  body.single-post #article-content h5,
  body.single-post #article-content h6 {
    break-after: avoid-page;
    page-break-after: avoid;
    color: #04223b !important;
    font-family: "Morabba", "IRANSansX", Tahoma, sans-serif !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.single-post #article-content h2 {
    margin: 8mm 0 3mm !important;
    padding: 0 3mm 0 0 !important;
    border: 0 !important;
    border-right: 3pt solid #0167ad !important;
    border-radius: 0 !important;
    font-size: 15.5pt !important;
    line-height: 1.65 !important;
  }

  body.single-post #article-content h3 {
    margin: 6mm 0 2mm !important;
    padding-right: 2.5mm !important;
    border-right: 2pt solid #fba830 !important;
    font-size: 12.5pt !important;
  }

  body.single-post #article-content p,
  body.single-post #article-content li {
    orphans: 3;
    widows: 3;
  }

  body.single-post #article-content p {
    margin: 0 0 3.2mm !important;
    text-align: justify;
  }

  body.single-post #article-content a {
    color: #015f9e !important;
    font-weight: 700 !important;
    text-decoration: underline !important;
    text-decoration-color: #8dbbd8 !important;
    text-underline-offset: 1.5pt !important;
  }

  /* Keep download links as readable anchor text. Browsers normally append
     long URLs in print styles; suppress every generated URL suffix here. */
  body.single-post #article-content a::after {
    content: none !important;
  }

  body.single-post #article-content ul,
  body.single-post #article-content ol,
  body.single-post #article-content blockquote,
  body.single-post #article-content .article-summary,
  body.single-post #article-content .wp-block-group.has-background,
  body.single-post #article-content p.has-background {
    break-inside: avoid-page;
    page-break-inside: avoid;
    margin: 4mm 0 !important;
    padding: 4mm 7mm 4mm 4mm !important;
    border: 1pt solid #d8e4ec !important;
    border-right: 3pt solid #0167ad !important;
    border-radius: 2mm !important;
    background: #f7fafc !important;
    box-shadow: none !important;
  }

  body.single-post #article-content blockquote {
    border-right-color: #fba830 !important;
    background: #fff9ed !important;
  }

  body.single-post #article-content figure,
  body.single-post #article-content img,
  body.single-post #article-content table,
  body.single-post #article-content pre,
  body.single-post #article-content details {
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  body.single-post #article-content figure {
    margin: 5mm auto !important;
  }

  body.single-post #article-content img {
    max-width: 100% !important;
    max-height: 120mm !important;
    width: auto !important;
    height: auto !important;
    margin: 0 auto !important;
    border-radius: 0 !important;
  }

  body.single-post #article-content figcaption {
    margin-top: 2mm !important;
    color: #607483 !important;
    font-size: 8pt !important;
  }

  body.single-post #article-content .wp-block-table {
    overflow: visible !important;
  }

  body.single-post #article-content table {
    min-width: 0 !important;
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 8pt !important;
  }

  body.single-post #article-content th,
  body.single-post #article-content td {
    padding: 2mm !important;
    border: 0.5pt solid #afbec9 !important;
    background: #fff !important;
    color: #172b3a !important;
  }

  body.single-post #article-content th {
    background: #eaf4fb !important;
    font-weight: 800 !important;
  }

  body.single-post #article-content details > * {
    display: block !important;
  }

  body.single-post #article-content details {
    padding: 3mm 0 !important;
    border: 0 !important;
    border-bottom: 0.5pt solid #d8e4ec !important;
    border-radius: 0 !important;
    background: #fff !important;
  }

  body.single-post #article-content summary::before {
    display: none !important;
  }

  body.single-post #article-content pre,
  body.single-post #article-content code {
    white-space: pre-wrap !important;
    overflow-wrap: anywhere !important;
    background: #f1f4f6 !important;
    color: #172b3a !important;
  }
}
