/* ============================================================
   CURIOUS FOUNDATION (plan item 2A)
   Design tokens + one shared button / card / pill system.
   Loaded on visitor pages after style.css (so new components win)
   and imported first by dashboard-main.css.

   Per-site branding still applies at runtime via v2-config.js —
   these tokens are the defaults underneath it.
   ============================================================ */

/* Inter (variable, latin): the same file the Curious website serves */
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  /* Inter runs wider than Fredoka did; 97% keeps lines wrapping as they did,
     and its taller lowercase still reads larger than Fredoka's */
  size-adjust: 97%;
}

/* Bold titles and names sit slightly tighter, so they stay on one line.
   :where() adds no specificity, so any rule that sets its own spacing wins. */
:where(h1, h2, h3, h4, h5, b, strong, button, .btn, .disc-block-head, .scan-label) {
  letter-spacing: -0.012em;
}

/* Form controls don't inherit the page font by default (browsers use the
   system font for them), so make them follow the guide's font */
input, select, textarea, button { font-family: inherit; }

:root {
  /* Brand */
  --c-navy: #18236e;
  --c-navy-deep: #121a54;
  --c-orange: #d35c18;
  --c-orange-deep: #b84a0b;
  --c-sea: #0e6e8c;

  /* Semantic */
  --c-good: #1e7a45;
  --c-good-bg: #e3f1e8;
  --c-warn: #8f6400;
  --c-warn-bg: #f7efd8;
  --c-crit: #b3261e;
  --c-crit-bg: #f9e9e7;
  --c-info: #2b5fa3;
  --c-info-bg: #e7eef8;

  /* Neutrals (hue-biased toward the navy) */
  --c-ink: #22284b;
  --c-muted: #5f6689;
  --c-faint: #9aa1c4;
  --c-line: #e3e6f0;
  --c-panel: #ffffff;
  --c-wash: #f4f5f9;

  /* Type */
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Shape & depth */
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 16px;
  --radius-pill: 999px;
  --shadow-1: 0 1px 3px rgba(24, 35, 110, 0.10), 0 2px 8px rgba(24, 35, 110, 0.06);
  --shadow-2: 0 4px 14px rgba(24, 35, 110, 0.16);

  /* Spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
}

/* ---------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.3;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-m);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.98); }

.btn:focus-visible {
  outline: 3px solid var(--c-info);
  outline-offset: 2px;
}

/* !important: the runtime theme engine paints every <a> and <button> with
   its own colours — these components must keep their contrast regardless */
.btn-primary {
  background: var(--c-navy) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: var(--shadow-1);
}
.btn-primary:hover { background: var(--c-navy-deep) !important; }

.btn-ghost {
  background: #fff !important;
  color: var(--c-navy) !important;
  border: 1.5px solid var(--c-line) !important;
}
.btn-ghost:hover { background: var(--c-wash) !important; }

.btn-danger {
  background: #fff !important;
  color: var(--c-crit) !important;
  border: 1.5px solid #ecc7c7 !important;
}
.btn-danger:hover { background: var(--c-crit-bg) !important; }

.btn-block { display: flex; width: 100%; }
.btn-small { padding: 6px 14px; font-size: 0.88rem; }

/* ----------------------------------------------------- pills & chips */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--c-wash);
  color: var(--c-navy);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 650;
}

.pill-good { background: var(--c-good-bg); color: var(--c-good); }
.pill-warn { background: var(--c-warn-bg); color: var(--c-warn); }
.pill-crit { background: var(--c-crit-bg); color: var(--c-crit); }
.pill-info { background: var(--c-info-bg); color: var(--c-info); }
.pill-accent { background: var(--c-orange); color: #fff; }

/* -------------------------------------------------------- panels */

.panel {
  background: var(--c-panel);
  color: var(--c-ink);
  border-radius: var(--radius-l);
  padding: var(--sp-4) var(--sp-5);
  box-shadow: var(--shadow-1);
}

/* ------------------------------------------------------ skeletons (2E) */

.skeleton {
  border-radius: var(--radius-s);
  background: linear-gradient(90deg, #e6e9f2 25%, #f3f5fa 40%, #e6e9f2 55%);
  background-size: 300% 100%;
  animation: skeleton-shimmer 1.5s linear infinite;
}

@keyframes skeleton-shimmer {
  to { background-position: -300% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
  .btn { transition: none; }
}

.skeleton-card {
  background: var(--c-panel);
  border-radius: var(--radius-m);
  padding: var(--sp-3);
  box-shadow: var(--shadow-1);
  margin-bottom: var(--sp-4);
}

/* ---------------------------------------------------- empty states (2E) */

.empty-state {
  background: var(--c-panel);
  color: var(--c-ink);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-1);
  padding: var(--sp-6) var(--sp-5);
  text-align: center;
  max-width: 420px;
  margin: var(--sp-6) auto;
}

.empty-state .empty-emoji {
  font-size: 2.6rem;
  display: block;
  margin-bottom: var(--sp-3);
}

.empty-state h3 {
  font-family: var(--font-display);
  color: var(--c-ink);
  margin: 0 0 var(--sp-2);
}

.empty-state p {
  color: var(--c-muted);
  font-size: 0.95rem;
  margin: 0 0 var(--sp-4);
}

.empty-state .empty-actions {
  display: flex;
  gap: var(--sp-3);
  justify-content: center;
  flex-wrap: wrap;
}
