/* The /blog pages. Loaded after staging.css and built on its colours and tokens (--si-*), so the
   blog reads as the rest of the site. */

/* ---- List ---------------------------------------------------------------------------------- */

.blog-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: -1rem auto 2.5rem;
  max-width: 880px;
}

.blog-chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0.45rem 1rem;
  border: 1px solid var(--si-hairline-strong);
  border-radius: 999px;
  background: var(--si-surface-hint);
  color: #e2e8f0;
  font-size: 0.84rem;
  font-weight: 750;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.blog-chip:hover {
  border-color: rgba(199, 210, 254, 0.6);
  color: #ffffff;
}

.blog-chip.is-active {
  border-color: transparent;
  background: var(--si-lime);
  color: var(--si-on-lime);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.blog-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--si-hairline);
  border-radius: var(--si-radius-panel);
  background: var(--si-surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 24px 64px rgba(0, 0, 0, 0.18);
  transition: transform 200ms ease, border-color 200ms ease;
}

.blog-card:hover {
  transform: translateY(-3px);
  border-color: rgba(165, 180, 252, 0.35);
}

.blog-card-media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--si-featured);
}

.blog-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}

.blog-card:hover .blog-card-media img {
  transform: scale(1.03);
}

.blog-card-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(217, 255, 63, 0.12), transparent 45%),
    linear-gradient(135deg, rgba(79, 70, 229, 0.45), rgba(14, 23, 64, 0.7));
}

.blog-card-placeholder .staging-icon-tile {
  width: 4rem;
  height: 4rem;
  border-radius: var(--si-radius-card);
}

.blog-card-placeholder .staging-icon-tile svg {
  width: 2rem;
  height: 2rem;
}

.blog-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1.4rem 1.5rem 1.5rem;
}

.blog-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  margin: 0;
  color: #a5b4fc;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.blog-card-title {
  margin: 0;
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 850;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

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

/* The whole card is the link. */
.blog-card-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.blog-card-title a:focus-visible {
  outline: none;
}

.blog-card:has(.blog-card-title a:focus-visible) {
  outline: 2px solid var(--si-lime);
  outline-offset: 3px;
}

.blog-card-copy {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #cbd5e1;
  font-size: 0.95rem;
  line-height: 1.6;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.blog-card-meta {
  display: flex;
  gap: 0.5rem;
  margin: auto 0 0;
  padding-top: 0.4rem;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 650;
}

.blog-card.is-featured {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
}

.blog-card.is-featured .blog-card-media {
  aspect-ratio: auto;
  min-height: 340px;
}

.blog-card.is-featured .blog-card-body {
  justify-content: center;
  gap: 1rem;
  padding: clamp(1.75rem, 4vw, 3rem);
}

.blog-card.is-featured .blog-card-title {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.blog-card.is-featured .blog-card-copy {
  font-size: 1.02rem;
  -webkit-line-clamp: 4;
}

.blog-card.is-featured .blog-card-meta {
  margin-top: 0.4rem;
}

.blog-empty {
  display: grid;
  justify-items: center;
  gap: 0.9rem;
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem);
  text-align: center;
}

.blog-empty h2 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.blog-empty p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.6;
}

/* ---- Post ---------------------------------------------------------------------------------- */

.blog-breadcrumb {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 750;
}

.blog-breadcrumb a {
  color: #94a3b8;
  text-decoration: none;
}

.blog-breadcrumb a:hover {
  color: #ffffff;
}

.blog-article-hero {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.blog-article-hero .staging-eyebrow {
  margin-bottom: 1.1rem;
}

.blog-article-title {
  margin: 0;
  color: #ffffff;
  font-size: clamp(2.3rem, 5.6vw, 4.4rem);
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.blog-article-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.6rem;
  margin: 1.5rem 0 0;
  color: #94a3b8;
  font-size: 0.92rem;
  font-weight: 600;
}

.blog-article-meta strong {
  color: #e2e8f0;
  font-weight: 750;
}

.blog-article-updated {
  margin: 0.4rem 0 0;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 600;
}

.blog-cover {
  max-width: 1080px;
  margin: clamp(2rem, 5vw, 3.25rem) auto 0;
  overflow: hidden;
  border: 1px solid var(--si-hairline);
  border-radius: var(--si-radius-sheet);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.35);
}

.blog-cover img {
  display: block;
  width: 100%;
  height: auto;
}

.blog-article-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 720px);
  justify-content: center;
  gap: clamp(2rem, 5vw, 4rem);
  margin-top: clamp(2.5rem, 5vw, 3.75rem);
}

.blog-article-layout.no-toc {
  grid-template-columns: minmax(0, 720px);
}

.blog-toc {
  position: sticky;
  top: 108px;
  align-self: start;
  padding-left: 1rem;
  border-left: 1px solid var(--si-hairline-strong);
}

.blog-toc-label {
  margin: 0 0 0.8rem;
  color: #a5b4fc;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.blog-toc ol {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.blog-toc a {
  color: #94a3b8;
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.4;
  text-decoration: none;
  transition: color 160ms ease;
}

.blog-toc a:hover {
  color: #ffffff;
}

.blog-answer {
  margin: 0 0 2.5rem;
  padding: clamp(1.3rem, 3vw, 1.75rem) clamp(1.3rem, 3vw, 1.9rem);
  border: 1px solid var(--si-hairline);
  border-left: 3px solid var(--si-lime);
  border-radius: var(--si-radius-panel);
  background: var(--si-featured);
}

.blog-answer-label {
  margin: 0 0 0.6rem;
  color: var(--si-lime);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.blog-answer-text {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.08rem, 2vw, 1.2rem);
  font-weight: 550;
  line-height: 1.6;
}

.blog-prose {
  color: #cbd5e1;
  font-size: 1.075rem;
  line-height: 1.8;
}

.blog-prose > :first-child {
  margin-top: 0;
}

.blog-prose p {
  margin: 0 0 1.3rem;
}

.blog-prose h2,
.blog-prose h3,
.blog-prose h4,
.blog-faq h2 {
  color: #ffffff;
  scroll-margin-top: 108px;
  text-wrap: balance;
}

.blog-prose h2,
.blog-faq h2 {
  margin: 2.8rem 0 1rem;
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.blog-prose h3 {
  margin: 2.1rem 0 0.75rem;
  font-size: 1.3rem;
  font-weight: 850;
  line-height: 1.25;
}

.blog-prose h4 {
  margin: 1.75rem 0 0.6rem;
  font-size: 1.05rem;
  font-weight: 850;
}

.blog-prose a {
  color: var(--si-lime);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

.blog-prose strong {
  color: #ffffff;
  font-weight: 750;
}

.blog-prose ul,
.blog-prose ol {
  display: grid;
  gap: 0.55rem;
  margin: 0 0 1.5rem;
  padding-left: 1.4rem;
}

/* staging.css's reset takes list markers off; posts want them back. */
.blog-prose ul {
  list-style: disc;
}

.blog-prose ol {
  list-style: decimal;
}

.blog-prose li {
  padding-left: 0.3rem;
}

.blog-prose ul li::marker {
  color: var(--si-lime);
}

.blog-prose ol li::marker {
  color: #a5b4fc;
  font-weight: 800;
}

.blog-prose blockquote {
  margin: 2rem 0;
  padding: 0.2rem 0 0.2rem 1.4rem;
  border-left: 3px solid #818cf8;
  color: #e2e8f0;
  font-size: 1.18rem;
  line-height: 1.65;
}

.blog-prose blockquote p:last-child {
  margin-bottom: 0;
}

.blog-prose figure {
  margin: 2.25rem 0;
}

.blog-prose figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--si-hairline);
  border-radius: var(--si-radius-card);
}

.blog-prose figcaption {
  margin-top: 0.75rem;
  color: #94a3b8;
  font-size: 0.86rem;
  line-height: 1.5;
  text-align: center;
}

.blog-prose hr {
  margin: 2.75rem 0;
  border: 0;
  border-top: 1px solid var(--si-hairline-strong);
}

.blog-prose code {
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  font-size: 0.9em;
}

.blog-table {
  margin: 2rem 0;
  overflow-x: auto;
  border: 1px solid var(--si-hairline);
  border-radius: var(--si-radius-card);
}

.blog-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.5;
}

.blog-table th,
.blog-table td {
  padding: 0.8rem 1rem;
  text-align: left;
  vertical-align: top;
}

.blog-table th {
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
  font-weight: 800;
  white-space: nowrap;
}

.blog-table tr + tr td,
.blog-table tbody tr:first-child td {
  border-top: 1px solid var(--si-hairline);
}

.blog-faq {
  margin-top: 3rem;
}

.blog-faq details {
  border-bottom: 1px solid var(--si-hairline);
}

.blog-faq details:first-of-type {
  border-top: 1px solid var(--si-hairline);
}

.blog-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 0;
  color: #ffffff;
  font-size: 1.06rem;
  font-weight: 800;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
}

.blog-faq summary::-webkit-details-marker {
  display: none;
}

.blog-faq summary::after {
  content: "+";
  display: grid;
  flex: none;
  width: 1.9rem;
  height: 1.9rem;
  place-items: center;
  border: 1px solid var(--si-hairline-strong);
  border-radius: 999px;
  color: var(--si-lime);
  font-size: 1.15rem;
  font-weight: 600;
  transition: transform 200ms ease;
}

.blog-faq details[open] summary::after {
  transform: rotate(45deg);
}

.blog-faq-answer {
  padding: 0 2.9rem 1.2rem 0;
  color: #cbd5e1;
  line-height: 1.75;
}

.blog-faq-answer p {
  margin: 0 0 0.9rem;
}

.blog-faq-answer p:last-child {
  margin-bottom: 0;
}

.blog-article-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--si-hairline);
}

.blog-author {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.blog-author img {
  border-radius: var(--si-radius-control);
}

.blog-author p {
  margin: 0;
}

.blog-author-name {
  color: #ffffff;
  font-weight: 800;
}

.blog-author-role {
  color: #94a3b8;
  font-size: 0.86rem;
}

.blog-share {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.blog-share a,
.blog-share button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0.45rem 1rem;
  border: 1px solid var(--si-hairline-strong);
  border-radius: 999px;
  background: var(--si-surface-hint);
  color: #e2e8f0;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease;
}

.blog-share a:hover,
.blog-share button:hover {
  border-color: rgba(199, 210, 254, 0.6);
  color: #ffffff;
}

.blog-related {
  margin-top: clamp(3.5rem, 7vw, 5rem);
}

.blog-related-title {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 900;
  letter-spacing: -0.025em;
}

.blog-preview-bar {
  position: fixed;
  top: 76px;
  left: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem 1.25rem;
  width: 100%;
  padding: 0.65rem 1rem;
  background: var(--si-lime);
  color: var(--si-on-lime);
  font-size: 0.88rem;
}

.blog-preview-bar a {
  color: var(--si-on-lime);
  font-weight: 850;
}

/* ---- Smaller screens ----------------------------------------------------------------------- */

@media (max-width: 980px) {
  .blog-article-layout {
    grid-template-columns: minmax(0, 720px);
  }

  .blog-toc {
    position: static;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--si-hairline);
    border-radius: var(--si-radius-card);
    background: var(--si-surface);
  }

  .blog-preview-bar {
    top: 68px;
  }
}

@media (max-width: 760px) {
  .blog-card.is-featured {
    grid-template-columns: 1fr;
  }

  .blog-card.is-featured .blog-card-media {
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }

  .blog-filter {
    flex-wrap: nowrap;
    justify-content: flex-start;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
    padding: 0 0.75rem 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .blog-chip {
    flex: none;
  }

  .blog-prose {
    font-size: 1.03rem;
  }

  .blog-faq-answer {
    padding-right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog-card,
  .blog-card-media img,
  .blog-faq summary::after {
    transition: none;
  }

  .blog-card:hover,
  .blog-card:hover .blog-card-media img {
    transform: none;
  }
}
