/* ============================================================
   Case Studies — Listing & Detail Pages
   Namespace: .cs-page (listing), .cs-detail (detail)
   ============================================================ */

/* ---- Listing Page ---- */

.cs-page {
  padding: 120px 0 60px;
}

.cs-page__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header bar */
.cs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light, #E5E7EB);
  padding-bottom: 14px;
  margin-bottom: 32px;
}

.cs-header__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cs-header__count {
  font-size: 13px;
  color: var(--gray-600);
}

/* Industry Tabs */
.cs-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.cs-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border-light, #E5E7EB);
  border-radius: 20px;
  background: white;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.cs-tab:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.cs-tab--active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: white;
}

.cs-tab--active:hover {
  color: white;
}

.cs-tab__count {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.6;
}

/* Section labels */
.cs-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

/* ---- Featured Grid (3 dark hero cards) ---- */

.cs-featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.cs-featured-card {
  background: var(--brand-primary);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: white;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.cs-featured-card:hover {
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.cs-featured-card__top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.cs-featured-card__logo {
  background: white;
  border-radius: 6px;
  padding: 4px 12px;
  display: flex;
  align-items: center;
  max-height: 32px;
}

.cs-featured-card__logo img {
  max-height: 22px;
  max-width: 120px;
  width: auto;
  display: block;
}

.cs-featured-card__logo-text {
  font-size: 14px;
  font-weight: 800;
  color: var(--brand-primary);
  white-space: nowrap;
}

.cs-featured-card__industry {
  font-size: 11px;
  background: rgba(196, 236, 176, 0.2);
  color: var(--brand-secondary);
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

.cs-featured-card__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: white;
  margin-bottom: 10px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cs-featured-card__cta {
  font-size: 13px;
  color: var(--brand-secondary);
  font-weight: 600;
  margin-top: auto;
}

/* ---- Grid Cards (4-col) ---- */

.cs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.cs-card {
  background: white;
  border-radius: 10px;
  border: 1px solid var(--border-light, #E5E7EB);
  border-top: 3px solid var(--brand-secondary);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.cs-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.cs-card__body {
  padding: 18px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.cs-card__logo {
  height: 28px;
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.cs-card__logo img {
  max-height: 24px;
  max-width: 110px;
  width: auto;
  display: block;
}

.cs-card__logo-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cs-card__title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--gray-900, #1a1a1a);
  margin-bottom: 8px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cs-card__industry {
  font-size: 11px;
  background: var(--surface-gray, #F9FAFB);
  padding: 3px 8px;
  border-radius: 10px;
  color: var(--gray-600);
  display: inline-block;
  margin-bottom: 10px;
  max-width: fit-content;
}

.cs-card__cta {
  font-size: 12px;
  color: var(--brand-primary);
  font-weight: 600;
  margin-top: auto;
}

/* ---- Pagination ---- */

.cs-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 16px 0 0;
}

.cs-pagination a,
.cs-pagination span {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}

.cs-pagination a {
  background: var(--surface-gray, #F9FAFB);
  color: var(--brand-primary);
}

.cs-pagination a:hover {
  background: var(--border-light, #E5E7EB);
}

.cs-pagination .active {
  background: var(--brand-primary);
  color: white;
}

/* ---- Detail Page ---- */

.cs-detail {
  max-width: 800px;
  margin: 0 auto;
  padding: 130px 24px 60px;
}

.cs-detail__breadcrumb {
  margin-bottom: 12px;
}

.cs-detail__breadcrumb a {
  font-size: 14px;
  color: var(--gray-600);
  text-decoration: none;
  font-weight: 500;
}

.cs-detail__breadcrumb a:hover {
  color: var(--brand-primary);
}

/* Dark hero banner */
.cs-hero {
  background: var(--brand-primary);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 36px;
}

.cs-hero__top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.cs-hero__logo {
  background: white;
  border-radius: 6px;
  padding: 5px 14px;
  display: flex;
  align-items: center;
  max-height: 36px;
}

.cs-hero__logo img {
  max-height: 24px;
  max-width: 140px;
  width: auto;
  display: block;
}

.cs-hero__logo-text {
  font-size: 16px;
  font-weight: 800;
  color: var(--brand-primary);
  white-space: nowrap;
}

.cs-hero__industry {
  font-size: 12px;
  background: rgba(196, 236, 176, 0.2);
  color: var(--brand-secondary);
  padding: 3px 12px;
  border-radius: 12px;
}

.cs-hero__title {
  font-size: clamp(22px, 3.5vw, 34px);
  font-weight: 700;
  color: white;
  line-height: 1.3;
  margin-bottom: 10px;
}

.cs-hero__meta {
  font-size: 14px;
  color: var(--gray-600);
}

/* Content area reuses ghost-post__content styles */
.cs-detail__content {
  font-size: 17px;
  line-height: 1.8;
  color: var(--gray-800, #2d3748);
}

.cs-detail__content h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 32px 0 14px;
  color: var(--gray-900, #1a1a1a);
  text-transform: none;
  letter-spacing: normal;
  -webkit-text-fill-color: var(--gray-900, #1a1a1a);
  background: none;
}

.cs-detail__content h2 {
  font-size: 26px;
  font-weight: 700;
  margin: 44px 0 14px;
  color: var(--gray-900, #1a1a1a);
}

.cs-detail__content h3 {
  font-size: 21px;
  font-weight: 600;
  margin: 32px 0 10px;
  color: var(--gray-900, #1a1a1a);
}

.cs-detail__content p {
  margin: 0 0 22px;
}

.cs-detail__content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 20px 0;
}

.cs-detail__content blockquote {
  border-left: 4px solid var(--brand-primary);
  padding: 14px 20px;
  margin: 24px 0;
  background: var(--surface-gray, #F9FAFB);
  border-radius: 0 8px 8px 0;
}

.cs-detail__content a {
  color: var(--brand-primary);
  text-decoration: underline;
}

.cs-detail__content ul,
.cs-detail__content ol {
  padding-left: 24px;
  margin: 0 0 22px;
}

.cs-detail__content li {
  margin-bottom: 8px;
}

/* Back link */
.cs-detail__footer {
  border-top: 1px solid var(--border-light, #E5E7EB);
  padding-top: 20px;
  margin-top: 48px;
}

.cs-detail__footer a {
  font-size: 14px;
  color: var(--brand-primary);
  font-weight: 600;
  text-decoration: none;
}

.cs-detail__footer a:hover {
  text-decoration: underline;
}

/* ---- Industry Hero ---- */

.cs-industry-hero {
  background: var(--brand-primary);
  border-radius: 12px;
  padding: 40px 36px;
  margin-bottom: 36px;
}

.cs-industry-hero__badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  background: rgba(196, 236, 176, 0.2);
  color: var(--brand-secondary);
  padding: 4px 14px;
  border-radius: 14px;
  margin-bottom: 16px;
}

.cs-industry-hero__headline {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 800;
  color: white;
  line-height: 1.25;
  margin: 0 0 14px;
}

.cs-industry-hero__desc {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
  margin: 0 0 20px;
  max-width: 720px;
}

.cs-industry-hero__highlights {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cs-industry-hero__highlights li {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-secondary);
  background: rgba(196, 236, 176, 0.1);
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(196, 236, 176, 0.2);
}

.cs-industry-hero__count {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
}

/* ---- Industry CTA ---- */

.cs-industry-cta {
  text-align: center;
  padding: 48px 24px;
  margin-top: 40px;
  border-top: 1px solid var(--border-light, #E5E7EB);
}

.cs-industry-cta h2 {
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 800;
  color: var(--brand-primary);
  margin: 0 0 10px;
}

.cs-industry-cta p {
  font-size: 15px;
  color: var(--gray-600);
  margin: 0 0 20px;
}

/* ---- Responsive ---- */

@media (max-width: 1199px) {
  .cs-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 899px) {
  .cs-featured-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .cs-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .cs-hero {
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .cs-grid {
    grid-template-columns: 1fr;
  }

  .cs-page__inner {
    padding: 0 16px;
  }

  .cs-detail {
    padding: 110px 16px 40px;
  }

  .cs-hero {
    padding: 20px;
    border-radius: 8px;
  }

  .cs-hero__title {
    font-size: 20px;
  }
}
