/* ===== BLOG PAGE — Redesign 2026 ===== */

/* Hero Styles */
.blog-hero-content {
  position: relative;
  z-index: 1;
  max-width: 820px;
}
.blog-hero-content h1 {
  font-size: var(--fs-h1);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-top: var(--space-sm);
}
.blog-hero-content .hero-lede {
  max-width: 680px;
  margin-top: var(--space-md);
}

/* Category Filter Tabs */
.blog-filters-section {
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.blog-filters-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-xs);
  overflow-x: auto;
  padding-bottom: var(--space-xs);
  -webkit-overflow-scrolling: touch;
}
.blog-filters-wrapper::-webkit-scrollbar {
  height: 4px;
}
.blog-filters-wrapper::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: var(--r-sm);
}
.filter-btn {
  padding: 10px 20px;
  border-radius: 100px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 200ms var(--ease);
}
.filter-btn:hover {
  background: var(--surface-3);
  color: var(--ink);
  border-color: var(--ink-muted);
}
.filter-btn.is-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Featured Article Section */
.featured-section {
  padding-top: var(--section-py);
  padding-bottom: var(--space-xl);
}
.featured-card {
  display: grid;
  gap: var(--grid-gap-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 240ms var(--ease);
}
@media (min-width: 992px) {
  .featured-card {
    grid-template-columns: 1.2fr 1fr;
  }
}
.featured-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(91,71,224,0.2);
}
.featured-image-wrapper {
  position: relative;
  min-height: 280px;
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
}
@media (min-width: 992px) {
  .featured-image-wrapper {
    height: 100%;
  }
}
.featured-image-wrapper img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.featured-content {
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
@media (min-width: 1200px) {
  .featured-content {
    padding: var(--space-2xl);
  }
}
.blog-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  width: fit-content;
  margin-bottom: var(--space-md);
}
.featured-content h2 {
  font-size: clamp(24px, 2.5vw, 36px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: var(--space-md);
}
.featured-content p {
  color: var(--ink-muted);
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: var(--space-lg);
}
.blog-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 13px;
  color: var(--ink-faint);
  margin-top: auto;
}
.author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

/* Articles Grid Section */
.articles-section {
  padding-bottom: var(--section-py);
}
.articles-grid {
  display: grid;
  gap: var(--grid-gap);
}
@media (min-width: 768px) {
  .articles-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (min-width: 1200px) {
  .articles-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.article-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 240ms var(--ease);
}
.article-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(91,71,224,0.22);
}
.article-image-wrapper {
  position: relative;
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
  overflow: hidden;
}
.article-image-wrapper img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}
.article-card:hover .article-image-wrapper img {
  transform: scale(1.04);
}
.article-card-content {
  padding: var(--card-pad-lg);
  display: flex;
  flex-direction: column;
  flex: 1;
}
.article-card-content h3 {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: var(--space-sm);
  margin-top: var(--space-xs);
}
.article-card-content p {
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: var(--space-lg);
}

/* Newsletter Section */
.newsletter-section {
  padding-bottom: var(--section-py);
}
.newsletter-card {
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface-3) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-2xl);
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}
@media (min-width: 768px) {
  .newsletter-card {
    padding: var(--space-3xl);
  }
}
.newsletter-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(91,71,224,0.06), transparent 50%);
  pointer-events: none;
}
.newsletter-content {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.newsletter-content h2 {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: var(--space-sm);
}
.newsletter-content p {
  color: var(--ink-muted);
  font-size: 16px;
  line-height: 1.65;
  margin-bottom: var(--space-xl);
}
.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
@media (min-width: 576px) {
  .newsletter-form {
    flex-direction: row;
    max-width: 500px;
    margin: 0 auto;
  }
}
.newsletter-input {
  flex: 1;
  padding: 14px 20px;
  border-radius: 100px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 200ms;
}
.newsletter-input:focus {
  border-color: var(--primary);
}
.newsletter-btn {
  padding: 14px 28px;
  border-radius: 100px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity 200ms, transform 200ms;
}
.newsletter-btn:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}
.newsletter-btn:active {
  transform: translateY(0);
}

/* ===== BLOG DETAILS PAGE (Light Theme - RankBoost Branding) ===== */

.blog-detail-hero {
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--line);
}
.blog-detail-hero-content {
  max-width: 960px;
  position: relative;
  z-index: 1;
}
.blog-detail-hero-content h1 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-top: var(--space-md);
  margin-bottom: var(--space-md);
}
.blog-detail-hero-content .hero-lede {
  font-size: 17px;
  color: var(--ink-muted);
  line-height: 1.6;
  max-width: 820px;
  margin-top: var(--space-xs);
}

/* 3-Column Responsive Grid Layout */
.blog-detail-section {
  padding-top: var(--space-xl);
  padding-bottom: var(--section-py);
  background: var(--surface);
}
.blog-detail-grid {
  max-width: 90%;
  display: grid;
  gap: var(--grid-gap-lg);
  align-items: start;
  grid-template-areas:
    "main"
    "toc"
    "sidebar";
}

@media (min-width: 768px) {
  .blog-detail-grid {
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-areas: 
      "main toc"
      "main sidebar";
  }
}

@media (min-width: 1200px) {
  .blog-detail-grid {
    grid-template-columns: 310px minmax(0, 1fr) 340px;
    grid-template-areas: "toc main sidebar";
  }
}

/* Sidebar Area Allocations */
.blog-sidebar-left {
  grid-area: toc;
}
.blog-sidebar-right {
  grid-area: sidebar;
}

/* Table of Contents Widget */
.toc-widget {
  background: var(--surface-2) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--r-xl);
  padding: 24px 20px !important;
  position: sticky;
  top: 100px;
  box-shadow: var(--shadow-sm);
}
.toc-scroll-container {
  max-height: 480px;
  overflow-y: auto;
  padding-right: 6px;
}
.toc-scroll-container::-webkit-scrollbar {
  width: 4px;
}
.toc-scroll-container::-webkit-scrollbar-track {
  background: transparent;
}
.toc-scroll-container::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 99px;
}
.toc-ordered-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.toc-ordered-list > li {
  margin-bottom: 18px;
}
.toc-ordered-list > li:last-child {
  margin-bottom: 0;
}
.toc-ordered-list a {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-decoration: none;
  color: var(--ink-muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  transition: color 200ms;
}
.toc-ordered-list a:hover {
  color: var(--primary);
}
.toc-num {
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.toc-text {
  flex: 1;
}
.toc-sub-list {
  list-style: none;
  padding-left: 36px;
  margin-top: 10px;
  display: grid;
  gap: 8px;
}
.toc-sub-list a {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-faint);
  position: relative;
  line-height: 1.35;
}
.toc-sub-list a::before {
  content: '•';
  color: var(--primary);
  font-size: 12px;
  position: absolute;
  left: -14px;
  top: -1px;
}
.toc-sub-list a:hover {
  color: var(--primary);
}

/* Share Article Widget (Sticky below TOC on desktop) */
.share-article-widget {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  margin-top: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}
@media (min-width: 1200px) {
  .share-article-widget {
    position: sticky;
    top: 660px;
  }
}
.share-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
}
.share-social-icons {
  display: flex;
  gap: 8px;
}
.social-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 200ms var(--ease);
  border: 1px solid var(--line);
}
.social-icon:hover {
  transform: translateY(-2px);
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Main Article Column styling */
.blog-article {
  grid-area: main;
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--r-2xl);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
}
@media (min-width: 768px) {
  .blog-article {
    padding: var(--space-xl);
  }
}

/* Meta Data Wrapper */
.blog-meta-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: var(--space-lg);
  font-size: 13.5px;
  color: var(--ink-muted);
}
.meta-avatar-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.meta-avatar-group .author-avatar {
  width: 28px;
  height: 28px;
}
.pill-category {
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 100px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pill-readtime {
  background: var(--surface-3);
  color: var(--ink-muted);
  border-radius: 100px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.article-featured-image {
  border-radius: var(--r-xl);
  overflow: hidden;
  margin-bottom: var(--space-lg);
  border: 1px solid var(--line);
}
.article-featured-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* AI Summarizer Card Widget */
.ai-summarizer-card {
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface-3) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-lg) 0;
  box-shadow: var(--shadow-sm);
}
.ai-summarizer-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: var(--space-md);
}
@media (min-width: 640px) {
  .ai-summarizer-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
.ai-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 16px;
  color: var(--ink);
}
.ai-icon {
  font-size: 18px;
  color: var(--primary);
}
.ai-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ai-btn {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-muted);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 200ms var(--ease);
  text-decoration: none;
}
.ai-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--line-strong);
}
.ai-btn.is-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.ai-summarizer-footer {
  font-size: 12px;
  color: var(--ink-faint);
  text-align: center;
}


/* Key Takeaways Section */
.key-takeaways-card {
  background: rgba(200, 255, 0, 0.05);
  border: 1px solid rgba(200, 255, 0, 0.25);
  border-radius: var(--r-xl);
  padding: var(--space-lg);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-xl);
}
.key-takeaways-card h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  margin-top: 0 !important;
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
}
.key-takeaways-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-sm);
}
.key-takeaways-card li {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-muted);
  position: relative;
  padding-left: 20px;
}
.key-takeaways-card li::before {
  content: '•';
  color: var(--primary);
  font-size: 20px;
  position: absolute;
  left: 0;
  top: -3px;
  font-weight: 900;
}

/* Sidebar Right Widgets */
.blog-sidebar-right .sidebar-widget {
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--r-xl);
  padding: 24px 20px !important;
  box-shadow: var(--shadow-sm);
}
.blog-sidebar-right .sidebar-widget-title {
  font-size: 16px !important;
  font-weight: 800;
  color: var(--ink) !important;
  border-bottom: 2px solid var(--primary-light) !important;
  padding-bottom: var(--space-xs);
  margin-bottom: var(--space-md);
  letter-spacing: -0.015em;
}
.blog-sidebar-right .related-posts-list {
  display: grid;
  gap: 20px;
}
.blog-sidebar-right .related-post-item {
  display: flex;
  gap: var(--space-sm);
  text-decoration: none;
}
.blog-sidebar-right .related-post-thumb {
  width: 76px;
  height: 64px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface-3);
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.blog-sidebar-right .related-post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.blog-sidebar-right .related-post-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.blog-sidebar-right .related-post-info h4 {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 5px;
  transition: color 200ms;
}
.blog-sidebar-right .related-post-item:hover h4 {
  color: var(--primary) !important;
}
.blog-sidebar-right .related-post-info span {
  font-size: 11px;
  color: var(--ink-faint);
}

/* Promo Banner Card */
.promo-banner-widget {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  position: relative;
  overflow: hidden;
  padding: 32px 24px !important;
  min-height: 300px;
  display: flex !important;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  box-shadow: var(--shadow-lg);
}
.promo-banner-widget::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 80% 25%, rgba(200, 255, 0, 0.20) 0%, transparent 60%),
    radial-gradient(circle at 10% 70%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
}
.promo-banner-widget::after {
  content: '';
  position: absolute;
  top: 15px; right: 15px;
  width: 90px; height: 90px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23C8FF00' opacity='0.25'%3E%3Cpath d='M10 2a8 8 0 100 16 8 8 0 000-16zm1 11H9v-2h2v2zm0-4H9V5h2v4z'/%3E%3C/svg%3E");
  background-size: contain;
  pointer-events: none;
}
.promo-banner-content {
  position: relative;
  z-index: 2;
  width: 100%;
}
.promo-banner-content h3 {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 8px;
  letter-spacing: -0.025em;
}
.promo-banner-content p {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 24px;
}
.promo-banner-btn {
  background: var(--accent) !important;
  color: #0c0b10 !important;
  padding: 12px 24px;
  border-radius: 100px;
  font-size: 13.5px;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 220ms var(--ease);
  box-shadow: 0 4px 15px rgba(200, 255, 0, 0.2);
  border: none !important;
}
.promo-banner-btn:hover {
  background: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.25);
}
.promo-btn-icon {
  font-size: 14px;
  font-weight: 900;
}


/* =====================================================
   ARTICLE RICH TEXT — Full Typography System
   Styles every CKEditor-generated tag inside blog posts
   ===================================================== */

.article-rich-text {
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink-muted);
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ── Paragraphs ── */
.article-rich-text p {
  margin-bottom: 1.5em;
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink-muted);
}
.article-rich-text p:last-child {
  margin-bottom: 0;
}

/* ── Headings H1–H6 ── */
.article-rich-text h1,
.article-rich-text h2,
.article-rich-text h3,
.article-rich-text h4,
.article-rich-text h5,
.article-rich-text h6 {
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  scroll-margin-top: 100px;
}
.article-rich-text h1 {
  font-size: clamp(28px, 3.2vw, 36px);
  letter-spacing: -0.03em;
}
.article-rich-text h2 {
  font-size: clamp(22px, 2.4vw, 28px);
}
.article-rich-text h3 {
  font-size: clamp(18px, 1.8vw, 22px);
  font-weight: 700;
}
.article-rich-text h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}
.article-rich-text h5 {
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
}
.article-rich-text h6 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}
/* Remove top-margin for the very first heading */
.article-rich-text > h1:first-child,
.article-rich-text > h2:first-child,
.article-rich-text > h3:first-child,
.article-rich-text > h4:first-child,
.article-rich-text > h5:first-child,
.article-rich-text > h6:first-child {
  margin-top: 0;
}

/* ── Links / Anchors ── */
.article-rich-text a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(91, 71, 224, 0.3);
  font-weight: 600;
  transition: all 180ms var(--ease);
}
.article-rich-text a:hover {
  color: var(--primary-dark);
  text-decoration-color: var(--primary);
}

/* ── Bold, Italic, Underline, Strikethrough ── */
.article-rich-text strong,
.article-rich-text b {
  font-weight: 700;
  color: var(--ink);
}
.article-rich-text em,
.article-rich-text i {
  font-style: italic;
}
.article-rich-text u {
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}
.article-rich-text s,
.article-rich-text del {
  text-decoration: line-through;
  color: var(--ink-faint);
}
.article-rich-text mark {
  background: rgba(200, 255, 0, 0.35);
  padding: 1px 5px;
  border-radius: 3px;
}
.article-rich-text sub,
.article-rich-text sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}
.article-rich-text sup { top: -0.5em; }
.article-rich-text sub { bottom: -0.25em; }

/* ── Unordered Lists ── */
.article-rich-text ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5em 0;
  display: grid;
  gap: 10px;
}
.article-rich-text ul li {
  position: relative;
  padding-left: 24px;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink-muted);
}
.article-rich-text ul li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.7;
}
/* Nested list */
.article-rich-text ul ul {
  margin-top: 10px;
  margin-bottom: 0;
}
.article-rich-text ul ul li::before {
  background: transparent;
  border: 2px solid var(--primary);
  width: 6px;
  height: 6px;
  top: 11px;
}

/* ── Ordered Lists ── */
.article-rich-text ol {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5em 0;
  counter-reset: rich-ol;
  display: grid;
  gap: 10px;
}
.article-rich-text ol li {
  position: relative;
  padding-left: 32px;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink-muted);
  counter-increment: rich-ol;
}
.article-rich-text ol li::before {
  content: counter(rich-ol);
  position: absolute;
  left: 0;
  top: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Nested ordered list */
.article-rich-text ol ol {
  margin-top: 10px;
  margin-bottom: 0;
}

/* ── Blockquote ── */
.article-rich-text blockquote {
  margin: 2em 0;
  padding: 24px 28px;
  border-left: 4px solid var(--primary);
  background: var(--primary-light);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: 16.5px;
  font-style: italic;
  line-height: 1.75;
  color: var(--ink);
  position: relative;
}
.article-rich-text blockquote::before {
  content: '"';
  position: absolute;
  top: -8px;
  left: 16px;
  font-size: 60px;
  font-weight: 900;
  color: var(--primary);
  opacity: 0.2;
  line-height: 1;
  font-family: Georgia, serif;
}
.article-rich-text blockquote p {
  margin-bottom: 0.5em;
  color: var(--ink);
}
.article-rich-text blockquote p:last-child {
  margin-bottom: 0;
}
.article-rich-text blockquote cite {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
  color: var(--primary);
}

/* ── Tables ── */
.article-rich-text table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 2em 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  overflow: hidden;
  font-size: 14.5px;
}
.article-rich-text thead {
  background: var(--primary);
}
.article-rich-text thead th {
  padding: 14px 18px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ffffff;
  text-align: left;
  border-bottom: 2px solid var(--primary-dark);
}
.article-rich-text tbody tr {
  transition: background 150ms var(--ease);
}
.article-rich-text tbody tr:nth-child(even) {
  background: var(--surface-2);
}
.article-rich-text tbody tr:hover {
  background: var(--primary-light);
}
.article-rich-text tbody td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-muted);
  line-height: 1.55;
  vertical-align: top;
}
.article-rich-text tbody tr:last-child td {
  border-bottom: none;
}
/* Table caption */
.article-rich-text table caption {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
  text-align: left;
  caption-side: bottom;
  background: var(--surface-2);
  border-top: 1px solid var(--line);
}
/* Responsive table wrapper */
.article-rich-text .table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 2em 0;
}

/* ── Code (inline) ── */
.article-rich-text code {
  background: var(--surface-3);
  color: var(--primary-dark);
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 0.88em;
  font-family: 'Courier New', Consolas, monospace;
  border: 1px solid var(--line);
  word-break: break-word;
}

/* ── Code Blocks (pre) ── */
.article-rich-text pre {
  background: #1E1E2E;
  color: #CDD6F4;
  padding: 24px;
  border-radius: var(--r-md);
  overflow-x: auto;
  margin: 2em 0;
  font-size: 14px;
  line-height: 1.7;
  font-family: 'Courier New', Consolas, monospace;
  border: 1px solid rgba(255,255,255,0.06);
  -webkit-overflow-scrolling: touch;
}
.article-rich-text pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border: none;
  border-radius: 0;
  font-size: inherit;
}

/* ── Images ── */
.article-rich-text img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r-lg);
  margin: 1.8em 0;
  border: 1px solid var(--line);
  display: block;
}
.article-rich-text figure {
  margin: 2em 0;
}
.article-rich-text figcaption {
  text-align: center;
  font-size: 13px;
  color: var(--ink-faint);
  margin-top: 10px;
  font-style: italic;
}

/* ── Horizontal Rule ── */
.article-rich-text hr {
  display: none;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
  margin: 2.5em 0;
}

/* ── Iframes & Embeds ── */
.article-rich-text iframe {
  max-width: 100%;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  margin: 2em 0;
}
.article-rich-text .embed-responsive {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin: 2em 0;
  border-radius: var(--r-md);
}
.article-rich-text .embed-responsive iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none; margin: 0;
}

/* ── Definition Lists ── */
.article-rich-text dl {
  margin: 1.5em 0;
}
.article-rich-text dt {
  font-weight: 800;
  color: var(--ink);
  font-size: 16px;
  margin-top: 1.2em;
}
.article-rich-text dd {
  margin-left: 0;
  padding-left: 20px;
  border-left: 3px solid var(--primary-light);
  color: var(--ink-muted);
  margin-bottom: 0.5em;
  font-size: 15px;
  line-height: 1.7;
}

/* ── Abbreviations ── */
.article-rich-text abbr[title] {
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: help;
  color: var(--ink);
}

/* ── Keyboard Shortcuts ── */
.article-rich-text kbd {
  display: inline-block;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 0.85em;
  font-family: 'Courier New', Consolas, monospace;
  box-shadow: 0 2px 0 var(--line-strong);
  color: var(--ink);
}

/* ── Details / Summary (accordion) ── */
.article-rich-text details {
  margin: 1.5em 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  overflow: hidden;
}
.article-rich-text summary {
  padding: 14px 20px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  background: var(--surface-2);
  transition: background 150ms;
  list-style: none;
}
.article-rich-text summary::-webkit-details-marker { display: none; }
.article-rich-text summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 10px;
  transition: transform 200ms;
  color: var(--primary);
  font-weight: 900;
}
.article-rich-text details[open] summary::before {
  transform: rotate(90deg);
}
.article-rich-text details[open] summary {
  border-bottom: 1px solid var(--line);
}
.article-rich-text details > *:not(summary) {
  padding: 16px 20px;
}

/* ── Responsive — Mobile ── */
@media (max-width: 768px) {
  .article-rich-text {
    font-size: 15px;
  }
  .article-rich-text h1 { font-size: 24px; }
  .article-rich-text h2 { font-size: 20px; }
  .article-rich-text h3 { font-size: 18px; }
  .article-rich-text h4 { font-size: 16px; }

  .article-rich-text blockquote {
    padding: 18px 20px;
    margin: 1.5em 0;
  }
  .article-rich-text blockquote::before {
    font-size: 40px;
    top: -4px;
    left: 10px;
  }

  .article-rich-text table {
    font-size: 13px;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .article-rich-text thead th,
  .article-rich-text tbody td {
    padding: 10px 14px;
  }

  .article-rich-text pre {
    padding: 16px;
    font-size: 13px;
  }

  .article-rich-text ul li,
  .article-rich-text ol li {
    font-size: 15px;
  }
}
