:root {
  color-scheme: light;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.5;
  color: #1a1a1a;
  background: #fafafa;
}

main,
header .site-nav,
footer.site-footer {
  max-width: 52rem;
  margin: 0 auto;
  padding: 1.5rem;
}

header {
  border-bottom: 1px solid #e5e5e5;
  background: #fff;
}

footer.site-footer {
  border-top: 1px solid #e5e5e5;
  margin-top: 2rem;
}

a {
  color: #0b57d0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid #0b57d0;
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  padding: 0.5rem 1rem;
  background: #0b57d0;
  color: #fff;
  z-index: 100;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

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

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.site-brand {
  font-weight: 700;
  color: #1a1a1a;
  text-decoration: none;
  margin-right: auto;
}

.meta {
  color: #4b4b4b;
  font-size: 0.95rem;
}

.prose > * + * {
  margin-top: 1rem;
}

.badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border: 1px solid #ccc;
  background: #f0f0f0;
  border-radius: 0.25rem;
  font-size: 0.8rem;
  margin-right: 0.35rem;
}

.badge-blocked {
  border-color: #b45309;
  background: #fef3e2;
  color: #7c3a09;
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.search-form input {
  flex: 1;
  min-width: 12rem;
  padding: 0.6rem 0.65rem;
  font-size: 1rem;
}

.search-form button {
  padding: 0.6rem 1rem;
  font-size: 1rem;
  min-height: 2.5rem;
}

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

.result-list li {
  border-top: 1px solid #e5e5e5;
  padding: 0.85rem 0;
}

.facet-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 0.5rem 0 1rem;
}

.facet-group {
  border: 1px solid #e5e5e5;
  border-radius: 0.35rem;
  padding: 0.5rem 0.75rem 0.65rem;
  min-width: 12rem;
}

.facet-group legend {
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0 0.25rem;
}

.facet-option {
  display: block;
  font-size: 0.9rem;
  padding: 0.15rem 0;
}

.facet-option input {
  margin-right: 0.4rem;
}

.pager {
  display: flex;
  gap: 1rem;
  margin-top: 1.25rem;
}

.pager a {
  padding: 0.4rem 0.1rem;
  min-height: 2.5rem;
  display: inline-flex;
  align-items: center;
}

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

.stat-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px dotted #ddd;
  padding: 0.2rem 0;
}

.stat-count {
  font-variant-numeric: tabular-nums;
  color: #4b4b4b;
}

.citation-block {
  border: 1px solid #e5e5e5;
  border-radius: 0.35rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.citation-block h3 {
  margin-top: 0;
  font-size: 0.95rem;
}

.citation-block pre,
.citation-block p {
  background: #f5f5f5;
  border-radius: 0.25rem;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  margin: 0 0 0.6rem;
}

.copy-button {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  min-height: 2.25rem;
}

.shortlist-button {
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
  min-height: 2rem;
  margin-top: 0.35rem;
}

.remove-link {
  display: inline-block;
  margin-left: 0.75rem;
  font-size: 0.85rem;
}

@media (max-width: 30rem) {
  main,
  header .site-nav,
  footer.site-footer {
    padding: 1rem;
  }

  .search-form {
    flex-direction: column;
  }

  .search-form button {
    width: 100%;
  }
}

/* Phase 2D: entry pages and shortlists are the two pages worth printing
 * well. Interactive-only chrome (nav, footer boilerplate, copy/shortlist
 * buttons, the shortlist's remove-links, the skip-link) never means
 * anything on paper, so it's hidden rather than left to print as dead
 * controls. Everything else keeps its normal on-screen layout — this is a
 * light print pass, not a second stylesheet. */
@media print {
  .skip-link,
  .site-nav,
  .site-footer,
  .copy-button,
  .shortlist-button,
  .remove-link {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  main {
    max-width: none;
    padding: 0;
    margin: 0;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  .citation-block {
    border-color: #999;
    break-inside: avoid;
  }

  .citation-block pre,
  .citation-block p {
    background: #fff;
    border: 1px solid #ccc;
  }

  .result-list li {
    break-inside: avoid;
  }
}
