/* Shared component primitives built on tokens.css. Page-specific layout
   (the DNA quiz's two-column split, the Compass's 1fr/360px grid, the
   invitation's dark two-panel layout) lives in each view's own <style>
   block - this file is only the pieces reused across more than one M4
   screen: buttons, cards, containers, eyebrows, and the a11y helpers
   section 5.5 asks for everywhere. */

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

@media (max-width: 639px) {
  .container { padding: 0 var(--space-4); }
}

.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-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink-900);
  color: #fff;
  padding: var(--space-3) var(--space-4);
  z-index: 100;
  border-radius: var(--radius-sm);
}
.skip-link:focus {
  left: var(--space-4);
  top: var(--space-4);
}

.eyebrow {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--fg-brand);
}

.eyebrow-inverse {
  color: var(--iris-300);
}

.card {
  background: var(--bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.card-inverse {
  background: var(--bg-inverse);
  color: var(--fg-on-inverse);
  border-radius: var(--radius-xl);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  line-height: 1;
  border-radius: var(--radius-md);
  padding: 0 var(--space-5);
  min-height: 44px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--duration-base) var(--ease-standard),
              transform var(--duration-base) var(--ease-standard),
              padding var(--duration-base) var(--ease-standard),
              font-size var(--duration-base) var(--ease-standard);
}

.btn-primary {
  background: var(--bg-brand);
  color: var(--fg-on-brand);
}
.btn-primary:hover { background: var(--iris-600); }

.btn-secondary {
  background: var(--bg-muted);
  color: var(--fg);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--ink-100); }

.btn-ghost {
  background: transparent;
  color: var(--fg-brand);
  border-color: var(--border-brand);
}
.btn-ghost:hover { background: var(--bg-brand-soft); }

.btn-lg {
  min-height: 52px;
  padding: 0 var(--space-6);
  font-size: var(--text-base);
}

.btn-block { width: 100%; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

form.inline-form { margin: 0; }

/* ---------- Icon tile ---------- */
.icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-brand-soft);
  color: var(--iris-600);
  flex-shrink: 0;
}
.icon-tile svg { width: 22px; height: 22px; }

/* ---------- Mono, for anything compared digit-by-digit ---------- */
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ---------- Offline banner (F10, PRD section 8) ----------
   Injected by public/js/pwa.js, not server-rendered - it only ever appears
   once the browser's online/offline events (or an initial navigator.onLine
   check) say the device actually has no network, never as a static element
   that could mislead a volunteer who's fully connected. */
.offline-banner {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ink-900);
  color: var(--fg-on-inverse);
  font-size: var(--text-sm);
  line-height: var(--lh-relaxed);
  text-align: center;
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
}
.offline-banner-mascot { flex-shrink: 0; }
@media (max-width: 479px) {
  /* At phone width the sentence needs the whole line. */
  .offline-banner-mascot { display: none; }
}
.offline-banner[hidden] { display: none; }

/* ---------- Error / notice banners ---------- */
.notice-error {
  background: var(--danger-50);
  color: var(--danger-700);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
}
