/* Base layer: type, motion and print rules that apply to every page. Loaded after tokens.css and before site.css.
   Components are not styled here; they come in phase 2 of the UI overhaul. */

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-size: var(--text-md);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* headings and the big numbers use the brand display face (the template's own font rules are overridden by the !important in site.css,
   so these need it too); numbers line up in columns */
h1, h2, h3, h4, .hero-title, .card-title, .kpi-value, .stat-value, .error-card h1 {
  font-family: var(--font-display) !important;
  letter-spacing: -.015em;
}
.kpi-value, .stat-value, .num, td.num, .hbar-value, .kpi-delta { font-variant-numeric: tabular-nums; }

/* Arabic text (campaign names, SMS texts, banners): more line height so the diacritics do not collide, and never letter-spaced (it breaks the joins) */
:lang(ar), [dir="rtl"], .ar { line-height: 1.6; letter-spacing: 0 !important; }

/* users who ask for less motion get none, whatever a component animates */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* printing a report page (or saving it as PDF): content only, on white, cards not split across pages */
@media print {
  .d-sidebar, .d-topbar, .d-footer, .hamburger, .range-bar a.btn, .range-bar button, .hero-actions, .skip-link, .flash { display: none !important; }
  .shell, .main { display: block !important; margin: 0 !important; padding: 0 !important; }
  body { background: #fff !important; color: #000 !important; }
  .content { padding: 0 !important; max-width: none !important; }
  .card, .kpi-card { box-shadow: none !important; border: 1px solid #ccc !important; break-inside: avoid; background: #fff !important; }
  a { color: inherit !important; text-decoration: none !important; }
}
