/* ─────────────────────────────────────────────────────────────────
   Chabad CRM design system
   Lifted from ~/Desktop/chabad-website/src/styles/global.css so the
   CRM and the public site read as one publication.
   ───────────────────────────────────────────────────────────────── */

:root {
  /* Duke royal blue */
  --duke: #00539B;
  --duke-dark: #002F6C;
  --duke-deep: #001838;

  /* Warm neutrals */
  --paper: #F7F2E7;
  --paper-warm: #EFE7D2;
  --surface: #FDFBF5;
  --rule: #E5DBC2;
  --rule-strong: #D4C5A8;

  /* Gold accent */
  --gold: #B8893B;
  --gold-soft: #D9B66E;

  /* Ink scale */
  --ink: #14181F;
  --ink-soft: #4E5560;
  --ink-mute: #8A8F99;

  /* Status — desaturated to live on cream */
  --ok: #4A7C59;
  --warn: #C08440;
  --alert: #9C5A4D;

  /* Type stacks */
  --font-display: "Cormorant Garamond", "Iowan Old Style", "Apple Garamond", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-hebrew: "Frank Ruhl Libre", "Times New Roman", serif;

  /* Soft shadows — barely there */
  --shadow-soft: 0 1px 2px rgb(20 24 31 / 0.04);
}

/* ───────────── Base ───────────── */

html {
  font-family: var(--font-body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background-color: var(--paper);
  /* Paper grain — barely visible, kills the "flat digital" feel */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.55  0 0 0 0 0.42  0 0 0 0 0.20  0 0 0 0.03 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  font-feature-settings: "kern", "liga", "calt";
}

/* ───────────── Focus / selection ───────────── */

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--duke);
  color: white;
}

/* ───────────── Typography utilities ───────────── */

.display {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.05;
  color: var(--ink);
}

.display-italic {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0;
}

/* Oversize Cormorant numerals — stat tiles, lifetime giving */
.display-num {
  font-family: var(--font-display);
  font-weight: 400;
  font-variant-numeric: lining-nums;
  letter-spacing: -0.02em;
  line-height: 0.85;
  color: var(--ink);
}

/* Eyebrow: small-caps kicker above headlines */
.eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.6875rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--duke);
}

.eyebrow-quiet {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.6875rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.eyebrow-light {
  color: var(--gold-soft);
}

/* Lead paragraph */
.lead {
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
}

/* Drop cap for editorial prose (bios) */
.dropcap::first-letter {
  font-family: var(--font-display);
  font-weight: 500;
  float: left;
  font-size: 3.5rem;
  line-height: 0.85;
  padding: 0.3rem 0.5rem 0 0;
  color: var(--duke-dark);
}

/* Hebrew run-in. Use on <span class="heb">…</span>. */
.heb {
  font-family: var(--font-hebrew);
  font-weight: 500;
  direction: rtl;
  unicode-bidi: isolate;
}

/* ───────────── Rules & decorative ───────────── */

.rule-gold {
  display: inline-block;
  width: 56px;
  height: 1px;
  background: var(--gold);
  vertical-align: middle;
}

.rule-gold-block {
  display: block;
  width: 56px;
  height: 1px;
  background: var(--gold);
  margin: 1rem 0;
}

.rule-gold-vertical {
  display: inline-block;
  width: 1px;
  height: 22px;
  background: var(--gold);
  vertical-align: middle;
  margin: 0 0.85rem;
}

.rule-hairline {
  border-color: var(--rule);
}

/* ───────────── Buttons ───────────── */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  background: var(--duke);
  color: var(--paper);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.005em;
  border: 1px solid var(--duke);
  border-radius: 1px;
  transition: background 0.18s, transform 0.18s;
  text-decoration: none;
}
.btn-primary:hover {
  background: var(--duke-dark);
  border-color: var(--duke-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.15rem;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  border: 1px solid var(--ink);
  border-radius: 1px;
  transition: background 0.18s, color 0.18s;
  text-decoration: none;
}
.btn-secondary:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn-ghost {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--duke);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.btn-ghost:hover { color: var(--duke-dark); text-decoration: underline; text-underline-offset: 3px; }

/* Display-serif button — used for "Record gift" submit */
.btn-display {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  background: var(--duke);
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.25rem;
  letter-spacing: 0;
  border: 1px solid var(--duke);
  border-radius: 1px;
  transition: background 0.18s;
  text-decoration: none;
}
.btn-display:hover { background: var(--duke-dark); }

/* ───────────── Chips (filter pills) ───────────── */

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: 100px;
  text-decoration: none;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.chip:hover {
  color: var(--ink);
  border-color: var(--ink);
}
.chip-active {
  background: var(--duke);
  color: var(--paper);
  border-color: var(--duke);
}
.chip-active:hover {
  color: var(--paper);
  background: var(--duke-dark);
  border-color: var(--duke-dark);
}

/* ───────────── Badges (status) ───────────── */

.badge-ok, .badge-warn, .badge-alert, .badge-info {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.55rem;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 100px;
  border: 1px solid currentColor;
}
.badge-ok { color: var(--ok); }
.badge-warn { color: var(--warn); }
.badge-alert { color: var(--alert); }
.badge-info { color: var(--duke); }

/* Status dot — for the live "outbox" pill in the header */
.status-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ok);
}
.status-dot-warn { background: var(--warn); }
.status-dot-alert { background: var(--alert); }

/* ───────────── Fields (forms) ───────────── */

.field {
  display: block;
  margin-bottom: 1.25rem;
}
.field-label {
  display: block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
}
.field-input,
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="date"],
.field input[type="number"],
.field input[type="search"],
.field select,
.field textarea {
  width: 100%;
  padding: 0.55rem 0.1rem;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule-strong);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  border-radius: 0;
  outline: none;
  transition: border-color 0.18s;
}
.field-input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-bottom-color: var(--duke);
}

/* ───────────── Ledger table ───────────── */

.ledger-table {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  border-collapse: collapse;
}
.ledger-table thead th {
  text-align: left;
  padding: 0.6rem 0;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--rule-strong);
}
.ledger-table tbody td {
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.ledger-table tbody tr:hover {
  background-color: rgb(184 137 59 / 0.04);
}
.ledger-table .num {
  font-variant-numeric: oldstyle-nums tabular-nums;
}

/* Directory row — used for the people list. Hover reveals actions. */
.directory-row .row-actions {
  opacity: 0;
  transition: opacity 0.15s;
}
.directory-row:hover .row-actions,
.directory-row:focus-within .row-actions {
  opacity: 1;
}

/* ───────────── Link micro-interactions ───────────── */

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--duke);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  position: relative;
  transition: gap 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.link-arrow::after {
  content: "→";
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.link-arrow:hover { gap: 0.6rem; }
.link-arrow:hover::after { transform: translateX(2px); }

/* ───────────── Motion: staggered reveal ───────────── */

@keyframes reveal-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  animation: reveal-up 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.reveal-1 { animation-delay: 0.05s; }
.reveal-2 { animation-delay: 0.20s; }
.reveal-3 { animation-delay: 0.35s; }
.reveal-4 { animation-delay: 0.50s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; }
  .btn-primary:hover { transform: none; }
}

/* ───────────── Card-less surfaces ───────────── */

.surface {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 1.25rem 1.5rem;
}

.surface-quiet {
  background: transparent;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 1rem 0;
}

/* ───────────── Tailwind-color overrides for the existing pages ─────
   The Phase 2 templates use stock Tailwind palette names. While
   they're being incrementally redesigned in 2.5B/C, these utility
   overrides keep things readable on the new cream background. */

.bg-slate-50  { background-color: var(--paper) !important; }
.bg-slate-100 { background-color: var(--paper-warm) !important; }
.bg-white     { background-color: var(--surface) !important; }
.text-slate-900 { color: var(--ink) !important; }
.text-slate-700 { color: var(--ink) !important; }
.text-slate-600 { color: var(--ink-soft) !important; }
.text-slate-500 { color: var(--ink-soft) !important; }
.text-slate-400 { color: var(--ink-mute) !important; }
.text-indigo-700 { color: var(--duke) !important; }
.border-slate-200 { border-color: var(--rule) !important; }
.border-slate-300 { border-color: var(--rule-strong) !important; }
.bg-indigo-600 { background-color: var(--duke) !important; }
.hover\:bg-indigo-700:hover { background-color: var(--duke-dark) !important; }
