/* Case study detail pages — extend blog layout */

.case-study-page .blog-hero__content {
  margin-bottom: 36px;
}

.case-study-page .blog-sidebar__panel--sticky {
  max-height: none;
  overflow: visible;
}

.case-study-page .blog-sidebar__panel--sticky > .blog-toc-block {
  flex: 0 0 auto;
}

.case-study-page .blog-toc--scroll {
  flex: 0 0 auto;
  max-height: none;
  overflow: visible;
  margin-right: 0;
  padding-right: 0;
  scrollbar-gutter: auto;
}

.case-study-page .blog-toc--scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.case-study-meta {
  display: grid;
  gap: 0;
  margin: 0 0 28px;
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(18, 99, 251, 0.18);
  background: #fbfdff;
  box-shadow: 0 1px 0 rgba(18, 99, 251, 0.04);
}

.case-study-meta__row {
  display: grid;
  grid-template-columns: minmax(140px, 200px) minmax(0, 1fr);
  align-items: stretch;
  border-bottom: 1px solid rgba(18, 99, 251, 0.12);
}

.case-study-meta__row:last-child {
  border-bottom: 0;
}

.case-study-meta__row span,
.case-study-meta__row strong {
  padding: 14px 16px;
}

.case-study-meta__row span {
  display: flex;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: linear-gradient(180deg, #f3f7fc, #eef4fb);
  border-right: 1px solid rgba(18, 99, 251, 0.12);
}

.case-study-meta__row strong {
  display: flex;
  align-items: center;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.45;
  background: #fff;
}

.case-study-meta__row:hover strong {
  background: rgba(18, 99, 251, 0.03);
}

.case-study-callout {
  margin: 8px 0 0;
}

.case-study-callout p {
  margin: 0;
  color: #2f3b4a;
  font-weight: 500;
  line-height: 1.7;
}

/* Section h2s are first-child inside <section>, so blog :first-child reset
   removes their top spacing — restore it for case study pages. */
.case-study-page .blog-content__surface > section > .blog-content__h2 {
  margin-top: 52px;
  padding-top: 18px;
  border-top: 1px solid rgba(18, 99, 251, 0.08);
}

.case-study-page .blog-content__surface > section > .blog-content__h2::before {
  top: 22px;
}

.case-study-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 8px 0 24px;
}

.case-study-stats__item {
  padding: 18px 18px 16px;
  border-radius: 16px;
  border: 1px solid rgba(18, 99, 251, 0.1);
  background: #fff;
}

.case-study-stats__item strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-head);
  font-size: 1.35rem;
  color: var(--blue);
}

.case-study-stats__item span {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.case-study-numbered {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 18px;
}

.case-study-numbered > li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.case-study-numbered__index {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--grad-brand);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
}

.case-study-numbered .blog-content__h3 {
  margin-top: 0;
}

.case-study-table-wrap {
  margin: 8px 0 28px;
  overflow-x: auto;
  border: 1px solid rgba(18, 99, 251, 0.1);
  border-radius: 18px;
  background: #fbfdff;
}

.case-study-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.case-study-table th,
.case-study-table td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(18, 99, 251, 0.08);
}

.case-study-table th {
  background: linear-gradient(180deg, #f3f7fc, #eef4fb);
  font-family: var(--font-head);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.case-study-table tbody tr:last-child td {
  border-bottom: 0;
}

.case-study-table tbody tr:hover td {
  background: rgba(18, 99, 251, 0.03);
}

.case-study-cta {
  margin-top: 20px;
  padding-top: 8px;
}

.case-study-cta .blog-content__cta-btn {
  margin-top: 4px;
}

@media (max-width: 700px) {
  .case-study-meta__row {
    grid-template-columns: 1fr;
  }

  .case-study-meta__row span {
    border-right: 0;
    border-bottom: 1px solid rgba(18, 99, 251, 0.1);
    padding-bottom: 10px;
  }

  .case-study-meta__row strong {
    padding-top: 10px;
  }

  .case-study-stats {
    grid-template-columns: 1fr;
  }

  .case-study-table {
    min-width: 0;
  }

  .case-study-table thead {
    display: none;
  }

  .case-study-table,
  .case-study-table tbody,
  .case-study-table tr,
  .case-study-table td {
    display: block;
    width: 100%;
  }

  .case-study-table tr {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(18, 99, 251, 0.08);
  }

  .case-study-table tr:last-child {
    border-bottom: 0;
  }

  .case-study-table td {
    padding: 6px 0;
    border-bottom: 0;
  }

  .case-study-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font-family: var(--font-head);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
  }
}
