/* PubSecAI — USWDS-Inspired Dark Government Design System
   Serious. Credible. Mission-oriented.
   Palette: USWDS dark variant — navy, federal blue, verified green. */

@import url('https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,300;0,400;0,600;0,700;0,800;1,400&family=Source+Code+Pro:wght@400;600&display=swap');

:root {
  /* Color palette */
  --bg:           #0b0c10;
  --bg-secondary: #12151a;
  --bg-card:      #1a1f2e;
  --bg-nav:       #0d1021;
  --border:       #2a2f3e;
  --border-light: #363d52;

  --accent:       #1a4480;
  --accent-bright:#2672de;
  --accent-hover: #4a8fe8;

  --high:         #2e8540;
  --medium:       #e6a817;
  --low:          #cd2026;
  --commentary:   #7b3fa0;

  --verified:     #2e8540;
  --unverified:   #4a5568;

  --text:         #f0f1f3;
  --text-muted:   #8d9297;
  --text-dim:     #565c66;

  --font:         'Public Sans', 'Source Sans Pro', system-ui, sans-serif;
  --font-mono:    'Source Code Pro', 'Consolas', monospace;
  --max-width:    1100px;
  --content-max:  780px;

  /* Content type accent colors */
  --type-reference:     #2672de;
  --type-commentary:    #7b3fa0;
  --type-auto-published:#2e8540;
  --type-analysis:      #2672de;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ── PATRIOTIC BANNER ─────────────────────────────────────── */
.gov-banner {
  height: 4px;
  background: linear-gradient(to right,
    #B22234 0%, #B22234 33.3%,
    #ffffff 33.3%, #ffffff 66.6%,
    #3C3B6E 66.6%, #3C3B6E 100%
  );
  flex-shrink: 0;
}

/* ── OFFICIAL GOV NOTICE BAR ──────────────────────────────── */
.gov-notice {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 5px 1.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.gov-notice::before {
  content: '🇺🇸';
  font-size: 0.85rem;
}
.gov-notice strong { color: var(--text); }

/* ── HEADER ───────────────────────────────────────────────── */
header {
  background: var(--bg-nav);
  border-bottom: 2px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  gap: 1px;
  line-height: 1;
}
.wordmark-name {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: 0.02em;
}
.wordmark-tagline {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-bright);
}

.nav-links {
  display: flex;
  gap: 0;
  align-items: stretch;
  height: 62px;
}
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 1.1rem;
  display: flex;
  align-items: center;
  border-bottom: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav-links a:hover {
  color: var(--text);
  border-bottom-color: var(--accent-bright);
  background: rgba(38, 114, 222, 0.06);
}
.nav-links a.active {
  color: var(--text);
  border-bottom-color: var(--accent-bright);
}

/* ── MAIN ─────────────────────────────────────────────────── */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
  width: 100%;
}

/* ── HERO SECTION ─────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border);
  border-left: 5px solid var(--accent);
  border-radius: 6px;
  padding: 2.5rem 2rem;
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 200px; height: 100%;
  background: radial-gradient(ellipse at top right, rgba(26,68,128,0.15), transparent 70%);
  pointer-events: none;
}
.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
  line-height: 1.2;
  color: var(--text);
}
.hero p {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 600px;
  line-height: 1.5;
}
.hero-accent {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-bright);
  margin-bottom: 0.75rem;
  display: block;
}

/* ── LAYOUT: INDEX ────────────────────────────────────────── */
.index-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 800px) {
  .index-layout { grid-template-columns: 1fr; }
}

.main-feed {}
.sidebar {}

.section-heading {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
  margin-bottom: 1.25rem;
}

/* ── FEATURED CARD ────────────────────────────────────────── */
.card-featured {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  transition: border-color 0.15s;
}
.card-featured:hover { border-color: var(--accent-bright); }
.card-featured .card-title { font-size: 1.4rem; }
.card-featured .card-excerpt {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0.75rem 0 1rem;
  line-height: 1.6;
}

/* ── CONTENT GRID ─────────────────────────────────────────── */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 650px) {
  .content-grid { grid-template-columns: 1fr; }
}

/* ── CARDS ────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--type-analysis);
  border-radius: 6px;
  padding: 1.25rem;
  transition: border-color 0.15s, transform 0.1s;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.card:hover {
  border-color: var(--accent-bright);
  transform: translateY(-1px);
}

/* Card left border by content type */
.card[data-type="reference"]      { border-left-color: var(--type-reference); }
.card[data-type="commentary"]     { border-left-color: var(--type-commentary); }
.card[data-type="auto-published"] { border-left-color: var(--type-auto-published); }
.card[data-type="analysis"]       { border-left-color: var(--type-analysis); }

.card-featured[data-type="reference"]      { border-left-color: var(--type-reference); }
.card-featured[data-type="commentary"]     { border-left-color: var(--type-commentary); }
.card-featured[data-type="auto-published"] { border-left-color: var(--type-auto-published); }

.card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}
.card-title a { color: var(--text); text-decoration: none; }
.card-title a:hover { color: var(--accent-bright); }

.card-excerpt {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.date {
  font-size: 0.73rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* ── CONTENT TYPE BADGES ──────────────────────────────────── */
.content-type {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border-radius: 3px;
  padding: 2px 7px;
  border: 1px solid;
}
.content-type,
.content-type-analysis {
  color: var(--accent-bright);
  background: rgba(38,114,222,0.1);
  border-color: rgba(38,114,222,0.35);
}
.content-type-reference {
  color: #6ba3f5;
  background: rgba(107,163,245,0.1);
  border-color: rgba(107,163,245,0.35);
}
.content-type-commentary {
  color: #c084fc;
  background: rgba(192,132,252,0.1);
  border-color: rgba(192,132,252,0.35);
}
.content-type-auto-published {
  color: #4ade80;
  background: rgba(74,222,128,0.1);
  border-color: rgba(74,222,128,0.35);
}

/* ── CONFIDENCE BADGES ────────────────────────────────────── */
.confidence {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 3px;
}
.confidence-HIGH, .confidence-high {
  background: var(--high);
  color: #fff;
}
.confidence-MEDIUM, .confidence-medium {
  background: var(--medium);
  color: #1a1200;
}
.confidence-LOW, .confidence-low {
  background: var(--low);
  color: #fff;
}
.confidence-COMMENTARY, .confidence-commentary {
  background: var(--commentary);
  color: #fff;
}
.confidence-UNVERIFIED, .confidence-unverified {
  background: var(--unverified);
  color: var(--text-muted);
}

/* ── VERIFIED BADGE ───────────────────────────────────────── */
.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--verified);
  border: 1px solid rgba(46,133,64,0.4);
  background: rgba(46,133,64,0.08);
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.04em;
}
.verified-badge::before { content: '✓'; font-weight: 800; }

/* ── SIDEBAR ──────────────────────────────────────────────── */
.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
}
.sidebar-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.sidebar-item:last-child { border-bottom: none; }
.sidebar-item-title {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.3rem;
}
.sidebar-item-title a { color: var(--text); text-decoration: none; }
.sidebar-item-title a:hover { color: var(--accent-bright); }
.sidebar-item-meta { font-size: 0.72rem; color: var(--text-muted); }
.persona-label { font-size: 0.7rem; color: #c084fc; }

/* ── EMPTY STATE ──────────────────────────────────────────── */
.empty {
  color: var(--text-muted);
  font-style: italic;
  padding: 3rem 0;
  text-align: center;
}

/* ── CONTENT PAGE ─────────────────────────────────────────── */
.content-page {
  max-width: var(--content-max);
}

/* Breadcrumb */
.breadcrumb {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--accent-bright);
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--text-dim); }
.breadcrumb-current { color: var(--text-muted); }

.content-header {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.content-header h1 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0.75rem 0 1rem;
  line-height: 1.25;
}
.content-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}
.scope {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Article hero image */
.article-hero-image {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin-bottom: 2rem;
}

/* Persona byline card */
.persona-byline {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  border-left: 4px solid var(--type-commentary);
}
.persona-emoji {
  font-size: 2.2rem;
  line-height: 1;
  flex-shrink: 0;
}
.persona-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.persona-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}
.persona-title {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.persona-sector {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #c084fc;
  background: rgba(192,132,252,0.1);
  border: 1px solid rgba(192,132,252,0.3);
  padding: 2px 7px;
  border-radius: 3px;
  margin-top: 0.1rem;
  width: fit-content;
}
.persona-disclosure {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 0.3rem;
}
.agency-focus {
  font-size: 0.75rem;
  color: var(--accent-bright);
  font-family: var(--font-mono);
}

/* Content body */
.content-body {
  font-size: 0.97rem;
  line-height: 1.7;
}
.content-body h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 2.25rem 0 0.75rem;
  color: var(--text);
  letter-spacing: -0.01em;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.content-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.75rem 0 0.5rem;
  color: var(--text-muted);
}
.content-body p { margin-bottom: 1rem; }
.content-body ul, .content-body ol { margin: 0 0 1rem 1.5rem; }
.content-body li { margin-bottom: 0.35rem; }
.content-body a { color: var(--accent-bright); text-decoration: none; }
.content-body a:hover { text-decoration: underline; }
.content-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  color: #a9c5f7;
}
.content-body pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  font-size: 0.85em;
  font-family: var(--font-mono);
}
.content-body blockquote {
  border-left: 4px solid var(--accent);
  padding: 0.5rem 1rem;
  color: var(--text-muted);
  margin: 1.25rem 0;
  background: var(--bg-secondary);
  border-radius: 0 4px 4px 0;
}
.content-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* Article footer */
.article-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.citation-note {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.citation-note::before { content: '◆'; color: var(--accent-bright); font-size: 0.6em; }

/* ── FOOTER ───────────────────────────────────────────────── */
footer {
  background: var(--bg-secondary);
  border-top: 2px solid var(--accent);
  margin-top: auto;
  padding: 2.5rem 1.5rem 1.5rem;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
@media (max-width: 700px) {
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
}
.footer-col h4 {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.footer-col p, .footer-col li {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.6;
}
.footer-col ul { list-style: none; }
.footer-col li { padding: 0.15rem 0; }
.footer-col a { color: var(--text-muted); text-decoration: none; }
.footer-col a:hover { color: var(--accent-bright); }

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.footer-bottom p {
  font-size: 0.75rem;
  color: var(--text-dim);
}
.footer-astra-note {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-style: italic;
}

/* ── ABOUT PAGE ───────────────────────────────────────────── */
.about-page .content-body h2 { margin-top: 2.5rem; }

/* ── SOCIAL PREVIEW PAGE ──────────────────────────────────── */
.stats-bar {
  display: flex;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-value { font-size: 1.5rem; font-weight: 800; }
.stat-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }

.article-group { margin-bottom: 2rem; }
.article-title-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.article-title-bar h2 { font-size: 1rem; font-weight: 700; flex: 1; }
.article-title-bar a {
  font-size: 0.8rem;
  color: var(--accent-bright);
  text-decoration: none;
}
.run-id-badge {
  font-size: 0.65rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
}
.card-twitter  { border-top: 3px solid #1d9bf0; }
.card-linkedin { border-top: 3px solid #0a66c2; }
.card-mastodon { border-top: 3px solid #6364ff; }
.card-ms_tech_community { border-top: 3px solid #00a4ef; }

.platform-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.platform-icon { font-size: 1rem; font-weight: 800; }
.platform-name { font-size: 0.85rem; font-weight: 700; }
.platform-handle { font-size: 0.72rem; color: var(--text-muted); margin-left: auto; font-family: var(--font-mono); }

.post-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: pre-wrap;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}
.error-text { color: var(--low); font-size: 0.82rem; margin-bottom: 0.75rem; }
.post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}
.dispatch-label { font-style: italic; }
.char-badge { font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-dim); }
.char-badge.over { color: var(--low); font-weight: 700; }
.status-badge {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 3px;
}
.status-queued   { background: rgba(38,114,222,0.2); color: var(--accent-bright); }
.status-dispatched { background: rgba(46,133,64,0.2); color: var(--high); }
.status-error    { background: rgba(205,32,38,0.2); color: var(--low); }
.queue-empty { color: var(--text-muted); padding: 2rem; text-align: center; font-style: italic; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .hero h1 { font-size: 1.5rem; }
  nav { padding: 0 1rem; }
  main { padding: 1.5rem 1rem; }
  .content-header h1 { font-size: 1.4rem; }
  .nav-links { display: none; }
}
