/*--------------------------------------------------------------
# Case Study Section Block
--------------------------------------------------------------*/

.case-studies-section {
  --css-link: #00e5ff;

  width: 100%;
  background-color: var(--color-ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  color: var(--color-text-inverse);
}

.case-studies-section::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 1400px;
  height: 100%;
  background: radial-gradient(circle, rgba(253, 167, 31, 0.02) 0%, rgba(0, 18, 25, 0) 70%);
  pointer-events: none;
  z-index: 1;
}

.case-studies-container {
  width: 100%;
  max-width: 1300px;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
}

/* Grid Layout */
.case-study-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: stretch;
  column-gap: 20px;
  row-gap: 50px;
  width: 100%;
}

@media (max-width: 767px) {
  .case-study-grid {
    grid-template-columns: 1fr;
    row-gap: var(--space-12);
    max-width: 640px;
    margin: 0 auto;
  }
}

/* Individual Card — equal height in a row so CTAs stay on one line */
.case-study-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  width: 100%;
  height: 100%;
  min-width: 0;
}

.card-image-wrap {
  width: 100%;
  height: 240px;
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

@media (min-width: 768px) {
  .card-image-wrap {
    height: 335px;
  }
}

.card-image-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 24px;
  border: 1px solid transparent;
  pointer-events: none;
  transition: border-color 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 10;
}



.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Category Pill Badge */
.card-tag,
.card-tag:is(h1, h2, h3, h4, h5, p) {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  margin: 0;
  background-color: var(--color-accent);
  color: #001219;
  font-family: var(--font-body);
  font-size: var(--fs-16);
  font-weight: var(--fw-semibold);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-transform: none;
  padding: 8px 16px;
  border-radius: 100px;
  border: 1px solid var(--color-white);
  z-index: 8;
}

/* Stats Overlay */
.card-stats-overlay {
  position: absolute;
  bottom: var(--space-4);
  left: var(--space-4);
  right: var(--space-4);
  height: 74px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid transparent;
  border-radius: 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  padding: 0 var(--space-3);
  z-index: 8;
  transition: border-color 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.case-study-card:hover .card-stats-overlay {
  border-color: rgba(253, 167, 31, 0.5);
}

.stat-item {
  flex: 1;
  min-width: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-number {
  color: #e9e9e9;
  font-family: var(--font-heading);
  font-weight: var(--fw-regular);
  line-height: 30px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-label {
  color: #e9e9e9;
  font-family: var(--font-body);
  font-size: var(--fs-14);
  font-weight: var(--fw-regular);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background-color: rgba(253, 167, 31, 0.24);
}

/* Tablet: tighter stats so labels stay on one line in 2-col layout */
@media (min-width: 768px) and (max-width: 1024px) {
  .card-stats-overlay {
    height: 64px;
    padding: 0 var(--space-2);
  }

  .stat-number {
    font-size: 16px;
    line-height: 1.2;
  }

  .stat-label {
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
  }

  .stat-divider {
    height: 28px;
  }
}

/* Typography below image — sizes preserve design; families from globals */
.case-studies-section .card-title,
.case-studies-section .card-title.h4 {
  color: var(--color-white);
  font-family: var(--font-heading);
  text-transform: none;
  margin-top: 24px;
  margin-bottom: var(--space-4);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: break-word;
}

.card-desc {
  color: #E9E9E9;
  font-family: var(--font-body);
  font-size: var(--fs-16);
  margin-bottom: var(--space-6);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: break-word;
  min-height: calc(2 * var(--lh-body));
}

.card-link {
  color: #00B8CC;
  font-family: var(--font-body);
  font-size: var(--fs-16);
  font-weight: var(--fw-semibold);
  text-decoration: none;
  display: inline-block;
  margin-top: auto;
  margin-bottom: var(--space-6);
  transition: color 0.3s ease;
  letter-spacing: -0.01em;
}

.case-study-card:hover .card-link {
  color: var(--color-accent);
}

.card-divider {
  height: 1px;
  background-color: #FDA71F42;
  width: 100%;
  transition: background-color 0.3s ease;
}

.case-study-card:hover .card-divider {
  background-color: var(--color-accent);
}

/* Load More — global forward CTA */
.case-studies-section .cta-container {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

/* display:flex above would otherwise override the HTML hidden attribute */
.case-studies-section .cta-container[hidden],
.case-studies-section .cta-container.is-hidden {
  display: none !important;
}

.case-studies-section .load-more-btn:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

/* Bottom Gradient Divider */
.case-studies-section .section-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(0, 18, 25, 0) 0%,
    rgba(255, 255, 255, 0.27) 50%,
    rgba(0, 18, 25, 0) 100%
  );
  margin-top: 120px;
}

@media (max-width: 767px) {

  .case-studies-section .section-divider {
    margin-top: 80px;
  }
}

@media (max-width: 576px) {
  .stat-label {
    line-height: 12px;
  }
}
