/* AI-search hub — Tygart Media
   Per-niche theme. Light-first, honors prefers-color-scheme: dark.
   Accessibility: 4.5:1 text contrast minimum, visible focus, skip link,
   rem-based type, max line length, reduced-motion support. */

:root {
  --bg: #f8f6f1;
  --surface: #ffffff;
  --ink: #1b2431;
  --ink-soft: #3c4757;
  --muted: #5b6675;
  --accent: #9a4a08;          /* amber-800: 6.2:1 on --bg */
  --accent-ink: #7c3a06;
  --link: #1d4ed8;            /* blue-700: 7.4:1 on --bg */
  --link-visited: #5b21b6;
  --border: #d9d4c7;
  --callout-bg: #fdf6e9;
  --callout-border: #9a4a08;
  --placeholder-bg: #eef3f8;
  --placeholder-border: #33507a;
  --radius: 0.625rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141a23;
    --surface: #1c2431;
    --ink: #eef1f6;
    --ink-soft: #c8d0dc;
    --muted: #a8b2c1;
    --accent: #f0a24a;
    --accent-ink: #f6bc72;
    --link: #9db9ff;
    --link-visited: #c4b0f5;
    --border: #3a4557;
    --callout-bg: #2a2114;
    --callout-border: #f0a24a;
    --placeholder-bg: #1a2434;
    --placeholder-border: #7d9bd1;
  }
}

/* Base */
* { box-sizing: border-box; }

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

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

h1, h2, h3, h4 { text-wrap: balance; line-height: 1.25; color: var(--ink); }
p, li, blockquote { text-wrap: pretty; }

article, .hub-grid { max-width: 72ch; }

/* Skip link */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--ink);
  color: var(--bg);
  padding: 0.6rem 1rem;
  border-radius: 0.375rem;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 1rem; }

/* Focus */
:where(a, button, [tabindex]):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Layout */
.site-header {
  border-bottom: 3px solid var(--accent);
  background: var(--surface);
}
.site-header .wrap,
.site-footer .wrap,
.page .wrap {
  max-width: 72ch;
  margin-inline: auto;
  padding-inline: 1.25rem;
}
.site-header .wrap { padding-block: 1rem; }
.brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
}
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: 0.85rem; }
.hub-nav ul {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  font-size: 0.95rem;
}
.hub-nav a { color: var(--link); }

main { padding-block: 2rem 3rem; }

.dateline {
  color: var(--muted);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}
.dateline strong { color: var(--ink-soft); }

h1 { font-size: 2rem; margin: 1rem 0 1.25rem; }
h2 { font-size: 1.4rem; margin: 2.25rem 0 0.75rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
h2:first-of-type { border-top: 0; padding-top: 0; }
h3 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; }

/* Links */
a { color: var(--link); text-underline-offset: 0.15em; }
a:visited { color: var(--link-visited); }
a:hover { text-decoration-thickness: 2px; }

/* Lists & tables */
ul, ol { padding-inline-start: 1.5rem; }
li { margin-bottom: 0.4rem; }
li::marker { color: var(--accent); }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.95rem;
  background: var(--surface);
}
caption { text-align: left; font-weight: 700; padding: 0.5rem 0; }
th, td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
}
th { background: var(--callout-bg); }
tbody tr:nth-child(even) { background: rgba(127, 140, 160, 0.08); }

/* Callouts */
.callout {
  background: var(--callout-bg);
  border-left: 4px solid var(--callout-border);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.callout p { margin: 0.5rem 0; }
.callout strong.lede { color: var(--accent-ink); }

.placeholder-box {
  background: var(--placeholder-bg);
  border: 2px dashed var(--placeholder-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.75rem 0;
}
.placeholder-box p { margin: 0.5rem 0; }
.placeholder-box .tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--placeholder-border);
  margin-bottom: 0.25rem;
}

/* Checklist */
.checklist { list-style: none; padding-inline-start: 0.25rem; }
.checklist li {
  position: relative;
  padding-inline-start: 2rem;
  margin-bottom: 0.65rem;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 0.35rem;
  width: 0.9rem;
  height: 0.9rem;
  border: 2px solid var(--accent);
  border-radius: 0.2rem;
}

/* Sibling links */
.siblings {
  margin-top: 2.5rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.siblings h2 { border: 0; padding: 0; margin: 0 0 0.5rem; font-size: 1.1rem; }
.siblings ul { margin: 0; }

/* Hub landing */
.hero { margin-bottom: 2rem; }
.hero p.lede { font-size: 1.2rem; color: var(--ink-soft); }
.hub-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
}
.hub-grid li {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}
.hub-grid li.pillar {
  grid-column: 1 / -1;
  border-top: 4px solid var(--accent);
}
.hub-grid a.card-link {
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--ink);
}
.hub-grid a.card-link:hover { color: var(--link); text-decoration: underline; }
.hub-grid p { margin: 0.4rem 0 0; font-size: 0.95rem; color: var(--ink-soft); }
.hub-grid .kicker {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.88rem;
}
.site-footer .wrap { padding-block: 1.5rem; }

/* Visually hidden */
.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

/* Motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 40rem) {
  body { font-size: 1rem; }
  h1 { font-size: 1.6rem; }
}

/* Featured article images */
.featured { margin: 1.5rem 0; }
.featured img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}
