/* ============================================
   ELEVATE BLOG — Design System v2
   Index: dark fixed | Article: light/dark toggle
   Brand: Space Grotesk + Inter | Purple #5b2ce9
   ============================================ */

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ---- Brand Variables ---- */
:root {
  --p:     #5b2ce9;
  --p2:    #7c55f5;
  --p3:    #a07ff8;
  --pglow: rgba(91,44,233,.35);
  --fh: 'Space Grotesk', 'Inter', Arial, sans-serif;
  --fb: 'Inter', Arial, sans-serif;
  --dur: 200ms;

  /* Blog Index (always dark) */
  --idx-bg:        #030308;
  --idx-gradient:  radial-gradient(ellipse 90% 55% at 50% -5%, rgba(91,44,233,.3) 0%, transparent 65%), #030308;
  --idx-surface:   #0d0d16;
  --idx-surface2:  #141423;
  --idx-text:      rgba(255,255,255,.92);
  --idx-muted:     rgba(255,255,255,.52);
  --idx-border:    rgba(255,255,255,.08);
  --idx-border-h:  rgba(124,85,245,.5);

  /* Article — light mode (default) */
  --art-bg:             #ffffff;
  --art-text:           #0f0a1a;
  --art-muted:          #5a5a78;
  --art-border:         #e2ddf8;
  --art-surface:        #f4f1ff;
  --art-surface2:       #ebe6ff;
  --art-header-bg:      rgba(255,255,255,.95);
  --art-header-border:  rgba(226,221,248,.9);
  --art-code-bg:        #f0eeff;
  --art-bq-bg:          rgba(91,44,233,.05);
  --art-tag-bg:         rgba(91,44,233,.1);
  --art-tag-text:       #5b2ce9;
}

/* Article — dark mode */
html[data-theme="dark"] {
  --art-bg:             #030308;
  --art-text:           rgba(255,255,255,.92);
  --art-muted:          rgba(255,255,255,.52);
  --art-border:         rgba(255,255,255,.08);
  --art-surface:        #0d0d16;
  --art-surface2:       #141423;
  --art-header-bg:      rgba(3,3,8,.92);
  --art-header-border:  rgba(255,255,255,.07);
  --art-code-bg:        #0d0d16;
  --art-bq-bg:          rgba(91,44,233,.1);
  --art-tag-bg:         rgba(91,44,233,.2);
  --art-tag-text:       var(--p3);
}

/* ============================================
   SHARED HEADER
   ============================================ */
.blog-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, 4vw);
  height: 68px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transition: background var(--dur), border-color var(--dur);
}
.blog-header--index {
  background: rgba(3,3,8,.82);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.blog-header--article {
  background: var(--art-header-bg);
  border-bottom: 1px solid var(--art-header-border);
  transition: background .3s, border-color .3s;
}

.blog-logo { height: 22px; width: auto; display: block; }
.blog-header--index .blog-logo { filter: brightness(10); }
html:not([data-theme="dark"]) .blog-header--article .blog-logo { filter: none; }
html[data-theme="dark"]       .blog-header--article .blog-logo { filter: brightness(10); }

.blog-header-nav { display: flex; align-items: center; gap: 8px; }

.blog-back-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--fh);
  font-size: 13px;
  font-weight: 600;
  border-radius: 40px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background var(--dur), color var(--dur);
}
.blog-header--article .blog-back-link {
  color: var(--art-muted);
  border: 1px solid var(--art-border);
}
.blog-header--article .blog-back-link:hover {
  background: var(--art-surface);
  color: var(--art-text);
}
.blog-back-link svg { width: 16px; height: 16px; }

/* Dark mode toggle */
.dark-toggle {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--art-border);
  background: transparent;
  color: var(--art-muted);
  cursor: pointer;
  transition: all var(--dur);
}
.dark-toggle:hover { background: var(--art-surface); color: var(--art-text); }
.dark-toggle svg { width: 18px; height: 18px; }
.dark-toggle .icon-sun  { display: none; }
.dark-toggle .icon-moon { display: block; }
html[data-theme="dark"] .dark-toggle .icon-sun  { display: block; }
html[data-theme="dark"] .dark-toggle .icon-moon { display: none; }

/* Primary CTA */
.blog-cta-btn {
  font-family: var(--fh);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  background: var(--p);
  color: #fff;
  border-radius: 40px;
  padding: 9px 20px;
  border: none;
  cursor: pointer;
  transition: background var(--dur), transform var(--dur);
}
.blog-cta-btn:hover { background: var(--p2); transform: translateY(-1px); }

/* Reading progress */
.reading-progress {
  position: fixed;
  top: 98px;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--p) 0%, var(--p2) 50%, var(--p3) 100%);
  z-index: 320;
  width: 0%;
  transition: width .08s linear;
  box-shadow: 0 0 18px rgba(91,44,233,.35);
}

/* Eyebrow */
.eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--p3);
  margin-bottom: 16px;
}

/* ============================================
   BLOG INDEX
   ============================================ */
body.page-index {
  background: var(--idx-gradient);
  color: var(--idx-text);
  font-family: var(--fb);
  -webkit-font-smoothing: antialiased;
  padding-top: 68px;
}

/* Hero */
.idx-hero {
  padding: 88px max(24px,5vw) 72px;
  max-width: 1240px;
  margin: 0 auto;
}
.idx-hero h1 {
  font-family: var(--fh);
  font-size: clamp(40px, 6vw, 82px);
  font-weight: 800;
  line-height: .95;
  letter-spacing: -.035em;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,.6) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.idx-hero .lead {
  font-size: 17px;
  color: var(--idx-muted);
  line-height: 1.7;
  max-width: 520px;
  margin-bottom: 40px;
}

/* Search bar (index) */
.idx-search-bar {
  display: flex;
  max-width: 540px;
  background: var(--idx-surface);
  border: 1px solid var(--idx-border);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.idx-search-bar:focus-within {
  border-color: var(--p2);
  box-shadow: 0 0 0 3px var(--pglow);
}
.idx-search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--idx-text);
  font-family: var(--fb);
  font-size: 15px;
  padding: 14px 20px;
}
.idx-search-bar input::placeholder { color: var(--idx-muted); }
.idx-search-btn {
  width: 56px;
  background: var(--p);
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: #fff;
  flex-shrink: 0;
  transition: background var(--dur);
}
.idx-search-btn:hover { background: var(--p2); }
.idx-search-btn svg { width: 18px; height: 18px; }

/* Filters */
.idx-filters {
  padding: 0 max(24px,5vw) 40px;
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.idx-filter-btn {
  padding: 8px 18px;
  border-radius: 40px;
  font-family: var(--fh);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--idx-border);
  background: transparent;
  color: var(--idx-muted);
  transition: all var(--dur);
}
.idx-filter-btn:hover,
.idx-filter-btn.active {
  background: var(--p);
  border-color: var(--p);
  color: #fff;
}

/* Grid wrapper */
.idx-grid-wrap {
  padding: 0 max(24px,5vw) 88px;
  max-width: 1240px;
  margin: 0 auto;
}

/* Featured post */
.idx-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--idx-surface);
  border: 1px solid var(--idx-border);
  border-radius: 28px;
  overflow: hidden;
  margin-bottom: 28px;
  cursor: pointer;
  transition: border-color var(--dur), transform var(--dur), box-shadow var(--dur);
}
.idx-featured:hover {
  border-color: var(--idx-border-h);
  transform: translateY(-4px);
  box-shadow: 0 24px 64px rgba(91,44,233,.22);
}

.idx-featured-img {
  min-height: 380px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, rgba(91,44,233,.45) 0%, #0d0d16 100%);
}
.idx-featured-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform .6s ease;
}
.idx-featured:hover .idx-featured-img img { transform: scale(1.05); }

.idx-featured-body {
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.featured-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  color: var(--p3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.featured-tag .tag-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--p2);
}
.idx-featured-body h2 {
  font-family: var(--fh);
  font-size: clamp(22px, 2.4vw, 34px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--idx-text);
  margin-bottom: 14px;
  letter-spacing: -.025em;
}
.idx-featured-body > p {
  color: var(--idx-muted);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 28px;
}
.idx-featured-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.post-meta-sm {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: rgba(255,255,255,.35);
}
.post-meta-sm span { display: flex; align-items: center; gap: 5px; }
.post-meta-sm svg { width: 13px; height: 13px; }
.read-more-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--fh);
  font-size: 13px;
  font-weight: 600;
  color: var(--p3);
  white-space: nowrap;
  transition: gap var(--dur), color var(--dur);
}
.read-more-link:hover { gap: 10px; color: var(--p2); }
.read-more-link svg { width: 16px; height: 16px; }

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

.blog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.blog-pagination-link {
  min-width: 44px;
  height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--idx-border);
  background: rgba(17,17,30,.78);
  color: var(--idx-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--fh);
  font-size: 14px;
  font-weight: 600;
  transition: transform var(--dur), border-color var(--dur), color var(--dur), background var(--dur);
}

.blog-pagination-link:hover {
  transform: translateY(-2px);
  border-color: var(--idx-border-h);
  color: var(--p3);
}

.blog-pagination-link.is-active {
  background: linear-gradient(135deg, var(--p) 0%, var(--p2) 100%);
  border-color: transparent;
  color: #fff;
}

.blog-pagination-link.is-nav {
  padding: 0 18px;
}

/* Post card */
.post-card {
  background: var(--idx-surface);
  border: 1px solid var(--idx-border);
  border-radius: 24px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: border-color var(--dur), transform var(--dur), box-shadow var(--dur);
}

.post-card--empty {
  grid-column: 1 / -1;
  min-height: 220px;
  cursor: default;
}

.post-card--empty:hover {
  transform: none;
  box-shadow: none;
}
.post-card:hover {
  border-color: var(--idx-border-h);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(91,44,233,.18);
}
.post-card-img {
  aspect-ratio: 16/9;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, rgba(91,44,233,.3) 0%, #0d0d16 100%);
}
.post-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform .5s ease;
}
.post-card:hover .post-card-img img { transform: scale(1.07); }

.post-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0;
}
.post-tag {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--p3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.post-card h3 {
  font-family: var(--fh);
  font-size: clamp(15px, 1.3vw, 19px);
  font-weight: 700;
  line-height: 1.3;
  color: var(--idx-text);
  margin-bottom: 10px;
  letter-spacing: -.01em;
}
.post-card p {
  color: var(--idx-muted);
  font-size: 13px;
  line-height: 1.65;
  flex: 1;
  margin-bottom: 20px;
}
.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--idx-border);
  margin-top: auto;
}
.post-card-date { font-size: 12px; color: rgba(255,255,255,.3); }
.post-card-read {
  font-size: 12px;
  font-weight: 600;
  color: var(--p3);
  display: flex;
  align-items: center;
  gap: 4px;
}
.post-card-read svg { width: 12px; height: 12px; }

/* Newsletter section */
.idx-newsletter {
  max-width: 1240px;
  margin: 0 auto 88px;
  padding: 0 max(24px,5vw);
}
.idx-newsletter-inner {
  background: linear-gradient(135deg, rgba(91,44,233,.22) 0%, rgba(124,85,245,.08) 100%);
  border: 1px solid rgba(124,85,245,.28);
  border-radius: 32px;
  padding: 72px 64px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.idx-newsletter-copy h2 {
  font-family: var(--fh);
  font-size: clamp(26px, 3vw, 44px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.03em;
  margin-bottom: 16px;
  color: var(--idx-text);
}
.idx-newsletter-copy p {
  color: var(--idx-muted);
  font-size: 15px;
  line-height: 1.7;
}
.newsletter-form { display: flex; flex-direction: column; gap: 12px; }
.newsletter-form input {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  padding: 14px 18px;
  color: var(--idx-text);
  font-family: var(--fb);
  font-size: 15px;
  outline: none;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.newsletter-form input::placeholder { color: rgba(255,255,255,.3); }
.newsletter-form input:focus {
  border-color: var(--p2);
  box-shadow: 0 0 0 3px var(--pglow);
}
.newsletter-submit {
  background: var(--p);
  color: #fff;
  font-family: var(--fh);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: none;
  border-radius: 12px;
  padding: 15px 24px;
  cursor: pointer;
  transition: background var(--dur), transform var(--dur);
}
.newsletter-submit:hover { background: var(--p2); transform: translateY(-2px); }

/* Blog footer */
.blog-footer {
  border-top: 1px solid var(--idx-border);
}
.blog-footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px max(24px,5vw);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.blog-footer-copy { font-size: 13px; color: rgba(255,255,255,.28); }
.blog-footer-links { display: flex; gap: 24px; }
.blog-footer-links a {
  font-size: 13px;
  color: rgba(255,255,255,.38);
  transition: color var(--dur);
}
.blog-footer-links a:hover { color: var(--p3); }

/* ============================================
   ARTICLE PAGE
   ============================================ */
body.page-article {
  background: var(--art-bg);
  color: var(--art-text);
  font-family: var(--fb);
  -webkit-font-smoothing: antialiased;
  padding-top: 68px;
  transition: background .3s ease, color .3s ease;
}

/* Breadcrumb */
.art-breadcrumb {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px max(24px,5vw) 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--art-muted);
}
.art-breadcrumb a { color: var(--art-muted); transition: color var(--dur); }
.art-breadcrumb a:hover { color: var(--p2); }
.art-breadcrumb .sep { opacity: .4; }

/* Two-column layout */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 64px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px max(24px,5vw) 96px;
  align-items: start;
}

/* ---- Article Main ---- */
.article-main { min-width: 0; }

.article-main .eyebrow { margin-bottom: 20px; }
.article-main h1 {
  font-family: var(--fh);
  font-size: clamp(28px, 3.8vw, 52px);
  font-weight: 800;
  line-height: 1.07;
  letter-spacing: -.03em;
  color: var(--art-text);
  margin-bottom: 22px;
  transition: color .3s;
}

.article-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 32px;
}
.article-meta .meta-item {
  font-size: 13px;
  color: var(--art-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color .3s;
}
.article-meta .meta-item svg { width: 14px; height: 14px; opacity: .6; }
.article-meta .sep {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: .35;
}

.article-cover {
  width: 100%;
  aspect-ratio: 16/9;
  max-height: 620px;
  object-fit: cover;
  object-position: center;
  border-radius: 20px;
  margin-bottom: 44px;
  background: linear-gradient(135deg, rgba(91,44,233,.35) 0%, #0d0d16 100%);
}

/* Article Content Typography */
.article-content { color: var(--art-text); transition: color .3s; }
.article-content > * + * { margin-top: 1.5em; }

.article-content p {
  font-size: 18px;
  line-height: 1.85;
  color: var(--art-text);
  transition: color .3s;
}
.article-content h2 {
  font-family: var(--fh);
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--art-text);
  margin-top: 56px !important;
  padding-top: 24px;
  border-top: 1px solid var(--art-border);
  transition: color .3s, border-color .3s;
}
.article-content h3 {
  font-family: var(--fh);
  font-size: clamp(17px, 1.8vw, 22px);
  font-weight: 700;
  color: var(--art-text);
  margin-top: 40px !important;
  transition: color .3s;
}
.article-content ul,
.article-content ol {
  padding-left: 24px;
  font-size: 18px;
  line-height: 1.85;
}
.article-content ul li { list-style: disc; }
.article-content ol li { list-style: decimal; }
.article-content li { margin: 8px 0; color: var(--art-text); transition: color .3s; }
.article-content strong { font-weight: 700; color: var(--art-text); }
.article-content em { font-style: italic; }
.article-content a {
  color: var(--p2);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur);
}
.article-content a:hover { color: var(--p); }
.article-content blockquote {
  border-left: 3px solid var(--p2);
  background: var(--art-bq-bg);
  padding: 18px 22px;
  border-radius: 0 12px 12px 0;
  font-style: italic;
  color: var(--art-muted);
  transition: background .3s, color .3s;
}
.article-content code {
  background: var(--art-code-bg);
  border: 1px solid var(--art-border);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: .88em;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  transition: background .3s, border-color .3s;
}
.article-content pre {
  background: var(--art-surface);
  border: 1px solid var(--art-border);
  border-radius: 12px;
  padding: 20px 24px;
  overflow-x: auto;
  transition: background .3s, border-color .3s;
}
.article-content pre code {
  background: none; border: none; padding: 0;
  font-size: 14px; line-height: 1.7;
}
.article-content img { border-radius: 12px; }
.article-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}
.article-content th,
.article-content td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--art-border);
  transition: border-color .3s;
}
.article-content th {
  font-weight: 700;
  background: var(--art-surface);
  font-family: var(--fh);
  transition: background .3s;
}

/* Tags + Share */
.article-footer {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--art-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  transition: border-color .3s;
}
.article-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.art-tag {
  background: var(--art-tag-bg);
  color: var(--art-tag-text);
  font-size: 12px;
  font-weight: 600;
  border-radius: 40px;
  padding: 6px 14px;
  letter-spacing: .05em;
  transition: background .3s, color .3s;
}
.share-btns { display: flex; gap: 8px; }
.share-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--art-border);
  color: var(--art-muted);
  cursor: pointer;
  background: transparent;
  transition: all var(--dur);
}
.share-btn:hover { background: var(--p); border-color: var(--p); color: #fff; }
.share-btn svg { width: 16px; height: 16px; }

/* CTA Box */
.article-cta-box {
  margin-top: 48px;
  background: linear-gradient(135deg, var(--p) 0%, var(--p2) 100%);
  border-radius: 20px;
  padding: 36px 40px;
  color: #fff;
}
.article-cta-box h3 {
  font-family: var(--fh);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}
.article-cta-box p {
  font-size: 15px;
  opacity: .85;
  line-height: 1.6;
  margin-bottom: 22px;
}
.article-cta-box a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--p);
  font-family: var(--fh);
  font-size: 14px;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 40px;
  transition: transform var(--dur), box-shadow var(--dur);
}
.article-cta-box a:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.3); }

/* ============================================
   SIDEBAR (always dark panel)
   ============================================ */
.sidebar {
  position: sticky;
  top: 88px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Base sidebar card */
.sidebar-card {
  background: #0d0d16;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  overflow: hidden;
}

/* Search */
.sidebar-search { display: flex; }
.sidebar-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: rgba(255,255,255,.85);
  font-family: var(--fb);
  font-size: 14px;
  padding: 16px 18px;
}
.sidebar-search input::placeholder { color: rgba(255,255,255,.3); }
.sidebar-search-btn {
  width: 56px;
  background: var(--p);
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: #fff;
  flex-shrink: 0;
  transition: background var(--dur);
}
.sidebar-search-btn:hover { background: var(--p2); }
.sidebar-search-btn svg { width: 18px; height: 18px; }

/* Newsletter */
.sidebar-newsletter { padding: 28px 24px; }
.sidebar-newsletter h3 {
  font-family: var(--fh);
  font-size: 20px;
  font-weight: 700;
  color: rgba(255,255,255,.92);
  margin-bottom: 10px;
}
.sidebar-newsletter > p {
  font-size: 13px;
  color: rgba(255,255,255,.45);
  line-height: 1.6;
  margin-bottom: 18px;
}
.sidebar-nl-form { display: flex; flex-direction: column; gap: 10px; }
.sidebar-nl-form input {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  padding: 12px 16px;
  color: rgba(255,255,255,.85);
  font-family: var(--fb);
  font-size: 13px;
  outline: none;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.sidebar-nl-form input::placeholder { color: rgba(255,255,255,.3); }
.sidebar-nl-form input:focus {
  border-color: var(--p2);
  box-shadow: 0 0 0 3px rgba(91,44,233,.25);
}
.sidebar-nl-submit {
  background: var(--p);
  color: #fff;
  font-family: var(--fh);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  border: none;
  border-radius: 10px;
  padding: 13px;
  cursor: pointer;
  transition: background var(--dur);
}
.sidebar-nl-submit:hover { background: var(--p2); }

/* Latest posts */
.sidebar-posts { padding: 24px; }
.sidebar-posts h3 {
  font-family: var(--fh);
  font-size: 15px;
  font-weight: 700;
  color: rgba(255,255,255,.92);
  margin-bottom: 18px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 11px;
  opacity: .6;
}
.sidebar-post-list { display: flex; flex-direction: column; }
.sidebar-post-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,.09);
  cursor: pointer;
  transition: opacity var(--dur);
  text-decoration: none;
}
.sidebar-post-item:first-child { padding-top: 0; }
.sidebar-post-item:last-child { border-bottom: none; padding-bottom: 0; }
.sidebar-post-item:hover { opacity: .7; }

.sidebar-post-thumb {
  width: 64px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(91,44,233,.4), #0d0d16);
}
.sidebar-post-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
}
.sidebar-post-info { flex: 1; min-width: 0; }
.sidebar-post-title {
  font-family: var(--fh);
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.sidebar-post-date { font-size: 11px; color: rgba(255,255,255,.3); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1100px) {
  .article-layout { grid-template-columns: 1fr 300px; gap: 48px; }
}

@media (max-width: 960px) {
  .idx-featured { grid-template-columns: 1fr; }
  .idx-featured-img { min-height: 280px; }
  .idx-featured-body { padding: 32px; }
  .idx-grid { grid-template-columns: repeat(2, 1fr); }
  .idx-newsletter-inner { grid-template-columns: 1fr; gap: 40px; padding: 48px 40px; }
  .article-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .sidebar .sidebar-card:first-child { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .idx-grid { grid-template-columns: 1fr; }
  .idx-newsletter-inner { padding: 40px 28px; }
  .idx-hero { padding: 60px 20px 48px; }
  .idx-filters { padding: 0 20px 32px; }
  .idx-grid-wrap { padding: 0 20px 64px; }
  .blog-footer-inner { flex-direction: column; gap: 16px; text-align: center; }
  .article-layout { padding: 32px 20px 72px; }
  .art-breadcrumb { padding: 16px 20px 0; }
  .sidebar { grid-template-columns: 1fr; }
  .sidebar .sidebar-card:first-child { grid-column: auto; }
  .article-cta-box { padding: 28px 24px; }
  .article-main h1 { font-size: clamp(26px, 8vw, 38px); }
}

@media (max-width: 768px) {
  .blog-header {
    height: auto;
    min-height: 64px;
    padding: 12px 16px;
    gap: 12px;
  }

  .reading-progress {
    top: 88px;
  }

  .blog-header-nav {
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .blog-back-link,
  .blog-cta-btn,
  .dark-toggle {
    min-height: 40px;
  }

  .idx-hero {
    padding-top: 72px;
  }

  .idx-hero .lead {
    font-size: 15px;
    line-height: 1.7;
  }

  .idx-search-bar {
    flex-direction: column;
    border-radius: 18px;
  }

  .idx-search-input,
  .idx-search-btn,
  .idx-search-bar input,
  .idx-search-bar button {
    width: 100%;
  }

  .idx-featured-body {
    padding: 26px 22px;
  }

  .idx-card-body {
    padding: 18px;
  }

  .article-meta {
    gap: 10px;
    flex-wrap: wrap;
  }

  .article-cover {
    margin: 28px 0 24px;
    border-radius: 16px;
  }

  .article-content p,
  .article-content li {
    font-size: 16px;
    line-height: 1.8;
  }

  .article-content h2 {
    font-size: clamp(24px, 7vw, 34px);
  }

  .article-content h3 {
    font-size: clamp(20px, 5.8vw, 28px);
  }

  .blog-footer-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
  }
}

@media (max-width: 480px) {
  .blog-header {
    padding: 10px 12px;
  }

  .reading-progress {
    top: 82px;
  }

  .blog-logo {
    height: 18px;
  }

  .blog-header-nav {
    width: auto;
    gap: 8px;
  }

  .blog-back-link {
    padding: 8px 12px;
    font-size: 12px;
  }

  .blog-cta-btn {
    padding: 9px 14px;
    font-size: 12px;
  }

  .idx-hero {
    padding: 52px 16px 40px;
  }

  .idx-hero h1 {
    font-size: clamp(34px, 12vw, 52px);
    line-height: 0.94;
  }

  .idx-filters,
  .idx-grid-wrap,
  .article-layout,
  .art-breadcrumb {
    padding-left: 16px;
    padding-right: 16px;
  }

  .article-main h1 {
    font-size: clamp(24px, 9vw, 34px);
  }

  .article-cta-box {
    padding: 22px 18px;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Focus states */
:focus-visible {
  outline: 2px solid var(--p2);
  outline-offset: 2px;
  border-radius: 4px;
}
