.toc-page {
  background: var(--color-neutral-200);
}

/* ---- Blog listing (sticky-tab grouped) ---- */

/* Keep the sticky tabs inside the same vertical border lines as the hero.
   Zero out the container's own horizontal padding so the sticky-tab group
   fills the full border-to-border width (cards/headings add padding back
   at the content level via .blog-tabs-wrap--inset). */
.blog-tabs-wrap {
  border-left: 1px solid #8898aa;
  border-right: 1px solid #8898aa;
  padding-top: 1px;
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 6em;
}

/* Neutralise any nested .container's padding as well. */
.blog-tabs-wrap .container {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

/* Re-apply horizontal breathing room for the sticky tab heading and cards
   so they don't sit flush against the border lines. */
.blog-tabs-wrap .sticky-tab__content,
.blog-tabs-wrap .blog-cards {
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

/* Even vertical rhythm. The sticky header and each card link both carry 2em
   padding, which already yields a 4em gap between cards. Zero the content
   container's own vertical padding so the header-to-first-card and
   last-card-to-next-group gaps stay 4em too (not 6em). */
.blog-tabs-wrap .sticky-tab > .container {
  padding-top: 0;
  padding-bottom: 0;
}

.blog-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.blog-card {
  border-top: 1px solid #8898aa;
}

/* Only keep dividers between cards: drop the leading divider on the first. */
.blog-card:first-child {
  border-top: none;
}

.blog-card__link {
  display: block;
  padding: 2em 0;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
}

.blog-card__link:hover {
  opacity: 0.7;
}

.blog-card__title {
  font-size: 1.75em;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #0f1b2d;
  margin: 0.5em 0;
}

.blog-card__description {
  font-size: 0.9375em;
  color: #4a5568;
  line-height: 1.55;
  margin: 0 0 0.75em;
  max-width: 60ch;
}

/* Always-visible link affordance so cards read as tappable without hover. */
.blog-card__more {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin-top: 0.5em;
  color: #6961fe;
  font-size: 0.875em;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.blog-card__more svg {
  width: 1em;
  height: 1em;
  transition: transform 0.2s ease;
}

.blog-card__link:hover .blog-card__more svg {
  transform: translateX(0.25em);
}

.toc-hero {
  padding-top: calc(var(--nav-bar-height) + 5em);
  padding-bottom: 0;
  border-left: 1px solid #8898aa;
  border-right: 1px solid #8898aa;
  border-bottom: 1px solid #8898aa;
  background: linear-gradient(to top, #ffffff, #f4f4f4);
}

.toc-hero__tags {
  display: flex;
  gap: 1em;
  margin-bottom: .75em;
}

.toc-hero__tag {
  font-size: .6875em;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #0f1b2d;
}

.toc-hero__title {
  font-size: 3em;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.02em;
  color: #0f1b2d;
  margin-top: 0;
  margin-bottom: .5em;
}

.toc-hero__body {
  display: flex;
  flex-direction: column;
}

.toc-hero__description {
  font-size: 1em;
  line-height: 1.5;
  color: #4a5568;
  max-width: 60ch;
  margin: 0 0 1em;
}

.toc-hero__meta {
  display: flex;
  gap: 2em;
  font-size: .875em;
  color: #8898aa;
  margin-top: .25em;
}

/* Match the meta->title gap to the blog overview cards (hero meta was flush
   against the title). Scoped to the hero body so index heroes and overview
   cards are unaffected. */
.toc-hero__body .toc-hero__meta {
  margin-bottom: 1em;
}

.toc-hero__divider {
  margin-top: 1.75em;
  margin-bottom: 0;
}

.toc-hero__label {
  font-size: .6875em;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #8898aa;
}

.toc-layout {
  padding-top: 3em;
  padding-bottom: 6em;
  position: relative;
  border-left: 1px solid #8898aa;
  border-right: 1px solid #8898aa;
}

.toc-article {
}

.toc-article h2 {
  scroll-margin-top: 160px;
  letter-spacing: -.01em;
  margin-top: 2em;
  margin-bottom: .75em;
  font-size: 2em;
  font-weight: 500;
  line-height: 1.2;
}

.toc-article > h2:first-child {
  margin-top: 0;
}

.toc-article p {
  margin-bottom: 1.5em;
  font-size: .9375em;
  line-height: 1.5;
}

.toc-article h3 {
  scroll-margin-top: 160px;
  margin-top: 2em;
  margin-bottom: .75em;
  font-size: 1.25em;
  font-weight: 500;
}

@media screen and (min-width: 992px) {
  .toc-article h2,
  .toc-article h3 {
    scroll-margin-top: 210px;
  }
}

.toc-article blockquote {
  color: #30557a;
  border-left-width: 2px;
  border-left-color: #6961fe;
  font-size: 1.125em;
  font-weight: 400;
  line-height: 1.4;
}

.toc-article :not(pre) > code {
  background-color: #dae3ee;
  border-radius: .25em;
  padding: .1em .4em .15em;
  font-family: Haffer Mono, Arial, sans-serif;
  font-size: .9em;
  display: inline-block;
}

.toc-article ul {
  margin-bottom: 0;
  padding-left: 2em;
}

.toc-article li {
  margin-bottom: 1em;
  font-size: .9375em;
  line-height: 1.5;
}

/* Reset the global .line divider class that collides with Shiki's <span class="line"> */
.astro-code .line {
  background-color: transparent;
  height: auto;
  width: auto;
  position: static;
  z-index: auto;
}

/* Style markdown-rendered fenced code blocks to match the CodeBlock component */
.toc-article pre.astro-code {
  border-radius: 0.625em;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.25em 1.5em;
  overflow-x: auto;
  line-height: 1.65;
  margin: 1.5em 0;
}

.toc-article pre.astro-code code {
  background-color: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  font-size: 0.875em;
  display: block !important;
}

.toc-article table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 0.9375em;
  margin: 1.5em 0;
  display: block;
  overflow-x: auto;
}

.toc-article thead tr {
  background-color: #fff;
  border-bottom: 1px solid #e3e8ee;
}

.toc-article thead th {
  padding: 0.875em 1.25em;
  text-align: left;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-neutral-600, #4b5563);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toc-article tbody tr {
  border-bottom: 1px solid #e3e8ee;
}

.toc-article tbody tr:nth-of-type(even) {
  background: #f6f9fc;
}

.toc-article tbody td {
  padding: 0.875em 1.25em;
  vertical-align: middle;
  line-height: 1.4;
  color: var(--color-neutral-800, #1f2937);
  overflow-wrap: break-word;
}

.toc-article tbody td:first-child {
  font-weight: 500;
  color: var(--color-neutral-900, #111827);
}

.toc-sidebar {
  grid-column-gap: 1em;
  grid-row-gap: 1em;
  flex-flow: column;
  justify-content: flex-start;
  align-items: flex-start;
  display: flex;
  position: sticky;
  top: calc(var(--nav-bar-height) + 2em);
}

/* Align sticky sidebar with the desktop heading rest line (scroll-margin-top) */
@media screen and (min-width: 992px) {
  .toc-sidebar {
    top: 220px;
  }
}

.toc-list {
  flex-flow: column;
  justify-content: flex-start;
  align-items: flex-start;
  width: 100%;
  display: flex;
}

.toc-list__items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-flow: column;
  width: 100%;
}

.toc-list__items li {
  margin-bottom: 0;
}

.toc-list__items li a {
  display: block;
}

.toc-link {
  color: #8898aa;
  border-left: 1px solid #e3e8ee;
  padding: .4rem .5em .4rem 1em;
  font-size: .875em;
  text-decoration: none;
  transition: all .25s;
}

.toc-link[data-toc-status="active"] {
  color: #1a2b3c;
  border-left-color: #6961fe;
}

.toc-link[data-toc-depth="3"] {
  padding-left: 1.75em;
}

.comparison-wrap {
  width: 100%;
  position: relative;
  isolation: isolate;
  --columns-in-view: 4;
  overflow-x: auto;
  display: block;
  border-spacing: 0;
  border-collapse: collapse;
}

.comparison-header {
  z-index: 10;
  background-color: #fff;
  border-bottom: 1px solid #e3e8ee;
  display: flex;
  position: sticky;
  top: 0;
}

.comparison-wrap thead {
  display: block;
}

.comparison-body {
  display: block;
}

.comparison-header__corner {
  min-width: 0;
  max-width: calc(100% / (var(--columns-in-view) + 1));
  flex: 1;
}

.comparison-header__list {
  display: flex;
}

.comparison-header__col {
  grid-column-gap: .3em;
  grid-row-gap: .3em;
  text-align: center;
  min-width: 0;
  max-width: calc(100% / var(--columns-in-view));
  flex-flow: column;
  flex: 1;
  justify-content: center;
  align-items: center;
  padding-top: 1.5em;
  padding-bottom: 1.5em;
  display: flex;
}

.comparison-header__inner {
  flex: var(--columns-in-view);
  min-width: 0;
  max-width: calc(var(--columns-in-view) * 100% / (var(--columns-in-view) + 1));
}

.comparison-header__name {
  letter-spacing: -.03em;
  margin-bottom: 0;
  font-size: 1.5em;
  line-height: 1;
}

.comparison-header__meta {
  opacity: .6;
  margin-bottom: 0;
  font-size: .875em;
  font-weight: 500;
  line-height: 1;
}

.comparison-row {
  border-bottom: 1px solid #e3e8ee;
  display: flex;
  position: relative;
  overflow: hidden;
}

.comparison-row:nth-of-type(even) {
  background: #f6f9fc;
}

.comparison-row__tile {
  z-index: 0;
  background-color: var(--color-electric);
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateY(-100%);
  will-change: transform;
}

.comparison-row__name {
  max-width: calc(100% / (var(--columns-in-view) + 1));
  flex: 1;
  justify-content: flex-start;
  align-items: center;
  padding-left: 1.25em;
  padding-right: 1.25em;
  display: flex;
  position: relative;
  z-index: 1;
}

.comparison-row__cells {
  flex: var(--columns-in-view);
  max-width: calc(var(--columns-in-view) * 100% / (var(--columns-in-view) + 1));
  display: flex;
  position: relative;
  z-index: 1;
}

.comparison-row__h {
  margin-top: 0;
  margin-bottom: 0;
  font-size: 1em;
  font-weight: 400;
}

.comparison-row__pill {
  color: #635bff;
  background-color: #eef2ff;
  border-radius: 100em;
  margin-top: 0;
  margin-bottom: 0;
  padding: .5em .75em;
  font-size: .75em;
  line-height: 1;
  position: relative;
}

.comparison-row__cell {
  text-align: center;
  min-width: 0;
  max-width: calc(100% / var(--columns-in-view));
  flex-flow: column;
  flex: 1;
  justify-content: center;
  align-items: center;
  padding: 1.5em 1em;
  display: flex;
}

.comparison-row__label {
  opacity: .6;
  margin-bottom: 0;
  font-size: .9375em;
  line-height: 1;
}

.comparison-row__icon {
  aspect-ratio: 1;
  color: #635bff;
  width: 1.125em;
}

.comparison-row__cell[aria-label="not included"] .comparison-row__icon {
  color: #a3acb9;
}

@media screen and (max-width: 767px) {
  .comparison-header__corner {
    display: none;
  }

  .comparison-header__inner {
    max-width: none;
  }

  .comparison-header__name {
    font-size: 1.125em;
  }

  .comparison-row {
    flex-flow: column;
    justify-content: flex-start;
    align-items: stretch;
  }

  .comparison-row__name {
    max-width: none;
    padding-top: 1em;
    padding-bottom: 1em;
  }

  .comparison-row__cells {
    max-width: none;
  }

  .comparison-row__cell {
    padding-top: 1em;
    padding-bottom: 2em;
  }
}

@media screen and (max-width: 767px) {
  .toc-sidebar {
    display: none;
    position: relative;
    top: 0;
  }

  .toc-hero__title {
    font-size: 2.25em;
  }

  .toc-article h2 {
    font-size: 1.6em;
  }

  .toc-article h3 {
    font-size: 1.15em;
  }

  .blog-card__title {
    font-size: 1.5em;
  }
}

/* Keep docs under-nav pinned — don't slide it away on scroll */
body:has([data-scrolling-started="true"]) [data-blog-under-nav],
body:has([data-nav-status="active"]) [data-blog-under-nav] {
  transform: translateY(0em) scale(1) rotate(0.001deg);
}

/* --- Docs TOC Drawer --- */

.blog-toc-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 27, 45, 0.4);
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.blog-toc-backdrop[data-status="open"] {
  opacity: 1;
  visibility: visible;
}

.blog-toc-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 80vw;
  max-width: 300px;
  background: var(--color-neutral-200, #f4f4f4);
  border-right: 1px solid #8898aa;
  z-index: 301;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding: calc(var(--nav-bar-height) + 1.5em) 1.5em 2em;
  overflow-y: auto;
  gap: 1em;
}

.blog-toc-panel[data-status="open"] {
  transform: translateX(0);
}

.blog-toc-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.blog-toc-close {
  background: none;
  border: none;
  padding: 0.25em;
  cursor: pointer;
  color: #8898aa;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.blog-toc-close:hover {
  color: #0f1b2d;
}

.blog-toc-toggle-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
}

@media screen and (min-width: 768px) {
  [data-blog-toc-toggle],
  .blog-toc-backdrop,
  .blog-toc-panel {
    display: none;
  }
}
