@import url('/back-to-top.css?v=2');

:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #5b4ce6;
  --toc-active-bg: #eef2ff;
  --toc-active-border: #c4b5fd;
}
html {
  scroll-behavior: smooth;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: radial-gradient(circle at top right, #eef2ff, #f8fafc 35%);
  color: var(--text);
}
body.has-sticky-article-cta--visible {
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}
a { color: var(--primary); text-decoration: none; }
/* Do not redefine global .container here — it breaks simple-header alignment vs privacy/about.
   Header and main both use .container from style.css so edges match. */

/* —— Visual blog hero (list view) —— */
/* Break out of .container so the panoramic cover can use nearly full viewport width */
#blogListView > .blog-hero {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 20px clamp(12px, 3vw, 40px) 18px;
  box-sizing: border-box;
}
.blog-hero-media {
  position: relative;
  width: 100%;
  max-width: min(1600px, 100%);
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  line-height: 0;
  background: #0f172a;
  box-shadow:
    0 22px 48px rgba(15, 23, 42, 0.14),
    0 6px 18px rgba(91, 76, 230, 0.1);
  animation: blogHeroIn 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.blog-hero-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: center center;
}
.blog-hero-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(105deg, rgba(15, 23, 42, 0.42) 0%, rgba(15, 23, 42, 0.08) 42%, transparent 62%),
    linear-gradient(to top, rgba(15, 23, 42, 0.5) 0%, rgba(15, 23, 42, 0.12) 38%, transparent 72%);
}
.blog-hero-caption {
  position: absolute;
  left: clamp(14px, 3.5%, 26px);
  bottom: clamp(12px, 3%, 22px);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  max-width: min(360px, 78%);
}
.blog-hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}
.blog-hero-badge-sub {
  margin: 0;
  padding: 0 2px;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 500;
  color: rgba(248, 250, 252, 0.9);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}
@keyframes blogHeroIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (max-width: 768px) {
  #blogListView > .blog-hero {
    padding: 14px 10px 12px;
  }
  .blog-hero-media {
    border-radius: 14px;
  }
  .blog-hero-image {
    object-position: center center;
  }
  .blog-hero-caption {
    left: 14px;
    bottom: 14px;
    max-width: calc(100% - 28px);
  }
  .blog-hero-badge-sub {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .blog-hero-media {
    animation: none;
  }
}

.blog-filters {
  display: grid;
  grid-template-columns: 1fr 210px 210px;
  gap: 10px;
  margin-bottom: 14px;
}
input, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}
input:focus, select:focus { outline: 2px solid rgba(91, 76, 230, 0.25); border-color: #c4b5fd; }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding-bottom: 30px;
}
.post-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  min-height: 0;
}
.post-card-media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  margin: 0 0 2px;
  background: #0f172a;
  border: 1px solid #1e293b;
}
.post-card-media:hover { border-color: #c4b5fd; }
.post-card-thumb {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  object-position: center top;
  z-index: 1;
}
.post-card-thumb--broken { display: none !important; }
.post-card-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
  font-weight: 700;
  font-size: 13px;
  color: #4338ca;
  padding: 10px;
  text-align: center;
  line-height: 1.25;
  background: linear-gradient(135deg, #e0e7ff 0%, #f5f3ff 42%, #ede9fe 100%);
}
.post-card h2 { margin: 0; font-size: 19px; line-height: 1.3; }
.post-card h2 a { color: inherit; text-decoration: none; }
.post-card h2 a:hover { color: var(--primary); }
.post-excerpt { margin: 0; color: #334155; line-height: 1.65; font-size: 14px; }
.post-meta-line { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--muted); }
.pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d8d4fe;
  background: #f5f3ff;
  color: #4338ca;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}
.read-more {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border: 1px solid var(--primary);
  color: #fff;
  background: var(--primary);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
}

.empty-state {
  background: #fff;
  border: 1px dashed #cbd5e1;
  color: var(--muted);
  border-radius: 12px;
  padding: 30px 16px;
  text-align: center;
}

.blog-post-view { padding: 24px 0 40px; }
.back-link { display: inline-flex; margin-bottom: 14px; font-weight: 600; }
.post-header h1 {
  margin: 0 0 10px;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 800;
}
.post-meta { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.post-cover-image {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--border);
  margin-bottom: 14px;
}

.post-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
}
.post-toc-wrap { position: sticky; top: 82px; align-self: start; }
.post-toc {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
  display: grid;
  gap: 6px;
}
.post-toc a {
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
  padding: 6px 8px;
  margin: 0 -4px;
  line-height: 1.35;
  transition: background 0.15s ease, color 0.15s ease;
}
.post-toc a:hover {
  background: #f8fafc;
  color: var(--primary);
}
.post-toc a.is-active {
  background: var(--toc-active-bg);
  color: #4338ca;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--toc-active-border);
}
.post-toc-title { margin: 0 0 8px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.copy-link-btn {
  margin-top: 10px;
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 600;
  cursor: pointer;
}

.post-content {
  max-width: 900px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  line-height: 1.8;
  font-size: 17px;
}
.post-content h1[id],
.post-content h2[id],
.post-content h3[id] {
  scroll-margin-top: 88px;
}
.post-content h2, .post-content h3 { line-height: 1.35; margin: 1.4em 0 0.6em; }
.post-content h1 {
  font-size: clamp(30px, 3.8vw, 42px);
  line-height: 1.2;
  margin: 1.2em 0 0.5em;
  font-weight: 800;
}
.post-content h2 {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
}
.post-content h3 {
  font-size: clamp(20px, 2.4vw, 24px);
  font-weight: 700;
}
.post-content p { margin: 0 0 1em; color: #1f2937; }
.post-content ul { margin: 0 0 1em 1.3em; }
.post-content strong { font-weight: 700; }
.post-content a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }

.post-cta {
  margin: 1.5em 0;
  padding: 22px 24px;
  border-radius: 14px;
  border: 1px solid #c4b5fd;
  background: linear-gradient(145deg, #f5f3ff 0%, #e0e7ff 38%, #faf5ff 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 4px 18px rgba(91, 76, 230, 0.12);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.post-cta:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 10px 32px rgba(91, 76, 230, 0.18);
  border-color: #a78bfa;
}
.post-cta-title {
  margin: 0 0 14px;
  font-size: clamp(17px, 2.2vw, 20px);
  font-weight: 700;
  color: #1e1b4b;
  line-height: 1.35;
}
.post-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #fff !important;
  background: linear-gradient(180deg, #6d5ff0 0%, var(--primary) 100%);
  border: 1px solid #4c3fd4;
  text-decoration: none !important;
  box-shadow: 0 2px 8px rgba(91, 76, 230, 0.35);
  transition: transform 0.2s cubic-bezier(0.34, 1.2, 0.64, 1), box-shadow 0.2s ease;
}
.post-cta:hover .post-cta-btn,
.post-cta-btn:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 6px 20px rgba(91, 76, 230, 0.45);
}
.post-cta-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.sticky-article-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.32s ease, transform 0.32s ease;
}
.sticky-article-cta.is-visible {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
}
.sticky-article-cta__inner {
  width: min(1140px, calc(100% - 8px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid #e9e5ff;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(8px);
}
.sticky-article-cta__text {
  margin: 0;
  flex: 1 1 160px;
  font-size: 14px;
  font-weight: 600;
  color: #312e81;
  line-height: 1.35;
}
.sticky-article-cta__btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #fff !important;
  background: linear-gradient(180deg, #6d5ff0 0%, var(--primary) 100%);
  border: 1px solid #4c3fd4;
  text-decoration: none !important;
  box-shadow: 0 2px 10px rgba(91, 76, 230, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
}
.sticky-article-cta__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(91, 76, 230, 0.42);
}
.sticky-article-cta__btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
@media (max-width: 760px) {
  .sticky-article-cta__inner {
    padding: 8px 12px;
    min-height: 0;
  }
  .sticky-article-cta__text {
    font-size: 13px;
    flex: 1 1 100%;
  }
  .sticky-article-cta__btn {
    width: 100%;
    padding: 10px 14px;
  }
  body.has-sticky-article-cta--visible {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }
}

.related-section {
  margin-top: 36px;
  padding-bottom: 40px;
}
.related-heading {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.related-grid {
  padding-bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  overflow: hidden;
}
.post-card--related {
  min-height: 0;
}
.post-card--related .read-more {
  margin-top: auto;
}

@media (max-width: 1024px) {
  .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-layout { grid-template-columns: 1fr; }
  .post-toc-wrap { position: static; }
}
@media (max-width: 768px) {
  .related-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 12px;
    padding: 0 2px 10px;
    scrollbar-width: none;
  }
  .related-grid::-webkit-scrollbar {
    display: none;
  }
  .related-grid .post-card {
    flex: 0 0 85vw;
    max-width: 85vw;
    scroll-snap-align: start;
  }
}
@media (max-width: 760px) {
  .blog-filters { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .post-content { padding: 16px; font-size: 16px; }
}

/* === Editorial article blocks (premium long-form) ============================
   All blocks use class selectors only — blog.js sanitizer keeps `class` attr
   and strips inline styles. Keep this section self-contained.
   ============================================================================ */

.blog-tldr {
  margin: 0 0 24px;
  padding: 18px 20px;
  border-radius: 14px;
  background: linear-gradient(140deg, #faf5ff 0%, #eef2ff 60%, #f0f9ff 100%);
  border: 1px solid #ddd6fe;
}
.blog-tldr-label {
  display: none !important;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6d28d9;
  margin: 0 0 6px;
}
.blog-tldr p {
  margin: 4px 0 0;
  font-size: 16px;
  line-height: 1.6;
  color: #1f2937;
}

.blog-author {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.blog-author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c4b5fd 0%, #818cf8 100%);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
}
.blog-author-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 13px;
  line-height: 1.35;
}
.blog-author-name { font-weight: 700; color: var(--text); }
.blog-author-role { color: var(--muted); font-size: 12px; }

.blog-image-placeholder {
  margin: 22px 0;
  padding: 38px 18px;
  border: 1px dashed #c7d2fe;
  border-radius: 14px;
  background: repeating-linear-gradient(
    135deg,
    #f5f3ff,
    #f5f3ff 12px,
    #faf5ff 12px,
    #faf5ff 24px
  );
  text-align: center;
  color: #4c1d95;
  font-size: 13px;
  font-weight: 600;
}
.blog-image-placeholder span.label {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: #ede9fe;
  border: 1px solid #c4b5fd;
  color: #4338ca;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-right: 8px;
}

.blog-callout {
  margin: 22px 0;
  padding: 16px 18px;
  border-radius: 12px;
  border-left: 4px solid var(--primary);
  background: #faf5ff;
  color: #1f2937;
  font-size: 15.5px;
  line-height: 1.6;
}
.blog-callout p { margin: 0; }
.blog-callout strong { color: #4c1d95; }

.blog-quote {
  margin: 22px 0;
  padding: 14px 22px;
  border-left: 3px solid #94a3b8;
  font-style: italic;
  color: #475569;
  font-size: 17px;
  line-height: 1.55;
}
.blog-quote-attr {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-size: 13px;
  color: #64748b;
  font-weight: 600;
}

.blog-tool-card {
  margin: 24px 0;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02), 0 4px 16px rgba(15, 23, 42, 0.04);
}
.blog-tool-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
  margin: 0 0 4px;
}
.blog-tool-card-head h3 {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 26px);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.blog-tool-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #ede9fe;
  border: 1px solid #c4b5fd;
  color: #4338ca;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.blog-tool-card-sub {
  margin: 4px 0 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.blog-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 22px;
  margin: 14px 0 4px;
}
.blog-tool-grid-row {
  font-size: 14px;
  line-height: 1.5;
  color: #1f2937;
}
.blog-tool-grid-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}

.blog-comparison {
  margin: 26px 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow-x: auto;
  background: #fff;
}
.blog-comparison table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  font-size: 14px;
}
.blog-comparison th,
.blog-comparison td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  line-height: 1.5;
}
.blog-comparison thead th {
  background: #f8fafc;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #475569;
  border-bottom: 1px solid var(--border);
}
.blog-comparison tbody tr:last-child td { border-bottom: 0; }
.blog-comparison tbody tr:hover { background: #faf5ff; }
.blog-comparison td:first-child { font-weight: 700; color: var(--text); }

.blog-cta-inline {
  margin: 28px 0;
  padding: 22px 24px;
  border-radius: 16px;
  border: 1px solid #c4b5fd;
  background: linear-gradient(135deg, #1e1b4b 0%, #3730a3 60%, #4c1d95 100%);
  color: #fff;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
.blog-cta-inline-text {
  flex: 1 1 280px;
}
.blog-cta-inline-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c4b5fd;
  margin-bottom: 6px;
}
.blog-cta-inline-title {
  margin: 0;
  font-size: clamp(18px, 2.4vw, 22px);
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
}
.blog-cta-inline-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #1e1b4b !important;
  background: #fff;
  border: 1px solid #fff;
  text-decoration: none !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
}
.blog-cta-inline-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
}

.blog-verdict {
  margin: 24px 0 16px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}
.blog-verdict-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0f172a;
  background: #fef3c7;
  border: 1px solid #fde68a;
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.blog-verdict p { margin: 4px 0 0; }

.blog-faq {
  margin: 28px 0 0;
  display: grid;
  gap: 12px;
}
.blog-faq-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 16px 18px;
}
.blog-faq-item h3 {
  margin: 0 0 6px !important;
  font-size: 17px !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  color: var(--text);
}
.blog-faq-item p {
  margin: 0;
  color: #334155;
  font-size: 15px;
  line-height: 1.6;
}

@media (max-width: 760px) {
  .blog-tool-grid { grid-template-columns: 1fr; }
  .blog-cta-inline { flex-direction: column; align-items: flex-start; }
  .blog-cta-inline-btn { width: 100%; }
}
