/* Print-only overrides */
@media print {
  /* Put a page break AFTER the bordered map area */
  .mapSection {
    break-after: page; /* modern */
    page-break-after: always; /* legacy fallback */
  }

  /* In the dataset area within the mapSection, keep ONLY the legend inner */
  .mapSection
    [class*="tjs-legend__legend"]
    > *:not([class*="tjs-legend__legend__inner"]) {
    display: none !important; /* hide headers, chrome, etc. */
  }
  .mapSection [class*="tjs-legend__legend__inner"] {
    display: block !important; /* ensure it prints */
  }
  .mapSection [class*="tjs-legend__legend__inner"] * {
    display: initial !important; /* restore normal display for its children */
  }

  /* Ensure the source/links block starts on the next page */
  .PrintView__source,
  [class*="PrintView__source"] {
    break-before: page; /* modern */
    page-break-before: always; /* fallback */
  }
  /* Avoid ugly URL wrapping */
  .PrintView__source a {
    word-break: break-all; /* or: overflow-wrap: anywhere; */
  }

  /* Optional: keep big blocks from splitting awkwardly */
  .textSection,
  .legendSection {
    break-inside: avoid;
  }

  /* Default page size/margins */
  @page {
    size: A3 portrait; /* or landscape */
    margin: 12mm;
  }
}
