/* ==========================================================================
   ITConnect.ge — Blog Styles
   Modern premium B2B blog layout
   Dependencies: Bootstrap 5.3.6
   Brand: #ED2328 | Dark navy: #1a1a2e
   Fonts: 'BPG Nino Mtavruli' (ka), 'Plus Jakarta Sans' / 'Inter' (en)
   ========================================================================== */

/* ---------- CSS Custom Properties ---------- */
:root {
  --blog-red: #ED2328;
  --blog-red-hover: #d41d21;
  --blog-red-light: rgba(237, 35, 40, 0.08);
  --blog-red-glow: rgba(237, 35, 40, 0.18);
  --blog-navy: #1a1a2e;
  --blog-navy-soft: #2d2d44;
  --blog-bg: #ffffff;
  --blog-bg-alt: #f8f9fa;
  --blog-bg-card: #ffffff;
  --blog-text: #1a1a2e;
  --blog-text-secondary: #4a4a5e;
  --blog-text-muted: #8e8ea0;
  --blog-border: #e8e8ee;
  --blog-border-light: #f0f0f5;
  --blog-radius: 16px;
  --blog-radius-sm: 10px;
  --blog-radius-xs: 6px;
  /* Shadows kept subtle — premium B2B feel, not SaaS card-heavy */
  --blog-shadow: 0 1px 3px rgba(26, 26, 46, 0.04), 0 4px 12px rgba(26, 26, 46, 0.06);
  --blog-shadow-hover: 0 4px 16px rgba(26, 26, 46, 0.08), 0 16px 40px rgba(26, 26, 46, 0.10);
  --blog-shadow-lg: 0 8px 24px rgba(26, 26, 46, 0.08), 0 24px 48px rgba(26, 26, 46, 0.12);
  --blog-transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --blog-content-width: 780px;
  --blog-wide-width: 1240px;
}

/* ---------- Blog Font Overrides ---------- */
/* Override global BPG Nino Mtavruli (all-caps font) for blog content */
.blog-hero,
.blog-filters,
.blog-grid,
.article-hero,
.article-content,
.article-toc,
.article-share,
.article-related {
  font-family: 'Inter', 'BPG Glaho', 'DejaVu Sans', Arial, sans-serif !important;
  font-weight: 400 !important;
  font-size: 16px !important;
  text-transform: none !important;
  text-align: left !important;
  letter-spacing: normal !important;
}

.blog-hero *,
.blog-filters *:not(i):not([class*="fa-"]),
.blog-grid *:not(i):not([class*="fa-"]),
.article-hero *:not(i):not([class*="fa-"]),
.article-content *:not(i):not([class*="fa-"]),
.article-toc *:not(i):not([class*="fa-"]),
.article-share *:not(i):not([class*="fa-"]),
.article-related *:not(i):not([class*="fa-"]) {
  font-family: inherit !important;
  text-transform: none !important;
}

.blog-hero h1,
.blog-hero h2,
.article-hero h1,
.article-content h2,
.article-content h3,
.article-related h2,
.blog-card__title {
  font-family: 'BPG Nino Mtavruli', 'Inter', sans-serif !important;
  font-weight: 700 !important;
}

html[lang="en"] .blog-hero,
html[lang="en"] .blog-filters,
html[lang="en"] .blog-grid,
html[lang="en"] .article-hero,
html[lang="en"] .article-content,
html[lang="en"] .article-toc,
html[lang="en"] .article-share,
html[lang="en"] .article-related {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif !important;
}

html[lang="en"] .blog-hero h1,
html[lang="en"] .article-hero h1,
html[lang="en"] .article-content h2,
html[lang="en"] .article-content h3,
html[lang="en"] .blog-card__title {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif !important;
  font-weight: 800 !important;
}

/* ==========================================================================
   1. READING PROGRESS BAR
   Provides spatial orientation in long-form articles — reduces "lost" feeling
   ========================================================================== */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--blog-red);
  z-index: 9999;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}

/* ==========================================================================
   2. BLOG LISTING PAGE
   ========================================================================== */

/* ---------- Blog Hero ---------- */
.blog-hero {
  position: relative;
  padding: 100px 0 64px;
  background: var(--blog-bg);
  text-align: center;
  overflow: hidden;
}

.blog-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, var(--blog-red-light) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0.5;
}

.blog-hero__title {
  position: relative;
  font-size: 52px;
  font-weight: 800;
  color: var(--blog-navy);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.blog-hero__subtitle {
  position: relative;
  font-size: 20px;
  font-weight: 400;
  color: var(--blog-text-secondary);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.65;
}

/* ---------- Blog Filters ---------- */
/* Sticky filter bar — important for scannability on content-heavy listing pages */
.blog-filters {
  padding: 20px 0 0;
  background: var(--blog-bg);
  border-bottom: 1px solid var(--blog-border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.94);
}

.blog-filters__inner {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 20px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.blog-filters__inner::-webkit-scrollbar {
  display: none;
}

/* Pill shape (100px radius) signals clickable category tags — familiar pattern */
.blog-filters__pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--blog-text-secondary);
  background: transparent;
  border: 1px solid var(--blog-border);
  border-radius: 100px;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--blog-transition);
  text-decoration: none;
  user-select: none;
  letter-spacing: 0.01em;
}

.blog-filters__pill:hover {
  color: var(--blog-navy);
  border-color: var(--blog-navy);
  background: var(--blog-bg-alt);
}

.blog-filters__pill.active,
.blog-filters__pill--active {
  color: #ffffff;
  background: var(--blog-red);
  border-color: var(--blog-red);
}

.blog-filters__pill.active:hover,
.blog-filters__pill--active:hover {
  background: var(--blog-red-hover);
  border-color: var(--blog-red-hover);
}

.blog-filters__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 100px;
  background: var(--blog-border-light);
  color: var(--blog-text-muted);
}

.blog-filters__pill.active .blog-filters__count,
.blog-filters__pill--active .blog-filters__count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* ---------- Blog Grid ---------- */
.blog-grid {
  padding: 56px 0 80px;
  background: var(--blog-bg-alt);
}

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

/* Featured / first card — full width */
.blog-grid__container .blog-card--featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0;
}

.blog-card--featured .blog-card__image-wrap {
  height: 100%;
  min-height: 360px;
  border-radius: var(--blog-radius) 0 0 var(--blog-radius);
}

.blog-card--featured .blog-card__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 44px;
}

.blog-card--featured .blog-card__title {
  font-size: 26px;
  line-height: 1.3;
}

.blog-card--featured .blog-card__desc {
  font-size: 16px;
  -webkit-line-clamp: 4;
}

/* ---------- Blog Card ---------- */
.blog-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--blog-bg-card);
  border-radius: var(--blog-radius);
  overflow: hidden;
  box-shadow: var(--blog-shadow);
  transition: transform var(--blog-transition), box-shadow var(--blog-transition);
  text-decoration: none;
  color: inherit;
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--blog-shadow-hover);
}

.blog-card:focus-visible {
  outline: 2px solid var(--blog-red);
  outline-offset: 2px;
}

/* Card image */
.blog-card__image-wrap {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: var(--blog-bg-alt);
}

.blog-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-card:hover .blog-card__image {
  transform: scale(1.04);
}

/* Category badge overlaying the image */
.blog-card__badge {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff;
  background: var(--blog-red);
  border-radius: 100px;
  z-index: 2;
}

.blog-card__badge--outline {
  color: var(--blog-red);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--blog-red-light);
}

/* Card body — flex column keeps the "read more" link pinned to the bottom */
.blog-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 28px 24px 24px;
}

.blog-card__category {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--blog-red);
  margin-bottom: 10px;
}

/* 20px for body card titles — readable at a glance, compact for grid */
.blog-card__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--blog-navy);
  line-height: 1.35;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/*
  15px minimum for descriptions — 14px was below WCAG readability guidance
  for secondary text on a white background in a data-dense layout.
*/
.blog-card__desc {
  font-size: 15px;
  font-weight: 400;
  color: var(--blog-text-secondary);
  line-height: 1.65;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* Card meta row — date and read time */
.blog-card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--blog-border-light);
  font-size: 13px;
  font-weight: 500;
  color: var(--blog-text-muted);
}

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

.blog-card__meta-item svg,
.blog-card__meta-item i {
  width: 14px;
  height: 14px;
  opacity: 0.6;
  font-size: 12px;
}

.blog-card__meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--blog-text-muted);
  opacity: 0.5;
}

/* Arrow link at bottom of card — animates right on hover (Fitts's law: larger target) */
.blog-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--blog-red);
  text-decoration: none;
  margin-top: auto;
  padding-top: 16px;
  transition: gap var(--blog-transition);
}

.blog-card__link::after {
  content: '\2192';
  display: inline-block;
  transition: transform var(--blog-transition);
}

.blog-card:hover .blog-card__link::after,
.blog-card__link:hover::after {
  transform: translateX(4px);
}

/* ---------- Blog Pagination ---------- */
.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 48px 0 0;
}

.blog-pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--blog-text-secondary);
  background: var(--blog-bg-card);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-xs);
  cursor: pointer;
  transition: all var(--blog-transition);
  text-decoration: none;
}

.blog-pagination__btn:hover {
  color: var(--blog-navy);
  border-color: var(--blog-navy);
}

.blog-pagination__btn.active,
.blog-pagination__btn--active {
  color: #ffffff;
  background: var(--blog-red);
  border-color: var(--blog-red);
}

/* ==========================================================================
   3. BLOG DETAIL / ARTICLE PAGE
   ========================================================================== */

/* ---------- Article Hero ---------- */
/*
  min-height 520px gives the hero photo enough breathing room to establish
  context before the content starts. Text is anchored to the bottom via
  align-items: flex-end — the gradient overlay ensures legibility.
*/
.article-hero {
  position: relative;
  width: 100%;
  min-height: 560px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--blog-navy);
}

.article-hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
}

.article-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(26, 26, 46, 0.95) 0%,
    rgba(26, 26, 46, 0.55) 45%,
    rgba(26, 26, 46, 0.15) 100%
  );
}

.article-hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 32px 60px;
}

.article-hero__badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #ffffff;
  background: var(--blog-red);
  border-radius: 100px;
  margin-bottom: 20px;
}

/*
  48px title is large enough to anchor the hero visually, but capped at 800px
  width so lines stay short enough to read without eye-tracking fatigue.
*/
.article-hero__title {
  font-size: 52px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
  letter-spacing: -0.03em;
  max-width: 820px;
  margin-bottom: 28px;
}

.article-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
}

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

.article-hero__meta-item i {
  opacity: 0.55;
  font-size: 13px;
}

.article-hero__author-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
  margin-right: 4px;
}

/* ---------- Article Layout — Three-Column Grid ---------- */
/*
  Column order: share sidebar | content | TOC sidebar
  At ≥1200px all three columns are visible.
  At <1200px collapses to single content column; TOC becomes hidden (or inline).

  The outer max-width is calculated so content stays at the comfortable
  reading width (720px) with sidebars of ~64px (share) and ~240px (TOC).
*/
.article-layout {
  display: grid;
  grid-template-columns: 56px minmax(0, var(--blog-content-width));
  grid-template-areas: "share content";
  gap: 48px;
  max-width: 960px;
  margin: 0 auto;
  padding: 72px 40px 100px;
  align-items: start;
}

/* Explicit area assignments ensure correct visual order */
.article-layout > .article-share   { grid-area: share; }
.article-layout > .article-content { grid-area: content; }
.article-layout > .article-toc     { display: none; }

/* When no TOC sidebar — content centered */
.article-layout--no-toc {
  grid-template-columns: 64px minmax(0, var(--blog-content-width)) 1fr;
  grid-template-areas: "share content .";
}

/* ---------- Article Content / Typography ---------- */
/*
  18px body at 1.8 line-height = optimal for long-form reading.
  Studies consistently show 1.5–1.8 line-height reduces eye-tracking errors.
*/
.article-content {
  max-width: var(--blog-content-width);
  width: 100%;
  font-size: 19px;
  font-weight: 400;
  line-height: 1.85;
  color: var(--blog-text-secondary);
  text-align: left;
}

/* Consistent vertical rhythm between all block elements */
.article-content > * + * {
  margin-top: 1.6em;
}

/* ---------- Heading Hierarchy ---------- */
/*
  H2: 30px — major section breaks. Border-top adds a visual "chapter" separator.
  H3: 22px — subsections. Distinct from body (18px) but clearly subordinate to H2.
  H4: 19px — infrequently used; only a notch above body.
  Rationale: stepping font sizes in ~25-30% increments creates clear hierarchy
  without requiring the user to consciously read the heading level.
*/
.article-content h1 {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--blog-navy);
  margin-top: 2.4em;
  margin-bottom: 0.6em;
}

.article-content h2 {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--blog-navy);
  margin-top: 2.8em;
  margin-bottom: 0.7em;
  padding-top: 32px;
  border-top: 2px solid var(--blog-border-light);
}

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

.article-content h3 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--blog-navy);
  margin-top: 2.2em;
  margin-bottom: 0.5em;
}

.article-content h4 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--blog-navy);
  margin-top: 1.8em;
  margin-bottom: 0.4em;
}

/* Anchor links on headings — visible on hover only to avoid visual noise */
.article-content h2 .anchor-link,
.article-content h3 .anchor-link {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.7em;
  color: var(--blog-text-muted);
  text-decoration: none;
  opacity: 0;
  transition: opacity var(--blog-transition);
  vertical-align: middle;
}

.article-content h2:hover .anchor-link,
.article-content h3:hover .anchor-link {
  opacity: 1;
}

.article-content h2 .anchor-link:hover,
.article-content h3 .anchor-link:hover {
  color: var(--blog-red);
}

/* ---------- Body Text Elements ---------- */

.article-content p {
  margin-bottom: 0;
}

.article-content a {
  color: var(--blog-red);
  text-decoration: underline;
  text-decoration-color: rgba(237, 35, 40, 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--blog-transition);
}

.article-content a:hover {
  text-decoration-color: var(--blog-red);
}

.article-content strong {
  font-weight: 700;
  color: var(--blog-navy);
}

/* ---------- Images ---------- */

.article-content img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--blog-radius);
  margin-top: 2em;
  margin-bottom: 0.5em;
  box-shadow: 0 4px 16px rgba(26, 26, 46, 0.08);
}

/* Full-bleed wide image — breaks out of content column for visual impact */
.article-content .article-image--wide {
  width: calc(100% + 100px);
  max-width: calc(100% + 100px);
  margin-left: -50px;
  margin-right: -50px;
  border-radius: var(--blog-radius);
  box-shadow: 0 8px 32px rgba(26, 26, 46, 0.10);
}

.article-content figcaption,
.article-content .image-caption {
  font-size: 14px;
  font-weight: 500;
  color: var(--blog-text-muted);
  text-align: center;
  margin-top: 14px;
  margin-bottom: 1.5em;
  line-height: 1.5;
  font-style: italic;
}

.article-content figure {
  margin: 3em 0;
}

.article-content figure img {
  margin-top: 0;
  margin-bottom: 0;
}

/* ---------- Blockquotes ---------- */
/*
  Left-bordered blockquote pattern is a well-established signal for
  "important callout". The pale background lifts it from the page flow
  without the aggressive visual weight of a full-colour box.
*/
.article-content blockquote {
  position: relative;
  margin: 2.5em 0;
  padding: 28px 32px 28px 36px;
  background: linear-gradient(135deg, #f8f9fb 0%, #f1f3f7 100%);
  border-left: 4px solid var(--blog-red);
  border-radius: 0 var(--blog-radius) var(--blog-radius) 0;
  font-size: 17px;
  font-style: normal;
  color: var(--blog-navy);
  line-height: 1.75;
  box-shadow: 0 2px 8px rgba(26, 26, 46, 0.04);
}

.article-content blockquote p {
  margin: 0;
}

.article-content blockquote p + p {
  margin-top: 0.8em;
}

.article-content blockquote cite,
.article-content blockquote footer {
  display: block;
  font-size: 13px;
  font-style: normal;
  font-weight: 600;
  color: var(--blog-text-muted);
  margin-top: 12px;
}

.article-content blockquote cite::before,
.article-content blockquote footer::before {
  content: '\2014\00a0';
}

/* ---------- Lists ---------- */

.article-content ul {
  list-style: none;
  padding-left: 0;
  margin: 1.5em 0;
}

.article-content ul li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 10px;
  line-height: 1.75;
}

.article-content ul li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 11px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blog-red);
  opacity: 0.65;
}

.article-content ol {
  list-style: none;
  padding-left: 0;
  margin: 1.5em 0;
  counter-reset: ol-counter;
}

.article-content ol li {
  position: relative;
  padding-left: 40px;
  margin-bottom: 14px;
  line-height: 1.75;
  counter-increment: ol-counter;
}

.article-content ol li::before {
  content: counter(ol-counter);
  position: absolute;
  left: 0;
  top: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  font-size: 12px;
  font-weight: 700;
  color: var(--blog-red);
  background: var(--blog-red-light);
  border-radius: 50%;
}

/* Nested lists */
.article-content ul ul,
.article-content ol ol,
.article-content ul ol,
.article-content ol ul {
  margin: 8px 0 4px;
}

.article-content ul ul li::before {
  width: 5px;
  height: 5px;
  background: transparent;
  border: 2px solid var(--blog-red);
  opacity: 0.45;
  top: 13px;
}

/* ---------- Code ---------- */

.article-content code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.87em;
  padding: 2px 7px;
  background: var(--blog-bg-alt);
  border: 1px solid var(--blog-border);
  border-radius: 5px;
  color: var(--blog-red-hover);
  word-break: break-word;
}

.article-content pre {
  margin: 2em 0;
  padding: 24px 28px;
  background: var(--blog-navy);
  color: #e0e0e8;
  border-radius: var(--blog-radius-sm);
  overflow-x: auto;
  font-size: 15px;
  line-height: 1.7;
  -webkit-overflow-scrolling: touch;
}

.article-content pre code {
  font-size: inherit;
  padding: 0;
  background: transparent;
  border: none;
  color: inherit;
  border-radius: 0;
}

/* ---------- Horizontal Rule ---------- */

.article-content hr {
  border: none;
  height: 1px;
  background: var(--blog-border);
  margin: 3em 0;
}

/* ---------- Tables ---------- */

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  font-size: 16px;
}

.article-content thead th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 700;
  color: var(--blog-navy);
  border-bottom: 2px solid var(--blog-border);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.article-content tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--blog-border-light);
  color: var(--blog-text-secondary);
}

.article-content tbody tr:last-child td {
  border-bottom: none;
}

/* ---------- Article CTA Box (in-content) ---------- */
/*
  Placed near the end of the article, just before the conclusion, this
  captures readers who have demonstrated high intent (they read to near-end).
  Dark navy background creates strong visual separation from surrounding text.
*/
.article-cta-box {
  margin: 3.5em 0 2em;
  padding: 44px 48px;
  background: linear-gradient(135deg, #1a1a2e 0%, #0d1b3e 100%);
  border-radius: var(--blog-radius);
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 8px 32px rgba(26, 26, 46, 0.15);
  position: relative;
  overflow: hidden;
}

.article-cta-box::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(237,35,40,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.article-cta-box__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blog-red);
  font-style: normal;
}

.article-cta-box__title {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
  margin: 0;
}

html[lang="en"] .article-cta-box__title {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif !important;
}

.article-cta-box__desc {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.65;
  margin: 0;
}

.article-cta-box__btn,
.article-content .article-cta-box__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  margin-top: 4px;
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff !important;
  background: var(--blog-red);
  border-radius: 100px;
  text-decoration: none !important;
  transition: background var(--blog-transition), transform var(--blog-transition);
}

.article-cta-box__btn:hover,
.article-content .article-cta-box__btn:hover {
  background: var(--blog-red-hover);
  color: #ffffff !important;
  transform: translateY(-1px);
}

/* ---------- Article Table of Contents (Sidebar) ---------- */
/*
  The TOC panel uses a light card background and a clear heading to
  signal its role as navigation — not content. The active-state highlight
  (red left border + color) provides reading position feedback.
*/
.article-toc {
  position: sticky;
  top: 96px;
  align-self: start;
  max-height: calc(100vh - 136px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--blog-border) transparent;
  background: var(--blog-bg);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius);
  padding: 28px 24px;
  box-shadow: 0 2px 12px rgba(26, 26, 46, 0.04);
}

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

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

.article-toc::-webkit-scrollbar-thumb {
  background: var(--blog-border);
  border-radius: 4px;
}

.article-toc__heading {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blog-text-muted);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--blog-border-light);
}

.article-toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 2px solid var(--blog-border-light);
}

.article-toc__item {
  margin: 0;
}

.article-toc__link {
  display: block;
  padding: 6px 0 6px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--blog-text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -2px;
  transition: all var(--blog-transition);
  line-height: 1.45;
}

.article-toc__link:hover {
  color: var(--blog-navy);
}

.article-toc__link.active,
.article-toc__link--active {
  color: var(--blog-red);
  border-left-color: var(--blog-red);
  font-weight: 600;
}

/* Nested TOC items (H3 level) — indented and slightly smaller */
.article-toc__link--h3 {
  padding-left: 28px;
  font-size: 12px;
  color: rgba(142, 142, 160, 0.8);
}

/* ---------- Article Share Buttons ---------- */
.article-share {
  position: sticky;
  top: 96px;
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

.article-share__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blog-text-muted);
  margin-bottom: 2px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.article-share__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--blog-bg-alt);
  border: 1px solid var(--blog-border);
  color: var(--blog-text-secondary);
  text-decoration: none;
  transition: all var(--blog-transition);
  cursor: pointer;
}

.article-share__btn:hover {
  background: var(--blog-red-light);
  border-color: var(--blog-red);
  color: var(--blog-red);
  transform: scale(1.08);
}

.article-share__btn svg {
  width: 16px;
  height: 16px;
}

/* Inline share — shown on mobile at bottom of article */
.article-share--inline {
  position: static;
  flex-direction: row;
  justify-content: flex-start;
  padding: 28px 0;
  border-top: 1px solid var(--blog-border-light);
  margin-top: 56px;
}

.article-share--inline .article-share__label {
  writing-mode: horizontal-tb;
  margin-bottom: 0;
  margin-right: 12px;
}

/* ---------- Related Posts ---------- */
.article-related {
  padding: 80px 0 96px;
  background: var(--blog-bg-alt);
  border-top: 1px solid var(--blog-border-light);
}

.article-related__header {
  text-align: center;
  margin-bottom: 44px;
}

/* "Related Posts" label above the grid title */
.article-related__label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blog-red);
  margin-bottom: 8px;
}

.article-related__title {
  font-size: 28px;
  font-weight: 700;
  color: var(--blog-navy);
  margin: 0;
}

html[lang="en"] .article-related__title {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif !important;
}

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

/* ==========================================================================
   4. LANGUAGE TOGGLE
   ========================================================================== */

.lang-toggle {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 100px;
  padding: 3px;
  gap: 2px;
}

.lang-toggle__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 100px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: all var(--blog-transition);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.lang-toggle__btn:hover {
  color: rgba(255, 255, 255, 0.85);
}

.lang-toggle__btn.active,
.lang-toggle__btn--active {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   5. UTILITY CLASSES
   ========================================================================== */

.blog-container {
  width: 100%;
  max-width: var(--blog-wide-width);
  margin: 0 auto;
  padding: 0 32px;
}

.blog-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--blog-red);
  background: var(--blog-red-light);
  border-radius: 100px;
  text-decoration: none;
  transition: background var(--blog-transition);
}

.blog-tag:hover {
  background: var(--blog-red-glow);
  color: var(--blog-red);
}

/* Empty state */
.blog-empty {
  text-align: center;
  padding: 80px 24px;
}

.blog-empty__icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.blog-empty__title {
  font-size: 22px;
  font-weight: 700;
  color: var(--blog-navy);
  margin-bottom: 8px;
}

.blog-empty__desc {
  font-size: 16px;
  color: var(--blog-text-muted);
}

/* ==========================================================================
   6. ANIMATIONS
   ========================================================================== */

@keyframes blogFadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.blog-animate-in {
  animation: blogFadeUp 0.55s ease-out both;
}

.blog-animate-in:nth-child(1) { animation-delay: 0s; }
.blog-animate-in:nth-child(2) { animation-delay: 0.07s; }
.blog-animate-in:nth-child(3) { animation-delay: 0.14s; }
.blog-animate-in:nth-child(4) { animation-delay: 0.21s; }
.blog-animate-in:nth-child(5) { animation-delay: 0.28s; }
.blog-animate-in:nth-child(6) { animation-delay: 0.35s; }

/* ==========================================================================
   7. RESPONSIVE
   ========================================================================== */

/* ---------- Desktops / small laptops (< 1200px) ---------- */
@media (max-width: 1199.98px) {
  .article-layout {
    grid-template-columns: minmax(0, var(--blog-content-width));
    grid-template-areas: "content";
    justify-content: center;
    gap: 0;
    padding: 56px 24px 80px;
  }

  /* Hide sidebar TOC at < 1200px — show inline version instead */
  .article-layout > .article-toc {
    display: none;
  }

  /* Hide sidebar share too — inline version at bottom of article is shown */
  .article-layout > .article-share {
    display: none;
  }

  /* Wide images can't break out of narrower containers */
  .article-content .article-image--wide {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}

/* ---------- Tablets (< 992px) ---------- */
@media (max-width: 991.98px) {
  .blog-hero {
    padding: 80px 0 48px;
  }

  .blog-hero__title {
    font-size: 40px;
  }

  .blog-hero__subtitle {
    font-size: 18px;
  }

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

  .blog-grid__container .blog-card--featured {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
  }

  .blog-card--featured .blog-card__body {
    padding: 32px 28px;
  }

  .blog-card--featured .blog-card__title {
    font-size: 22px;
  }

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

  .article-hero__title {
    font-size: 38px;
  }

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

  .article-content h1 { font-size: 36px; }
  .article-content h2 { font-size: 28px; }
  .article-content h3 { font-size: 22px; }
}

/* ---------- Mobile (< 768px) ---------- */
@media (max-width: 767.98px) {
  .blog-hero {
    padding: 64px 0 36px;
  }

  .blog-hero__title {
    font-size: 30px;
  }

  .blog-hero__subtitle {
    font-size: 16px;
  }

  .blog-grid {
    padding: 40px 0 56px;
  }

  .blog-grid__container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

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

  .blog-card--featured .blog-card__image-wrap {
    min-height: 220px;
    border-radius: var(--blog-radius) var(--blog-radius) 0 0;
  }

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

  .blog-card--featured .blog-card__title {
    font-size: 20px;
  }

  .blog-card__image-wrap {
    height: 200px;
  }

  .blog-card__body {
    padding: 20px 18px 18px;
  }

  .blog-card__title {
    font-size: 18px;
  }

  .blog-card__desc {
    font-size: 14px;
    -webkit-line-clamp: 2;
  }

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

  .article-hero__content {
    padding: 60px 20px 40px;
  }

  .article-hero__title {
    font-size: 28px;
  }

  .article-hero__meta {
    font-size: 13px;
    gap: 14px;
  }

  /* Article body */
  .article-layout {
    padding: 40px 20px 64px;
  }

  .article-content {
    font-size: 17px;
    line-height: 1.8;
  }

  .article-content h1 { font-size: 28px; }
  .article-content h2 { font-size: 24px; padding-top: 24px; }
  .article-content h3 { font-size: 20px; }
  .article-content h4 { font-size: 18px; }

  .article-content pre {
    padding: 16px 16px;
    font-size: 14px;
    border-radius: var(--blog-radius-xs);
  }

  .article-content blockquote {
    padding: 18px 20px 18px 24px;
    font-size: 16px;
  }

  .article-cta-box {
    padding: 28px 24px;
  }

  .article-cta-box__title {
    font-size: 20px;
  }

  /* Related */
  .article-related {
    padding: 48px 0 56px;
  }

  .article-related__title {
    font-size: 24px;
  }

  .article-related__grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* ---------- Small phones (< 480px) ---------- */
@media (max-width: 479.98px) {
  .blog-hero__title {
    font-size: 26px;
  }

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

  .blog-container {
    padding: 0 16px;
  }

  .blog-card__image-wrap {
    height: 180px;
  }

  .article-hero__title {
    font-size: 24px;
  }

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

  .article-content h1 { font-size: 24px; }
  .article-content h2 { font-size: 21px; }
  .article-content h3 { font-size: 18px; }

  .article-content ol li {
    padding-left: 34px;
  }
}

/* ---------- Scroll to Top Button ---------- */
.scroll-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--blog-red);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 14px rgba(237, 35, 40, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s, background 0.3s;
  z-index: 999;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  background: var(--blog-red-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(237, 35, 40, 0.45);
}

/* ---------- TOC Sidebar CTA ---------- */
.article-toc-cta {
  margin-top: 20px;
  padding: 20px;
  background: linear-gradient(135deg, #1a1a2e 0%, #0d1b3e 100%);
  border-radius: var(--blog-radius-sm);
  text-align: center;
}

.article-toc-cta__text {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 12px;
  line-height: 1.5;
}

.article-toc-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--blog-red);
  border-radius: 100px;
  text-decoration: none;
  transition: all var(--blog-transition);
}

.article-toc-cta__btn:hover {
  background: var(--blog-red-hover);
  transform: translateY(-1px);
  color: #fff;
}

/* ---------- Callout Variants ---------- */
.article-content .callout-warning {
  border-left-color: #f59e0b;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.article-content .callout-success {
  border-left-color: #10b981;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.article-content .callout-info {
  border-left-color: #3b82f6;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

/* ==========================================================================
   8. PRINT
   ========================================================================== */

@media print {
  .blog-filters,
  .article-toc,
  .article-share,
  .article-related,
  .article-cta-box,
  .blog-pagination,
  .lang-toggle,
  .reading-progress,
  .scroll-to-top {
    display: none !important;
  }

  .article-hero {
    min-height: auto;
    background: none;
    color: #000;
    page-break-after: avoid;
  }

  .article-hero__overlay {
    display: none;
  }

  .article-hero__title {
    color: #000;
    font-size: 24pt;
  }

  .article-content {
    font-size: 11pt;
    max-width: 100%;
  }

  .article-content a {
    color: #000;
    text-decoration: underline;
  }

  .blog-card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }
}
