/* NomisFile Base Styles — Reset + typography + body */

/* Skip-to-content link — visible only on focus */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 1000;
  padding: 8px 16px;
  background: var(--color-primary, #4F46E5);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
}
.skip-link:focus {
  position: fixed;
  top: 0;
  left: 16px;
  width: auto;
  height: auto;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--space-4) 0;
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  color: var(--color-text-primary);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p {
  margin: 0 0 var(--space-4) 0;
  color: var(--color-text-secondary);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-hover);
}

small {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

code, pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-6) 0;
}

::selection {
  background: var(--color-primary-soft);
  color: var(--color-primary-text);
}

/* ── Screen-reader-only utility — WCAG ── */
.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;
}

/* ── Focus indicators — WCAG 2.4.7 ── */
a:focus-visible {
  outline: 2px solid var(--color-primary, #4F46E5);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── HTMX swap transitions ── */
.htmx-settling {
  opacity: 0;
}
.htmx-settling * {
  transition: opacity 150ms ease;
}
.htmx-added {
  opacity: 1;
}

/* ── Status pill transitions ── */
.focus-pill, .badge, .status-pill {
  transition: background-color 200ms ease, color 200ms ease;
}

/* ── Keyboard shortcuts cheatsheet ── */
.shortcuts-dialog {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  max-width: 400px;
  background: var(--color-bg-card, #fff);
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}
.shortcuts-dialog::backdrop {
  background: rgba(0,0,0,0.3);
}
.shortcuts-dialog h3 {
  margin: 0 0 var(--space-4) 0;
  font-family: var(--font-display);
  font-size: var(--text-h3, 1.5rem);
}
.shortcut-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.shortcut-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-sm);
}
.shortcut-list li:last-child { border-bottom: none; }
.shortcut-key {
  display: inline-block;
  padding: 2px 8px;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 4px);
  font-family: monospace;
  font-size: var(--text-xs);
}
