.blog-page {
  background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
  scroll-behavior: smooth;
}

.blog-page--article {
  padding-top: 4rem;
}

.blog-shell {
  width: min(1120px, 92%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.blog-shell--article {
  width: min(980px, 94%);
  gap: 2.5rem;
}



.blog-hero {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 26px;
  color: var(--color-text);
  box-shadow: 0 32px 64px rgba(17, 24, 39, 0.16);
}



.blog-hero--article .blog-hero__image {
  height: clamp(340px, 45vw, 480px);
}

.blog-hero__image {
  width: 100%;
  object-fit: cover;
  display: block;
  transition: transform 240ms ease;
}

.blog-hero:hover .blog-hero__image {
  transform: scale(1.015);
}

.blog-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(17, 24, 39, 0.92), rgba(17, 24, 39, 0.18));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(1.6rem, 5.5vw, 3rem);
  color: #f8fafc;
}

.blog-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #e2e8f0;
}

.blog-hero__title {
  font-size: clamp(2.2rem, 3vw, 3.1rem);
  margin: 0.35rem 0 0;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.blog-hero__summary {
  margin: 0.5rem 0 0;
  max-width: 620px;
  font-size: 1.02rem;
  line-height: 1.6;
  color: rgba(248, 250, 252, 0.88);
}

.blog-grid-section {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.blog-grid {
  display: grid;
  gap: 1.6rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  align-items: stretch;
}

.blog-grid--latest {
  margin-top: 1.5rem;
}

.blog-empty {
  padding: 2rem;
  border-radius: 16px;
  background: rgba(226, 232, 240, 0.45);
  color: #334155;
  border: 1px solid #e5e7eb;
}

.blog-card {
  background: var(--color-surface);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  box-shadow: 0 16px 40px rgba(17, 24, 39, 0.08);
  display: flex;
  flex-direction: column;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.blog-card:hover {
  transform: translateY(-3px);
  border-color: #d1d5db;
  box-shadow: 0 22px 60px rgba(17, 24, 39, 0.12);
}

.blog-card__image-wrapper {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0f172a;
  overflow: hidden;
}
.blog-card__image-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,0.25) 100%);
  opacity: 0;
  transition: opacity 160ms ease;
}
.blog-card:hover .blog-card__image-wrapper::after { opacity: 1; }

.blog-card__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}
.blog-card:hover .blog-card__image { transform: scale(1.03); }

.blog-card__body {
  padding: 1.2rem 1.35rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.blog-card__title a {
  color: inherit;
}

.blog-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #475569;
}

.blog-card__title {
  font-size: 1.12rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card__summary {
  color: #334155;
  line-height: 1.45;
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}







.blog-post-layout {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}



@media (max-width: 960px) {
  .blog-post-layout {
    grid-template-columns: 1fr;
  }
  
}

.blog-post {
  background: var(--color-surface);
  padding: clamp(1.4rem, 3vw, 2rem);
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 16px 40px rgba(17, 24, 39, 0.08);
}

/* Top-of-article table of contents */
.blog-toc {
  margin: 0 0 1.4rem;
  padding: 1rem 1.1rem;
  background: transparent;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.blog-toc__header {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}
.blog-toc__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #e2e8f0;
  color: #0f172a;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
}
.blog-toc__eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #0f172a;
}
.blog-toc__hint {
  font-size: 0.74rem;
  color: #475569;
}
.blog-toc__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.blog-toc__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.26rem 0.6rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: transparent;
  color: #0f172a;
  font-size: 0.86rem;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}
.blog-toc__chip--level-3 {
  font-size: 0.8rem;
  padding: 0.24rem 0.5rem;
  border-style: dashed;
}
.blog-toc__chip:hover {
  border-color: #94a3b8;
  background: #f8fafc;
  color: #0f172a;
}
.blog-toc__more {
  margin-top: 0.2rem;
}
.blog-toc__more > summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1e293b;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.blog-toc__more > summary::marker { color: #1e293b; }
.blog-toc__more[open] > summary { color: #475569; }
.blog-toc__chips--secondary {
  margin-top: 0.5rem;
}

.blog-post h2,
.blog-post h3 {
  margin-top: 2.1rem;
  color: #0f172a;
  scroll-margin-top: 96px;
}

.blog-post p { line-height: 1.75; color: #1f2937; }
.blog-post a { color: var(--color-accent-strong); text-underline-offset: 2px; }
.blog-post a:hover { text-decoration: underline; }

.blog-post img { width: 100%; border-radius: 12px; margin: 1.2rem 0; box-shadow: 0 10px 28px rgba(17, 24, 39, 0.12); }

.blog-post blockquote { margin: 1.6rem 0; padding: 1.1rem 1.3rem; background: #eef2ff; border-left: 4px solid #4338ca; border-radius: 12px; color: #1e1b4b; }

.blog-post ul,
.blog-post ol {
  margin: 1rem 0 1.5rem 1.2rem;
  padding: 0;
  color: #1f2937;
}

.blog-post li {
  margin-bottom: 0.35rem;
}

.blog-post code { background: rgba(17, 24, 39, 0.06); padding: 0.1rem 0.35rem; border-radius: 6px; font-family: "SFMono-Regular", ui-monospace, "Roboto Mono", monospace; font-size: 0.86rem; }

.blog-post pre { background: #0f172a; color: #e2e8f0; padding: 1rem 1.2rem; border-radius: 14px; overflow-x: auto; font-size: 0.86rem; }

.blog-section--back {
  margin-top: 1.4rem;
}

.blog-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.2rem;
  color: #111827;
  font-weight: 700;
  border: 1px solid #111827;
  border-radius: 999px;
  padding: 0.42rem 0.9rem;
  background: transparent;
}

.blog-back-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.blog-back-link:hover {
  background: #111827;
  color: #ffffff;
}

.blog-post__neighbours {
  margin-top: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.blog-post__neighbour {
  color: #111827;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.blog-post__neighbour:hover {
  border-bottom-color: #111827;
}

/* Related links at the end of article */
.blog-related {
  margin-top: 2.2rem;
  padding: 1rem 0 0;
  background: transparent;
  border-radius: 0;
  border-top: 1px solid #e2e8f0;
  box-shadow: none;
}
.blog-related__title { font-size: 1.02rem; font-weight: 700; margin: 0 0 .55rem; color: #0f172a; }
.blog-related__links { display: flex; flex-wrap: wrap; gap: .55rem; }
.blog-related__link {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-accent-strong);
  font-weight: 600;
}
.blog-related__link::after {
  content: "\2192";
  font-size: 0.85rem;
  transition: transform 140ms ease;
}
.blog-related__link:hover {
  color: #334155;
}
.blog-related__link:hover::after {
  transform: translateX(2px);
}

.blog-section__cta {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
}

.blog-section--back {
  margin-top: 0;
}

.blog-latest {
  background: #ffffff;
}

.blog-latest .blog-shell {
  gap: 1.6rem;
}

@media (max-width: 720px) {
  .blog-shell {
    gap: 2rem;
  }
  .blog-hero__overlay {
    padding: 1.6rem;
  }
  .blog-hero__meta {
    font-size: 0.78rem;
  }
  
  .blog-section__cta {
    justify-content: center;
  }
}
