/* SITE_WIDE_PRINT_CONTRACT: browser-native print/PDF for the authorized page. */
.print-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: -1rem 0 1rem;
}
.print-action {
  padding: .2rem .1rem;
  border: 0;
  color: var(--theme-muted);
  background: transparent;
  font-size: .82rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: .18em;
  cursor: pointer;
}
.print-action:hover,
.print-action:focus-visible { color: var(--theme-accent); }

@media print {
  @page { margin: .62in .62in .72in; }

  html, body { background: #fff !important; }
  body { color: #111 !important; font-size: 10.5pt; }
  .skip-link,
  .topbar,
  .sidebar,
  .print-toolbar,
  .screen-only,
  button,
  form,
  select,
  input,
  textarea,
  .header-actions,
  .campaign-hero-actions,
  .card-bottom-controls,
  .map-note-actions,
  [data-screen-only] { display: none !important; }
  .app-shell { display: block; min-height: 0; }
  .main-content { max-width: none; padding: 0; }
  .messages { display: none; }
  a { color: inherit; text-decoration: none; }
  h1, h2, h3, h4 { color: #111 !important; break-after: avoid; }
  h1 { font-size: 25pt; }
  h2 { font-size: 16pt; }
  h3 { font-size: 12.5pt; }
  p, li, dd { orphans: 3; widows: 3; }
  article, section, figure, .panel, .detail-panel, .gm-panel,
  .reference-group, .record-card, .briefing-card, .prep-card,
  .session-opening, .session-goals, .map-note-card {
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none !important;
  }
  .page-header { align-items: flex-start; margin-bottom: 1.25rem; }
  .page-header, .campaign-hero { display: block; }
  .panel, .detail-panel, .gm-panel, .reference-group { background: #fff !important; }
  .record-prose, .content-prose, .preview-rich { overflow-wrap: anywhere; }
  table { max-width: 100%; border-collapse: collapse; }
  th, td { break-inside: avoid; }
  img { max-width: 100% !important; height: auto; }

  /* Hidden note cards are hidden only for the interactive map drawer. The
     server has already filtered this list for the current audience. */
  [data-map-note-card][hidden] { display: block !important; }
  .map-workspace { display: block; }
  .map-surface {
    page: intaverna-map;
    break-after: page;
    page-break-after: always;
    min-height: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
  }
  .map-surface > img { width: 100%; }
  .map-note-drawer { position: static; min-height: 0; padding: 0; border: 0; }
  .map-note-card { margin: 1rem 0; padding: .7rem 0; border-top: 1px solid #aaa; }
  .map-pin, .fog-safe-overlay, .map-scale-grid, .fog-editor-layer { display: none !important; }
}

@page intaverna-map { size: landscape; margin: .4in; }
