/* Shared curriculum chrome — colors come from the site theme. */
@import "/theme/tokens.css";
@import "/theme/editorial.css";
@import "/theme/palettes.css";
@import "/theme/curriculum-editorial.css";
@import "/theme/course-search.css";

:root {
  --bg: var(--color-bg);
  --surface: var(--color-surface);
  --surface-2: var(--color-surface-raised);
  --sunken: var(--color-surface-sunken);
  --text: var(--color-text);
  --muted: var(--color-text-muted);
  --accent: var(--color-accent);
  --good: var(--color-success);
  --bad: var(--color-danger);
  --warn: var(--color-warning);
  --border: var(--color-border);
  --focus: var(--color-focus);
  --font: Verdana, Geneva, sans-serif;
  --mono: Consolas, "Courier New", monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

a {
  color: var(--accent);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -100px;
  background: var(--focus);
  color: var(--color-focus-ink);
  padding: 0.5rem 0.85rem;
  font-weight: 700;
  z-index: 1000;
  border-radius: 4px;
}

.skip-link:focus {
  top: 0.75rem;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
}

.brand span {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 4rem;
}

h1,
h2,
h3 {
  line-height: 1.25;
  font-weight: 650;
}

h1 {
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.35rem;
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 1.1rem;
  margin: 1.25rem 0 0.5rem;
}

.lead {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 65ch;
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 800px) {
  .grid.two {
    grid-template-columns: 1fr 1fr;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
}

.card h2,
.card h3 {
  margin-top: 0;
  border: 0;
  padding: 0;
}

.lesson-list {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: grid;
  gap: 0.75rem;
}

.lesson-list a {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.95rem 1.1rem;
}

.lesson-list a:hover {
  border-color: var(--accent);
}

.lesson-list .num {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.85rem;
}

.lesson-list .title {
  display: block;
  font-weight: 650;
  margin: 0.2rem 0;
}

.lesson-list .desc {
  color: var(--muted);
  font-size: 0.92rem;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
}

.badge.bad {
  background: color-mix(in srgb, var(--bad) 20%, transparent);
  color: var(--color-badge-danger);
}

.badge.good {
  background: color-mix(in srgb, var(--good) 18%, transparent);
  color: var(--color-badge-success);
}

.badge.wcag {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--color-badge-accent);
}

.compare {
  display: grid;
  gap: 1rem;
}

@media (min-width: 900px) {
  .compare {
    grid-template-columns: 1fr 1fr;
  }
}

.panel {
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-weight: 650;
}

.panel-body {
  padding: 1rem;
}

.panel.bad {
  border-color: color-mix(in srgb, var(--bad) 45%, var(--border));
}

.panel.good {
  border-color: color-mix(in srgb, var(--good) 45%, var(--border));
}

.callout {
  border-left: 4px solid var(--accent);
  background: var(--surface);
  padding: 0.85rem 1rem;
  margin: 1rem 0;
  border-radius: 0 8px 8px 0;
}

.callout.warn {
  border-left-color: var(--warn);
}

.callout.tip {
  border-left-color: var(--good);
}

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

pre code {
  color: var(--color-code-fg);
  background: transparent;
}

pre {
  background: var(--color-code-bg);
  color: var(--color-code-fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  font-size: 0.85rem;
}

.checklist {
  list-style: none;
  padding: 0;
}

.checklist li {
  margin: 0.45rem 0;
  padding-left: 1.6rem;
  position: relative;
}

.checklist li::before {
  content: "☐";
  position: absolute;
  left: 0;
}

.def-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 1.25rem;
  font-size: 0.95rem;
}

.def-table th,
.def-table td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  padding: 0.65rem 0.55rem;
}

.def-table th {
  width: 13.5rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 650;
}

.def-table code {
  font-size: 0.84em;
}

.steps {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  display: grid;
  gap: 0.85rem;
}

.steps > li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem 0.15rem;
}

.step-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.pager a {
  text-decoration: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  color: var(--text);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.playground-open {
  margin: 1.25rem 0 0;
}

.playground-open a {
  display: inline-block;
  text-decoration: none;
  background: var(--color-accent-fill);
  color: var(--color-contrast);
  font-weight: 700;
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
}

.demo-box {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 1rem;
  background: var(--sunken);
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

kbd {
  font-family: var(--mono);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  font-size: 0.85em;
}
