/* LegalRecordPrintView — human-readable, printable copy of a B3 signed legal-export Bundle.
   Screen: laid out as a simple document (cover sheet + integrity block + section charts).
   Print (@media print): hides everything else on the page (app chrome, dialog controls, the
   `no-print` action buttons) so Ctrl+P / Save-as-PDF produces a clean, court-appropriate printout
   of just this document. */

.ahr-legal-record-print {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px;
  color: hsl(var(--foreground));
}

.ahr-legal-record-print__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 16px;
}

.ahr-legal-record-print__cover {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid hsl(var(--border));
}

.ahr-legal-record-print__title {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 700;
}

.ahr-legal-record-print__meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 24px;
  margin: 0;
}

.ahr-legal-record-print__meta dt {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.ahr-legal-record-print__meta dd {
  margin: 2px 0 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.ahr-legal-record-print__integrity {
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--ak-card-radius);
  background: hsl(var(--muted));
  /* Hashes and references are unbroken runs; at phone width they pushed the view sideways. */
  overflow-wrap: anywhere;
}

.ahr-legal-record-print__integrity h2 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
}

.ahr-legal-record-print__verified {
  margin: 0 0 10px;
  font-weight: 700;
  color: var(--success);
}

.ahr-legal-record-print__narrative {
  margin: 12px 0 0;
  font-size: 13px;
  font-style: italic;
  color: hsl(var(--muted-foreground));
}

.ahr-legal-record-print__verify-pointer,
.ahr-legal-record-print__authoritative {
  margin: 10px 0 0;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

.ahr-legal-record-print__authoritative {
  font-weight: 600;
}

.ahr-legal-record-print__empty {
  margin: 0;
  font-size: 13px;
  color: hsl(var(--muted-foreground));
}

.ahr-legal-record-print__error {
  border: 1px solid var(--danger);
  background: var(--red-soft);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
}

.ahr-legal-record-print section > h2 {
  margin: 24px 0 10px;
  font-size: 16px;
  font-weight: 700;
}

/* The WordPress admin bar stays above every page, so a full-screen overlay starts below it or its
   Close button sits under the bar and cannot be clicked. The height variable is WordPress's own. */
@media screen {
  body.admin-bar [data-akashic-legal-print-overlay] {
    top: var(--wp-admin--admin-bar--height, 32px);
  }
}

@media print {
  /* A fixed, scrolling overlay prints one screen of the record, repeated on every page. */
  [data-akashic-legal-print-overlay] {
    position: static;
    overflow: visible;
  }

  body * {
    visibility: hidden;
  }

  .ahr-legal-record-print,
  .ahr-legal-record-print * {
    visibility: visible;
  }

  .ahr-legal-record-print {
    position: absolute;
    inset: 0;
    max-width: none;
    padding: 0;
  }

  .no-print {
    display: none !important;
  }
}
