/* ════════════════════════════════════════════════════════════════════
   KVCN Design System — ENTRY STYLESHEET
   Kiwanis Voices Club of Nippon
   ────────────────────────────────────────────────────────────────────
   Import THIS one file and you get the whole system:
     <link rel="stylesheet" href="/styles.css">
   It pulls in tokens → type → components, then layers base resets,
   accessibility defaults, and a small layout utility set.
   No build step. Works on static HTML (kvcn.org, learn.kvcn.org) and in
   the Pulse React/Vite app alike.
   ════════════════════════════════════════════════════════════════════ */

@import "tokens.css";
@import "fonts.css";   /* self-hosted @font-face (Oswald + Sora) — CSP font-src 'self' */
@import "type.css";
@import "components.css";

/* ── BASE RESET ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
}
img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
ul, ol { margin: 0; padding: 0; }
:target { scroll-margin-top: calc(var(--topbar-height) + var(--space-4)); }

/* ── ACCESSIBILITY ────────────────────────────────────────────────────── */

/* Visible focus for keyboard users only. Mouse clicks stay clean. */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}
/* Inputs already draw a ring via box-shadow; keep the offset tidy. */
.kv-input:focus-visible, .kv-select:focus-visible, .kv-textarea:focus-visible { outline: none; }

/* Skip link — first focusable element on every page. */
.kv-skip-link {
  position: absolute; left: var(--space-3); top: -100px;
  z-index: var(--z-tooltip);
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-md);
  background: var(--color-primary); color: var(--color-text-on-navy);
  font-weight: var(--weight-semibold); text-decoration: none;
  transition: top var(--dur-fast) var(--ease-standard);
}
.kv-skip-link:focus { top: var(--space-3); }

/* Screen-reader-only utility. */
.kv-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Honor reduced-motion globally. Components also self-disable, but this is
   the safety net: near-zero durations + no transforms/scroll-behaviour. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── LAYOUT UTILITIES ─────────────────────────────────────────────────── */
.kv-container { width: 100%; max-width: var(--content-max); margin-inline: auto; padding-inline: var(--space-5); }
.kv-app-shell { display: flex; min-height: 100vh; }            /* sidebar + content */
.kv-app-shell__main { flex: 1; min-width: 0; }
.kv-page { padding: var(--space-6) 0; }

.kv-stack   { display: flex; flex-direction: column; gap: var(--space-4); }
.kv-stack-2 { display: flex; flex-direction: column; gap: var(--space-2); }
.kv-stack-6 { display: flex; flex-direction: column; gap: var(--space-6); }
.kv-row-x   { display: flex; align-items: center; gap: var(--space-3); }
.kv-row-x--between { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.kv-grid { display: grid; gap: var(--space-4); }
.kv-grid--cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.kv-grid--stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.kv-divider { height: var(--hairline); background: var(--color-border); border: 0; margin: var(--space-4) 0; }
.kv-spacer { flex: 1; }

/* Spacing helpers (use sparingly — prefer stack/grid gap) */
.kv-mt-2 { margin-top: var(--space-2); } .kv-mt-4 { margin-top: var(--space-4); } .kv-mt-6 { margin-top: var(--space-6); }
.kv-mb-2 { margin-bottom: var(--space-2); } .kv-mb-4 { margin-bottom: var(--space-4); }
