/* Public blog listing + article */
.blog-page,
.blog-article-page {
  --blog-navy: #0f1b2d;
  --blog-muted: #64748b;
  --blog-border: #e2e8f0;
  --blog-card: #ffffff;
  --blog-accent: #2563eb;
  --blog-soft: #f8fafc;
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(37, 99, 235, 0.08), transparent 60%),
    linear-gradient(180deg, #f8fafc 0%, #ffffff 42%, #f1f5f9 100%);
  color: var(--blog-navy);
  overflow-x: hidden;
}

.blog-hero {
  position: relative;
  padding: 72px 20px 36px;
}

.blog-hero__glow {
  position: absolute;
  inset: 10% 20% auto;
  height: 180px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.18), transparent 70%);
  pointer-events: none;
}

.blog-hero__inner,
.blog-toolbar__inner,
.blog-listing,
.blog-article-wrap {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.blog-hero__badge {
  margin: 0 0 12px;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.blog-hero__title {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.blog-hero__lead {
  margin: 16px 0 0;
  max-width: 62ch;
  color: var(--blog-muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.blog-toolbar {
  padding: 8px 0 28px;
}

.blog-toolbar__inner {
  display: grid;
  gap: 16px;
}

.blog-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--blog-border);
  border-radius: 999px;
  background: var(--blog-card);
  box-shadow: 0 8px 24px rgba(15, 27, 45, 0.04);
}

.blog-search__icon {
  color: var(--blog-muted);
  display: inline-flex;
}

.blog-search__input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  outline: none;
}

.blog-search__btn {
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--blog-navy);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.blog-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.blog-cat {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--blog-border);
  border-radius: 999px;
  background: #fff;
  color: var(--blog-muted);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 700;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.blog-cat:hover,
.blog-cat.is-active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.blog-listing {
  padding-bottom: 72px;
}

.blog-listing__meta {
  margin-bottom: 16px;
  color: var(--blog-muted);
  font-size: 13px;
  font-weight: 600;
}

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

.blog-grid--related {
  margin-top: 18px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--blog-border);
  border-radius: 18px;
  background: var(--blog-card);
  box-shadow: 0 10px 28px rgba(15, 27, 45, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(15, 27, 45, 0.1);
}

.blog-card__media {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #e2e8f0;
}

.blog-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

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

.blog-card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 16px 18px;
  flex: 1;
}

.blog-card__cat {
  margin: 0;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.blog-card__title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.blog-card__title a {
  color: inherit;
  text-decoration: none;
}

.blog-card__title a:hover {
  color: #1d4ed8;
}

.blog-card__excerpt {
  margin: 0;
  color: var(--blog-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.blog-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--blog-muted);
  font-size: 12.5px;
  font-weight: 600;
}

.blog-card__cta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #1d4ed8;
  font-size: 13.5px;
  font-weight: 750;
  text-decoration: none;
}

.blog-empty {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  place-items: start;
  padding: 48px 24px;
  border: 1px dashed var(--blog-border);
  border-radius: 18px;
  background: #fff;
  color: var(--blog-muted);
}

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

.blog-pager__btn,
.blog-pager__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--blog-border);
  border-radius: 10px;
  background: #fff;
  color: var(--blog-navy);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.blog-pager__num.is-current {
  background: var(--blog-navy);
  border-color: var(--blog-navy);
  color: #fff;
}

.blog-preview-banner {
  background: #fff7ed;
  color: #9a3412;
  text-align: center;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
}

.blog-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0 18px;
  color: var(--blog-muted);
  font-size: 13px;
}

.blog-crumbs a {
  color: inherit;
  text-decoration: none;
}

.blog-article-hero h1 {
  margin: 8px 0 0;
  font-size: clamp(1.8rem, 3.6vw, 2.8rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.blog-article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 14px;
  color: var(--blog-muted);
  font-size: 13.5px;
  font-weight: 600;
}

.blog-article-cover {
  margin: 24px 0 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--blog-border);
  aspect-ratio: 16 / 9;
  background: #e2e8f0;
}

.blog-article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-article-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  margin: 28px 0 40px;
  align-items: start;
}

.blog-toc {
  position: sticky;
  top: 88px;
  padding: 14px;
  border: 1px solid var(--blog-border);
  border-radius: 14px;
  background: #fff;
}

.blog-toc__label {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blog-muted);
}

.blog-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.blog-toc a {
  color: var(--blog-navy);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.35;
}

.blog-toc__item--h3 {
  padding-left: 10px;
}

.blog-prose {
  min-width: 0;
  font-size: 1.05rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.blog-prose h2,
.blog-prose h3,
.blog-prose h4 {
  margin: 1.6em 0 0.55em;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #0f172a;
}

.blog-prose h2 { font-size: 1.45rem; }
.blog-prose h3 { font-size: 1.2rem; }
.blog-prose h4 { font-size: 1.05rem; }

.blog-prose p,
.blog-prose ul,
.blog-prose ol,
.blog-prose blockquote,
.blog-prose figure,
.blog-prose pre,
.blog-prose .blog-table-wrap {
  margin: 0 0 1em;
}

.blog-prose ul,
.blog-prose ol {
  padding-left: 1.35em;
}

.blog-prose li + li {
  margin-top: 0.35em;
}

.blog-prose a {
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.blog-prose a:hover {
  color: #1e40af;
}

.blog-prose blockquote {
  padding: 10px 16px;
  border-left: 3px solid #93c5fd;
  background: #f8fafc;
  color: #334155;
}

.blog-prose img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

.blog-prose figure {
  margin: 0 0 1.25em;
}

.blog-prose figcaption {
  margin-top: 0.45em;
  font-size: 0.9rem;
  color: #64748b;
}

.blog-prose .blog-img-center {
  margin-left: auto;
  margin-right: auto;
}

.blog-prose .blog-img-wide img {
  width: 100%;
}

.blog-prose hr {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 1.6em 0;
}

.blog-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: #f1f5f9;
  color: #0f172a;
  padding: 0.12em 0.35em;
  border-radius: 5px;
}

.blog-prose pre {
  overflow-x: auto;
  max-width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid #1e293b;
}

.blog-prose pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: 0.88rem;
  line-height: 1.55;
}

.blog-prose .blog-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.blog-prose table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.blog-prose th,
.blog-prose td {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: top;
}

.blog-prose th {
  background: #f8fafc;
  font-weight: 750;
  color: #0f172a;
}

.blog-prose tr:last-child td {
  border-bottom: 0;
}

.blog-share {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--blog-border);
}

.blog-share__label {
  margin: 0;
  font-weight: 800;
  font-size: 13px;
}

.blog-share__btn {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--blog-border);
  border-radius: 999px;
  background: #fff;
  color: var(--blog-navy);
  text-decoration: none;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.blog-back {
  margin-top: 18px;
}

.blog-back a {
  color: var(--blog-muted);
  text-decoration: none;
  font-weight: 700;
}

.blog-neighbors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 36px;
}

.blog-neighbor {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--blog-border);
  border-radius: 14px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}

.blog-neighbor span {
  color: var(--blog-muted);
  font-size: 12px;
  font-weight: 700;
}

.blog-neighbor--next {
  text-align: right;
}

.blog-related {
  padding-bottom: 72px;
}

.blog-related h2 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .blog-article-layout {
    grid-template-columns: 1fr;
  }
  .blog-toc {
    position: static;
  }
}

@media (max-width: 640px) {
  .blog-grid,
  .blog-grid--related,
  .blog-neighbors {
    grid-template-columns: 1fr;
  }
  .blog-neighbor--next {
    text-align: left;
  }
  .blog-hero {
    padding-top: 56px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog-card,
  .blog-card__media img,
  .blog-cat {
    transition: none !important;
  }
  .blog-card:hover {
    transform: none;
  }
  .blog-card:hover .blog-card__media img {
    transform: none;
  }
}
