.blog-page {
  min-width: 0;
  background: var(--bg-page);
  color: var(--text-primary);
}

.blog-page .site-content,
.blog-page > .blog-footer {
  box-sizing: border-box;
  width: 100%;
  margin-left: 0;
}

.blog-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 72px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  background: color-mix(in srgb, var(--bg-surface) 94%, transparent);
  backdrop-filter: blur(12px);
}

.blog-navbar-inner {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  max-width: 1200px;
  height: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin: 0 auto;
  padding-inline: 32px;
}

.blog-brand {
  display: flex;
  min-width: 0;
  flex-direction: column;
  color: var(--text-primary);
  line-height: 1.3;
}

.blog-brand strong {
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blog-brand span {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.blog-brand:hover strong {
  color: var(--blue);
}

.blog-nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.blog-nav-links > a {
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}

.blog-nav-links > a:hover,
.blog-nav-links > a.active {
  background: var(--blue-soft);
  color: var(--blue);
}

.blog-navbar .theme-toggle {
  flex: 0 0 auto;
  margin: 0 0 0 4px;
}

.blog-main,
.article-main {
  min-height: 100vh;
  background: var(--bg-page);
}

.blog-container {
  box-sizing: border-box;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: 44px;
}

.blog-intro {
  background: var(--bg-surface);
  padding: 100px 0 88px;
}

.blog-heading {
  max-width: 760px;
  margin-bottom: 54px;
}

.blog-heading h2 {
  margin-bottom: 18px;
  font-size: clamp(32px, 4vw, 48px);
  letter-spacing: -.035em;
}

.blog-heading p {
  max-width: 700px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.8;
}

.featured-post {
  display: grid;
  overflow: hidden;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, .88fr);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg-surface);
  box-shadow: 0 8px 28px rgba(15, 23, 42, .06);
}

.featured-post-image,
.article-image {
  display: block;
  overflow: hidden;
  background: var(--bg-subtle);
}

.featured-post-image {
  min-height: 430px;
}

.featured-post-image img,
.article-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.featured-post:hover .featured-post-image img,
.article-card:hover .article-image img {
  transform: scale(1.03);
}

.featured-post-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 42px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 15px;
}

.post-meta span,
.articles-heading > div > span {
  color: var(--blue);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.post-meta time {
  color: var(--text-muted);
  font-size: 11px;
}

.featured-post h3,
.article-card h3 {
  margin: 0;
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -.025em;
}

.featured-post h3 {
  font-size: clamp(25px, 2.5vw, 34px);
  line-height: 1.35;
}

.featured-post h3 a,
.article-card h3 a {
  color: inherit;
}

.featured-post h3 a:hover,
.article-card h3 a:hover {
  color: var(--blue);
}

.featured-post-content > p,
.article-content > p {
  color: var(--text-secondary);
  line-height: 1.75;
}

.featured-post-content > p {
  margin: 18px 0 25px;
  font-size: 14px;
}

.read-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 9px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
}

.read-link:hover {
  gap: 13px;
  color: var(--blue-hover);
}

.articles-section {
  background: var(--bg-page);
  padding: 90px 0 110px;
}

.articles-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
}

.articles-heading h2 {
  margin: 7px 0 0;
  color: var(--text-primary);
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -.03em;
}

.blog-search {
  position: relative;
  display: block;
  width: min(100%, 360px);
}

.blog-search input {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: 0;
  background: var(--bg-surface);
  padding: 14px 46px 14px 16px;
  color: var(--text-primary);
  font: 400 13px/1.5 "Poppins", sans-serif;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .25s ease;
}

.blog-search input::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.blog-search input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}

.blog-search i {
  position: absolute;
  top: 50%;
  right: 17px;
  color: var(--text-muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 34px 0 42px;
}

.blog-filters button {
  border: 0;
  border-radius: 7px;
  background: transparent;
  padding: 9px 14px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}

.blog-filters button:hover,
.blog-filters button.active {
  background: var(--blue-soft);
  color: var(--blue);
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;
}

.article-card {
  display: flex;
  min-width: 0;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-surface);
  box-shadow: 0 2px 10px rgba(15, 23, 42, .035);
  transition: opacity .25s ease, transform .25s ease, border-color .25s ease, box-shadow .25s ease, background-color .25s ease;
}

.article-card:hover {
  border-color: var(--border-accent);
  box-shadow: 0 10px 26px rgba(15, 23, 42, .07);
  transform: translateY(-3px);
}

.article-card.is-hidden,
.featured-post.is-hidden {
  display: none;
}

.article-image {
  aspect-ratio: 16 / 9;
}

.article-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 27px 27px 29px;
}

.article-card h3 {
  font-size: 19px;
  line-height: 1.5;
}

.article-content > p {
  margin: 13px 0 22px;
  font-size: 13px;
}

.article-content .read-link {
  margin-top: auto;
}

.blog-empty {
  margin: 40px 0 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-surface);
  padding: 28px;
  color: var(--text-secondary);
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* Article page */
.article-main {
  padding: 88px 40px 120px;
}

.article-shell {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
}

.article-not-found {
  width: min(100%, 720px);
  margin: 80px auto;
  text-align: center;
}

.article-not-found .error-code {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .18em;
}

.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 22px;
  margin-top: 28px;
}

.not-found-actions .primary-link {
  border-radius: 8px;
  background: var(--blue);
  padding: 11px 18px;
  color: #fff;
}

.article-not-found h1 {
  margin: 0 0 18px;
  color: var(--text-primary);
  font-size: clamp(36px, 5vw, 58px);
  letter-spacing: -.04em;
}

.article-not-found p {
  margin: 0 0 28px;
  color: var(--text-secondary);
  font-size: 16px;
}

.article-not-found .read-link {
  display: inline-flex;
}

.back-to-blog {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 48px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}

.back-to-blog:hover {
  color: var(--blue);
}

.article-header {
  max-width: 820px;
  margin: 0 auto 48px;
  text-align: center;
}

.article-eyebrow {
  margin: 0 0 19px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.article-eyebrow span {
  color: var(--blue);
}

.article-header h1 {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(36px, 5vw, 62px);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -.045em;
}

.article-deck {
  max-width: 700px;
  margin: 24px auto 20px;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.75;
}

.article-byline {
  display: flex;
  justify-content: center;
  gap: 11px;
  color: var(--text-muted);
  font-size: 11px;
}

.article-byline span::before {
  margin-right: 11px;
  content: "·";
}

.article-cover {
  aspect-ratio: 16 / 8.4;
  overflow: hidden;
  margin: 0 0 64px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg-subtle);
}

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

.article-body {
  max-width: 790px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.85;
}

.article-body p {
  margin: 0 0 25px;
}

.article-body .article-lead {
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1.8;
}

.article-body h2,
.article-body h3 {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -.025em;
}

.article-body h2 {
  margin: 58px 0 20px;
  font-size: 28px;
  line-height: 1.35;
}

.article-body h3 {
  margin: 45px 0 18px;
  font-size: 21px;
}

.article-body ul,
.article-body ol {
  margin: 0 0 30px;
  padding-left: 24px;
}

.article-body li {
  margin-bottom: 10px;
  padding-left: 5px;
}

.article-body blockquote {
  margin: 38px 0;
  border-left: 3px solid var(--blue);
  border-radius: 0 10px 10px 0;
  background: var(--blue-soft);
  padding: 24px 28px;
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.75;
}

.article-body a {
  color: var(--blue);
}

.code-block {
  overflow: hidden;
  margin: 32px 0;
  border: 1px solid #243247;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
}

.code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #243247;
  padding: 9px 14px;
  color: #94a3b8;
  font: 500 10px/1.4 "Poppins", sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.code-toolbar button {
  border: 1px solid #334155;
  border-radius: 6px;
  background: #1e293b;
  padding: 5px 9px;
  color: #cbd5e1;
  font: 500 10px/1.3 "Poppins", sans-serif;
  cursor: pointer;
}

.code-toolbar button:hover {
  border-color: #60a5fa;
  color: #fff;
}

.code-block pre {
  overflow-x: auto;
  margin: 0;
  padding: 20px;
}

.code-block code {
  color: inherit;
  font: 400 13px/1.75 "Source Code Pro", Consolas, monospace;
}

.article-footer-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 65px;
  border-top: 1px solid var(--border);
  padding-top: 28px;
  font-size: 12px;
  font-weight: 600;
}

.blog-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}

.blog-footer .blog-container {
  display: flex;
  min-height: 90px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--text-muted);
  font-size: 11px;
}

.blog-footer a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-weight: 500;
}

.blog-footer a:hover {
  color: var(--blue);
}

[data-theme="dark"] .featured-post,
[data-theme="dark"] .article-card,
[data-theme="dark"] .blog-empty {
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

[data-theme="dark"] .article-card:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, .24);
}

@media (max-width: 1100px) {
  .blog-container { padding-inline: 30px; }
  .featured-post { grid-template-columns: 1fr; }
  .featured-post-image { min-height: 360px; aspect-ratio: 16 / 9; }
}

@media (max-width: 1000px) and (min-width: 768px) {
  .article-grid { grid-template-columns: 1fr; }
  .articles-heading { align-items: start; flex-direction: column; }
  .blog-search { width: 100%; }
}

@media (max-width: 767px) {
  .blog-navbar { height: 68px; }
  .blog-navbar-inner { gap: 12px; padding-inline: 18px; }
  .blog-brand strong { font-size: 13px; }
  .blog-brand span { display: none; }
  .blog-nav-links { gap: 1px; }
  .blog-nav-links > a { padding: 8px 7px; font-size: 11px; }
  .blog-navbar .theme-toggle { gap: 6px; margin-left: 2px; padding: 8px 10px; font-size: 10px; }
  .blog-container { padding-inline: 21px; }
  .blog-intro { padding: 85px 0 64px; }
  .blog-heading { margin-bottom: 38px; }
  .blog-heading h2 { font-size: 34px; }
  .featured-post { border-radius: 15px; }
  .featured-post-image { min-height: 0; }
  .featured-post-content { padding: 29px 23px 32px; }
  .featured-post h3 { font-size: 24px; }
  .articles-section { padding: 70px 0 85px; }
  .articles-heading { align-items: stretch; flex-direction: column; }
  .blog-search { width: 100%; }
  .blog-filters { margin: 27px 0 35px; }
  .blog-filters button { padding: 8px 11px; }
  .article-grid { grid-template-columns: 1fr; gap: 24px; }
  .article-content { padding: 24px 22px 26px; }
  .article-main { padding: 88px 21px 85px; }
  .back-to-blog { margin-bottom: 38px; }
  .article-header { margin-bottom: 36px; text-align: left; }
  .article-header h1 { font-size: 38px; }
  .article-deck { font-size: 15px; }
  .article-byline { justify-content: flex-start; }
  .article-cover { margin-bottom: 42px; border-radius: 14px; }
  .article-body { font-size: 16px; line-height: 1.8; }
  .article-body .article-lead { font-size: 17px; }
  .article-body h2 { margin-top: 45px; font-size: 24px; }
  .article-body blockquote { padding: 20px; font-size: 15px; }
  .code-block pre { padding: 17px; }
  .code-block code { font-size: 12px; }
  .article-footer-links { align-items: flex-start; flex-direction: column; }
  .blog-footer .blog-container { min-height: 82px; align-items: flex-start; flex-direction: column; justify-content: center; gap: 7px; }
}

@media (max-width: 430px) {
  .blog-brand strong { max-width: 118px; }
  .blog-navbar .theme-toggle span { display: none; }
  .blog-navbar .theme-toggle { width: 36px; height: 36px; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .featured-post-image img,
  .article-image img,
  .article-card,
  .blog-search input,
  .blog-filters button {
    transition-duration: .01ms !important;
  }
}

/* Editorial blog listing ---------------------------------------- */
.blog-heading h1 {
  margin: 8px 0 18px;
  color: var(--text-primary);
  font-size: clamp(36px, 4.5vw, 54px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.045em;
}

.blog-heading .blog-topics {
  margin-top: 13px;
  color: var(--text-muted);
  font-size: 12px;
}

.featured-post,
.article-card { position: relative; }

.featured-post {
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  box-shadow: 0 5px 20px rgba(15, 23, 42, .05);
  transition: transform .23s ease, border-color .23s ease, box-shadow .23s ease;
}

.featured-post:hover {
  border-color: var(--border-accent);
  box-shadow: 0 12px 30px rgba(15, 23, 42, .08);
  transform: translateY(-3px);
}

.featured-post-image { min-height: 370px; }

.featured-label {
  align-self: flex-start;
  margin-bottom: 16px;
  border-radius: 999px;
  background: var(--blue-soft);
  padding: 6px 10px;
  color: var(--blue);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.articles-heading { margin-bottom: 38px; }

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

.article-content { padding: 23px 22px 25px; }
.article-card h3 { font-size: 17px; line-height: 1.45; }
.article-content > p {
  display: -webkit-box;
  overflow: hidden;
  margin: 12px 0 18px;
  font-size: 12px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.post-read-time {
  margin: auto 0 13px;
  color: var(--text-muted);
  font-size: 10px;
}

.card-link::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
}

.featured-post-image,
.article-image,
.read-link { position: relative; z-index: 2; }

[data-theme="dark"] .featured-post,
[data-theme="dark"] .article-card {
  border-color: var(--border);
  background: var(--bg-surface);
}

@media (max-width: 1050px) {
  .featured-post { grid-template-columns: 1fr 1fr; }
  .featured-post-image { min-height: 340px; }
  .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .featured-post { grid-template-columns: 1fr; }
  .featured-post-image { min-height: 0; aspect-ratio: 16 / 9; }
}

@media (max-width: 767px) {
  .blog-heading h1 { font-size: 36px; }
  .featured-post { grid-template-columns: 1fr; }
  .featured-post-image { min-height: 0; aspect-ratio: 16 / 9; }
  .articles-heading { margin-bottom: 30px; }
  .article-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .featured-post { transition-duration: .01ms !important; }
}
