/*
  הדפסה חסכונית — שני עמודים פנימיים רציפים בכל דף A4 לרוחב.
  מצב זה מבודד לחלוטין באמצעות html.print-compact.
*/

@page compact-sheet {
  size: A4 landscape;
  margin: 7mm;

  @top-center { content: none; border: 0; }
  @bottom-left { content: none; }
}

#compact-print-root {
  display: none;
}

html.print-compact .compact-measure-host {
  position: fixed;
  top: 0;
  left: -10000px;
  width: 134.4mm;
  height: 194.5mm;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
  font-family: "Noto Sans Hebrew", Arial, sans-serif;
}

html.print-compact .compact-measure-host .compact-section-flow {
  width: 134.4mm;
  height: 194.5mm;
  column-width: 134.4mm;
  column-gap: 0;
  column-fill: auto;
  direction: ltr;
  font-family: "Noto Sans Hebrew", Arial, sans-serif;
  font-size: 8.2pt;
  line-height: 1.55;
}

html.print-compact .compact-measure-host .compact-section-clone {
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  direction: rtl;
  text-align: right;
}

html.print-compact .compact-measure-host .compact-section-kicker {
  gap: 1.5mm;
  margin-bottom: 1mm;
  font-size: 7.5pt;
}

html.print-compact .compact-measure-host .print-section-icon {
  width: 5.5mm;
  height: 5.5mm;
  flex-basis: 5.5mm;
}

html.print-compact .compact-measure-host .compact-section-clone > h2 {
  margin: 0 0 3.5mm;
  font-size: 12.5pt;
  line-height: 1.25;
}

html.print-compact .compact-measure-host .print-post-content {
  font-size: 8.2pt;
  line-height: 1.55;
}

html.print-compact .compact-measure-host .print-post-content img {
  display: block !important;
  height: auto !important;
  max-width: 53mm !important;
  max-height: 53mm !important;
  margin: 3mm auto !important;
  object-fit: contain !important;
  break-inside: avoid-column !important;
}

html.print-compact .compact-measure-host .print-post-content blockquote {
  margin: 3mm 0;
  padding: 2mm 2.5mm;
  border-right-width: 1mm;
  border-radius: 2mm 0 0 2mm;
}

html.print-compact .compact-measure-host .print-post-content th,
html.print-compact .compact-measure-host .print-post-content td {
  padding: 1mm 1.4mm;
}

html.print-compact .compact-measure-host .print-shorts-group {
  margin-top: 3mm;
  break-inside: avoid-column;
}

html.print-compact .compact-measure-host .print-shorts-group h3 {
  margin-bottom: 1mm;
  font-size: 8.3pt;
}

@media print {
  html.print-compact body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff;
  }

  html.print-compact #print-page {
    display: none !important;
  }

  html.print-compact #compact-print-root {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    direction: rtl;
  }

  html.print-compact .compact-sheet {
    page: compact-sheet;
    width: 282mm;
    height: 194.5mm;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 137.5mm 137.5mm;
    column-gap: 7mm;
    overflow: hidden;
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  html.print-compact .compact-sheet + .compact-sheet {
    break-before: page;
    page-break-before: always;
  }

  html.print-compact .compact-sheet-half {
    position: relative;
    width: 137.5mm;
    height: 194.5mm;
    overflow: hidden;
    background: #fff;
  }

  html.print-compact .compact-sheet-right {
    border-left: .3mm solid #d8ddd8;
    padding-left: 3.1mm;
  }

  html.print-compact .compact-sheet-left {
    padding-right: 3.1mm;
  }

  html.print-compact .compact-page-viewport {
    position: relative;
    width: 134.4mm;
    height: 194.5mm;
    overflow: hidden;
    background: #fff;
  }

  html.print-compact .compact-logical-page-number {
    position: absolute;
    right: 0;
    bottom: 1.5mm;
    left: 0;
    z-index: 80;
    display: block !important;
    color: #66716b;
    font-family: "Rubik", "Noto Sans Hebrew", Arial, sans-serif;
    font-size: 7.2pt;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    pointer-events: none;
  }

  html.print-compact .compact-cover-page .compact-logical-page-number,
  html.print-compact .compact-back-cover-page .compact-logical-page-number {
    display: none !important;
  }

  html.print-compact .compact-cover-native {
    width: 134.4mm;
    height: 194.5mm;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fffdf8;
    color: #20342b;
    direction: rtl;
    font-family: "Noto Sans Hebrew", Arial, sans-serif;
  }

  html.print-compact .compact-cover-native-hero {
    position: relative;
    width: 134.4mm;
    height: 112.8mm;
    overflow: hidden;
    flex: 0 0 112.8mm;
    background: #eef4ef;
  }

  html.print-compact .compact-cover-hero-shell {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    width: 210mm !important;
    height: 176mm !important;
    min-height: 176mm !important;
    margin: 0 !important;
    overflow: hidden !important;
    transform: scale(.64);
    transform-origin: top right;
    background: transparent !important;
    break-after: auto !important;
    page-break-after: auto !important;
  }

  html.print-compact .compact-cover-hero-shell .magazine-cover-hero,
  html.print-compact .compact-cover-hero-source {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    width: 210mm !important;
    height: 176mm !important;
    min-height: 176mm !important;
    margin: 0 !important;
    transform: none !important;
    overflow: hidden !important;
  }

  html.print-compact .compact-cover-hero-shell .magazine-cover-overlay {
    padding: 7mm 15mm 0 !important;
  }

  html.print-compact .compact-cover-hero-shell .magazine-cover-badge {
    width: 25mm !important;
    height: 25mm !important;
    padding: 3mm !important;
    border-width: 1.2mm !important;
  }

  html.print-compact .compact-cover-hero-shell .magazine-cover-divider {
    width: 68% !important;
    margin-top: 1mm !important;
  }

  html.print-compact .compact-cover-native-contents {
    flex: 1 1 auto;
    min-height: 0;
    margin: 2.8mm 4.5mm 0;
    padding: 2.6mm 3mm 3mm;
    border: .35mm solid #d8c9ab;
    border-radius: 3mm;
    background: rgba(255,253,248,.99);
    overflow: hidden;
    box-sizing: border-box;
  }

  html.print-compact .compact-cover-native-title {
    margin: 0 0 2mm;
    color: #4f6d5a;
    text-align: center;
    font-family: "Gveret Levin", "Noto Sans Hebrew", Arial, sans-serif;
    font-size: 11pt;
    line-height: 1.15;
    font-weight: 400;
  }

  html.print-compact .compact-cover-native-title::before,
  html.print-compact .compact-cover-native-title::after {
    content: "❧";
    margin: 0 2mm;
    color: #56745c;
    font-size: .8em;
  }

  html.print-compact .compact-cover-native-index {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: .25mm solid #d8ddd8;
    direction: rtl;
  }

  html.print-compact .compact-cover-native-item {
    display: flex !important;
    align-items: center;
    gap: 1.2mm;
    min-width: 0;
    min-height: 8.6mm;
    padding: 1mm 1.2mm;
    border-bottom: .25mm solid #d8ddd8;
    box-sizing: border-box;
    visibility: visible !important;
    opacity: 1 !important;
  }

  html.print-compact .compact-cover-native-item:nth-child(odd) {
    border-left: .25mm dotted #d6cdbd;
  }

  html.print-compact .compact-cover-native-item .magazine-index-icon {
    flex: 0 0 5.2mm;
    width: 5.2mm;
    height: 5.2mm;
    padding: .2mm;
  }

  html.print-compact .compact-cover-native-item .magazine-index-text {
    flex: 1 1 auto;
    min-width: 0;
  }

  html.print-compact .compact-cover-native-item .magazine-index-name {
    overflow: hidden;
    font-size: 6.9pt !important;
    line-height: 1.05;
    font-weight: 700 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html.print-compact .compact-cover-native-item .magazine-index-description {
    display: block !important;
    margin-top: .5mm;
    overflow: hidden;
    font-size: 5.4pt !important;
    line-height: 1.16;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  html.print-compact .compact-cover-native-item .magazine-index-page {
    flex: 0 0 5mm;
    margin-right: auto;
    font-size: 6.3pt !important;
    line-height: 1;
    text-align: left;
  }

  html.print-compact .compact-scaled-full-page {
    position: absolute;
    top: 0;
    right: 0;
    width: 210mm !important;
    height: 297mm !important;
    min-height: 297mm !important;
    max-height: 297mm !important;
    margin: 0 !important;
    transform: scale(.638);
    transform-origin: top right;
    page: compact-sheet !important;
  }

  html.print-compact .compact-scaled-full-page.print-back-cover {
    padding: 22mm 18mm 16mm !important;
    break-before: auto !important;
    page-break-before: auto !important;
  }

  html.print-compact .compact-section-flow {
    position: absolute;
    top: 0;
    left: 0;
    right: auto;
    width: 134.4mm;
    height: 194.5mm;
    overflow: visible;
    column-width: 134.4mm;
    column-gap: 0;
    column-fill: auto;
    direction: ltr;
    font-family: "Noto Sans Hebrew", Arial, sans-serif;
    font-size: 8.2pt;
    line-height: 1.55;
  }

  html.print-compact .compact-section-clone {
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    direction: rtl;
    text-align: right;
  }

  html.print-compact .compact-section-clone .print-section-kicker {
    gap: 1.5mm;
    margin-bottom: 1mm;
    font-size: 7.5pt;
  }

  html.print-compact .compact-section-clone .print-section-icon {
    width: 5.5mm;
    height: 5.5mm;
    flex-basis: 5.5mm;
  }

  html.print-compact .compact-section-clone > h2 {
    margin: 0 0 3.5mm;
    font-size: 12.5pt;
    line-height: 1.25;
  }

  html.print-compact .compact-section-clone .print-post-content {
    font-size: 8.2pt;
    line-height: 1.55;
  }

  html.print-compact .compact-section-clone .print-post-content img {
    display: block !important;
    height: auto !important;
    max-width: 53mm !important;
    max-height: 53mm !important;
    margin: 3mm auto !important;
    object-fit: contain !important;
    break-inside: avoid-column !important;
  }

  html.print-compact .compact-section-clone .print-post-content blockquote {
    margin: 3mm 0;
    padding: 2mm 2.5mm;
    border-right-width: 1mm;
    border-radius: 2mm 0 0 2mm;
  }

  html.print-compact .compact-section-clone .print-post-content th,
  html.print-compact .compact-section-clone .print-post-content td {
    padding: 1mm 1.4mm;
  }

  html.print-compact .compact-section-clone .print-shorts-group {
    margin-top: 3mm;
    break-inside: avoid-column;
  }

  html.print-compact .compact-section-clone .print-shorts-group h3 {
    margin-bottom: 1mm;
    font-size: 8.3pt;
  }
}
