/* ============================================================
   PRC WIRE — Global Stylesheet
   ============================================================ */

:root {
  --bg: #111318;
  --surface: #181c24;
  --surface-alt: #1e2330;
  --border: #282e3a;
  --text: #e4e8ee;
  --text-secondary: #9ca3b4;
  --accent: #e5a93c;
  --accent-hover: #cc932e;
  --seal-red: #bd2828;
  --seal-red-border: #ef4444;
  --link: #7fb3e0;
  --link-hover: #a8cfe9;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.7;
  font-size: 17px;
}

/* Keyboard-only focus ring */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  text-decoration: underline;
}

/* ==========  Header  ========== */

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 32px 0 24px;
  background: var(--bg);
}
.header-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
}
.site-brand {
  display: flex;
  align-items: center;
}
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text);
}
.brand-link:hover {
  text-decoration: none;
}
.brand-seal {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 9px;
  box-shadow: 0 3px 12px rgba(189, 40, 40, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.brand-link:hover .brand-seal {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 5px 16px rgba(189, 40, 40, 0.65);
}
.brand-seal svg {
  width: 100%;
  height: 100%;
  display: block;
}
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.site-title {
  margin: 0;
  font-size: 26px;
  letter-spacing: 2px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.site-title-wire {
  color: var(--accent);
  transition: color 0.15s ease;
}
.brand-link:hover .site-title-wire {
  color: var(--accent-hover);
}
.site-sub {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.8px;
  color: var(--text-secondary);
}
.site-domain {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-secondary);
}
.site-tagline {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
  max-width: 50ch;
  line-height: 1.5;
}
.site-nav {
  display: flex;
  gap: 24px;
  font-size: 14px;
  font-weight: 500;
}
.site-nav a {
  color: var(--text-secondary);
}
.site-nav a:hover {
  color: var(--text);
  text-decoration: none;
}
.site-nav a.active {
  color: var(--accent);
  font-weight: 600;
}

/* ==========  Main  ========== */

.site-main {
  padding: 32px 0 64px;
}

/* ========== Feed Filter Tabs ========== */
.feed-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.feed-tab {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.feed-tab:hover {
  color: var(--text);
  border-color: var(--text-secondary);
  text-decoration: none;
}
.feed-tab.active {
  color: #111318;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}

.feed-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  margin: 0 0 16px;
}

/* ==========  Story Cards (Slashdot-style story stream)  ========== */

.story-card {
  padding: 36px 0 28px;
  border-bottom: 1px solid var(--border);
}
.story-card:first-child {
  padding-top: 0;
}
.story-card:last-child {
  border-bottom: none;
}
.story-card.single-story {
  padding: 8px 0 32px;
  border-bottom: none;
}

.story-header {
  margin-bottom: 18px;
}

/* ==========  Story Headings  ========== */

.story-title {
  margin: 0 0 8px;
  font-size: 23px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -0.2px;
  text-wrap: balance;
}
.story-title a {
  color: var(--text);
  transition: color 0.15s ease;
}
.story-title a:hover {
  color: var(--accent);
  text-decoration: none;
}
.story-title.single {
  font-size: 30px;
  line-height: 1.3;
  letter-spacing: -0.3px;
  margin-bottom: 14px;
}

/* Legacy alias for other pages */
.post-title {
  margin: 0 0 8px;
  line-height: 1.35;
  font-weight: 700;
}
.post-title a {
  color: var(--text);
}
.post-title a:hover {
  color: var(--accent);
  text-decoration: none;
}
.post-title.single {
  font-size: 30px;
  margin-bottom: 14px;
}

/* ==========  Story Byline / Metadata  ========== */

.story-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.byline-sep {
  color: #4b5563;
  font-size: 11px;
  user-select: none;
}
.story-date {
  color: var(--text-secondary);
}
.byline-scope {
  color: #94a3b8;
  font-weight: 600;
  text-decoration: none;
}
a.byline-scope:hover {
  color: var(--text);
  text-decoration: underline;
}
.byline-category {
  color: #cbd5e1;
  font-weight: 600;
  text-decoration: none;
}
a.byline-category:hover {
  color: var(--accent);
  text-decoration: underline;
}
.byline-source {
  color: #94a3b8;
  font-style: italic;
}

/* Legacy post-meta */
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.post-meta.top {
  margin-bottom: 8px;
}
.post-date {
  color: var(--text-secondary);
}
.post-source {
  color: var(--text-secondary);
  font-style: italic;
}

/* ==========  Story Body / Prose  ========== */

.prose {
  font-size: 17px;
  line-height: 1.75;
}
.prose p {
  margin: 0 0 20px;
  text-wrap: pretty;
}
.prose p:last-child {
  margin-bottom: 0;
}
.prose strong {
  font-weight: 700;
}
.prose a {
  color: var(--link);
}
.prose a:hover {
  color: var(--link-hover);
}
.prose h2 {
  font-size: 24px;
  margin: 40px 0 16px;
  text-wrap: balance;
}
.prose h3 {
  font-size: 20px;
  margin: 28px 0 12px;
  text-wrap: balance;
}
.prose ul,
.prose ol {
  padding-left: 24px;
  margin: 0 0 20px;
}
.prose li {
  margin-bottom: 8px;
}
.prose blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
}

/* ==========  Story Footer (Landing Page & Listing Streams)  ========== */

.story-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13.5px;
}
.story-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.story-permalink {
  font-weight: 600;
  color: var(--link);
  text-decoration: none;
}
.story-permalink:hover {
  color: var(--link-hover);
  text-decoration: underline;
}
.story-source-link {
  color: var(--text-secondary);
  text-decoration: none;
}
.story-source-link:hover {
  color: var(--text);
  text-decoration: underline;
}
.story-search-excerpt {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
  margin: 10px 0 14px;
}

/* ==========  Story Details & Subtle Tags (Permalink Page)  ========== */

.story-source-block {
  margin: 28px 0 0;
}
.story-source-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s ease;
}
.story-source-btn:hover {
  background: var(--surface-alt);
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.story-tags-section {
  margin: 28px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.story-tags-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.story-tags-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #6b7280;
  min-width: 68px;
}
.subtle-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.subtle-tag {
  font-size: 12.5px;
  color: #9ca3b4;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 2px 9px;
  line-height: 1.5;
  text-decoration: none;
  transition: all 0.15s ease;
}
a.subtle-tag:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  text-decoration: none;
}

.back-nav {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.nav-sep {
  color: #4b5563;
}

/* Subdued styles for legacy tags/badges to ensure no distracting colored blocks remain */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px;
}
.tag {
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
a.tag:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text);
  text-decoration: none;
}
.tactics-container {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin: 6px 0 12px;
}
.tactics-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #6b7280;
  font-weight: 600;
  margin-right: 2px;
}
.tactic-badge {
  font-size: 11.5px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  transition: all 0.15s ease;
}
a.tactic-badge:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text);
  text-decoration: none;
}

.scope-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all 0.15s ease;
}
.scope-badge.scope-local,
.scope-badge.scope-international {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}
.scope-badge:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.25);
  text-decoration: none;
}

.post-category {
  color: #cbd5e1;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  transition: all 0.15s ease;
}
a.post-category:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.badge-latest {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  background: rgba(229, 169, 60, 0.12);
  border: 1px solid rgba(229, 169, 60, 0.3);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.post-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 24px;
  margin-bottom: 32px;
}

.post-card,
.post-list-item {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}
.post-list-item:last-child {
  border-bottom: none;
}
.post-list-excerpt {
  color: var(--text-secondary);
  font-size: 15px;
  margin: 8px 0 12px;
  line-height: 1.6;
}
.read-more {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
}
.read-more:hover {
  color: var(--accent-hover);
}
.source-link {
  margin: 32px 0;
}
.back-link {
  margin-top: 48px;
  font-size: 14px;
}

/* ==========  Search UI  ========== */

.search-container {
  margin: 0 0 32px;
}
.search-form {
  position: relative;
  display: flex;
  align-items: center;
}
.search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 44px 12px 16px;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(229, 169, 60, 0.12);
}
.search-input::placeholder {
  color: var(--text-secondary);
}
.search-clear {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 4px;
  display: none;
}
.search-clear:hover {
  color: var(--text);
}
.search-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 12px 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.search-shortcut {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-secondary);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
}
.popular-tags {
  margin: 16px 0;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.popular-tags-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.no-results {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

/* ==========  Pagination  ========== */

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  flex-wrap: wrap;
  gap: 12px;
}
.pagination-btn {
  color: var(--link);
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.15s ease;
}
.pagination-btn:hover {
  background: var(--surface-alt);
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.pagination-btn.disabled {
  opacity: 0.3;
  pointer-events: none;
  color: var(--text-secondary);
}
.pagination-info {
  color: var(--text-secondary);
}

/* ==========  Footer  ========== */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 32px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.site-footer p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}
.footer-links {
  display: flex;
  gap: 16px;
  font-size: 13px;
}
.footer-links a {
  color: var(--text-secondary);
}
.footer-links a:hover {
  color: var(--text);
}

/* ==========  404  ========== */

.error-page {
  text-align: center;
  padding: 64px 24px;
}
.error-page h1 {
  font-size: 48px;
  margin: 0 0 16px;
  color: var(--text-secondary);
}
.error-page p {
  color: var(--text-secondary);
  margin: 0 0 8px;
}

/* ==========  Responsive — Tablet  ========== */

@media (max-width: 768px) {
  .site-title {
    font-size: 24px;
  }
  .story-title {
    font-size: 21px;
  }
  .story-title.single,
  .post-title.single {
    font-size: 26px;
  }
  .prose h2 {
    font-size: 22px;
  }
  .story-card {
    padding: 28px 0 22px;
  }
}

/* ==========  Responsive — Phone  ========== */

@media (max-width: 520px) {
  body {
    font-size: 16px;
  }
  .container {
    padding: 0 16px;
  }
  .site-header {
    padding: 24px 0 16px;
  }
  .brand-seal {
    width: 36px;
    height: 36px;
  }
  .site-title {
    font-size: 20px;
    letter-spacing: 1.5px;
  }
  .site-sub {
    font-size: 8.5px;
    letter-spacing: 1.2px;
  }
  .story-title {
    font-size: 19px;
  }
  .story-title.single,
  .post-title.single {
    font-size: 23px;
  }
  .post-title {
    font-size: 18px;
  }
  .story-card {
    padding: 22px 0 18px;
  }
  .story-byline {
    font-size: 12.5px;
  }
  .story-footer {
    font-size: 13px;
  }
  .site-nav {
    gap: 16px;
  }
  .pagination {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
}

/* ==========  Print  ========== */

@media print {
  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
  }
  .site-header,
  .site-footer,
  .site-nav,
  .search-container,
  .pagination,
  .source-link,
  .back-link,
  .tags {
    display: none;
  }
  .post-card,
  .featured-card {
    border: none;
    background: none;
    padding: 0;
  }
  a {
    color: #000;
    text-decoration: underline;
  }
  .post-category {
    background: none;
    border: 1px solid #999;
    color: #333;
  }
}