/* ============================================================
   IP Lookup App — Blog CSS
   Dedicated typography & layout for long-form reading
   ============================================================ */

/* ── Reading Progress Bar ── */
.reading-progress-container {
  position: fixed;
  top: 64px; /* below navbar */
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  z-index: 99;
}

.reading-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  width: 0%;
  transition: width 0.1s;
}

/* ── Blog Layout ── */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  max-width: 1100px;
  margin: 0 auto;
  align-items: start;
}

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

/* ── Article Header ── */
.article-header {
  margin-bottom: 2.5rem;
  text-align: center;
}

.article-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

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

.article-hero-img {
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  border: 1px solid var(--border);
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-card);
}

/* ── Better Typography for Reading ── */
.article-body {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.article-body h2 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 2.5rem 0 1rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
}

.article-body h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
}

.article-body p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.article-body a {
  color: var(--accent-light);
  text-decoration: none;
  border-bottom: 1px dashed var(--accent-light);
  transition: all var(--transition);
}

.article-body a:hover {
  color: var(--accent);
  border-bottom-style: solid;
}

.article-body ul, .article-body ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

.article-body li {
  margin-bottom: 0.5rem;
}

.article-body blockquote {
  border-left: 4px solid var(--accent);
  background: var(--accent-glow);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 2rem 0;
  font-style: italic;
  color: var(--text-primary);
}

/* Code block styles */
.article-body pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.article-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
  color: var(--accent-light);
  background: var(--bg-secondary);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  border: 1px solid var(--border);
}

.article-body pre code {
  color: var(--text-primary);
  background: none;
  padding: 0;
  border: none;
}

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

.toc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.toc-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toc-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all var(--transition);
  padding-left: 0.5rem;
  border-left: 2px solid transparent;
}

.toc-nav a:hover, .toc-nav a.active {
  color: var(--accent-light);
  border-left-color: var(--accent);
}

.toc-nav a.toc-h3 {
  padding-left: 1.25rem;
  font-size: 0.85rem;
}

/* ── Related Articles ── */
.related-articles {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.related-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
}
