@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@600;700&family=Playfair+Display:ital,wght@0,600;0,700;1,600&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --blog-primary: #0080D7;
  --blog-primary-hover: #006bb5;
  --blog-text-dark: #111827;
  --blog-text-body: #374151;
  --blog-text-muted: #6B7280;
  --blog-text-subtle: #9CA3AF;
  --blog-bg-light: #F9FAFB;
  --blog-border: #E5E7EB;
  --blog-dark-card: #0B111E;
}

*,
*::before,
*::after {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html,
body {
  max-width: 100%;
  overflow-x: clip;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Top horizontal reading progress bar (hidden on web/desktop, visible on mobile) */
.reading-progress-top-bar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3.5px;
  background: linear-gradient(90deg, #8E51FF 0%, #0087F0 100%);
  z-index: 10001;
  transition: width 0.1s ease-out;
  pointer-events: none;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--blog-text-dark);
  background-color: #FFFFFF;
  -webkit-font-smoothing: antialiased;
}

input,
button,
select,
textarea {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ==========================================================================
   Blog Listing Page - Hero Section
   ========================================================================== */
.blog-hero-container {
  width: 83%;
  max-width: 100rem;
  margin: 0 auto;
  padding: 3rem 0 1.5rem;
  text-align: center;
}

.blog-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 1.125rem;
  border-radius: 624.9375rem;
  background-color: #EBF5FF;
  border: 0.0625rem solid #C7E2FE;
  color: var(--blog-primary);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.blog-badge-pill svg {
  width: 1rem;
  height: 1rem;
}

.blog-hero-title {
  font-size: 2.625rem;
  font-weight: 800;
  color: #111827;
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.blog-hero-highlight {
  font-family: 'BakeshopRegular', sans-serif;
  font-size: 4.375rem;
  color: var(--blog-primary);
  font-weight: 500;
  display: block;
  line-height: 1.15;
}

/* ==========================================================================
   Filter Pills & Search Bar
   ========================================================================== */
.blog-controls-row {
  width: 83%;
  max-width: 100rem;
  margin: 2rem auto 2.25rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: nowrap;
}

.blog-filter-nav-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.blog-pill-scroll-btn {
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  border-radius: 50%;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  color: #374151;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
  padding: 0;
  flex-shrink: 0;
  z-index: 5;
}

.blog-pill-scroll-btn:hover {
  background: var(--blog-primary);
  border-color: var(--blog-primary);
  color: #FFFFFF;
  box-shadow: 0 4px 10px rgba(0, 128, 215, 0.25);
  transform: scale(1.05);
}

.blog-pill-scroll-btn:active {
  transform: scale(0.95);
}

.blog-filter-pills {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  padding: 0.25rem 0.125rem;
}

.blog-filter-pills::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  flex-shrink: 0;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.25rem;
  border-radius: 624.9375rem;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  background: #FFFFFF;
  color: #374151;
  border: 0.0625rem solid #E5E7EB;
  transition: all 0.2s ease;
}

.filter-pill:hover {
  background: #F9FAFB;
  border-color: #D1D5DB;
  color: #111827;
}

.filter-pill.active {
  background: var(--blog-primary);
  border-color: var(--blog-primary);
  color: #FFFFFF;
  box-shadow: 0 0.125rem 0.5rem rgba(0, 128, 215, 0.25);
}

.blog-search-box {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  background: #FFFFFF;
  border: 0.0625rem solid #E5E7EB;
  border-radius: 624.9375rem;
  padding: 0.5rem 1.125rem;
  width: 16.875rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.blog-search-box:focus-within {
  border-color: var(--blog-primary);
  box-shadow: 0 0 0 0.1875rem rgba(0, 128, 215, 0.15);
}

.blog-search-box svg {
  color: #9CA3AF;
  flex-shrink: 0;
}

.blog-search-input {
  border: none;
  outline: none;
  background: transparent;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.875rem;
  color: #111827;
  flex: 1;
  min-width: 0;
  width: 100%;
}

.blog-search-input::placeholder {
  color: #9CA3AF;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.blog-search-clear {
  background: transparent;
  border: none;
  color: #9CA3AF;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, background-color 0.2s ease;
  margin-left: auto;
  flex-shrink: 0;
}

.blog-search-clear:hover {
  color: #4B5563;
  background: #F3F4F6;
}

.blog-search-clear svg {
  color: inherit;
}

/* ==========================================================================
   Category Pill Badges
   ========================================================================== */
.cat-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 624.9375rem;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.3;
}

.cat-badge-purple {
  background-color: #EDE9FE;
  color: #7C3AED;
}

.cat-badge-green {
  background-color: #D1FAE5;
  color: #065F46;
}

.cat-badge-blue {
  background-color: #DBEAFE;
  color: #1D4ED8;
}

.cat-badge-orange {
  background-color: #FFEDD5;
  color: #C2410C;
}

.cat-badge-grey,
.cat-badge-gray {
  background-color: #F3F4F6;
  color: #374151;
}

.cat-badge-red {
  background-color: #FEE2E2;
  color: #B91C1C;
}

.badge-featured {
  background-color: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(0.5rem);
  color: #FFFFFF;
  border: 0.0625rem solid rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.75rem;
  border-radius: 624.9375rem;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ==========================================================================
   Blog Posts Grid Layout
   ========================================================================== */
.blog-grid-container {
  width: 83%;
  max-width: 100rem;
  margin: 0 auto 5rem;
  padding: 0;
}

/* Top Row: Featured Card (2 cols) + Standard Card (1 col) */
.blog-top-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Featured Large Card */
.featured-blog-card {
  position: relative;
  border-radius: 1.25rem;
  overflow: hidden;
  min-height: 25rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2.25rem;
  text-decoration: none;
  color: #FFFFFF;
  background-color: #0B111E;
  box-shadow: 0 0.625rem 1.5625rem -0.3125rem rgba(0, 0, 0, 0.1), 0 0.5rem 0.625rem -0.375rem rgba(0, 0, 0, 0.1);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.featured-blog-card:hover {
  transform: translateY(-0.25rem);
  box-shadow: 0 1.25rem 1.875rem -0.625rem rgba(0, 0, 0, 0.25);
}

.featured-card-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  filter: brightness(0.65) contrast(1.1);
}

.featured-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.2) 0%, rgba(15, 23, 42, 0.85) 60%, rgba(15, 23, 42, 0.95) 100%);
  z-index: 2;
}

.featured-card-content {
  position: relative;
  z-index: 3;
}

.featured-badges-row {
  position: absolute;
  top: 2rem;
  left: 2.25rem;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.featured-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.3;
  margin: 0 0 0.75rem;
}

.featured-excerpt {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.55;
  margin: 0 0 1.25rem;
  max-width: 90%;
}

.featured-author-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.author-avatar-circle {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8125rem;
  color: #FFFFFF;
  flex-shrink: 0;
}

.author-info-text {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.8125rem;
  font-weight: 500;
}

/* ==========================================================================
   Standard Blog Post Card
   ========================================================================== */
.standard-blog-card {
  background: #FFFFFF;
  border: 0.0625rem solid #E5E7EB;
  border-radius: 1.25rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--blog-text-dark);
  box-shadow: 0 0.25rem 0.375rem -0.0625rem rgba(0, 0, 0, 0.05);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.standard-blog-card:hover {
  transform: translateY(-0.25rem);
  box-shadow: 0 0.75rem 1.5rem -0.5rem rgba(0, 0, 0, 0.12);
}

.card-img-wrapper {
  position: relative;
  width: 100%;
  height: 12.5rem;
  overflow: hidden;
  background-color: #F3F4F6;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.card-cat-badge {
  position: absolute;
  top: 0.875rem;
  left: 0.875rem;
  z-index: 2;
}

.card-body {
  padding: 1.375rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.35;
  margin: 0 0 0.625rem;
}

.card-excerpt {
  font-size: 0.875rem;
  color: #6B7280;
  line-height: 1.5;
  margin: 0 0 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
}

.card-author-left {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.card-author-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
  line-height: 1.2;
}

.card-author-meta {
  font-size: 0.75rem;
  color: #6B7280;
  margin: 0.125rem 0 0;
}

.card-arrow-icon {
  color: #9CA3AF;
  display: flex;
  align-items: center;
  transition: transform 0.2s ease, color 0.2s ease;
}

.standard-blog-card:hover .card-arrow-icon {
  color: var(--blog-primary);
  transform: translateX(0.1875rem);
}

/* 3-Cards Grid Row */
.blog-standard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* ==========================================================================
   Blog Empty State (Matching FAQ Empty State)
   ========================================================================== */
.blog-empty-state,
.faq-empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  background: #FFFFFF;
  border: 1px dashed #CBD5E1;
  border-radius: 1.25rem;
  margin: 1.5rem 0 3rem;
  width: 100%;
}

.blog-empty-icon,
.faq-empty-icon {
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.blog-empty-title,
.faq-empty-title {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--blog-text-dark, #111827);
  margin: 0 0 0.5rem;
}

.blog-empty-desc,
.faq-empty-desc {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.95rem;
  color: var(--blog-text-muted, #6B7280);
  max-width: 28rem;
  margin: 0 auto 1.5rem;
  line-height: 1.5;
}

.blog-btn-clear-search,
.faq-btn-clear-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.4rem;
  background: var(--blog-primary, #0080D7);
  color: #FFFFFF !important;
  border: none;
  border-radius: 624.9375rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.25s ease, transform 0.25s ease;
}

.blog-btn-clear-search:hover,
.faq-btn-clear-search:hover {
  background: var(--blog-primary-hover, #006bb5);
  color: #FFFFFF !important;
  transform: translateY(-1px);
}

/* ==========================================================================
   Public Blog Pagination Controls
   ========================================================================== */
.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3.5rem;
  padding: 1rem 0 0;
  flex-wrap: wrap;
}

.blog-page-numbers {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.blog-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.875rem;
  border-radius: 0.5rem;
  border: 1px solid var(--blog-border, #E5E7EB);
  background-color: #FFFFFF;
  color: var(--blog-text-dark, #111827);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.blog-page-btn:hover:not(.disabled):not(.active) {
  border-color: #0080D7;
  color: #0080D7;
  background-color: #F0F9FF;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 128, 215, 0.12);
}

.blog-page-btn.active {
  background-color: #0080D7;
  border-color: #0080D7;
  color: #FFFFFF;
  font-weight: 600;
  cursor: default;
  box-shadow: 0 2px 6px rgba(0, 128, 215, 0.28);
}

.blog-page-btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  background-color: #F9FAFB;
  border-color: #E5E7EB;
  color: #9CA3AF;
  box-shadow: none;
}

.blog-page-btn svg {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
}

.blog-page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 2.5rem;
  color: #9CA3AF;
  font-weight: 600;
  font-size: 0.95rem;
  user-select: none;
}

@media (max-width: 48rem) {
  .blog-pagination {
    margin-top: 2.5rem;
    gap: 0.375rem;
  }

  .blog-page-btn {
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.625rem;
    font-size: 0.8125rem;
    border-radius: 0.375rem;
  }

  .blog-page-nav span {
    display: none;
  }

  .blog-page-nav {
    padding: 0 0.5rem;
    min-width: 2.25rem;
  }
}

/* ==========================================================================
   Blog Detail Page Styles
   ========================================================================== */
.blog-detail-container {
  width: 83%;
  max-width: 100rem;
  margin: 0 auto;
  padding: 0;
}

/* Detail Hero Banner */
.detail-hero-banner {
  position: relative;
  border-radius: 1.25rem;
  overflow: hidden;
  min-height: 23.75rem;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  margin: 1.5rem 0 3rem;
  background-color: #0B111E;
  box-shadow: 0 0.625rem 1.5625rem -0.3125rem rgba(0, 0, 0, 0.1);
}

.detail-hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.6) contrast(1.1);
}

.detail-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.3) 0%, rgba(15, 23, 42, 0.88) 60%, rgba(15, 23, 42, 0.96) 100%);
}

.detail-hero-content {
  position: relative;
  z-index: 3;
}

.detail-badges-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1.125rem;
}

.detail-title {
  font-size: 2.375rem;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.25;
  margin: 0 0 0.875rem;
  max-width: 75rem;
}

.detail-excerpt {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.55;
  margin: 0 0 1.5rem;
  max-width: 70rem;
}

.detail-author-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.detail-author-text {
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.875rem;
  font-weight: 500;
}

/* 2-Column Detail Body Layout */
.detail-main-layout {
  display: grid;
  grid-template-columns: 16rem minmax(0, 1fr);
  gap: 3.5rem;
  align-items: start;
  margin-bottom: 4rem;
  min-width: 0;
  max-width: 100%;
}

/* Left Column: Reading Progress & Sticky Outline TOC with Separate Scroll */
.detail-sidebar-left {
  position: sticky;
  top: 8rem;
  max-height: calc(100vh - 9.5rem);
  display: flex;
  flex-direction: column;
  align-self: start;
  min-width: 0;
  z-index: 10;
}

.reading-progress-widget {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1.5rem;
  flex-shrink: 0;
}

.progress-circle-container {
  position: relative;
  width: 2.75rem;
  height: 2.75rem;
}

.progress-circle-svg {
  width: 2.75rem;
  height: 2.75rem;
  transform: rotate(-90deg);
}

.progress-circle-bg {
  fill: none;
  stroke: #E5E7EB;
  stroke-width: 3.5;
}

.progress-circle-bar {
  fill: none;
  stroke: var(--blog-primary);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 0.15s ease;
}

.progress-circle-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--blog-primary);
}

.progress-label-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
  line-height: 1.2;
}

.progress-label-sub {
  font-size: 0.75rem;
  color: #9CA3AF;
  margin: 0.125rem 0 0;
}

.toc-header {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9CA3AF;
  margin: 0 0 0.875rem;
  flex-shrink: 0;
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  overflow-y: auto;
  max-height: calc(100vh - 17rem);
  padding-right: 0.5rem;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #CBD5E1 transparent;
}

.toc-list::-webkit-scrollbar {
  width: 4px;
}

.toc-list::-webkit-scrollbar-track {
  background: transparent;
}

.toc-list::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

.toc-list::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

.toc-item {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  text-decoration: none;
  color: #4B5563;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
  transition: color 0.2s ease;
}

.toc-item:hover {
  color: var(--blog-primary);
}

.toc-num-badge {
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 600;
  flex-shrink: 0;
  background: #FFFFFF;
  color: #6B7280;
  border: 0.0625rem solid #D1D5DB;
  transition: all 0.2s ease;
}

.toc-item.active {
  color: var(--blog-primary);
  font-weight: 700;
}

.toc-item.active .toc-num-badge {
  background: var(--blog-primary);
  color: #FFFFFF;
  border-color: var(--blog-primary);
}

/* Middle Column: Article Body */
.detail-article-body {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

.article-rich-content {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

.article-rich-content *,
.detail-article-body * {
  max-width: 100%;
  box-sizing: border-box;
}

.article-rich-content img,
.detail-article-body img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 0.75rem;
  display: block;
  margin: 1.5rem 0;
}

.article-rich-content table,
.detail-article-body table {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto;
  display: block;
}

.article-rich-content iframe,
.detail-article-body iframe,
.article-rich-content video,
.detail-article-body video {
  max-width: 100% !important;
}

.article-rich-content pre,
.detail-article-body pre {
  max-width: 100% !important;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.article-rich-content p,
.detail-article-body p {
  font-size: 0.9375rem;
  color: #374151;
  line-height: 1.75;
  margin: 0 0 1.25rem;
  overflow-wrap: break-word;
  word-break: break-word;
}

.article-rich-content ol,
.detail-article-body ol {
  list-style: decimal outside;
  padding-left: 2rem;
  margin: 1.25rem 0;
}

.article-rich-content ul,
.detail-article-body ul {
  list-style: disc outside;
  padding-left: 2rem;
  margin: 1.25rem 0;
}

.article-rich-content li,
.detail-article-body li {
  margin-bottom: 0.75rem;
  line-height: 1.75;
  color: #374151;
  font-size: 0.9375rem;
  padding-left: 0.25rem;
}

.article-rich-content ol ol,
.article-rich-content ul ol,
.detail-article-body ol ol,
.detail-article-body ul ol {
  list-style-type: lower-alpha;
  margin: 0.5rem 0;
  padding-left: 1.75rem;
}

.article-rich-content ul ul,
.article-rich-content ol ul,
.detail-article-body ul ul,
.detail-article-body ol ul {
  list-style-type: circle;
  margin: 0.5rem 0;
  padding-left: 1.75rem;
}

.article-rich-content li::marker,
.detail-article-body li::marker {
  color: var(--blog-primary);
  font-weight: 600;
}

.article-rich-content blockquote,
.detail-article-body blockquote {
  border-left: 4px solid var(--blog-primary);
  padding: 0.75rem 1rem 0.75rem 1.25rem;
  margin: 1.5rem 0;
  color: #4B5563;
  font-style: italic;
  background: #F8FAFC;
  border-radius: 0 0.5rem 0.5rem 0;
}

.article-rich-content h2,
.detail-article-body h2 {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: #111827;
  margin: 2.25rem 0 1rem;
  line-height: 1.3;
}

.article-rich-content h3,
.detail-article-body h3 {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #1F2937;
  margin: 1.75rem 0 0.875rem;
  line-height: 1.35;
}

.article-rich-content h4,
.detail-article-body h4 {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: #1F2937;
  margin: 1.5rem 0 0.75rem;
  line-height: 1.4;
}

.article-lead-text {
  font-size: 1.0625rem;
  font-style: italic;
  color: #4B5563;
  line-height: 1.7;
  margin: 0 0 2.25rem;
}

.article-section {
  margin-bottom: 2.5rem;
  scroll-margin-top: 8.75rem;
}

.article-section-heading {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 1rem;
  line-height: 1.3;
}

.article-paragraph {
  font-size: 0.9375rem;
  color: #374151;
  line-height: 1.75;
  margin: 0 0 1.125rem;
}

.highlight-blue {
  color: var(--blog-primary);
  font-weight: 700;
}

/* Dark Metric Stats Callout Grid */
.article-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.75rem 0 2.25rem;
}

.stat-box-card {
  background: var(--blog-dark-card);
  border-radius: 0.875rem;
  padding: 1.375rem 1rem;
  text-align: center;
  color: #FFFFFF;
  box-shadow: 0 0.25rem 0.375rem -0.0625rem rgba(0, 0, 0, 0.1);
}

.stat-box-value {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.875rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.stat-box-label {
  font-size: 0.75rem;
  color: #94A3B8;
  line-height: 1.45;
  margin: 0;
  font-weight: 400;
}

/* Bottom Section: Related Blogs */
.detail-bottom-related {
  margin: 3.5rem 0 5.5rem;
  padding-top: 3.5rem;
  border-top: 1px solid #E5E7EB;
}

.related-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.related-tagline {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blog-primary);
  margin-bottom: 0.375rem;
}

.related-section-heading {
  font-size: 1.875rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.related-carousel-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.related-nav-btn {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: #FFFFFF;
  border: 1.5px solid #E5E7EB;
  color: #374151;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  padding: 0;
}

.related-nav-btn:hover:not(:disabled) {
  background: var(--blog-primary);
  border-color: var(--blog-primary);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
  transform: translateY(-1px);
}

.related-nav-btn:active:not(:disabled) {
  transform: translateY(0);
}

.related-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: #E5E7EB;
  color: #9CA3AF;
  box-shadow: none;
  transform: none;
}

.related-cards-track-wrapper {
  position: relative;
  width: 100%;
}

.related-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.related-cards-grid.is-carousel {
  display: flex;
  flex-wrap: nowrap;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0.375rem 0.25rem 0.75rem 0.25rem;
  margin: -0.375rem -0.25rem -0.75rem -0.25rem;
}

.related-cards-grid.is-carousel::-webkit-scrollbar {
  display: none;
}

.related-cards-grid.is-carousel .related-card-item {
  flex: 0 0 calc((100% - 3rem) / 3);
  scroll-snap-align: start;
  min-width: 17.5rem;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 87.5rem) {
  .detail-sidebar-left {
    top: 6.25rem;
    max-height: calc(100vh - 7.5rem);
  }
}

@media (max-width: 68.75rem) {
  .detail-main-layout {
    grid-template-columns: 14rem minmax(0, 1fr);
    gap: 2rem;
  }
}

@media (max-width: 56.25rem) {

  .blog-hero-container,
  .blog-controls-row,
  .blog-grid-container,
  .blog-detail-container {
    width: 92%;
  }

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

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

  .detail-main-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .blog-controls-row {
    flex-wrap: wrap;
    gap: 1.25rem;
  }

  .blog-filter-nav-wrapper {
    width: 100%;
    order: 1;
  }

  .blog-search-box {
    width: 100%;
    order: 2;
  }

  /* Hide left sidebar circular progress in mobile view, show top reading progress bar instead */
  .detail-sidebar-left {
    display: none !important;
  }

  .reading-progress-widget {
    display: none !important;
  }

  .reading-progress-top-bar {
    display: block !important;
  }

  .toc-list {
    max-height: none !important;
    overflow-y: visible !important;
  }

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

  .related-cards-grid.is-carousel {
    display: flex;
  }

  .related-cards-grid.is-carousel .related-card-item {
    flex: 0 0 calc((100% - 1.5rem) / 2);
    min-width: 16rem;
  }

  .article-stats-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

@media (max-width: 40rem) {

  .blog-hero-container,
  .blog-controls-row,
  .blog-grid-container,
  .blog-detail-container {
    width: 95%;
  }

  .blog-hero-title {
    font-size: 2rem;
  }

  .blog-hero-highlight {
    font-size: 2.5rem;
  }

  .blog-controls-row {
    flex-direction: column;
    align-items: stretch;
  }

  .blog-search-box {
    width: 100%;
  }

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

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

  .related-cards-grid.is-carousel .related-card-item {
    flex: 0 0 85%;
    min-width: 15rem;
  }

  .detail-hero-banner {
    padding: 1.75rem 1.25rem;
    min-height: 18.75rem;
  }

  .detail-title {
    font-size: 1.625rem;
  }

  .featured-blog-card {
    padding: 1.5rem;
    min-height: 20rem;
  }

  .featured-title {
    font-size: 1.375rem;
  }
}