/* ══════════════════════════════════════════════════════════
   BLOG STYLES
   ══════════════════════════════════════════════════════════
   Scoped under .blog-listing (listing page) and
   .blog-post (article page) body classes.
   Uses --rt-* variables from retro-theme.css.
   ══════════════════════════════════════════════════════════ */

/* ── Reading Progress Bar ──────────────────────────────── */
.blog-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--rt-neon, #d41150), var(--rt-neon-light, #ff54ad));
  z-index: 10000;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px var(--rt-neon-glow, rgba(212,17,80,0.35));
}

/* ── Blog Hero Section ─────────────────────────────────── */
.blog-hero {
  position: relative;
  padding: 100px 0 60px;
  background: var(--rt-void, #06060e);
  overflow: hidden;
}

.blog-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse at 20% 50%, var(--rt-neon-faint, rgba(212,17,80,0.06)) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 50%, var(--rt-cyan-soft, rgba(6,182,212,0.10)) 0%, transparent 60%);
  pointer-events: none;
}

.blog-hero .container {
  position: relative;
  z-index: 1;
}

.blog-hero h1 {
  font-family: var(--rt-font-display, 'Orbitron', sans-serif);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--rt-text-bright, #eef0f4);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.blog-hero p {
  color: var(--rt-text-dim, #6b7080);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 620px;
  margin: 0 auto;
}

/* ── Category Filter Tabs ──────────────────────────────── */
.blog-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 36px;
}

.blog-categories a {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: all var(--rt-speed, 0.3s) var(--rt-ease);
  border: 1px solid var(--rt-border, rgba(255,255,255,0.06));
  color: var(--rt-text-dim, #6b7080);
  background: var(--rt-surface, #0e0e1a);
}

.blog-categories a:hover,
.blog-categories a.active {
  color: var(--rt-text-bright, #eef0f4);
  border-color: var(--rt-neon, #d41150);
  background: var(--rt-neon-faint, rgba(212,17,80,0.06));
  box-shadow: 0 0 12px var(--rt-neon-glow, rgba(212,17,80,0.35));
}

/* ── Featured Post Card ────────────────────────────────── */
.blog-featured {
  padding: 48px 0 0;
  background: var(--rt-void, #06060e);
}

.blog-featured-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--rt-border, rgba(255,255,255,0.06));
  background: var(--rt-surface, #0e0e1a);
  transition: border-color var(--rt-speed, 0.3s) var(--rt-ease);
}

.blog-featured-card:hover {
  border-color: var(--rt-border-neon, rgba(212,17,80,0.15));
}

.blog-featured-card a {
  text-decoration: none;
  color: inherit;
}

.blog-featured-img {
  position: relative;
  min-height: 320px;
  overflow: hidden;
}

.blog-featured-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--rt-ease);
}

.blog-featured-card:hover .blog-featured-img img {
  transform: scale(1.03);
}

.blog-featured-content {
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.blog-featured-content .blog-card-category {
  margin-bottom: 16px;
}

.blog-featured-content h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--rt-text-bright, #eef0f4);
  line-height: 1.35;
  margin-bottom: 16px;
}

.blog-featured-content p {
  color: var(--rt-text, #c8cad0);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 20px;
}

.blog-featured-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  color: var(--rt-text-dim, #6b7080);
  font-size: 13px;
}

/* ── Post Grid ─────────────────────────────────────────── */
.blog-grid-section {
  padding: 48px 0 80px;
  background: var(--rt-void, #06060e);
}

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

/* ── Post Card ─────────────────────────────────────────── */
.blog-card {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--rt-border, rgba(255,255,255,0.06));
  background: var(--rt-surface, #0e0e1a);
  display: flex;
  flex-direction: column;
  transition: border-color var(--rt-speed, 0.3s) var(--rt-ease),
              transform var(--rt-speed, 0.3s) var(--rt-ease);
}

.blog-card:hover {
  border-color: var(--rt-border-neon, rgba(212,17,80,0.15));
  transform: translateY(-4px);
}

.blog-card a {
  text-decoration: none;
  color: inherit;
}

.blog-card-img {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.blog-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--rt-ease);
}

.blog-card:hover .blog-card-img img {
  transform: scale(1.05);
}

.blog-card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card-category {
  display: inline-block;
  background: var(--rt-neon-faint, rgba(212,17,80,0.06));
  color: var(--rt-neon, #d41150);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 1px;
  width: fit-content;
}

.blog-card-body h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--rt-text-bright, #eef0f4);
  line-height: 1.4;
  margin: 14px 0 12px;
}

.blog-card-body p {
  color: var(--rt-text-dim, #6b7080);
  font-size: 14px;
  line-height: 1.65;
  flex: 1;
}

.blog-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--rt-border, rgba(255,255,255,0.06));
  font-size: 12px;
  color: var(--rt-text-dim, #6b7080);
}

/* ── Pagination ────────────────────────────────────────── */
.blog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 48px;
}

.blog-pagination a,
.blog-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--rt-speed, 0.3s) var(--rt-ease);
  border: 1px solid var(--rt-border, rgba(255,255,255,0.06));
  color: var(--rt-text-dim, #6b7080);
  background: var(--rt-surface, #0e0e1a);
}

.blog-pagination a:hover {
  color: var(--rt-text-bright, #eef0f4);
  border-color: var(--rt-neon, #d41150);
  background: var(--rt-neon-faint, rgba(212,17,80,0.06));
}

.blog-pagination .active {
  color: var(--rt-text-bright, #eef0f4);
  border-color: var(--rt-neon, #d41150);
  background: var(--rt-neon-soft, rgba(212,17,80,0.12));
  box-shadow: 0 0 12px var(--rt-neon-glow, rgba(212,17,80,0.35));
}

.blog-pagination .disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* ── Empty State ───────────────────────────────────────── */
.blog-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--rt-text-dim, #6b7080);
}

.blog-empty p {
  font-size: 16px;
}

/* ══════════════════════════════════════════════════════════
   ARTICLE PAGE STYLES (.blog-post body class)
   ══════════════════════════════════════════════════════════ */

/* ── Article Hero ──────────────────────────────────────── */
.article-hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--rt-void, #06060e);
}

.article-hero-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
}

.article-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
}

.article-hero-bg::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(6,6,14,0.3) 0%,
    rgba(6,6,14,0.7) 50%,
    rgba(6,6,14,0.95) 100%
  );
}

.article-hero-content {
  position: relative;
  z-index: 2;
  padding: 60px 0 48px;
  width: 100%;
}

.article-hero-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--rt-text-dim, #6b7080);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 20px;
  transition: color var(--rt-speed, 0.3s) var(--rt-ease);
}

.article-hero-back:hover {
  color: var(--rt-neon, #d41150);
}

.article-hero-content .blog-card-category {
  margin-bottom: 16px;
}

.article-hero-content h1 {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--rt-text-bright, #eef0f4);
  line-height: 1.3;
  max-width: 760px;
  margin-bottom: 20px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  color: var(--rt-text-dim, #6b7080);
  font-size: 14px;
}

.article-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ── Article Layout (Content + TOC sidebar) ────────────── */
.article-layout {
  padding: 48px 0 60px;
  background: var(--rt-void, #06060e);
}

.article-row {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  align-items: start;
}

/* ── Article Content Typography ────────────────────────── */
.article-content {
  color: var(--rt-text, #c8cad0);
  font-size: 16.5px;
  line-height: 1.85;
}

.article-content h2 {
  color: var(--rt-text-bright, #eef0f4);
  font-size: 1.55rem;
  font-weight: 700;
  margin: 48px 0 16px;
  padding-top: 20px;
  scroll-margin-top: 80px;
}

.article-content h2:first-child {
  margin-top: 0;
  padding-top: 0;
}

.article-content h3 {
  color: var(--rt-text-bright, #eef0f4);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 32px 0 12px;
  scroll-margin-top: 80px;
}

.article-content p {
  margin-bottom: 20px;
}

.article-content ul,
.article-content ol {
  margin: 16px 0 24px 24px;
  color: var(--rt-text, #c8cad0);
}

.article-content li {
  margin-bottom: 10px;
  line-height: 1.7;
}

.article-content strong {
  color: var(--rt-text-bright, #eef0f4);
}

.article-content a {
  color: var(--rt-neon, #d41150);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--rt-speed, 0.3s) var(--rt-ease);
}

.article-content a:hover {
  color: var(--rt-neon-light, #ff54ad);
}

.article-content blockquote {
  border-left: 3px solid var(--rt-neon, #d41150);
  margin: 28px 0;
  padding: 16px 24px;
  background: var(--rt-surface, #0e0e1a);
  border-radius: 0 8px 8px 0;
  color: var(--rt-text, #c8cad0);
  font-style: italic;
}

.article-content code {
  font-family: var(--rt-font-mono, 'JetBrains Mono', monospace);
  background: var(--rt-surface, #0e0e1a);
  border: 1px solid var(--rt-border, rgba(255,255,255,0.06));
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--rt-neon-light, #ff54ad);
}

.article-content pre {
  background: var(--rt-surface, #0e0e1a);
  border: 1px solid var(--rt-border, rgba(255,255,255,0.06));
  border-radius: 8px;
  padding: 20px 24px;
  overflow-x: auto;
  margin: 24px 0;
}

.article-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 14px;
  color: var(--rt-text, #c8cad0);
}

/* ── Table of Contents Sidebar ─────────────────────────── */
.toc-sidebar {
  position: sticky;
  top: 24px;
}

.toc-box {
  background: var(--rt-surface, #0e0e1a);
  border: 1px solid var(--rt-border, rgba(255,255,255,0.06));
  border-radius: 8px;
  padding: 24px;
}

.toc-box h4 {
  font-family: var(--rt-font-display, 'Orbitron', sans-serif);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--rt-text-dim, #6b7080);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rt-border, rgba(255,255,255,0.06));
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-list li {
  margin-bottom: 2px;
}

.toc-list li a {
  display: block;
  padding: 6px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--rt-text-dim, #6b7080);
  text-decoration: none;
  border-radius: 4px;
  border-left: 2px solid transparent;
  transition: all var(--rt-speed, 0.3s) var(--rt-ease);
}

.toc-list li a:hover {
  color: var(--rt-text-bright, #eef0f4);
  background: var(--rt-neon-faint, rgba(212,17,80,0.06));
}

.toc-list li a.active {
  color: var(--rt-neon, #d41150);
  border-left-color: var(--rt-neon, #d41150);
  background: var(--rt-neon-faint, rgba(212,17,80,0.06));
}

.toc-list li.toc-h3 a {
  padding-left: 24px;
  font-size: 12px;
}

/* ── Author Box ────────────────────────────────────────── */
.author-box {
  margin-top: 56px;
  padding: 28px 32px;
  background: var(--rt-surface, #0e0e1a);
  border: 1px solid var(--rt-border, rgba(255,255,255,0.06));
  border-radius: 8px;
  display: flex;
  gap: 20px;
  align-items: center;
}

.author-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rt-neon, #d41150), var(--rt-neon-light, #ff54ad));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.author-info label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--rt-text-dim, #6b7080);
  display: block;
  margin-bottom: 4px;
}

.author-info h4 {
  color: var(--rt-text-bright, #eef0f4);
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.author-info p {
  color: var(--rt-text-dim, #6b7080);
  font-size: 13.5px;
  line-height: 1.6;
  margin: 0;
}

/* ── Related Posts ─────────────────────────────────────── */
.related-posts {
  padding: 60px 0;
  background: var(--rt-void, #06060e);
  border-top: 1px solid var(--rt-border, rgba(255,255,255,0.06));
}

.related-posts h3 {
  font-family: var(--rt-font-display, 'Orbitron', sans-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--rt-text-bright, #eef0f4);
  margin-bottom: 32px;
  text-align: center;
}

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

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 991px) {
  .blog-featured-card {
    grid-template-columns: 1fr;
  }

  .blog-featured-img {
    min-height: 240px;
  }

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

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

  .toc-sidebar {
    position: static;
    order: -1;
  }

  .toc-box {
    margin-bottom: 32px;
  }

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

  .article-hero-content h1 {
    font-size: 2rem;
  }
}

/* Mobile */
@media (max-width: 767px) {
  .blog-hero {
    padding: 80px 0 40px;
  }

  .blog-hero h1 {
    font-size: 1.8rem;
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }

  .blog-featured-content {
    padding: 24px 20px;
  }

  .blog-featured-content h2 {
    font-size: 1.3rem;
  }

  .blog-categories {
    gap: 6px;
  }

  .blog-categories a {
    padding: 6px 14px;
    font-size: 12px;
  }

  .article-hero {
    min-height: 340px;
  }

  .article-hero-content h1 {
    font-size: 1.6rem;
  }

  .article-content {
    font-size: 15.5px;
  }

  .article-content h2 {
    font-size: 1.35rem;
  }

  .author-box {
    flex-direction: column;
    text-align: center;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .blog-pagination {
    flex-wrap: wrap;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .blog-hero h1 {
    font-size: 1.5rem;
  }

  .article-hero-content h1 {
    font-size: 1.4rem;
  }

  .blog-featured-content h2 {
    font-size: 1.15rem;
  }
}
