/* Public code-section library styles.
   Navy/gold, responsive, system fonts only. No remote assets, no web fonts,
   no tracking pixels, no popups. */

:root {
  --navy-900: #0b1b33;
  --navy-800: #112a4d;
  --navy-700: #1b3c67;
  --navy-100: #e8edf5;
  --navy-050: #f5f7fb;
  --gold-600: #8a6410;
  --gold-500: #b8860b;
  --gold-300: #e3b84a;
  --ink: #16202e;
  --ink-muted: #44536b;
  --paper: #ffffff;
  --border: #cdd6e4;
  --focus: #8a4b00;
  --measure: 68ch;
  --radius: 6px;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--navy-050);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
}

/* ---------- Focus and skip link ---------- */

a {
  color: var(--navy-700);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--navy-900);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Fallback for engines without :focus-visible. */
:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--paper);
  color: var(--navy-900);
  padding: 0.75rem 1rem;
  font-weight: 700;
  z-index: 10;
}

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

/* ---------- Header and navigation ---------- */

.site-header {
  background: var(--navy-900);
  color: var(--paper);
  padding: 1rem clamp(1rem, 4vw, 3rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
  border-bottom: 4px solid var(--gold-500);
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand img {
  max-width: 136px;
  width: 100%;
  height: auto;
  display: block;
}

.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  display: inline-block;
}

.site-nav a:hover,
.site-nav a:focus {
  color: var(--gold-300);
  border-bottom-color: var(--gold-300);
}

/* ---------- Layout ---------- */

main {
  max-width: 54rem;
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 4vw, 2rem) 3rem;
}

main > *,
article > * {
  max-width: var(--measure);
}

article,
section,
nav,
aside {
  margin-bottom: 2rem;
}

h1,
h2,
h3 {
  color: var(--navy-900);
  line-height: 1.25;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
}

h1 {
  font-size: clamp(1.6rem, 1.2rem + 2vw, 2.25rem);
  margin-top: 0.5rem;
}

h2 {
  font-size: clamp(1.25rem, 1.05rem + 1vw, 1.5rem);
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--navy-100);
}

h3 {
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

p,
li {
  margin: 0 0 0.9rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold-600);
  margin-bottom: 0.25rem;
}

.summary {
  font-size: 1.15rem;
  color: var(--ink-muted);
}

.checked-on,
.source-checked {
  color: var(--ink-muted);
  font-size: 0.9rem;
}

/* ---------- Breadcrumbs ---------- */

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1rem;
  padding: 0;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.breadcrumbs li {
  margin: 0;
}

.breadcrumbs li + li::before {
  content: "/";
  margin-right: 0.35rem;
  color: var(--border);
}

/* ---------- Table of contents ---------- */

.toc {
  background: var(--paper);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold-500);
  border-radius: var(--radius);
  padding: 0.75rem 1rem 0.25rem;
}

.toc h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 0;
  margin: 0 0 0.5rem;
  padding: 0;
  color: var(--ink-muted);
}

.toc ol {
  margin: 0;
  padding-left: 1.25rem;
  columns: 2 16rem;
  column-gap: 1.5rem;
}

.toc li {
  margin-bottom: 0.35rem;
  break-inside: avoid;
}

/* ---------- Index cards ---------- */

.card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: none;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
}

.card-list > li {
  background: var(--paper);
  border: 1px solid var(--border);
  border-top: 4px solid var(--navy-700);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 0;
}

.card-list h2 {
  border: 0;
  padding: 0;
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

/* ---------- Sources ---------- */

.sources {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sources > li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  margin: 0;
}

.sources > li:last-child {
  border-bottom: 0;
}

.sources a {
  font-weight: 600;
}

.source-host {
  display: block;
  font-size: 0.85rem;
  color: var(--ink-muted);
  word-break: break-word;
}

.source-checked {
  display: block;
}

/* ---------- Related and FAQs ---------- */

.related ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.related li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.related .eyebrow {
  display: block;
  margin: 0.15rem 0 0;
}

.faq {
  border-left: 3px solid var(--navy-100);
  padding-left: 0.9rem;
  margin-bottom: 1.25rem;
}

/* ---------- CTA ---------- */

.cta {
  background: var(--navy-800);
  color: var(--paper);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  max-width: none;
}

.cta h2 {
  color: var(--paper);
  border-bottom-color: var(--navy-700);
  margin-top: 0;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0;
}

.button {
  display: inline-block;
  background: var(--gold-300);
  color: var(--navy-900);
  font-weight: 700;
  text-decoration: none;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius);
  border: 2px solid var(--gold-300);
}

.button:hover,
.button:focus {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--navy-900);
}

.button-secondary {
  background: transparent;
  color: var(--paper);
  border-color: var(--gold-300);
}

.button-secondary:hover,
.button-secondary:focus {
  background: var(--gold-300);
  color: var(--navy-900);
}

.cta .button:focus-visible,
.cta .button:focus {
  outline-color: var(--gold-300);
}

/* ---------- Disclaimer and footer ---------- */

.disclaimer {
  border: 1px solid var(--border);
  border-left: 4px solid var(--ink-muted);
  background: var(--paper);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  color: var(--ink-muted);
}

.disclaimer h2 {
  font-size: 0.95rem;
  border: 0;
  padding: 0;
  margin: 0 0 0.5rem;
  color: var(--ink);
}

.disclaimer p {
  margin-bottom: 0;
}

.back-link {
  font-weight: 600;
}

.site-footer {
  background: var(--navy-900);
  color: var(--paper);
  padding: 1.5rem clamp(1rem, 4vw, 3rem);
  font-size: 0.95rem;
  border-top: 4px solid var(--gold-500);
}

.site-footer p {
  margin: 0 0 0.35rem;
}

.site-footer a {
  color: var(--gold-300);
}

/* ---------- Preferences and print ---------- */

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --ink-muted: #26303f;
    --border: #6b7788;
  }
}

@media print {
  body {
    background: #fff;
  }

  .site-header,
  .site-nav,
  .cta,
  .site-footer,
  .skip-link {
    display: none;
  }

  main {
    max-width: none;
  }

  .sources a::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    word-break: break-all;
  }
}
