/* ============================================================
   Premium Theme – Blog & Post Styles
   W3Schools-inspired layout with premium dark mode design
   ============================================================ */

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

/* ── Blog Layout Variables ───────────────────────────────── */
:root {
  --blog-sidebar-width: 280px;
  --blog-content-max: 800px;
  --code-bg: #1e1e2e;
  --code-header-bg: #181825;
  --code-border: rgba(99, 102, 241, 0.3);
  --code-text: #cdd6f4;
  --code-line-num: #585b70;
  --inline-code-bg: rgba(99, 102, 241, 0.1);
  --inline-code-color: #a5b4fc;
  --quote-border: #6366f1;
  --card-hover-shadow: 0 20px 60px -10px rgba(99, 102, 241, 0.2);
  --tag-bg: rgba(99, 102, 241, 0.08);
  --tag-color: #818cf8;
}

/* ── W3S-style Article Cards ─────────────────────────────── */
.blog-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-4px);
}

.blog-card__thumb {
  position: relative;
  overflow: hidden;
  height: 200px;
  background: linear-gradient(135deg, #1e1b4b, #312e81);
}

.blog-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.blog-card__no-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
  position: relative;
  overflow: hidden;
}

.blog-card__no-image::before {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.3), transparent 70%);
  top: -50px;
  right: -50px;
}

.blog-card__no-image-icon {
  width: 48px;
  height: 48px;
  color: rgba(99, 102, 241, 0.4);
  position: relative;
  z-index: 1;
}

.blog-card__category-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 4px 12px;
  background: rgba(99, 102, 241, 0.9);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.2s;
}

.blog-card__category-badge:hover {
  background: rgba(79, 70, 229, 1);
  color: #fff;
}

.blog-card__body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 12px;
}

.blog-card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.blog-card__meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.blog-card__title {
  font-family: 'Inter', var(--font-heading, sans-serif);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--foreground);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}

.blog-card:hover .blog-card__title {
  color: #6366f1;
}

.blog-card__excerpt {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.blog-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.blog-card__tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.blog-card__tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  background: var(--tag-bg);
  color: var(--tag-color);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.blog-card__tag:hover {
  background: #6366f1;
  color: #fff;
}

.blog-card__read-more {
  font-size: 0.8rem;
  font-weight: 600;
  color: #6366f1;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s, color 0.2s;
  white-space: nowrap;
}

.blog-card__read-more:hover {
  gap: 8px;
  color: #818cf8;
}

/* ── W3S Featured Post (First Post) ──────────────────────── */
.blog-featured-post {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: 360px;
  transition: all 0.35s ease;
  margin-bottom: 40px;
}

.blog-featured-post:hover {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: var(--card-hover-shadow);
}

.blog-featured-post__image {
  position: relative;
  overflow: hidden;
}

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

.blog-featured-post:hover .blog-featured-post__image img {
  transform: scale(1.05);
}

.blog-featured-post__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.2));
}

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

.blog-featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #818cf8;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  width: fit-content;
}

.blog-featured-post__title {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--foreground);
  text-decoration: none;
  transition: color 0.2s;
}

.blog-featured-post:hover .blog-featured-post__title {
  color: #6366f1;
}

.blog-featured-post__excerpt {
  color: var(--muted-foreground);
  line-height: 1.7;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .blog-featured-post {
    grid-template-columns: 1fr;
  }
  .blog-featured-post__image {
    height: 220px;
  }
  .blog-featured-post__content {
    padding: 24px;
  }
}

/* ── Blog Filter Bar ─────────────────────────────────────── */
.blog-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.blog-filter-btn {
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  color: var(--muted-foreground);
  background: var(--muted);
  border: 1px solid transparent;
  letter-spacing: 0.02em;
}

.blog-filter-btn:hover,
.blog-filter-btn.active {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

/* ── Blog Sidebar ────────────────────────────────────────── */
.blog-sidebar-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  transition: border-color 0.2s;
}

.blog-sidebar-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

.blog-sidebar-title {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(var(--foreground-rgb, 255, 255, 255), 0.5);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.blog-sidebar-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Search Box ──────────────────────────────────────────── */
.blog-search-form {
  position: relative;
}

.blog-search-input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--foreground);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.blog-search-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.blog-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  width: 16px;
  height: 16px;
}

/* ── POST CONTENT STYLES (Article body) ──────────────────── */

/* Headings */
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  color: var(--foreground);
  scroll-margin-top: 80px;
  line-height: 1.35;
}

.post-content h2 {
  font-size: 1.6rem;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
  position: relative;
}

.post-content h2::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 2px;
}

.post-content h3 {
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
  color: #818cf8;
}

.post-content h4 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.5rem;
}

/* Paragraphs */
.post-content p {
  color: var(--muted-foreground);
  line-height: 1.85;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

/* Links */
.post-content a {
  color: #818cf8;
  text-decoration: underline;
  text-decoration-color: rgba(129, 140, 248, 0.4);
  text-underline-offset: 3px;
  transition: color 0.2s, text-decoration-color 0.2s;
}

.post-content a:hover {
  color: #a5b4fc;
  text-decoration-color: rgba(165, 180, 252, 0.7);
}

/* Lists */
.post-content ul,
.post-content ol {
  margin: 0 0 1.5rem 1.5rem;
  color: var(--muted-foreground);
  line-height: 1.8;
}

.post-content ul li {
  position: relative;
  padding-left: 8px;
  margin-bottom: 6px;
}

.post-content ul li::marker {
  color: #6366f1;
}

.post-content ol li::marker {
  color: #6366f1;
  font-weight: 600;
}

/* Blockquote */
.post-content blockquote {
  margin: 2rem 0;
  padding: 20px 24px;
  background: rgba(99, 102, 241, 0.06);
  border-left: 4px solid #6366f1;
  border-radius: 0 12px 12px 0;
  color: var(--muted-foreground);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.7;
  position: relative;
}

.post-content blockquote::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 16px;
  font-size: 4rem;
  color: rgba(99, 102, 241, 0.2);
  font-family: Georgia, serif;
  line-height: 1;
}

/* Inline code */
.post-content code:not(pre code) {
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.85em;
  padding: 2px 8px;
  background: var(--inline-code-bg);
  color: var(--inline-code-color);
  border-radius: 6px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  white-space: nowrap;
}

/* Images in content */
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.post-content figure {
  margin: 2rem 0;
}

.post-content figcaption {
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted-foreground);
  margin-top: 8px;
  font-style: italic;
}

/* HR */
.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* Tables */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9rem;
  border-radius: 12px;
  overflow: hidden;
}

.post-content thead {
  background: rgba(99, 102, 241, 0.1);
}

.post-content th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  color: var(--foreground);
  border-bottom: 2px solid rgba(99, 102, 241, 0.3);
}

.post-content td {
  padding: 12px 16px;
  color: var(--muted-foreground);
  border-bottom: 1px solid var(--border);
}

.post-content tr:hover td {
  background: rgba(99, 102, 241, 0.04);
}

/* ── W3Schools-style Code Block ──────────────────────────── */
.code-block-wrapper {
  margin: 2rem 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--code-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  position: relative;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--code-header-bg);
  border-bottom: 1px solid var(--code-border);
}

.code-block-dots {
  display: flex;
  gap: 6px;
}

.code-block-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.code-block-dot.red   { background: #ff5f57; }
.code-block-dot.yellow { background: #febc2e; }
.code-block-dot.green  { background: #28c840; }

.code-block-lang {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(205, 214, 244, 0.5);
  font-family: 'Fira Code', monospace;
}

.code-block-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(205, 214, 244, 0.5);
  background: transparent;
  border: 1px solid rgba(205, 214, 244, 0.15);
  padding: 3px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.code-block-copy:hover {
  color: #cdd6f4;
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(99, 102, 241, 0.1);
}

.code-block-copy.copied {
  color: #a6e3a1;
  border-color: rgba(166, 227, 161, 0.4);
  background: rgba(166, 227, 161, 0.08);
}

.code-block-body {
  background: var(--code-bg);
  overflow-x: auto;
  padding: 20px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.3) transparent;
}

.code-block-body::-webkit-scrollbar {
  height: 6px;
}

.code-block-body::-webkit-scrollbar-track {
  background: transparent;
}

.code-block-body::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3);
  border-radius: 3px;
}

.code-block-body pre {
  margin: 0;
  padding: 0 20px;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--code-text);
  white-space: pre;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  display: table;
  min-width: 100%;
}

.code-block-body .line-numbers {
  display: table-column;
  user-select: none;
  color: var(--code-line-num);
  text-align: right;
  padding-right: 20px;
  padding-left: 0;
  min-width: 40px;
  display: none; /* optional: enable via JS if needed */
}

/* Prism overrides within our wrapper */
.code-block-body .token.keyword    { color: #cba6f7; }
.code-block-body .token.string     { color: #a6e3a1; }
.code-block-body .token.comment    { color: #6c7086; font-style: italic; }
.code-block-body .token.number     { color: #fab387; }
.code-block-body .token.function   { color: #89b4fa; }
.code-block-body .token.operator   { color: #89dceb; }
.code-block-body .token.class-name { color: #f38ba8; }
.code-block-body .token.property   { color: #f2cdcd; }
.code-block-body .token.punctuation { color: #9399b2; }
.code-block-body .token.tag        { color: #f38ba8; }
.code-block-body .token.attr-name  { color: #89b4fa; }
.code-block-body .token.attr-value { color: #a6e3a1; }
.code-block-body .token.variable   { color: #cdd6f4; }
.code-block-body .token.boolean    { color: #fab387; }
.code-block-body .token.constant   { color: #fab387; }
.code-block-body .token.selector   { color: #a6e3a1; }
.code-block-body .token.builtin    { color: #89b4fa; }

/* ── W3S-style "Try it" Result Box ──────────────────────── */
.code-result-box {
  border: 1px solid var(--border);
  border-radius: 0 0 14px 14px;
  border-top: 0;
  padding: 20px;
  background: var(--muted);
  position: relative;
}

.code-result-box::before {
  content: 'Result';
  position: absolute;
  top: -11px;
  left: 16px;
  background: var(--muted);
  padding: 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

/* ── TOC Sidebar ─────────────────────────────────────────── */
.toc-widget {
  position: sticky;
  top: 88px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.3) transparent;
}

.toc-title {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toc-nav a {
  display: block;
  padding: 5px 12px;
  font-size: 0.82rem;
  color: var(--muted-foreground);
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  transition: all 0.2s;
  line-height: 1.4;
}

.toc-nav a:hover,
.toc-nav a.active {
  color: #818cf8;
  border-left-color: #6366f1;
  background: rgba(99, 102, 241, 0.06);
}

.toc-nav a.toc-h3 {
  padding-left: 24px;
  font-size: 0.78rem;
}

/* ── Post Hero Section ───────────────────────────────────── */
.post-hero {
  position: relative;
  padding: 80px 0 48px;
  background: linear-gradient(to bottom, rgba(99, 102, 241, 0.05), transparent);
  overflow: hidden;
}

.post-hero::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.08), transparent 70%);
  top: -200px;
  right: -200px;
  pointer-events: none;
}

/* ── Author Card ─────────────────────────────────────────── */
.author-card {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-top: 40px;
  transition: border-color 0.2s;
}

.author-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
}

.author-card__avatar {
  border-radius: 12px;
  width: 64px;
  height: 64px;
  object-fit: cover;
  flex-shrink: 0;
}

.author-card__label {
  font-size: 0.65rem;
  font-weight: 800;
  color: #6366f1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.author-card__name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 6px;
}

.author-card__bio {
  font-size: 0.8rem;
  color: var(--muted-foreground);
  line-height: 1.6;
}

/* ── Post Navigation ─────────────────────────────────────── */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s;
}

.post-nav-link:hover {
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(99, 102, 241, 0.04);
}

.post-nav-link.prev { align-items: flex-start; }
.post-nav-link.next { align-items: flex-end; text-align: right; }

.post-nav-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted-foreground);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.post-nav-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
  transition: color 0.2s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-nav-link:hover .post-nav-title {
  color: #818cf8;
}

/* ── Image Lightbox Hint ─────────────────────────────────── */
.post-content img {
  cursor: zoom-in;
}

/* ── Archive Hero Banner ─────────────────────────────────── */
.archive-hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #1e1b4b 100%);
  position: relative;
  overflow: hidden;
  padding: 80px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}

.archive-hero::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.25), transparent 70%);
  top: -150px;
  left: 10%;
  pointer-events: none;
  animation: float 8s ease-in-out infinite;
}

.archive-hero::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.2), transparent 70%);
  bottom: -100px;
  right: 10%;
  pointer-events: none;
  animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.archive-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.archive-hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 12px;
}

.archive-hero-desc {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.65);
  max-width: 580px;
  line-height: 1.7;
  margin-bottom: 24px;
}

.archive-hero-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.archive-hero-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
}

/* ── Category Chip ───────────────────────────────────────── */
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  background: var(--muted);
}

.cat-chip:hover {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.cat-chip.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* ── Category Page ───────────────────────────────────────── */
.category-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  margin-bottom: 32px;
}

.category-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.category-name {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.category-count {
  font-size: 0.82rem;
  color: var(--muted-foreground);
}

/* ── Page Content (Static Pages) ────────────────────────── */
.page-content-wrapper {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 48px 56px;
  max-width: 860px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.page-content-wrapper::before {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.08), transparent 70%);
  top: -100px;
  right: -80px;
  pointer-events: none;
}

.page-header-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 20px;
}

.page-header-divider {
  width: 64px;
  height: 4px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 4px;
  margin-bottom: 32px;
}

@media (max-width: 640px) {
  .page-content-wrapper {
    padding: 28px 20px;
    border-radius: 16px;
  }
  .post-nav {
    grid-template-columns: 1fr;
  }
  .blog-featured-post {
    display: none; /* Hide featured on mobile, cards show instead */
  }
}

/* ── Reading Progress Bar ────────────────────────────────── */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #06b6d4);
  z-index: 9999;
  width: 0%;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

/* ── Share Bar ───────────────────────────────────────────── */
.share-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--muted);
  color: var(--muted-foreground);
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid var(--border);
}

.share-btn:hover {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* ── Reading Time Badge ──────────────────────────────────── */
.reading-time-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #818cf8;
}

/* ── Related Posts ───────────────────────────────────────── */
.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.related-post-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 12px;
  text-decoration: none;
  transition: background 0.2s;
  border: 1px solid var(--border);
  background: var(--card);
}

.related-post-card:hover {
  background: rgba(99, 102, 241, 0.05);
  border-color: rgba(99, 102, 241, 0.3);
}

.related-post-thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.related-post-thumb-placeholder {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #6366f1;
}

.related-post-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--foreground);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}

.related-post-card:hover .related-post-title {
  color: #818cf8;
}

.related-post-date {
  font-size: 0.7rem;
  color: var(--muted-foreground);
  margin-top: 4px;
}

/* ── Tags Section ────────────────────────────────────────── */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: var(--muted);
  color: var(--muted-foreground);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid var(--border);
}

.post-tag:hover {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
}

/* ── Responsive adjustments ──────────────────────────────── */
@media (max-width: 1024px) {
  :root { --blog-sidebar-width: 240px; }
}
