/* ================================================================
   Blog Styles — StrikeTracker
   Uses the same CSS variables defined in the main site's critical CSS.
   ================================================================ */

/* Smooth scroll for anchor links */
html {
  scroll-behavior: smooth;
}

/* Blog listing page */
.blog-header {
  text-align: center;
  padding: 48px 0 24px;
}
.blog-header h1 {
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 8px;
}
.blog-header p {
  color: var(--text-dim);
  font-size: 18px;
  max-width: 600px;
  margin: 0 auto;
}

/* Category filter */
.blog-categories {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 24px 0 32px;
}
.blog-cat-btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: white;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s;
}
.blog-cat-btn:hover,
.blog-cat-btn.active {
  background: var(--primary-100);
  color: var(--text);
  border-color: var(--primary-300);
}

/* Post cards grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}
.blog-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(13, 64, 118, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.blog-card-img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  background: #ffffff;
}
.blog-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-dim);
}
.blog-card-category {
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.blog-card-category.statistics { background: #dbeafe; color: #1e40af; }
.blog-card-category.blog       { background: #dcfce7; color: #166534; }
.blog-card-category.newsletter { background: #fef3c7; color: #92400e; }
.blog-card-category.report     { background: #ede9fe; color: #5b21b6; }

.blog-card-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.3;
}
.blog-card-excerpt {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.5;
  flex: 1;
}
.blog-card-read {
  margin-top: 16px;
  font-weight: 600;
  color: var(--primary-600);
  font-size: 14px;
}

/* Empty state */
.blog-empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-dim);
}

/* ================================================================
   Single Post
   ================================================================ */
.post-header {
  max-width: 780px;
  margin: 0 auto;
  padding: 48px 0 6px;
}
.post-breadcrumb {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.post-breadcrumb a {
  color: var(--primary-600);
  text-decoration: none;
}
.post-breadcrumb a:hover {
  text-decoration: underline;
}
.post-category {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.post-category.statistics { background: #dbeafe; color: #1e40af; }
.post-category.blog       { background: #dcfce7; color: #166534; }
.post-category.newsletter { background: #fef3c7; color: #92400e; }
.post-category.report     { background: #ede9fe; color: #5b21b6; }

.post-title {
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.15;
  margin: 0 0 16px;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-dim);
  font-size: 14px;
  flex-wrap: wrap;
}
.post-meta-sep { color: var(--border); }
.post-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.post-tag {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
}

/* Featured image */
.post-hero-img {
  width: 100%;
  max-width: 900px;
  margin: 32px auto;
  display: block;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* Post body */
.post-body {
  max-width: 780px;
  margin: 0 auto;
  padding-bottom: 64px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
}
.post-body h2 {
  font-size: 28px;
  margin: 48px 0 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.post-body h3 {
  font-size: 22px;
  margin: 36px 0 12px;
}
.post-body h4 {
  font-size: 18px;
  margin: 24px 0 8px;
}
.post-body p {
  margin: 0 0 20px;
}
.post-body a {
  color: var(--primary-600);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.post-body a:hover {
  color: var(--primary-500);
}
.post-body ul,
.post-body ol {
  margin: 0 0 20px;
  padding-left: 24px;
}
.post-body li {
  margin-bottom: 8px;
}
.post-body blockquote {
  margin: 24px 0;
  padding: 16px 24px;
  border-left: 4px solid var(--primary-400);
  background: var(--primary-50);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.post-body blockquote p {
  margin: 0;
  color: var(--text-dim);
  font-style: italic;
}
.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: 16px 0;
}
.post-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 48px 0;
}
.post-body code {
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}
.post-body pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 20px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 24px 0;
}
.post-body pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* Tables */
.post-body .table-wrapper {
  overflow-x: auto;
  margin: 24px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.post-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.post-body th {
  background: var(--bg-soft);
  font-weight: 700;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.post-body td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.post-body tr:last-child td {
  border-bottom: none;
}

/* Charts */
.chart-container {
  position: relative;
  margin: 32px 0;
  padding: 24px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(13, 64, 118, 0.06);
}
.chart-container canvas {
  max-height: 400px;
}

/* Data disclaimer box */
.data-disclaimer {
  margin: 32px 0;
  padding: 20px 24px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  font-size: 15px;
  line-height: 1.6;
  color: #92400e;
}
.data-disclaimer strong {
  display: block;
  margin-bottom: 6px;
  color: #78350f;
}

/* Key stats banner */
.stats-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin: 32px 0;
}
.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}
.stat-number {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary-600);
  display: block;
}
.stat-label {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
  margin-top: 4px;
}

/* Country jump links */
.country-jump-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.country-jump-links a {
  padding: 4px 12px;
  border-radius: 6px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  transition: all 0.2s;
}
.country-jump-links a::before {
  content: '#';
  margin-right: 3px;
  color: var(--primary-400);
  font-weight: 400;
}
.country-jump-links a:hover {
  background: var(--primary-50);
  color: var(--primary-600);
  border-color: var(--primary-300);
}

/* Country section cards */
.country-section {
  margin: 40px 0;
  padding: 28px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(13, 64, 118, 0.06);
}
.country-section-header {
  margin: 0 0 4px !important;
  padding: 0 !important;
  border: none !important;
  line-height: 1.2;
}
.country-section-flag {
  font-size: 1.1em;
  vertical-align: middle;
}
.country-section-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-600);
  text-decoration: none;
}
.country-section-link:hover {
  text-decoration: underline;
}
.country-section-severity {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

/* Severity badges */
.severity-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}
.severity-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #2d3748;
}
.country-section-severity .severity-badge {
  padding: 4px 12px;
  border-radius: 6px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}
.severity-badge::before {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.severity-badge.critical::before { background: #dc2626; }
.severity-badge.major::before    { background: #f59e0b; }
.severity-badge.minor::before    { background: #eab308; }
.severity-badge.low::before      { background: #1d87ff; }

/* Share / CTA */
.post-footer {
  max-width: 780px;
  margin: 0 auto;
  padding: 32px 0 64px;
  border-top: 1px solid var(--border);
}
.post-footer .social-share {
  margin: 0;
  padding: 20px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.social-share-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.social-share-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.social-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 40px;
}
.social-share-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 64, 118, 0.1);
}
.social-share-btn svg {
  flex-shrink: 0;
}
.social-share-btn-text {
  white-space: nowrap;
}
.social-share-btn.copied {
  background: var(--primary-50);
  border-color: var(--primary-400);
  color: var(--primary-600);
}
.social-share-twitter:hover { background: #1DA1F2; border-color: #1DA1F2; color: white; }
.social-share-facebook:hover { background: #1877F2; border-color: #1877F2; color: white; }
.social-share-linkedin:hover { background: #0A66C2; border-color: #0A66C2; color: white; }
.social-share-whatsapp:hover { background: #25D366; border-color: #25D366; color: white; }
.social-share-email:hover { background: var(--primary-500); border-color: var(--primary-600); color: white; }
.social-share-copy:hover { background: var(--primary-50); border-color: var(--primary-300); color: var(--primary-600); }
.social-share-native:hover { background: var(--primary-500); border-color: var(--primary-600); color: white; }

/* Responsive */
@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
  .stats-banner {
    grid-template-columns: repeat(2, 1fr);
  }
  .post-body {
    font-size: 16px;
  }
  .post-footer .social-share {
    padding: 16px;
  }
  .social-share-buttons {
    gap: 6px;
  }
  .social-share-btn {
    padding: 6px 10px;
    font-size: 13px;
    min-height: 36px;
  }
  .social-share-btn-text {
    display: none;
  }
  .social-share-btn svg {
    width: 18px;
    height: 18px;
  }
  .country-section {
    padding: 20px;
  }
}
@media (max-width: 480px) {
  .stats-banner {
    grid-template-columns: 1fr;
  }
}
