/*
 * Global styles. Tokens live in app/assets/tailwind/application.css (@theme).
 * This file holds typographic feature flags and print rules.
 */

/* Geist Sans: enable stylistic alternates and slashed zero for clinical clarity. */
:root {
  font-feature-settings: "ss01", "cv11";
  --prescription-pad-width: 139.7mm;  /* 5.5in */
  --prescription-pad-height: 215.9mm; /* 8.5in */
  --prescription-pad-padding: 7mm;
}

/* Tabular numerals for any column where a clinician compares numbers. */
.tabular,
.font-mono,
table tbody td,
.prescription-sheet {
  font-variant-numeric: tabular-nums;
}

/* Keep the printable prescription dimensions in plain CSS instead of relying on Tailwind arbitrary mm classes. */
.prescription-sheet {
  box-sizing: border-box;
  width: var(--prescription-pad-width);
  min-height: var(--prescription-pad-height);
}

/* Print sheet: standard prescription pad / half-letter size (5.5in × 8.5in). */
@page {
  size: 139.7mm 215.9mm;
  margin: 0;
}

@media print {
  html,
  body {
    background: white !important;
    color: #0b1220 !important;
    margin: 0 !important;
    width: var(--prescription-pad-width);
    min-height: var(--prescription-pad-height);
  }

  .no-print,
  .no-print * {
    display: none !important;
  }

  .prescription-sheet {
    box-sizing: border-box;
    width: var(--prescription-pad-width) !important;
    min-height: var(--prescription-pad-height) !important;
    margin: 0 !important;
    padding: var(--prescription-pad-padding) !important;
    box-shadow: none !important;
    border: 0 !important;
  }

  /* Avoid splitting an Rx item across pages. */
  .rx-item {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
