.case-study-page {
  background: #f8fafc;
  color: #0f172a;
}

.case-study-hero {
  position: relative;
  min-height: auto;
  overflow: hidden;
  color: #0f172a;
  padding: clamp(2rem, 5vw, 4rem) 0 2.5rem;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, .08), rgba(245, 158, 11, .1)),
    #f8fafc;
}

.case-study-detail-hero {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  color: #fff;
}

.case-study-detail-hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.case-study-detail-hero > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.case-study-detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(15, 23, 42, .92), rgba(15, 23, 42, .58), rgba(15, 23, 42, .2));
}

.case-study-detail-overlay {
  position: relative;
  z-index: 1;
}

.case-study-hero .container {
  min-height: 0;
}

.case-study-hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 440px);
  gap: clamp(1.25rem, 4vw, 2.5rem);
  align-items: center;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: clamp(1rem, 3vw, 2rem);
  box-shadow: 0 20px 45px rgba(15, 23, 42, .08);
}

.case-study-hero-media {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 4 / 3;
  background: #e2e8f0;
  border: 1px solid #e5e7eb;
}

.case-study-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.case-study-detail-overlay .container {
  max-width: 850px;
}

.case-study-hero-content > span,
.case-study-label {
  display: inline-flex;
  color: #0f766e;
  background: #ccfbf1;
  border-radius: 999px;
  padding: .38rem .75rem;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.case-study-label.light {
  color: #fff;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .22);
}

.case-study-hero h1,
.case-study-detail-hero h1 {
  margin: 1rem 0;
  font-size: clamp(2.25rem, 6vw, 4.75rem);
  line-height: 1;
  font-weight: 900;
}

.case-study-hero p,
.case-study-detail-hero p {
  max-width: 760px;
  color: #475569;
  font-size: 1.12rem;
  line-height: 1.75;
}

.case-study-detail-hero p {
  color: rgba(255, 255, 255, .84);
}

.case-study-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  margin-top: 1.5rem;
}

.case-study-primary-btn,
.case-study-secondary-btn,
.case-study-filter button,
.case-study-download a,
.case-study-sidebar-cta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: .75rem 1rem;
  font-weight: 800;
  text-decoration: none;
}

.case-study-primary-btn,
.case-study-filter button,
.case-study-download a,
.case-study-sidebar-cta a:first-of-type {
  background: #f59e0b;
  color: #111827;
  border: 1px solid #f59e0b;
}

.case-study-secondary-btn,
.case-study-sidebar-cta a:last-of-type {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .5);
}

.case-study-section {
  padding: 4rem 0;
}

.case-study-filter {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(180px, .8fr) minmax(180px, .8fr) auto;
  gap: .75rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 2rem;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .06);
}

.case-study-filter input,
.case-study-filter select {
  width: 100%;
  border: 1px solid #dbe3ea;
  border-radius: 6px;
  padding: .75rem .85rem;
  color: #0f172a;
  background: #fff;
}

.case-study-featured {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .9fr);
  gap: 1.5rem;
  align-items: stretch;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .08);
  margin-bottom: 2.5rem;
}

.case-study-featured-image img,
.case-study-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.case-study-featured-image {
  min-height: 360px;
}

.case-study-featured-body {
  padding: 2rem;
}

.case-study-featured h2,
.case-study-results-head h2,
.case-study-card h3,
.case-study-summary-grid h2,
.case-study-gallery-section h2,
.case-study-download h2,
.case-study-sidebar h2 {
  font-weight: 900;
}

.case-study-featured h2 a,
.case-study-card h3 a {
  color: #0f172a;
  text-decoration: none;
}

.case-study-featured p,
.case-study-card p,
.case-study-summary-grid p,
.case-study-download p,
.case-study-sidebar p {
  color: #64748b;
  line-height: 1.65;
}

.case-study-meta,
.case-study-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1rem 0;
}

.case-study-meta span,
.case-study-detail-meta span {
  background: #f1f5f9;
  border-radius: 999px;
  color: #334155;
  padding: .35rem .65rem;
  font-size: .86rem;
  font-weight: 700;
}

.case-study-detail-meta span {
  background: rgba(255, 255, 255, .16);
  color: #fff;
}

.case-study-results-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.case-study-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: stretch;
}

.case-study-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(15, 23, 42, .08);
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}

.case-study-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 40px rgba(15, 23, 42, .12);
  border-color: transparent;
}

.case-study-card-image {
  display: block;
  height: 220px;
  flex: 0 0 220px;
  padding: 0;
  background: #f1f5f9;
  border-bottom: 1px solid #e5e7eb;
  overflow: hidden;
}

.case-study-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transition: transform .4s ease;
}

.case-study-card:hover .case-study-card-image img {
  transform: scale(1.06);
}

.case-study-card-body {
  padding: 25px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.case-study-card h3 {
  min-height: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: .85rem 0 .75rem;
}

.case-study-card p {
  min-height: 0;
  flex-grow: 1;
  margin-bottom: 1rem;
}

.case-study-card .case-study-link {
  margin-top: auto;
}

.case-study-link {
  display: inline-flex;
  margin-top: .75rem;
  color: #0f766e;
  font-weight: 900;
  text-decoration: none;
}

.case-study-empty {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
}

.case-study-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

.case-study-pagination a,
.case-study-pagination span {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: .6rem .9rem;
  color: #0f172a;
  text-decoration: none;
}

.case-study-detail-overlay {
  min-height: 320px;
  display: flex;
  align-items: end;
  padding: 4rem 0 2.25rem;
}

.case-study-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, .75);
}

.case-study-breadcrumb a {
  color: #fff;
  text-decoration: none;
}

.case-study-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.5rem;
  align-items: start;
}

.case-study-article,
.case-study-sidebar section,
.case-study-download {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .05);
}

.case-study-article {
  padding: 1.5rem;
}

.case-study-summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.case-study-summary-grid section {
  border: 1px solid #e5e7eb;
  border-top: 4px solid #0f766e;
  border-radius: 8px;
  padding: 1.15rem;
  background: #f8fafc;
  min-width: 0;
}

.case-study-summary-grid h2 {
  font-size: 1.05rem;
  margin-bottom: .55rem;
}

.case-study-summary-rich {
  color: #334155;
  line-height: 1.65;
}

.case-study-summary-rich > :last-child {
  margin-bottom: 0;
}

.case-study-summary-rich h2,
.case-study-summary-rich h3,
.case-study-summary-rich h4 {
  color: #0f172a;
  font-size: 1rem;
  font-weight: 800;
  margin: 1rem 0 .5rem;
}

.case-study-summary-rich img {
  display: block;
  width: min(100%, 360px);
  height: auto;
  border-radius: 8px;
  margin: 1rem auto;
}

.case-study-summary-rich figure {
  margin: 1rem 0;
}

.case-study-summary-rich ul,
.case-study-summary-rich ol {
  padding-left: 1.2rem;
}

.case-study-content {
  color: #334155;
  line-height: 1.78;
  font-size: 1.03rem;
}

.case-study-content h2,
.case-study-content h3,
.case-study-content h4 {
  color: #0f172a;
  font-weight: 900;
  margin-top: 2rem;
}

.case-study-content img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem auto;
}

.case-study-content table {
  width: 100%;
  overflow-x: auto;
}

.case-study-gallery-section {
  margin-top: 2.5rem;
}

.case-study-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.case-study-gallery figure {
  margin: 0;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.case-study-gallery img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.case-study-gallery figcaption {
  padding: .75rem;
  color: #475569;
  font-size: .92rem;
}

.case-study-download {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
  margin-top: 2rem;
}

.case-study-sidebar {
  display: grid;
  gap: 1rem;
  position: sticky;
  top: 90px;
}

.case-study-sidebar section {
  padding: 1.1rem;
}

.case-study-sidebar dl {
  margin: 0;
}

.case-study-sidebar dt {
  color: #64748b;
  font-size: .83rem;
  font-weight: 800;
  text-transform: uppercase;
}

.case-study-sidebar dd {
  margin: 0 0 .9rem;
  color: #0f172a;
  font-weight: 800;
}

.case-study-sidebar-cta {
  background: #0f172a !important;
  color: #fff;
}

.case-study-sidebar-cta p {
  color: rgba(255, 255, 255, .78);
}

.case-study-sidebar-cta a {
  width: 100%;
  margin-top: .6rem;
}

.case-study-related {
  margin-top: 3rem;
}

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

  .case-study-hero-media {
    max-width: 520px;
    width: 100%;
    margin: 0 auto;
  }

  .case-study-featured,
  .case-study-detail-layout {
    grid-template-columns: 1fr;
  }

  .case-study-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .case-study-sidebar {
    position: static;
  }

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

@media (max-width: 575.98px) {
  .case-study-hero,
  .case-study-detail-hero,
  .case-study-hero .container,
  .case-study-detail-overlay {
    min-height: auto;
  }

  .case-study-detail-overlay {
    padding-top: 5rem;
    padding-bottom: 3rem;
  }

  .case-study-hero {
    padding: 1.25rem 0 1.75rem;
  }

  .case-study-hero-panel {
    padding: 1rem;
  }

  .case-study-section {
    padding: 2.75rem 0;
  }

  .case-study-filter,
  .case-study-results-head,
  .case-study-download {
    grid-template-columns: 1fr;
    display: grid;
  }

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

  .case-study-featured-body,
  .case-study-article {
    padding: 1rem;
  }

  .case-study-gallery img {
    height: 135px;
  }

  .case-study-card-image {
    height: 200px;
    flex-basis: 200px;
    padding: 0;
  }

  .case-study-card h3,
  .case-study-card p {
    min-height: 0;
  }
}
