/* ============================================================================
   CMS-TEMPLATES.CSS — FlickLabs World-Class Publishing System
   Warm White · Charcoal · Muted Gold  |  Manrope · Sreda
   Comparable to: Stripe, Linear, Vercel, Notion, Shopify Engineering
   ============================================================================ */

/* ── CSS VARIABLE ALIASES ────────────────────────────────────────────────────
   Bridge legacy variable names to the design tokens in styles.css            */
:root {
  --text:        var(--c-charcoal);
  --text-muted:  var(--c-slate);
  --text-light:  var(--c-slate-lt);
  --accent:      var(--c-gold);
  --accent-lt:   var(--c-gold-lt);
  --accent-dk:   var(--c-gold-dk);
  --bg:          var(--c-bg);
  --bg-alt:      var(--c-bg-alt);
  --surface:     var(--c-surface);
  --border:      var(--c-border);
  --border-lt:   var(--c-border-lt);
}

/* ── SHARED: PAGE CONTAINERS ─────────────────────────────────────────────── */
.page-container {
  max-width: 1160px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 48px) clamp(20px, 5vw, 80px) 96px;
}

.case-study-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 32px) clamp(20px, 5vw, 80px) 96px;
}

/* ── SHARED: BREADCRUMBS ─────────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--c-slate);
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--c-slate);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
.breadcrumb a:hover { color: var(--c-charcoal); }
.breadcrumb-sep { color: var(--c-border); }
.breadcrumb span:last-child { color: var(--c-charcoal); font-weight: 500; }

/* ── READING PROGRESS BAR ────────────────────────────────────────────────── */
.reading-progress-container {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 9999;
  pointer-events: none;
}
.reading-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--c-gold-dk) 0%, var(--c-gold) 50%, var(--c-gold-lt) 100%);
  width: 0%;
  transition: width 0.12s linear;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BLOG POST TEMPLATE
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Post Hero ───────────────────────────────────────────────────────────── */
.post-hero {
  text-align: center;
  margin-bottom: 56px;
  padding-top: 32px;
  max-width: 820px;
  margin-inline: auto;
  margin-bottom: 56px;
}

.post-category-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.post-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--c-slate);
}

.post-badge--category {
  background: var(--c-charcoal);
  border-color: var(--c-charcoal);
  color: var(--c-white);
}

.post-title {
  font-family: var(--f-sreda);
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--c-charcoal);
  margin-bottom: 24px;
}

.post-excerpt {
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.7;
  color: var(--c-slate);
  margin-bottom: 32px;
  max-width: 620px;
  margin-inline: auto;
  margin-bottom: 32px;
}

.post-meta-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: var(--c-slate);
}

.post-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-meta-item i { font-size: 0.9rem; }

.post-meta-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--c-border);
}

.post-hero-author {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--c-border-lt);
}

.post-hero-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--c-border);
}

.post-hero-avatar-placeholder {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--c-bg-alt);
  border: 2px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-slate);
}

.post-hero-author-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--c-charcoal);
  line-height: 1.2;
}

.post-hero-author-role {
  font-size: 0.775rem;
  color: var(--c-slate);
}

/* ── Featured Image ──────────────────────────────────────────────────────── */
.post-featured-image-wrapper {
  max-width: 1000px;
  margin: 0 auto 64px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.post-featured-image-wrapper img {
  width: 100%;
  max-height: 540px;
  object-fit: cover;
  display: block;
  transition: transform var(--dur-slow) var(--ease);
}

.post-featured-image-wrapper:hover img { transform: scale(1.015); }

/* ── Blog Two-Column Layout ──────────────────────────────────────────────── */
.blog-layout {
  display: grid;
  grid-template-columns: minmax(0, 740px) 260px;
  gap: 80px;
  align-items: start;
}

/* ── Post Content Typography ─────────────────────────────────────────────── */
.post-content {
  font-family: var(--f-sans);
  font-size: 1.0625rem;
  line-height: 1.88;
  color: var(--c-charcoal);
  min-width: 0;
}

.post-content p {
  margin-bottom: 1.6em;
  color: var(--c-graphite);
}

/* ── Headings with Anchor Links ──────────────────────────────────────────── */
.post-content .heading-with-anchor {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  scroll-margin-top: calc(var(--nav-h) + 28px);
}

.post-content h2.heading-with-anchor {
  font-family: var(--f-sreda);
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.2;
  color: var(--c-charcoal);
  margin-top: 2.75em;
  margin-bottom: 0.8em;
  padding-bottom: 0.6em;
  border-bottom: 1px solid var(--c-border-lt);
}

.post-content h3.heading-with-anchor {
  font-family: var(--f-sans);
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--c-charcoal);
  margin-top: 2.25em;
  margin-bottom: 0.65em;
}

.post-content h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-charcoal);
  margin-top: 1.75em;
  margin-bottom: 0.5em;
  scroll-margin-top: calc(var(--nav-h) + 28px);
}

.heading-anchor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  color: var(--c-slate-lt);
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  text-decoration: none !important;
  background-image: none !important;
  opacity: 0;
  flex-shrink: 0;
  transition: opacity var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
}

.heading-with-anchor:hover .heading-anchor {
  opacity: 1;
  color: var(--c-gold-dk);
  background: rgba(176,141,87,0.1);
}

/* ── Links ───────────────────────────────────────────────────────────────── */
.post-content a,
.post-link {
  color: var(--c-charcoal);
  text-decoration: none;
  background-image: linear-gradient(var(--c-gold), var(--c-gold));
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  font-weight: 500;
  transition: background-size var(--dur-base) var(--ease);
}

.post-content a:hover,
.post-link:hover {
  background-size: 100% 1.5px;
}

/* ── Lists ───────────────────────────────────────────────────────────────── */
.post-content ul,
.post-content ol {
  padding-left: 0;
  margin-bottom: 1.6em;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.post-content ul li {
  position: relative;
  padding-left: 26px;
  color: var(--c-graphite);
  line-height: 1.75;
}

.post-content ul li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.65em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-gold);
  flex-shrink: 0;
}

.post-content ol {
  counter-reset: ol-counter;
}

.post-content ol li {
  position: relative;
  padding-left: 36px;
  color: var(--c-graphite);
  line-height: 1.75;
  counter-increment: ol-counter;
}

.post-content ol li::before {
  content: counter(ol-counter);
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 22px;
  height: 22px;
  background: var(--c-charcoal);
  color: var(--c-white);
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-content li > ul,
.post-content li > ol {
  margin-top: 8px;
  margin-bottom: 0;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  margin: 2.25em 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}

.post-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.post-table th {
  background: var(--c-bg-alt);
  padding: 12px 20px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-slate);
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}

.post-table td {
  padding: 13px 20px;
  border-bottom: 1px solid var(--c-border-lt);
  color: var(--c-graphite);
  line-height: 1.55;
}

.post-table tr:last-child td { border-bottom: none; }
.post-table tr:hover td { background: var(--c-bg-alt); }

/* ── Code Blocks ─────────────────────────────────────────────────────────── */
.code-block-wrapper {
  margin: 2.25em 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2), 0 2px 8px rgba(0,0,0,0.1);
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: #161618;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.code-lang-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 5px;
  color: rgba(255,255,255,0.45);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--f-sans);
  transition: all var(--dur-fast) var(--ease);
}

.copy-btn:hover {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.9);
  border-color: rgba(255,255,255,0.2);
}

.code-pre {
  background: #1c1c1e;
  padding: 24px;
  margin: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.code-pre code {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875rem;
  line-height: 1.72;
  color: #e4e4e7;
  white-space: pre;
  display: block;
}

/* Inline code */
.post-content p code,
.post-content li code,
.post-content td code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.84em;
  padding: 2px 8px;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  color: var(--c-charcoal);
}

/* ── Blockquotes ─────────────────────────────────────────────────────────── */
.post-content blockquote {
  position: relative;
  margin: 2.5em 0;
  padding: 32px 40px;
  background: var(--c-bg-alt);
  border-left: 4px solid var(--c-gold);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.post-content blockquote::before {
  content: '\201C';
  position: absolute;
  top: -16px;
  left: 24px;
  font-family: var(--f-sreda);
  font-size: 5.5rem;
  color: var(--c-gold);
  opacity: 0.2;
  line-height: 1;
  pointer-events: none;
}

.post-content blockquote p {
  font-family: var(--f-sreda);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.6;
  color: var(--c-charcoal);
  font-style: normal;
  margin: 0;
}

/* ── Callout Blocks (7 types) ────────────────────────────────────────────── */
.callout {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 2.25em 0;
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  font-size: 0.9375rem;
  line-height: 1.7;
}

.callout-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.callout-header i { font-size: 0.9rem; }
.callout-body { color: var(--c-graphite); }
.callout-body p { margin: 0; }
.callout-body p + p { margin-top: 0.75em; }
.callout-body code { font-family: ui-monospace, Menlo, monospace; font-size: 0.85em; }

/* Info / Note */
.callout-info {
  background: #EEF4FF;
  border-color: #C5D8FF;
}
.callout-info .callout-header { color: #3451B2; }

/* Warning */
.callout-warning {
  background: #FFF8ED;
  border-color: #FFD08A;
}
.callout-warning .callout-header { color: #C47600; }

/* Tip */
.callout-tip {
  background: #F4F0FF;
  border-color: #D3BBFF;
}
.callout-tip .callout-header { color: #6741D9; }

/* Best Practice */
.callout-best-practice {
  background: #EAFAF1;
  border-color: #85E0A9;
}
.callout-best-practice .callout-header { color: #1A7034; }

/* Architecture */
.callout-architecture {
  background: #F1F3F5;
  border-color: #CED4DA;
}
.callout-architecture .callout-header { color: var(--c-charcoal); }

/* Decision */
.callout-decision {
  background: #FFF4F4;
  border-color: #FFC9C9;
}
.callout-decision .callout-header { color: #C92A2A; }

/* Success */
.callout-success {
  background: #EAFAF1;
  border-color: #69DB7C;
}
.callout-success .callout-header { color: #0F6B2F; }

/* ── Post Images (Lazy + Lightbox + Caption) ─────────────────────────────── */
.post-figure {
  margin: 2.5em 0;
}

.post-image {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transition: transform var(--dur-base) var(--ease);
  cursor: zoom-in;
  display: block;
}

.post-image:hover { transform: scale(1.008); }

.post-image-caption {
  display: block;
  text-align: center;
  font-size: 0.8rem;
  color: var(--c-slate);
  margin-top: 12px;
  font-style: italic;
  line-height: 1.5;
}

/* ── Table of Contents (Sidebar) ─────────────────────────────────────────── */
.toc-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 28px);
}

.toc-container {
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border-lt);
  border-radius: var(--radius-lg);
  padding: 20px;
  max-height: calc(100vh - var(--nav-h) - 80px);
  overflow-y: auto;
}

.toc-container::-webkit-scrollbar { width: 3px; }
.toc-container::-webkit-scrollbar-track { background: transparent; }
.toc-container::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 3px; }

.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.toc-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-slate-lt);
}

.toc-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  color: var(--c-slate);
  cursor: pointer;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.toc-toggle:hover { color: var(--c-charcoal); background: var(--c-border-lt); }

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc-link {
  display: block;
  font-size: 0.8rem;
  color: var(--c-slate);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  line-height: 1.45;
  border-left: 2px solid transparent;
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
  background-image: none !important;
}

.toc-link:hover {
  color: var(--c-charcoal);
  background: var(--c-surface);
}

.toc-link--active {
  color: var(--c-gold-dk) !important;
  background: rgba(176,141,87,0.09) !important;
  border-left-color: var(--c-gold) !important;
  font-weight: 600;
}

.toc-link--h3 {
  padding-left: 22px;
  font-size: 0.75rem;
}

/* ── Social Share ────────────────────────────────────────────────────────── */
.social-share {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--c-border);
}

.social-share-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-slate);
  margin-right: 4px;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  color: var(--c-charcoal);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--f-sans);
  transition: all var(--dur-fast) var(--ease);
}

.social-btn:hover {
  background: var(--c-charcoal);
  border-color: var(--c-charcoal);
  color: var(--c-white);
  transform: translateY(-1px);
}

/* ── Author Card ─────────────────────────────────────────────────────────── */
.author-card {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-top: 72px;
  padding: 36px;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border-lt);
  border-radius: 16px;
}

.author-card-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--c-border);
  flex-shrink: 0;
  display: block;
}

.author-card-avatar-placeholder {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--c-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--c-slate);
  font-size: 1.75rem;
}

.author-card-body { flex: 1; min-width: 0; }

.author-card-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-slate-lt);
  margin-bottom: 6px;
}

.author-card-name {
  font-family: var(--f-sreda);
  font-size: 1.25rem;
  color: var(--c-charcoal);
  margin-bottom: 10px;
  line-height: 1.2;
}

.author-card-bio {
  font-size: 0.9375rem;
  color: var(--c-slate);
  line-height: 1.65;
  margin-bottom: 16px;
}

.author-card-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.author-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-charcoal);
  text-decoration: none;
  padding: 5px 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  transition: all var(--dur-fast) var(--ease);
}
.author-link:hover {
  background: var(--c-charcoal);
  border-color: var(--c-charcoal);
  color: var(--c-white);
}

/* ── Related Articles ────────────────────────────────────────────────────── */
.related-articles {
  margin-top: 72px;
  padding-top: 48px;
  border-top: 1px solid var(--c-border-lt);
}

.related-articles-header { margin-bottom: 32px; }

.related-articles-title {
  font-family: var(--f-sreda);
  font-size: 1.75rem;
  color: var(--c-charcoal);
  margin-bottom: 6px;
}

.related-articles-sub {
  font-size: 0.9375rem;
  color: var(--c-slate);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.related-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background: var(--c-surface);
  border: 1px solid var(--c-border-lt);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--c-charcoal);
  transition: all var(--dur-base) var(--ease);
}

.related-card:hover {
  border-color: var(--c-gold);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.related-card-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--c-gold-dk);
}

.related-card-title {
  font-family: var(--f-sreda);
  font-size: 1rem;
  line-height: 1.35;
  color: var(--c-charcoal);
  flex: 1;
}

.related-card-meta {
  font-size: 0.78rem;
  color: var(--c-slate);
  display: flex;
  gap: 6px;
  margin-top: auto;
}

/* ── Post Navigation (Prev / Next) ───────────────────────────────────────── */
.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 72px;
  padding-top: 48px;
  border-top: 1px solid var(--c-border);
}

.nav-link-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  background: var(--c-surface);
  border: 1px solid var(--c-border-lt);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--c-charcoal);
  transition: all var(--dur-base) var(--ease);
}

.nav-link-card:hover {
  border-color: var(--c-gold);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.nav-link-card--next { text-align: right; }

.nav-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-slate-lt);
}

.nav-link-card--next .nav-label { justify-content: flex-end; }

.nav-title {
  font-family: var(--f-sreda);
  font-size: 1rem;
  line-height: 1.3;
  color: var(--c-charcoal);
}

/* ── Blog CTA Section ────────────────────────────────────────────────────── */
.blog-cta-section {
  margin-top: 80px;
  padding: 72px 56px;
  background: var(--c-charcoal);
  border-radius: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.blog-cta-section::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -5%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(176,141,87,0.18) 0%, transparent 70%);
  pointer-events: none;
}

.blog-cta-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-gold);
  margin-bottom: 16px;
}

.blog-cta-title {
  font-family: var(--f-sreda);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--c-white);
  margin-bottom: 16px;
  line-height: 1.12;
}

.blog-cta-desc {
  font-size: 1.0625rem;
  color: rgba(255,255,255,0.58);
  max-width: 480px;
  margin: 0 auto 36px;
  line-height: 1.65;
}

.blog-cta-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--c-gold);
  color: var(--c-charcoal);
  font-size: 0.9375rem;
  font-weight: 700;
  border-radius: var(--radius);
  text-decoration: none;
  transition: all var(--dur-base) var(--ease);
}

.btn-cta-primary:hover {
  background: var(--c-gold-lt);
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(176,141,87,0.4);
}

.btn-cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.82);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.12);
  text-decoration: none;
  transition: all var(--dur-base) var(--ease);
}

.btn-cta-secondary:hover {
  background: rgba(255,255,255,0.13);
  color: var(--c-white);
}

/* ═══════════════════════════════════════════════════════════════════════════
   CASE STUDY TEMPLATE — Enterprise Portfolio Layout
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── CS Hero ─────────────────────────────────────────────────────────────── */
.cs-hero {
  text-align: center;
  padding: 48px 0 40px;
}

.cs-industry-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 20px;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-slate);
  margin-bottom: 28px;
}

.cs-hero h1 {
  font-family: var(--f-sreda);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: var(--c-charcoal);
  margin-bottom: 20px;
  max-width: 900px;
  margin-inline: auto;
}

.cs-hero-sub {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--c-slate);
  max-width: 680px;
  margin: 0 auto 12px;
  line-height: 1.65;
}

.cs-featured-image-wrapper {
  margin-top: 48px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.cs-featured-image {
  width: 100%;
  max-height: 600px;
  object-fit: cover;
  display: block;
}

/* ── CS Metrics Grid (Animated) ──────────────────────────────────────────── */
.cs-metrics-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin: 72px 0;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: 20px;
  overflow: hidden;
}

.cs-metric {
  text-align: center;
  padding: 44px 24px;
  border-right: 1px solid var(--c-border);
  transition: background var(--dur-base) var(--ease);
}

.cs-metric:last-child { border-right: none; }
.cs-metric:hover { background: var(--c-surface); }

.cs-metric-val {
  font-family: var(--f-sreda);
  font-size: clamp(2.25rem, 4vw, 3.5rem);
  color: var(--c-gold-dk);
  margin-bottom: 8px;
  line-height: 1;
}

.cs-metric-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-slate);
}

/* ── CS Sections ─────────────────────────────────────────────────────────── */
.cs-section {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 72px;
  margin: 88px 0;
  align-items: start;
}

.cs-section-header {
  position: sticky;
  top: calc(var(--nav-h) + 32px);
}

.cs-section-number {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-gold);
  margin-bottom: 12px;
}

.cs-section-header h2 {
  font-family: var(--f-sreda);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  line-height: 1.2;
  color: var(--c-charcoal);
}

.cs-section-content {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--c-graphite);
}

.cs-section-content p { margin-bottom: 1.25em; }
.cs-section-content p:last-child { margin-bottom: 0; }

.cs-section-content h3 {
  font-family: var(--f-sreda);
  font-size: 1.3rem;
  color: var(--c-charcoal);
  margin: 1.5em 0 0.75em;
}

/* ── CS Technology Stack ─────────────────────────────────────────────────── */
.cs-tech-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cs-tech-chip {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--c-charcoal);
  transition: all var(--dur-fast) var(--ease);
  cursor: default;
}

.cs-tech-chip:hover {
  background: var(--c-charcoal);
  color: var(--c-white);
  border-color: var(--c-charcoal);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* ── CS Gallery ──────────────────────────────────────────────────────────── */
.cs-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 64px 0;
}

.cs-gallery-item {
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: zoom-in;
  box-shadow: var(--shadow-sm);
}

.cs-gallery-item:first-child { grid-column: span 2; }

.cs-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--dur-slow) var(--ease);
}

.cs-gallery-item:hover img { transform: scale(1.04); }

/* ── CS Testimonial ──────────────────────────────────────────────────────── */
.cs-testimonial {
  margin: 72px 0;
  padding: 52px;
  background: var(--c-charcoal);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
}

.cs-testimonial::before {
  content: '\201C';
  position: absolute;
  top: -24px;
  left: 36px;
  font-family: var(--f-sreda);
  font-size: 10rem;
  color: rgba(255,255,255,0.05);
  line-height: 1;
  pointer-events: none;
}

.cs-testimonial-text {
  font-family: var(--f-sreda);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  line-height: 1.55;
  color: var(--c-white);
  margin-bottom: 36px;
  position: relative;
}

.cs-testimonial-author {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cs-testimonial-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.2);
}

.cs-testimonial-name {
  font-weight: 700;
  color: var(--c-white);
  font-size: 0.9375rem;
  line-height: 1.3;
}

.cs-testimonial-role {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.5);
}

/* ── CS CTA Section ──────────────────────────────────────────────────────── */
.cs-cta-section {
  text-align: center;
  padding: 96px 0 48px;
  margin-top: 80px;
  border-top: 1px solid var(--c-border);
}

.cs-cta-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-gold-dk);
  margin-bottom: 16px;
}

.cs-cta-section h2 {
  font-family: var(--f-sreda);
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--c-charcoal);
  margin-bottom: 16px;
  line-height: 1.12;
}

.cs-cta-section p {
  font-size: 1.125rem;
  color: var(--c-slate);
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.65;
}

.cs-cta-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LISTING PAGES — Blog & Case Studies
   ═══════════════════════════════════════════════════════════════════════════ */

.listing-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 56px) clamp(20px, 5vw, 80px) 96px;
}

/* ── Listing Hero ────────────────────────────────────────────────────────── */
.listing-hero {
  margin-bottom: 64px;
}

.listing-hero-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-gold-dk);
  margin-bottom: 16px;
}

.listing-hero-title {
  font-family: var(--f-sreda);
  font-size: clamp(2.5rem, 5.5vw, 4.25rem);
  color: var(--c-charcoal);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.listing-hero-sub {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--c-slate);
  max-width: 560px;
  line-height: 1.65;
}

/* ── Featured Article ────────────────────────────────────────────────────── */
.featured-article {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--c-border-lt);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 56px;
  text-decoration: none;
  color: var(--c-charcoal);
  background: var(--c-surface);
  transition: all var(--dur-base) var(--ease);
  box-shadow: var(--shadow-sm);
}

.featured-article:hover {
  border-color: var(--c-gold);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.featured-article-image {
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--c-bg-alt);
}

.featured-article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--dur-slow) var(--ease);
}

.featured-article:hover .featured-article-image img { transform: scale(1.04); }

.featured-article-image-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--c-bg-alt) 0%, var(--c-border) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-slate-lt);
  font-size: 3rem;
}

.featured-article-body {
  padding: 52px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
}

.featured-article-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-gold-dk);
  background: rgba(176,141,87,0.09);
  border: 1px solid rgba(176,141,87,0.22);
  border-radius: 100px;
  padding: 4px 14px;
  width: fit-content;
}

.featured-article-title {
  font-family: var(--f-sreda);
  font-size: clamp(1.25rem, 2.5vw, 1.875rem);
  line-height: 1.18;
  color: var(--c-charcoal);
}

.featured-article-excerpt {
  font-size: 0.9375rem;
  color: var(--c-slate);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-article-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--c-slate);
  flex-wrap: wrap;
}

.featured-article-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--c-charcoal);
  margin-top: 8px;
  transition: gap var(--dur-fast) var(--ease);
}

.featured-article:hover .featured-article-cta { gap: 12px; }

/* ── Filter Controls ─────────────────────────────────────────────────────── */
.listing-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 18px;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--c-slate);
  cursor: pointer;
  font-family: var(--f-sans);
  transition: all var(--dur-fast) var(--ease);
  user-select: none;
}

.filter-chip:hover {
  background: var(--c-surface);
  border-color: var(--c-charcoal);
  color: var(--c-charcoal);
}

.filter-chip.active {
  background: var(--c-charcoal);
  border-color: var(--c-charcoal);
  color: var(--c-white);
}

.listing-search {
  position: relative;
  flex-shrink: 0;
}

.listing-search-input {
  padding: 9px 16px 9px 38px;
  border: 1px solid var(--c-border);
  border-radius: 100px;
  background: var(--c-surface);
  font-size: 0.8125rem;
  color: var(--c-charcoal);
  outline: none;
  width: 230px;
  font-family: var(--f-sans);
  transition: border-color var(--dur-base) var(--ease), width var(--dur-base) var(--ease);
}

.listing-search-input::placeholder { color: var(--c-slate-lt); }
.listing-search-input:focus {
  border-color: var(--c-charcoal);
  width: 280px;
}

.listing-search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-slate-lt);
  font-size: 0.875rem;
  pointer-events: none;
}

.listing-count {
  font-size: 0.875rem;
  color: var(--c-slate);
  margin-bottom: 28px;
  font-weight: 500;
}

/* ── Articles Grid ───────────────────────────────────────────────────────── */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

/* ── Article Card ────────────────────────────────────────────────────────── */
.article-card {
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  border: 1px solid var(--c-border-lt);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: var(--c-charcoal);
  box-shadow: var(--shadow-sm);
  transition: all var(--dur-base) var(--ease);
}

.article-card:hover {
  border-color: var(--c-gold);
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.article-card-image {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--c-bg-alt);
  flex-shrink: 0;
}

.article-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--dur-slow) var(--ease);
}

.article-card:hover .article-card-image img { transform: scale(1.06); }

.article-card-image-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--c-bg-alt) 0%, var(--c-border) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-slate-lt);
  font-size: 2rem;
}

.article-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.article-card-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-gold-dk);
}

.article-card-title {
  font-family: var(--f-sreda);
  font-size: 1.05rem;
  line-height: 1.3;
  color: var(--c-charcoal);
}

.article-card-excerpt {
  font-size: 0.875rem;
  color: var(--c-slate);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.article-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--c-border-lt);
  font-size: 0.78rem;
  color: var(--c-slate);
}

.article-card-read-more {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--c-charcoal);
  transition: gap var(--dur-fast) var(--ease);
}

.article-card:hover .article-card-read-more { gap: 8px; }

/* ── Empty State ─────────────────────────────────────────────────────────── */
.listing-empty {
  text-align: center;
  padding: 96px 24px;
}

.listing-empty-icon {
  font-size: 3rem;
  color: var(--c-border);
  margin-bottom: 16px;
}

.listing-empty h3 {
  font-family: var(--f-sreda);
  font-size: 1.5rem;
  color: var(--c-charcoal);
  margin-bottom: 10px;
}

.listing-empty p {
  font-size: 1rem;
  color: var(--c-slate);
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.65;
}

/* ── Homepage blog cards (injected into index.html) ──────────────────────── */
.blog-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  color: var(--c-slate);
}

.blog-badge--eng {
  background: var(--c-charcoal);
  border-color: var(--c-charcoal);
  color: var(--c-white);
}

/* ── Keep legacy homepage blog card styles intact ────────────────────────── */
.blog-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--c-slate);
}

/* ═══════════════════════════════════════════════════════════════════════════
   LIGHTBOX OVERLAY
   ═══════════════════════════════════════════════════════════════════════════ */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.94);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease);
  padding: 24px;
}

.lightbox-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 32px 80px rgba(0,0,0,0.6);
  display: block;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 46px;
  height: 46px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 50%;
  color: var(--c-white);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--dur-fast);
}

.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET (≤ 1024px)
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .blog-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .toc-sidebar {
    position: static;
    order: -1;
    margin-bottom: 40px;
  }

  .toc-toggle { display: flex; }

  .toc-body { display: none; }
  .toc-body.toc-open { display: block; }

  .toc-container { max-height: none; }

  .cs-section {
    grid-template-columns: 1fr;
    gap: 24px;
    margin: 64px 0;
  }

  .cs-section-header { position: static; }

  .featured-article { grid-template-columns: 1fr; }
  .featured-article-image { aspect-ratio: 16/9; }

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

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤ 768px)
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .page-container {
    padding: calc(var(--nav-h) + 28px) 20px 72px;
  }

  .listing-page {
    padding: calc(var(--nav-h) + 28px) 20px 72px;
  }

  .case-study-container {
    padding: calc(var(--nav-h) + 24px) 20px 72px;
  }

  .post-hero {
    text-align: left;
    padding-top: 16px;
  }

  .post-category-row { justify-content: flex-start; }
  .post-meta-bar { justify-content: flex-start; }
  .post-hero-author { justify-content: flex-start; }
  .post-excerpt { margin-left: 0; margin-right: 0; }

  .post-navigation { grid-template-columns: 1fr; }

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

  .articles-grid { grid-template-columns: 1fr; }

  .featured-article-body { padding: 28px 24px; }

  .author-card {
    flex-direction: column;
    gap: 16px;
    padding: 24px;
  }

  .blog-cta-section { padding: 48px 28px; }

  .cs-metrics-bar { grid-template-columns: repeat(2, 1fr); }

  .cs-metric {
    border-right: none;
    border-bottom: 1px solid var(--c-border);
  }

  .cs-metric:nth-child(even) { border-left: 1px solid var(--c-border); }
  .cs-metric:last-child { border-bottom: none; }
  .cs-metric:nth-last-child(2):nth-child(odd) { border-bottom: none; }

  .cs-gallery { grid-template-columns: 1fr; }
  .cs-gallery-item:first-child { grid-column: span 1; }

  .cs-testimonial { padding: 32px 24px; }

  .listing-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .listing-search { width: 100%; }
  .listing-search-input,
  .listing-search-input:focus { width: 100%; }

  .code-pre { padding: 16px; }
  .code-pre code { font-size: 0.8125rem; }
}

@media (max-width: 480px) {
  .post-title { font-size: 2.1rem; }
  .blog-cta-actions,
  .cs-cta-actions { flex-direction: column; align-items: stretch; }
  .btn-cta-primary,
  .btn-cta-secondary { text-align: center; justify-content: center; }
}
