/* ==========================================================================
   Block: case-studies — scoped under .cs-listing
   Real theme variables only: --primary, --secondary, --white, --text-color,
   --poppins, --nutralight, --nutrabold (see class-theme.php get_root_variables).
   Typography sizes/colors come from per-block CSS vars emitted by the render
   template (--atg-csl-*), each with a sensible fallback so unset = inherit.
   Pill pastels are hardcoded hex (no theme variable exists for them).
   ========================================================================== */

.cs-listing {
  padding: 80px 0;
}

/* ── Section heading ─────────────────────────────────────────────────── */
.cs-listing__head {
  text-align: left;
  margin: 0 0 48px;
}

.cs-listing .cs-eyebrow {
  display: inline-block;
  font-family: var(--poppins);
  font-size: var(--atg-csl-eyebrow-size, 14px);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--atg-csl-eyebrow-color, var(--primary));
  margin-bottom: 12px;
}

.cs-listing__heading {
  font-family: var(--nutrabold);
  font-size: var(--atg-csl-heading-size, 36px);
  line-height: 1.2;
  color: var(--atg-csl-heading-color, var(--text-color));
  margin: 0;
}

/* Accent underline between the heading and the count line (left-aligned). */
.cs-listing__heading::after {
  content: "";
  display: block;
  width: 52px;
  height: 3px;
  margin: 16px 0 0;
  background: var(--primary);
  border-radius: 2px;
}

.cs-listing__count {
  font-family: var(--poppins);
  font-size: 15px;
  color: #6b7280;
  margin: 12px 0 0;
}

.cs-listing__empty {
  text-align: center;
  font-family: var(--nutralight);
  color: #6b7280;
  padding: 40px 0;
  margin: 0;
}

/* ── Featured card (text left, quotes right) ─────────────────────────── */
.cs-featured {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 40px;
  align-items: center;
  background: var(--primary);
  color: var(--white);
  border-radius: 20px;
  padding: 48px;
  margin-bottom: 48px;
}

.cs-featured__title {
  font-family: var(--nutrabold);
  font-size: 30px;
  line-height: 1.25;
  margin: 0 0 16px;
}

.cs-featured__title a {
  color: var(--white);
  text-decoration: none;
}

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

.cs-featured__excerpt {
  font-family: var(--nutralight);
  font-size: var(--atg-csl-body-size, 16px);
  line-height: 1.7;
  color: var(--white);
  opacity: 0.92;
  margin: 0 0 24px;
}

.cs-featured__link {
  display: inline-block;
  font-family: var(--poppins);
  font-weight: 600;
  color: var(--white);
  text-decoration: none;
  border-bottom: 2px solid rgba(255, 255, 255, 0.6);
  padding-bottom: 2px;
  transition: border-color 0.2s ease;
}

.cs-featured__link:hover {
  border-color: var(--white);
}

.cs-featured__quotes {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cs-quote {
  background: rgba(255, 255, 255, 0.12);
  border-left: 3px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  padding: 20px 22px;
  margin: 0;
  font-family: var(--nutralight);
  font-style: italic;
  line-height: 1.6;
  color: var(--white);
}

/* ── Grid of remaining cards ─────────────────────────────────────────── */
.cs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.cs-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid #e6eef3;
  border-radius: 16px;
  padding: 28px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

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

/* Highlighted entries — mint tint (theme --secondary is a mint tint) */
.cs-card.is-highlight {
  background: var(--secondary);
  border-color: transparent;
}

.cs-card__title {
  font-family: var(--nutrabold);
  font-size: var(--atg-csl-card-title-size, 22px);
  line-height: 1.3;
  margin: 0 0 12px;
}

.cs-card__title a {
  color: var(--atg-csl-card-title-color, var(--text-color));
  text-decoration: none;
}

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

.cs-card__excerpt {
  flex: 1 1 auto;
  font-family: var(--nutralight);
  font-size: var(--atg-csl-body-size, 16px);
  line-height: 1.65;
  color: var(--atg-csl-body-color, var(--text-color));
  margin: 0 0 20px;
}

.cs-card__link {
  margin-top: auto;
  font-family: var(--poppins);
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.cs-card__link:hover {
  text-decoration: underline;
}

/* ── Practice-area pills (color keyed by term slug) ──────────────────── */
.cs-pill {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--poppins);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
  background: #eef2f7;
  color: #334155;
}

.cs-pill.pill--negotiation   { background: #e3f2fd; color: #1565c0; }
.cs-pill.pill--leadership    { background: #f3e5f5; color: #6a1b9a; }
.cs-pill.pill--training      { background: #fff3e0; color: #e65100; }
.cs-pill.pill--peace-building{ background: #e8f5e9; color: #2e7d32; }
.cs-pill.pill--mediation     { background: #fce4ec; color: #ad1457; }

/* Featured pill overrides the slug colour so it stays legible on teal.
   Declared last so it wins the source-order tie. */
.cs-pill.cs-pill--featured {
  background: rgba(255, 255, 255, 0.18);
  color: var(--white);
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .cs-listing {
    padding: 56px 0;
  }
  .cs-featured {
    grid-template-columns: 1fr; /* quotes stack below text */
    padding: 36px;
    gap: 28px;
  }
  .cs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .cs-listing {
    padding: 44px 0;
  }
  .cs-featured {
    padding: 28px;
    border-radius: 16px;
  }
  .cs-featured__title {
    font-size: 24px;
  }
  .cs-grid {
    grid-template-columns: 1fr;
  }
}
