/* ============================================================
 * Shared article-detail layout for blog + case-study singles —
 * ported from the inline <style> of blog-details.html (the static
 * "hide until JS renders" rule html.bd-pending is dropped since WP
 * renders server-side). Also carries the .gr-1…9 gradient classes
 * used by the case-study hero art.
 * ========================================================== */

.post-card { text-decoration: none; color: inherit; }

/* ===== HERO ===== */
.bd-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  align-items: center;
}
@media (min-width: 1024px) {
  .bd-hero-grid { grid-template-columns: 1.05fr 0.95fr; gap: 56px; }
}

.bd-cat {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-glass-b);
  backdrop-filter: blur(10px);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.bd-cat .led {
  width: 6px; height: 6px; border-radius: 999px;
  background: #4ade80; box-shadow: 0 0 8px rgba(74,222,128,.9);
}

.bd-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--text-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.bd-meta .sep { width: 4px; height: 4px; border-radius: 999px; background: var(--text-2); opacity: .45; }

.bd-authors { display: flex; flex-wrap: wrap; gap: 12px; }
.bd-author {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px 10px 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
}
[data-theme="light"] .bd-author { background: linear-gradient(to bottom, rgba(15,18,32,0.03), rgba(15,18,32,0.008)); }
.bd-author .av {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  color: white; font-weight: 700;
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
  flex-shrink: 0;
}
.bd-author .nm { font-size: 13.5px; font-weight: 600; color: var(--text-0); }
.bd-author .rl { font-size: 11.5px; color: var(--text-2); margin-top: 2px; }

.bd-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bd-share-btn {
  width: 38px; height: 38px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--text-1);
  display: grid; place-items: center;
  transition: border-color .2s, background .2s, color .2s, transform .15s;
}
[data-theme="light"] .bd-share-btn { background: rgba(15,18,32,0.03); }
.bd-share-btn:hover {
  border-color: rgba(123,140,255,.45);
  background: rgba(123,140,255,.08);
  color: var(--text-0);
  transform: translateY(-1px);
}
.bd-share-btn svg { display: block; flex-shrink: 0; }

.bd-hero-art {
  position: relative;
  min-height: 380px;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  isolation: isolate;
}
@media (min-width: 1024px) { .bd-hero-art { min-height: 460px; } }
.bd-hero-art .pattern {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
  opacity: 0.55;
}
.bd-hero-art .badge {
  position: absolute;
  top: 22px; left: 22px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(0,0,0,.34);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.2);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: white;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  z-index: 2;
}
.bd-hero-art .badge .led {
  width: 6px; height: 6px; border-radius: 999px;
  background: #4ade80; box-shadow: 0 0 8px rgba(74,222,128,.9);
}
.bd-hero-art .ribbon {
  position: absolute;
  bottom: 18px; right: 18px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 88px; font-weight: 800;
  color: rgba(255,255,255,0.12);
  letter-spacing: -3px;
  line-height: 1;
  z-index: 1;
}
.bd-hero-art svg.deco {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

.art-1 { background: linear-gradient(135deg, #7b8cff 0%, #b27bff 100%); }
.art-2 { background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%); }
.art-3 { background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%); }
.art-4 { background: linear-gradient(135deg, #14b8a6 0%, #0ea5e9 100%); }
.art-5 { background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%); }
.art-6 { background: linear-gradient(135deg, #f97316 0%, #dc2626 100%); }
.art-7 { background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%); }
.art-8 { background: linear-gradient(135deg, #d946ef 0%, #6366f1 100%); }
.art-9 { background: linear-gradient(135deg, #84cc16 0%, #16a34a 100%); }
.art-ai {
  background:
    radial-gradient(80% 70% at 30% 30%, rgba(123,140,255,0.55), transparent 70%),
    radial-gradient(70% 70% at 80% 80%, rgba(178,123,255,0.45), transparent 70%),
    #1e1b4b;
}
/* Case-study hero art uses the gr-* gradients from the listing page. */
.gr-1 { background: linear-gradient(135deg, #7b8cff 0%, #b27bff 100%); }
.gr-2 { background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%); }
.gr-3 { background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%); }
.gr-4 { background: linear-gradient(135deg, #14b8a6 0%, #0ea5e9 100%); }
.gr-5 { background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%); }
.gr-6 { background: linear-gradient(135deg, #f97316 0%, #dc2626 100%); }
.gr-7 { background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%); }
.gr-8 { background: linear-gradient(135deg, #d946ef 0%, #6366f1 100%); }
.gr-9 { background: linear-gradient(135deg, #84cc16 0%, #16a34a 100%); }

/* ===== TOC + ARTICLE PANELS ===== */
.bd-panel {
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(255,255,255,0.04), rgba(255,255,255,0.012));
  backdrop-filter: blur(12px);
}
[data-theme="light"] .bd-panel {
  background: #ffffff;
  box-shadow: 0 20px 48px -32px rgba(15, 18, 32, 0.18);
}

.bd-toc-col {
  position: sticky;
  top: 100px;
  align-self: start;
  z-index: 6;
}
.toc {
  padding: 22px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.bd-article-panel {
  padding: 22px 22px 28px;
  min-width: 0;
}
@media (min-width: 768px) {
  .bd-article-panel { padding: 32px 36px 36px; }
}
.toc h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.toc h4 .dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: linear-gradient(135deg, #7b8cff, #b27bff);
}
.toc-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-0);
  cursor: pointer;
  transition: background .2s, color .2s, transform .15s;
  margin-bottom: 3px;
  line-height: 1.35;
  text-decoration: none;
  font-weight: 500;
}
.toc-item:hover {
  color: var(--text-0);
  background: rgba(123,140,255,.05);
  transform: translateX(2px);
}
.toc-item.active {
  color: white;
  background: linear-gradient(135deg, #7b8cff, #b27bff);
  box-shadow: 0 8px 20px -10px rgba(123,140,255,.55);
}
.toc-item .num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  opacity: 0.6;
  flex-shrink: 0;
}
.toc-item.active .num { opacity: 0.85; }

.toc-mobile {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 6px;
  margin-bottom: 22px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  scrollbar-width: none;
}
.toc-mobile::-webkit-scrollbar { display: none; }
[data-theme="light"] .toc-mobile { background: #f7f7f4; }
@media (min-width: 1024px) { .toc-mobile,.mobile-toc-cta { display: none; } }
.toc-mobile a {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--text-1);
  white-space: nowrap;
}
.toc-mobile a.active {
  color: white;
  background: linear-gradient(135deg, #7b8cff, #b27bff);
}

/* ===== ARTICLE ===== */
.bd-section {
  margin-bottom: 48px;
  scroll-margin-top: calc(108px + var(--sb-announce-h));
}
.bd-article-panel .bd-section:last-of-type { margin-bottom: 28px; }
.bd-section .sh {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.bd-section .sh .ico {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(123,140,255,.22), rgba(178,123,255,.14));
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--accent);
  flex-shrink: 0;
}
[data-theme="light"] .bd-section .sh .ico {
  background: linear-gradient(135deg, rgba(79,95,229,.16), rgba(138,82,232,.10));
  border-color: rgba(15,18,32,0.10);
}
.bd-section .sh .cat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.bd-section .sh h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.45px;
  color: var(--text-0);
  line-height: 1.2;
}
.bd-section p {
  font-size: 15px;
  line-height: 1.78;
  color: var(--text-1);
  margin-bottom: 14px;
}
.bd-section p b, .bd-section p strong { color: var(--text-0); font-weight: 600; }
.bd-section h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: -0.3px;
  margin: 22px 0 10px;
}
.bd-section ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 18px;
  display: grid; gap: 8px;
}
.bd-section ul li {
  display: flex; align-items: flex-start; gap: 12px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-1);
}
.bd-section ul li::before {
  content: '';
  width: 14px; height: 14px;
  border-radius: 5px;
  flex-shrink: 0;
  margin-top: 5px;
  background: linear-gradient(135deg, rgba(123,140,255,.20), rgba(178,123,255,.10));
  border: 1px solid rgba(123,140,255,.3);
}

.callout {
  padding: 18px 20px;
  border-radius: 14px;
  border-left: 3px solid var(--accent);
  background: rgba(123,140,255,0.06);
  margin: 18px 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-0);
}
.callout .label {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.bd-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.bd-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.025);
  font-size: 12px;
  color: var(--text-1);
}
[data-theme="light"] .bd-tag { background: #f7f7f4; }
.bd-tag .hash { color: var(--accent); }

/* ===== RELATED ===== */
.post-card {
  position: relative;
  display: flex; flex-direction: column;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(255,255,255,0.03), rgba(255,255,255,0.008));
  transition: transform .35s ease, border-color .35s, box-shadow .35s;
  backdrop-filter: blur(12px);
  height: 100%;
  text-decoration: none;
  color: inherit;
}
[data-theme="light"] .post-card { background: linear-gradient(to bottom, rgba(15,18,32,0.022), rgba(15,18,32,0.005)); }
.post-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,0.20);
  box-shadow: 0 30px 60px -22px rgba(0,0,0,.45);
}
[data-theme="light"] .post-card:hover {
  border-color: rgba(15,18,32,0.22);
  box-shadow: 0 30px 60px -22px rgba(15,18,32,.22);
}
.post-art { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.post-art .pattern-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: 0.5;
}
.post-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.post-meta {
  display: flex; align-items: center; gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-2);
  margin-bottom: 10px;
}
.post-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 17px; font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.3px;
  color: var(--text-0);
  margin-bottom: 10px;
}
.post-excerpt { font-size: 13.5px; line-height: 1.6; color: var(--text-1); }
