/* Print + A4-förhandsvisning — /rapporter/mkvinnor
   Länkas med media="print" normalt; A4-preview sätter media="all".
   Typografi i pt, layout i mm — tweaka här. */

@page {
  size: a4 portrait;
  margin: 22mm 26mm;

  /*
    Logga i page-margin (utanför satsytan).
    Chrome 131+ / CSS Paged Media — inte position:fixed
    (fixed är relativ till satsytan och klipps/flyttas fel).
    Hörnrutan = höger×botten-marginal (26×22 mm); centrerad ≈ 14 mm från kant.
  */
  @bottom-right-corner {
    content: "";
    background-image: url("/logos/intellecta.png");
    background-repeat: no-repeat;
    background-position: right 8mm center;
    background-size: 18mm auto;
    vertical-align: middle;
  }
}

/* DOM-logga bara för A4-skärmpreview; vid riktig utskrift sköter @page */
.report-print-mark {
  display: none !important;
}
@media screen {
  body.is-report-a4-preview .report-print-mark[hidden],
  body.is-report-a4-preview .report-print-mark {
    display: block !important;
    position: absolute;
    right: 18mm;
    bottom: 14mm;
    z-index: 9999;
    width: 18mm;
    color: #111;
    opacity: 0.9;
    pointer-events: none;
  }
  body.is-report-a4-preview .report-print-mark img {
    width: 100%;
    height: auto;
    display: block;
  }
}

html,
body {
  background: #fff !important;
  color: #111 !important;
  font-size: 12pt;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.skip-link,
header.nav,
.view-tabs,
#themeToggle,
#shareLink,
.story-progress,
.nav-filters,
#dashHero,
#liveStatus,
footer.note,
.story-anchor,
.scroll-hint,
.story-exit {
  display: none !important;
}

body.is-report {
  overflow: visible;
}

.wrap {
  padding: 0;
  max-width: none;
}
.story {
  --story-gutter: 0;
  --story-lift: none;
  --story-measure: 82ch;
  --story-head: 75.4ch;
}
.story::before {
  display: none;
}

.story-hero {
  position: relative;
  padding: 0 0 14mm;
  break-after: avoid;
}
.story-hero::after {
  display: none;
}
.story-hero-copy {
  padding-left: 4mm;
}
.story-hero h1 {
  position: relative;
  font-size: 54.6pt;
  line-height: 1.15;
}
.story-hero h1::before {
  content: "";
  position: absolute;
  left: -4mm;
  top: 0.12em;
  bottom: 0.08em;
  width: 2pt;
  background: #e1294a;
}
.story-body > h2.story-h::before {
  width: 8mm;
  height: 2pt;
  margin: 0 0 2.5mm;
}
.story-byline,
.story-dek,
.story-updated {
  font-size: 10pt;
  line-height: 1.4;
}
.story-body {
  font-size: 12pt;
  line-height: 1.45;
}
.story-body > p {
  margin: 0 0 0.75em;
  max-width: var(--story-measure) !important;
}
.story-body > h2.story-h,
.story-body > h3.story-h {
  max-width: var(--story-head) !important;
  margin-left: 0 !important;
  margin-right: auto !important;
}
.story-body > h2.story-h {
  font-size: 21.6pt;
  line-height: 1.2;
  margin-top: 8mm;
  margin-bottom: 3mm;
  break-after: avoid;
  page-break-after: avoid;
}
.story-body > h2.story-h:first-of-type {
  margin-top: 4mm;
}
#jamforelse-med-tankesmedjorna,
#jamforelse-med-partierna,
#vad-som-gick-battre-an-medianen,
#inlagg-som-stack-ut {
  break-before: page;
  page-break-before: always;
  margin-top: 0;
}
.story-body > h3.story-h {
  font-size: 13pt;
  line-height: 1.25;
  margin-top: 6mm;
  break-after: avoid;
}
.report .story-ex-label,
.report .report-posts-title,
.report .report-chart-title {
  max-width: var(--story-measure) !important;
  margin: 6mm 0 2.5mm !important;
  margin-right: auto !important;
  font-size: 11pt !important;
  font-weight: 400 !important;
  line-height: 1.35;
  text-align: left;
}
.report .report-chart-title {
  font-style: italic;
  max-width: 100% !important;
}

.report-chart,
.report-kpis,
.story-chart,
.story-pull,
.post-card,
.chart-row {
  break-inside: avoid;
  page-break-inside: avoid;
}
/* Hela posts-blocket får brytas så rubrik+ingress inte lämnas ensamma */
.report-posts,
.report .story-posts.report-posts {
  break-inside: auto !important;
  page-break-inside: auto !important;
}

.chart-row,
.simple-bar,
.bar-track,
.report-chan-seg,
.report-chan-bar,
.seg,
.report .chart-row.is-lit,
.line-chart,
canvas {
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

/*
 Print-bredd (~A4) träffar ofta max-width:720px i styles.css,
 som bryter chart-row till två rader. Tvinga en rad: label | BAR | värde.
*/
.report .chart-row,
.report .chart-row:not(.chart-row--dual) {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 6pt !important;
  margin-bottom: 3pt;
}
.report .chart-row .party-label {
  width: 52pt !important;
  max-width: 52pt !important;
  flex: 0 0 52pt !important;
  padding-right: 0 !important;
  text-align: right !important;
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 8pt;
  grid-column: unset !important;
  grid-row: unset !important;
}
.report .chart-row .party-full {
  display: none !important;
}
.report .chart-row .party-code {
  display: inline !important;
}
.report .chart-row .bar-track {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  height: 8pt !important;
  grid-column: unset !important;
  grid-row: unset !important;
}
.report .chart-row .simple-bar {
  height: 8pt !important;
}
.report .chart-row .value-label {
  width: auto !important;
  min-width: 36pt;
  flex: 0 0 auto !important;
  white-space: nowrap !important;
  font-size: 8pt;
  text-align: left !important;
  grid-column: unset !important;
  grid-row: unset !important;
}
.report .chart-row .n-hint {
  font-size: 7pt;
}
.report .chart-row.is-dim {
  opacity: 0.7;
}
.report .chart-row.is-lit {
  background: color-mix(in srgb, #000094 12%, #fff) !important;
  box-shadow: inset 2pt 0 0 #000094;
  margin-left: 0;
  margin-right: 0;
  padding: 1.5pt 3pt;
}

.report-chart-frame .line-chart {
  height: 65mm;
}

.report .story-posts,
.report-posts {
  zoom: 0.85;
}
.report .story-posts .post-grid,
.report-posts .post-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 6pt !important;
}
.report .story-posts .post-grid .post-card,
.report .story-posts .post-grid .post-card:nth-child(n),
.report-posts .post-grid .post-card,
.report-posts .post-grid .post-card:nth-child(n) {
  display: flex !important;
}
.report .post-card .meta {
  padding: 5pt 6pt 6pt;
}
.report .post-card .engagement,
.report .post-card .eng-item,
.report .post-card .handle,
.report .post-card .when {
  font-size: 7.5pt;
}
.report .post-card .snippet {
  font-size: 8pt;
  line-height: 1.3;
}
.report .post-card .over-kicker {
  font-size: 8pt;
  font-weight: 400;
}
.report .post-card .party-logo {
  width: 10pt;
  height: 10pt;
}

.report-kpis {
  font-size: 10pt;
}
.report-kpi-head {
  font-size: 8pt;
}
.report-kpi-label {
  font-size: 9pt;
}
.report-kpi-year,
.report-kpi-camp {
  font-size: 12pt;
}
.report-kpi-camp {
  color: #000094;
}
.report-chan-legend {
  font-size: 8pt;
}

a[href]::after {
  content: none;
}

/* Dölj knappen vid riktig utskrift; behåll den i A4-förhandsvisning på skärm */
@media print {
  #reportA4Preview {
    display: none !important;
  }
}
@media screen {
  #reportA4Preview {
    display: inline-flex !important;
  }
}
