/* ─────────────────────────────────────────────────────────────────────────────
   ThreatWire — Main Stylesheet
   Editorial cybersecurity news publication
   Inspired by Pan American Dispatch's clean editorial layout
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Google Fonts Import ────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@700;800&display=swap');

/* ── CSS Variables ──────────────────────────────────────────────────────────── */
:root {
  --color-accent:       #e53e3e;   /* Brand red */
  --color-accent-dark:  #c53030;
  --color-accent-light: #fed7d7;
  --color-black:        #0d0d0d;
  --color-charcoal:     #1a1a1a;
  --color-dark:         #2d2d2d;
  --color-mid:          #4a4a4a;
  --color-muted:        #6b7280;
  --color-border:       #e5e7eb;
  --color-border-light: #f3f4f6;
  --color-bg:           #ffffff;
  --color-bg-subtle:    #fafafa;
  --font-sans:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif:         'Playfair Display', Georgia, 'Times New Roman', serif;
  --max-width:          1180px;
  --header-height:      88px;
}

/* ── Reset & Base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-dark);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--color-accent); }
img { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; }

/* ── Container ──────────────────────────────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Breaking News Banner ───────────────────────────────────────────────────── */
.breaking-banner {
  background: var(--color-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 0;
  text-align: center;
}

.breaking-banner strong {
  font-weight: 800;
  margin-right: 8px;
  background: rgba(0,0,0,.15);
  padding: 1px 8px;
  border-radius: 2px;
}

/* ── Site Header ────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 16px 20px;
  max-width: var(--max-width);
  margin: 0 auto;
  gap: 12px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-logo-small {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.header-logo-small img {
  height: 36px;
  width: auto;
}

.header-wordmark {
  text-align: center;
}

.header-wordmark a {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-black);
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.header-wordmark a:hover { color: var(--color-black); }

.wordmark-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--color-accent);
  border-radius: 50%;
  margin-left: 2px;
  flex-shrink: 0;
  position: relative;
  top: -4px;
}

.header-tagline {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-top: 1px;
}

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.header-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--color-mid);
  border-radius: 50%;
  transition: background .15s, color .15s;
  text-decoration: none;
}

.header-icon-btn:hover {
  background: var(--color-border-light);
  color: var(--color-black);
}

.header-icon-btn svg { width: 18px; height: 18px; }

.btn-subscribe {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-accent);
  color: #fff !important;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 7px 16px;
  border-radius: 3px;
  text-decoration: none;
  transition: background .15s;
}

.btn-subscribe:hover { background: var(--color-accent-dark); color: #fff !important; }

.btn-signin {
  font-size: 13px;
  color: var(--color-mid);
  text-decoration: none;
  font-weight: 500;
}
.btn-signin:hover { color: var(--color-black); }

/* ── Primary Navigation ─────────────────────────────────────────────────────── */
.site-nav {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 0;
}

.nav-item {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-mid);
  padding: 10px 14px;
  position: relative;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color .15s;
  white-space: nowrap;
}

.nav-item:hover, .nav-item.active {
  color: var(--color-black);
}

.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 14px; right: 14px;
  height: 2px;
  background: var(--color-black);
  border-radius: 1px 1px 0 0;
}

.nav-item:first-child { padding-left: 0; }
.nav-item:first-child.active::after { left: 0; }

/* Mobile nav toggle */
.nav-mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  margin-left: auto;
}

.nav-mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-mid);
  border-radius: 2px;
  transition: .2s;
}

/* ── Page Layout ────────────────────────────────────────────────────────────── */
.page-main {
  padding-top: 28px;
  padding-bottom: 60px;
}

/* ── Homepage Hero Grid ─────────────────────────────────────────────────────── */
/*  Three-column layout matching Pan American Dispatch reference:               */
/*  Left (25%) | Center (50%) | Right (25%)                                     */

.home-hero {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 32px;
  margin-bottom: 36px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 0;
}

/* ── Hero: Left Column ──────────────────────────────────────────────────────── */
.hero-col-left,
.hero-col-right {
  padding: 0 24px;
}

.hero-col-left { border-right: 1px solid var(--color-border); }
.hero-col-right { border-left: 1px solid var(--color-border); }

/* Stacked article cards in side columns */
.side-article {
  padding: 20px 0;
  border-bottom: 1px solid var(--color-border);
}

.side-article:first-child { padding-top: 0; }
.side-article:last-child { border-bottom: none; }

.side-article-thumb {
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 2px;
  margin-bottom: 10px;
  background: var(--color-border-light);
}

.side-article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.side-article:hover .side-article-thumb img {
  transform: scale(1.03);
}

.side-article-category {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 4px;
  display: block;
}

.side-article-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--color-charcoal);
  margin-bottom: 6px;
}

.side-article-title a:hover { color: var(--color-accent); }

.side-article-excerpt {
  font-size: 13px;
  color: var(--color-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.side-article-meta {
  font-size: 10px;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 500;
}

.side-article-meta span { margin: 0 4px; opacity: .5; }

/* ── Hero: Center Column (Featured Story) ───────────────────────────────────── */
.hero-col-center {
  padding: 0 28px;
}

.featured-story {}

.featured-story-image {
  aspect-ratio: 16/10;
  overflow: hidden;
  border-radius: 2px;
  margin-bottom: 20px;
  background: var(--color-border-light);
  position: relative;
}

.featured-story-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.featured-story:hover .featured-story-image img {
  transform: scale(1.02);
}

.featured-story-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 10px;
}

.featured-story-label::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

.featured-story-title {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-charcoal);
  margin-bottom: 12px;
}

.featured-story-title a:hover { color: var(--color-accent); }

.featured-story-excerpt {
  font-size: 15px;
  color: var(--color-muted);
  line-height: 1.65;
  margin-bottom: 14px;
}

.featured-story-meta {
  font-size: 11px;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.featured-story-meta .separator { opacity: .4; }

.featured-story-meta .author-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

/* ── Section Dividers ───────────────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-black);
}

.section-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-black);
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.section-see-all {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  transition: color .15s;
}

.section-see-all:hover { color: var(--color-accent); }

/* ── Category Section Grid (3-col) ──────────────────────────────────────────── */
.category-section {
  margin-bottom: 40px;
}

.articles-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

/* ── Article Card ────────────────────────────────────────────────────────────── */
.article-card {
  display: flex;
  flex-direction: column;
}

.article-card-thumb {
  aspect-ratio: 16/10;
  overflow: hidden;
  border-radius: 2px;
  background: var(--color-border-light);
  margin-bottom: 12px;
}

.article-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.article-card:hover .article-card-thumb img {
  transform: scale(1.04);
}

.article-card-category {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 5px;
  display: block;
  text-decoration: none;
}

.article-card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-charcoal);
  margin-bottom: 8px;
}

.article-card-title a:hover { color: var(--color-accent); }

.article-card-excerpt {
  font-size: 13px;
  color: var(--color-muted);
  line-height: 1.55;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}

.article-card-meta {
  font-size: 11px;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 500;
}

/* ── Most Popular Row ────────────────────────────────────────────────────────── */
.popular-section {
  margin-bottom: 40px;
  padding: 24px 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.popular-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.popular-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.popular-card-thumb {
  width: 64px;
  height: 64px;
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--color-border-light);
}

.popular-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.popular-card-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-charcoal);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.popular-card-title a:hover { color: var(--color-accent); }

.popular-card-meta {
  font-size: 10px;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* ── Sidebar layout for /category pages ────────────────────────────────────── */
.with-sidebar {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  align-items: start;
}

/* ── Newsletter Section ──────────────────────────────────────────────────────── */
.newsletter-section {
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 52px 20px;
  text-align: center;
  margin: 40px 0;
}

.newsletter-section h2 {
  font-family: var(--font-sans);
  font-size: 26px;
  font-weight: 800;
  color: var(--color-black);
  margin-bottom: 10px;
}

.newsletter-section p {
  font-size: 15px;
  color: var(--color-muted);
  max-width: 480px;
  margin: 0 auto 24px;
  line-height: 1.65;
}

.newsletter-form {
  display: flex;
  gap: 0;
  max-width: 420px;
  margin: 0 auto;
}

.newsletter-form input[type="email"] {
  flex: 1;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid var(--color-border);
  border-right: none;
  border-radius: 3px 0 0 3px;
  outline: none;
  font-family: var(--font-sans);
  color: var(--color-charcoal);
  transition: border-color .15s;
}

.newsletter-form input:focus {
  border-color: var(--color-mid);
}

.newsletter-form button {
  padding: 10px 20px;
  background: var(--color-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 0 3px 3px 0;
  border: 1px solid var(--color-accent);
  transition: background .15s;
  font-family: var(--font-sans);
}

.newsletter-form button:hover { background: var(--color-accent-dark); }

.newsletter-message {
  font-size: 13px;
  color: var(--color-muted);
  margin-top: 10px;
}

.newsletter-message.success { color: #16a34a; }

/* ── Site Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  padding: 36px 20px 24px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 24px;
  gap: 12px;
}

.footer-wordmark {
  font-size: 20px;
  font-weight: 800;
  color: var(--color-black);
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.footer-tagline {
  font-size: 13px;
  color: var(--color-muted);
}

.footer-nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 16px;
}

.footer-nav a {
  font-size: 12px;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  text-decoration: none;
  transition: color .15s;
}

.footer-nav a:hover { color: var(--color-black); }

.footer-social {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-bottom: 20px;
}

.footer-social a {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  font-size: 14px;
  transition: border-color .15s, color .15s;
}

.footer-social a:hover {
  border-color: var(--color-mid);
  color: var(--color-black);
}

.footer-bottom {
  border-top: 1px solid var(--color-border-light);
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--color-muted);
}

.footer-bottom a {
  color: var(--color-muted);
  text-decoration: none;
}
.footer-bottom a:hover { color: var(--color-mid); }

/* ── Article Page ────────────────────────────────────────────────────────────── */
.article-page {
  max-width: 700px;
  margin: 0 auto;
  padding: 40px 20px;
}

.article-category-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 12px;
  display: block;
}

.article-headline {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-charcoal);
  margin-bottom: 14px;
}

.article-subtitle {
  font-size: 18px;
  color: var(--color-muted);
  line-height: 1.55;
  margin-bottom: 24px;
}

.article-author-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 24px;
}

.article-author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.article-author-info {}

.article-author-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-charcoal);
}

.article-author-name a:hover { color: var(--color-accent); }

.article-meta-row {
  font-size: 11px;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 500;
}

.article-featured-image {
  width: 100%;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
  background: var(--color-border-light);
}

.article-featured-image img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.article-image-caption {
  font-size: 12px;
  color: var(--color-muted);
  text-align: center;
  margin-bottom: 28px;
  font-style: italic;
}

/* ── Article Body ────────────────────────────────────────────────────────────── */
.article-body {
  font-size: 17px;
  line-height: 1.75;
  color: var(--color-dark);
}

.article-body p { margin-bottom: 1.4em; }

.article-body h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--color-charcoal);
  margin: 2em 0 .8em;
  line-height: 1.3;
}

.article-body h3 {
  font-size: 19px;
  font-weight: 700;
  color: var(--color-charcoal);
  margin: 1.8em 0 .7em;
}

.article-body a {
  color: var(--color-black);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body a:hover { color: var(--color-accent); }

.article-body ul, .article-body ol {
  padding-left: 1.6em;
  margin-bottom: 1.4em;
}

.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: .4em; }

.article-body blockquote {
  border-left: 3px solid var(--color-accent);
  padding: 4px 0 4px 20px;
  margin: 2em 0;
  font-size: 19px;
  font-style: italic;
  color: var(--color-mid);
  line-height: 1.6;
}

.article-body pre, .article-body code {
  font-family: 'Courier New', Courier, monospace;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: 3px;
}

.article-body pre {
  padding: 16px;
  overflow-x: auto;
  margin-bottom: 1.4em;
  font-size: 14px;
  line-height: 1.6;
}

.article-body code {
  padding: 2px 6px;
  font-size: .88em;
}

.article-body pre code {
  background: none;
  border: none;
  padding: 0;
}

/* ── Cybersecurity Meta Box ──────────────────────────────────────────────────── */
.cve-box {
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  border-radius: 0 3px 3px 0;
  padding: 20px 24px;
  margin: 28px 0;
}

.cve-box-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cve-box-title::before {
  content: '⚠';
  font-size: 13px;
}

.cve-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 24px;
}

.cve-field {}

.cve-field-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  margin-bottom: 2px;
}

.cve-field-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-charcoal);
}

.cve-field-value.monospace {
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

.severity-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.severity-critical { background: #fee2e2; color: #991b1b; }
.severity-high     { background: #ffedd5; color: #9a3412; }
.severity-medium   { background: #fef3c7; color: #92400e; }
.severity-low      { background: #d1fae5; color: #065f46; }
.severity-info     { background: #dbeafe; color: #1e40af; }

/* ── Tags ────────────────────────────────────────────────────────────────────── */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 28px 0 24px;
}

.tag-chip {
  display: inline-block;
  padding: 3px 10px;
  background: var(--color-border-light);
  border: 1px solid var(--color-border);
  border-radius: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-mid);
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: background .15s, color .15s;
}

.tag-chip:hover {
  background: var(--color-border);
  color: var(--color-charcoal);
}

/* ── Social Share ────────────────────────────────────────────────────────────── */
.share-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  margin: 24px 0;
}

.share-bar-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-muted);
  margin-right: 4px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity .15s;
}

.share-btn:hover { opacity: .85; }

.share-btn-twitter  { background: #1da1f2; color: #fff; }
.share-btn-linkedin { background: #0077b5; color: #fff; }
.share-btn-copy     { background: var(--color-border-light); border: 1px solid var(--color-border); color: var(--color-mid); }

/* ── Related Articles ────────────────────────────────────────────────────────── */
.related-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 2px solid var(--color-black);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.related-card {
  display: flex;
  gap: 12px;
}

.related-card-thumb {
  width: 80px;
  height: 60px;
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--color-border-light);
}

.related-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-card-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--color-charcoal);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-card-title a:hover { color: var(--color-accent); }

.related-card-meta {
  font-size: 10px;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 4px;
}

/* ── Article Prev/Next ────────────────────────────────────────────────────────── */
.article-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--color-border);
  border-top: 1px solid var(--color-border);
  margin-top: 48px;
}

.article-nav-item {
  background: var(--color-bg);
  padding: 20px 24px;
  text-decoration: none;
}

.article-nav-item:hover { background: var(--color-bg-subtle); }

.article-nav-dir {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.article-nav-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-charcoal);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-nav-item.next { text-align: right; }

/* ── Correction Notice ────────────────────────────────────────────────────────── */
.correction-notice {
  background: #fef9c3;
  border: 1px solid #fde68a;
  border-radius: 3px;
  padding: 12px 16px;
  font-size: 13px;
  color: #78350f;
  margin-bottom: 24px;
  line-height: 1.5;
}

.correction-notice strong {
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 4px;
}

/* ── Search Page ─────────────────────────────────────────────────────────────── */
.search-form {
  display: flex;
  gap: 0;
  margin-bottom: 32px;
  max-width: 600px;
}

.search-form input {
  flex: 1;
  padding: 12px 16px;
  font-size: 16px;
  border: 2px solid var(--color-border);
  border-right: none;
  border-radius: 3px 0 0 3px;
  outline: none;
  font-family: var(--font-sans);
  transition: border-color .15s;
}

.search-form input:focus { border-color: var(--color-mid); }

.search-form button {
  padding: 12px 20px;
  background: var(--color-black);
  color: #fff;
  font-weight: 700;
  border-radius: 0 3px 3px 0;
  font-family: var(--font-sans);
  font-size: 14px;
  transition: background .15s;
}

.search-form button:hover { background: var(--color-charcoal); }

/* ── Admin Layout ────────────────────────────────────────────────────────────── */
.admin-body {
  background: #f8f9fa;
  min-height: 100vh;
}

.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

/* Admin Sidebar */
.admin-sidebar {
  background: var(--color-charcoal);
  color: #fff;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 0;
}

.admin-sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 8px;
}

.admin-sidebar-brand a {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-sidebar-brand a::before {
  content: '⚡';
  font-size: 16px;
}

.admin-sidebar-subtitle {
  font-size: 10px;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
}

.admin-nav-group {
  padding: 0 12px 8px;
}

.admin-nav-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  padding: 12px 8px 4px;
  display: block;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 5px;
  font-size: 13px;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  transition: background .15s, color .15s;
  margin-bottom: 1px;
}

.admin-nav-item:hover,
.admin-nav-item.active {
  background: rgba(255,255,255,.1);
  color: #fff;
}

.admin-nav-item.active {
  background: var(--color-accent);
  color: #fff;
}

.admin-nav-icon { font-size: 15px; flex-shrink: 0; }

/* Admin Top Bar */
.admin-topbar {
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  padding: 0 28px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.admin-topbar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-charcoal);
}

.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Admin Content */
.admin-content {
  padding: 28px;
  overflow-x: auto;
}

/* Admin Cards / Panels */
.admin-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 20px;
}

.admin-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-charcoal);
}

.admin-card-body { padding: 20px; }

/* Stats Grid */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.admin-stat-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 18px 20px;
}

.admin-stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--color-charcoal);
  line-height: 1;
  margin-bottom: 4px;
}

.admin-stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
}

.admin-stat-card.accent { border-top: 3px solid var(--color-accent); }

/* Admin Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s, opacity .15s;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: var(--font-sans);
}

.btn-primary { background: var(--color-black); color: #fff; border-color: var(--color-black); }
.btn-primary:hover { background: var(--color-charcoal); color: #fff; }

.btn-danger { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.btn-danger:hover { background: #fecaca; }

.btn-success { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.btn-success:hover { background: #a7f3d0; }

.btn-ghost { background: transparent; color: var(--color-mid); border-color: var(--color-border); }
.btn-ghost:hover { background: var(--color-border-light); color: var(--color-charcoal); }

.btn-accent { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.btn-accent:hover { background: var(--color-accent-dark); color: #fff; }

.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Admin Table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-muted);
  background: var(--color-bg-subtle);
  border-bottom: 1px solid var(--color-border);
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: middle;
}

.admin-table tr:hover td { background: var(--color-bg-subtle); }
.admin-table tr:last-child td { border-bottom: none; }

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-published  { background: #d1fae5; color: #065f46; }
.status-draft      { background: #e5e7eb; color: #374151; }
.status-scheduled  { background: #dbeafe; color: #1e40af; }
.status-review     { background: #fef3c7; color: #92400e; }
.status-archived   { background: #f3f4f6; color: #6b7280; }
.status-unpublished{ background: #fee2e2; color: #991b1b; }

/* Admin Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-charcoal);
  margin-bottom: 6px;
}

.form-label.optional::after {
  content: ' (optional)';
  font-weight: 400;
  text-transform: none;
  color: var(--color-muted);
  font-size: 11px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  outline: none;
  font-family: var(--font-sans);
  color: var(--color-charcoal);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}

.form-control:focus {
  border-color: var(--color-mid);
  box-shadow: 0 0 0 3px rgba(45,45,45,.08);
}

.form-control.error {
  border-color: var(--color-accent);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 32px;
}

.form-hint {
  font-size: 11px;
  color: var(--color-muted);
  margin-top: 4px;
}

.form-error {
  font-size: 12px;
  color: var(--color-accent);
  margin-top: 4px;
  font-weight: 500;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-accent);
}

.form-check label {
  font-size: 13px;
  color: var(--color-charcoal);
}

/* Rich text editor area */
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
}

.editor-btn {
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 12px;
  color: var(--color-mid);
  background: transparent;
  cursor: pointer;
  transition: background .12s;
  font-family: monospace;
}

.editor-btn:hover { background: var(--color-border); color: var(--color-charcoal); }

.editor-body {
  min-height: 350px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: 0 0 4px 4px;
  outline: none;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-dark);
}

.editor-body:focus { border-color: var(--color-mid); }

/* Admin alerts */
.alert {
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

/* Media Grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.media-item {
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .15s;
  position: relative;
}

.media-item:hover { border-color: var(--color-mid); }
.media-item.selected { border-color: var(--color-accent); }

.media-item-thumb {
  aspect-ratio: 4/3;
  background: var(--color-border-light);
  overflow: hidden;
}

.media-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-item-name {
  font-size: 11px;
  padding: 4px 6px;
  background: rgba(0,0,0,.04);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--color-mid);
}

/* ── Pagination ──────────────────────────────────────────────────────────────── */
.pagination-wrap {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 40px;
}

.pagination-wrap a,
.pagination-wrap span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  font-size: 13px;
  color: var(--color-mid);
  text-decoration: none;
  transition: background .15s, border-color .15s;
}

.pagination-wrap a:hover { background: var(--color-border-light); color: var(--color-charcoal); }
.pagination-wrap .active { background: var(--color-black); color: #fff; border-color: var(--color-black); }
.pagination-wrap .disabled { opacity: .4; pointer-events: none; }

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

.text-accent { color: var(--color-accent); }
.text-muted  { color: var(--color-muted); }
.font-bold   { font-weight: 700; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr 1.8fr 1fr;
  }

  .admin-stats-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .hero-col-left,
  .hero-col-right {
    border: none;
    border-top: 1px solid var(--color-border);
    padding: 20px 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .hero-col-center { padding: 0; margin-bottom: 24px; }

  .featured-story-title { font-size: 22px; }

  .articles-3col { grid-template-columns: repeat(2, 1fr); }
  .popular-strip  { grid-template-columns: repeat(2, 1fr); }
  .related-grid   { grid-template-columns: 1fr; }

  .with-sidebar {
    grid-template-columns: 1fr;
  }

  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: fixed;
    left: -240px;
    top: 0;
    z-index: 200;
    transition: left .25s;
  }
  .admin-sidebar.open { left: 0; }

  .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .header-top {
    grid-template-columns: auto 1fr auto;
    padding: 12px 16px;
  }

  .header-wordmark a { font-size: 20px; }

  .header-icon-btn:not(.search-toggle) { display: none; }

  .articles-3col {
    grid-template-columns: 1fr;
  }

  .popular-strip { grid-template-columns: 1fr; }

  .hero-col-left,
  .hero-col-right { grid-template-columns: 1fr; }

  .article-headline { font-size: 26px; }

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

  .newsletter-form input {
    border-right: 1px solid var(--color-border);
    border-bottom: none;
    border-radius: 3px 3px 0 0;
  }

  .newsletter-form button {
    border-radius: 0 0 3px 3px;
  }

  .nav-mobile-toggle { display: flex; }

  .nav-inner {
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 4px 0 8px;
  }

  .nav-inner.open { display: flex; }

  .nav-item {
    padding: 10px 20px;
    width: 100%;
  }

  .nav-item.active::after { display: none; }

  .admin-stats-grid { grid-template-columns: 1fr 1fr; }

  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }

  .cve-grid { grid-template-columns: 1fr; }
  .article-navigation { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
  .admin-stats-grid { grid-template-columns: 1fr; }
}
