/* Southwest Valley Connect — visual tokens.
   Colors swapped from the placeholder set to actual district brand on 2026-05-26
   per the logo asset drop from LaToya. District palette = navy + crimson red.
   See docs/decisions/0002-visual-shell.md + docs/logo-inventory.md. */

:root {
  /* Brand — district navy + crimson, pulled from the horizontal district wordmark. */
  --brand-primary: #1F2A5C;
  --brand-primary-700: #2A3878;
  --brand-primary-900: #14193D;
  --brand-primary-50: #ECEEF6;
  --brand-accent: #C32232;
  --brand-accent-600: #A41C2A;

  /* Neutrals */
  --ink: #0f172a;
  --ink-muted: #475569;
  --surface: #ffffff;
  --surface-muted: #f4f6fb;
  --border: #e2e8f0;
  --danger: #b91c1c;
  --success: #15803d;
}

html, body {
  background: var(--surface-muted);
  color: var(--ink);
  font-family: var(--font-sans, 'Inter'), system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  margin: 0;
  min-height: 100%;
}

h1, h2, h3, .display-serif {
  font-family: var(--font-serif, 'Source Serif 4'), Georgia, serif;
  color: var(--brand-primary);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Gold/accent underline under section heads — recognizable from many institutional designs. */
.section-rule {
  display: inline-block;
  border-bottom: 3px solid var(--brand-accent);
  padding-bottom: 0.25rem;
}

/* Card surface used throughout the app. */
.surface-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
}

/* Subtle hero backdrop — used only on public/marketing surfaces, never on dense data screens. */
.hero-backdrop {
  background:
    radial-gradient(circle at 20% 20%, rgba(195, 34, 50, 0.08), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(31, 42, 92, 0.10), transparent 45%),
    linear-gradient(180deg, var(--surface) 0%, var(--surface-muted) 100%);
}

/* Buttons (composable with Tailwind utility classes). */
.btn-primary {
  background: var(--brand-primary);
  color: #fff;
  font-weight: 500;
  padding: 0.65rem 1.1rem;
  border-radius: 0.5rem;
  border: 0;
  cursor: pointer;
  transition: background 120ms ease;
}
.btn-primary:hover { background: var(--brand-primary-700); }
.btn-primary:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }

.btn-accent {
  /* White text on crimson reads cleanly; the previous navy-on-crimson failed
     contrast (LaToya feedback 2026-05-26). */
  background: var(--brand-accent);
  color: #fff;
  font-weight: 600;
  padding: 0.75rem 1.4rem;
  border-radius: 0.5rem;
  border: 0;
  cursor: pointer;
  transition: background 120ms ease;
}
.btn-accent:hover { background: var(--brand-accent-600); color: #fff; }

/* Compact variant -- same color treatment as btn-accent but with nav-appropriate
   padding so a crimson CTA doesn't visually dwarf the surrounding "Partner sign in"
   / "Staff sign in" links in the 64px header band. */
.btn-accent-sm {
  background: var(--brand-accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.375rem 0.85rem;
  border-radius: 0.4rem;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  transition: background 120ms ease;
}
.btn-accent-sm:hover { background: var(--brand-accent-600); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--brand-primary);
  border: 1px solid var(--border);
  padding: 0.55rem 0.9rem;
  border-radius: 0.5rem;
  font-weight: 500;
}
.btn-ghost:hover { background: var(--brand-primary-50); }

/* Nav links */
.nav-link {
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  transition: background 120ms;
}
.nav-link:hover { color: var(--brand-primary); background: var(--brand-primary-50); }
.nav-link.active { color: var(--brand-primary); background: var(--brand-primary-50); }

/* Chips */
.chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--brand-primary-50);
  color: var(--brand-primary);
}
/* WCAG 2.1 AA: crimson on light-crimson failed 4.5:1 contrast. Use solid
   crimson background with white text (5.2:1, comfortable AA). */
.chip-accent { background: var(--brand-accent); color: #ffffff; }

/* Button chips (used for status quick-actions on org profile).
   Override default button styles so they look identical to text chips. */
button.chip {
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
button.chip:hover {
  background: var(--brand-primary);
  color: #fff;
}

/* FAB — staff mobile quick-add (placeholder; activates when interactions feature ships). */
.fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  background: var(--brand-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  text-decoration: none;
}
.fab:hover { background: var(--brand-accent-600); }

/* Site footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 1.5rem 0;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

/* Visually-hidden utility for accessibility. */
.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;
}

/* Skip-to-content link. Hidden until focused so keyboard users can jump
   past the header nav. Visible-on-focus pattern. */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--brand-primary);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 0.375rem;
  font-weight: 600;
  text-decoration: none;
  z-index: 100;
  transition: top 120ms ease;
}
.skip-link:focus { top: 1rem; outline: 2px solid var(--brand-accent); outline-offset: 2px; }

/* Make focus rings consistent and visible across all interactive elements. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
  border-radius: 0.375rem;
}

/* Surface-card links: lighten background + bring border into focus too. */
.surface-card:focus-visible,
a.surface-card:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

/* Native <dialog> polish (landing-page QR modal). */
dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
}
dialog {
  background: var(--surface, #ffffff);
  color: inherit;
}

/* Page titles always start their own line, left-aligned (2026-08-13: chips
   are inline-flex and titles were inline-block, so an eyebrow chip or back
   link before an <h1> shared its line and nudged the title right).
   fit-content keeps the section-rule underline hugging the text like
   inline-block did; beats Tailwind's .inline-block on specificity. */
h1.section-rule {
  display: block;
  width: fit-content;
}
/* Deliberately centered pages (confirmations etc.) keep their centering. */
.text-center h1.section-rule {
  margin-left: auto;
  margin-right: auto;
}

/* Links inside a block of text carry a permanent underline, so color is never
   the only thing distinguishing them from the prose around them (WCAG 2.1
   SC 1.4.1 Use of Color). The brand link color (#1f2a5c) measures 1.79:1
   against body text (#475569) -- far below the 3:1 that would let color alone
   carry the difference, so an underline is the fix rather than a palette shift.

   Scoped to <p> and <li> on purpose: standalone links (back links, card
   headings, buttons styled as links) are distinguishable by position and role
   rather than by color against adjacent prose, so they keep Tailwind's
   hover:underline. */
main p a:not(.btn-primary):not(.btn-secondary),
main li a:not(.btn-primary):not(.btn-secondary) {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
