/* ============================================================
 * Power Funding Solutions: brand tokens and PFS additions (Task 6.3b)
 *
 * Loaded after styles.css. styles.css carries Fundivi's sections
 * verbatim; this file only re-points their tokens at the PFS colours
 * from the operator's site (primary #2868c7, navy #102a43, accent
 * #f3a36a) and adds the few classes PFS views use that Fundivi's
 * copied sections do not define. public/brand.contrast.test.ts
 * computes the WCAG ratios of these values.
 * ============================================================ */

:root {
  /* #2868c7 is oklch(52.95% 0.1618 258.62). */
  --brand-h: 258.62;
  --brand: oklch(52.95% 0.1618 258.62);
  --brand-strong: oklch(45% 0.16 258.62);
  --brand-ink: oklch(38% 0.14 258.62);

  /* Navy #102a43 (oklch(27.85% 0.0564 249.75)) is the PFS ink. */
  --ink: oklch(27.85% 0.0564 249.75);
  --pfs-navy: oklch(27.85% 0.0564 249.75);

  /* Accent #f3a36a: decoration only (never text on a light surface). */
  --accent: oklch(78.25% 0.1199 55.45);
  --accent-soft: oklch(95% 0.035 55.45);
  --accent-ink: oklch(42% 0.11 55.45);
}

[data-theme="dark"] {
  --brand: oklch(72% 0.15 258.62);
  --brand-strong: oklch(80% 0.13 258.62);
  --brand-ink: oklch(85% 0.12 258.62);
  --ink: oklch(97% 0.01 258.62);
  --accent: oklch(80% 0.11 55.45);
  --accent-soft: oklch(30% 0.06 55.45);
  --accent-ink: oklch(88% 0.09 55.45);
}

/* ---------- PFS additions (not in Fundivi's copied sections) ---------- */

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* Status pills by tone (statusTone() in src/lib/viewHelpers.ts). */
.status-pill.tone-ok     { background: var(--ok-soft);     color: var(--ok-ink); }
.status-pill.tone-warn   { background: var(--warn-soft);   color: var(--warn-ink); }
.status-pill.tone-danger { background: var(--danger-soft); color: var(--danger-ink); }
.status-pill.tone-info   { background: var(--info-soft);   color: var(--info-ink); }
.status-pill.tone-mute   { background: var(--surface-3);   color: var(--ink-2); }

.text-danger { color: var(--danger-ink); }

/* The labelled-field partial (partials/field.ejs). */
.field { display: flex; flex-direction: column; gap: var(--s1); margin-bottom: var(--s3); }
.field .hint { margin: 0; font-size: var(--fs-sm); color: var(--mute); }
.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: var(--danger); }

/* The empty-state partial (Fundivi's markup from admin/outreach/detail.ejs). */
.empty-state { padding: var(--s8) var(--s5); text-align: center; color: var(--mute); }
.empty-state__icon { color: var(--mute-soft); font-size: 1.5rem; }
.empty-state__title { margin: var(--s2) 0; color: var(--ink); font-weight: 700; }
.empty-state__hint { max-width: 440px; margin: 0 auto var(--s4); color: var(--ink-2); }

.confirm-panel .kv { margin-bottom: var(--s4); }

/* With JavaScript off there is no theme toggle to drive. */
.no-js [data-toggle] { display: none; }

/* The unread-notifications link in both top bars (partials/alerts-link.ejs):
   Fundivi's .topbar-alerts button, used as a link. */
a.topbar-alerts:hover { text-decoration: none; }

/* The date-range partial (partials/date-range.ejs): From and To side by side,
   stacked on a narrow screen. */
.date-range { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: flex-start; margin: 0 0 var(--s3); padding: 0; border: 0; min-width: 0; }
.date-range > legend { padding: 0; margin-bottom: var(--s2); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.date-range .field { flex: 1 1 10rem; min-width: 0; margin-bottom: 0; }
.date-range input[type="date"] { width: 100%; }

/* Report bars under the CSP (no style=""): a percentage is a <meter> with its
   value as visible text beside it; a relative bar is an inline <svg> whose
   <rect width> is an attribute. */
.meter-row { display: flex; align-items: center; gap: var(--s2); min-width: 0; }
.meter-row > .num { flex: none; font-family: var(--font-mono); font-variant-numeric: var(--num); }
meter.meter { flex: 1 1 6rem; min-width: 4rem; height: 0.6rem; }
.svg-bar { display: block; width: 100%; height: 0.75rem; overflow: visible; }
.svg-bar .svg-bar__track { fill: var(--surface-3); }
.svg-bar .svg-bar__fill { fill: var(--brand); }
.svg-bar .svg-bar__fill.is-negative { fill: var(--danger); }

/* A one-time link shown once in a read-only input (6.12 send, 6.22, 6.23):
   copy-link.js adds a Copy button; without JavaScript the text is selectable. */
.copy-link { display: flex; gap: var(--s2); align-items: center; min-width: 0; }
.copy-link input[readonly] { flex: 1 1 auto; min-width: 0; font-family: var(--font-mono); font-size: var(--fs-sm); }
.copy-link .copy-link__status { font-size: var(--fs-sm); color: var(--ok-ink); }

/* The "not available yet" state (partials/feature-unavailable.ejs). */
.feature-unavailable { border: 1px dashed var(--line-strong); border-radius: var(--r-md); }
.csv-link { white-space: nowrap; }
