/*
 * ProSocial Agency - Case study cards
 * 18-work.css
 * Deferred tier. Homepage index, case study archive, related lists.
 *
 * Ported from the LGC case study cards. Bordered card, 16:10 media,
 * lift and shadow on hover, image scaling inside its own overflow.
 *
 * Three things move together on hover and they are what make the card
 * feel responsive rather than static: the card lifts 3px and takes a
 * shadow, the image scales 4 percent inside the fixed media box, and
 * the read link turns orange and pushes its arrow.
 *
 * The headline figure sits above the read link with a hairline over
 * it, since it is the number a prospect is actually scanning for.
 */

.cs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-6);
}

.cs-card {
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition:
    box-shadow   var(--duration-base) var(--ease-out),
    transform    var(--duration-base) var(--ease-out),
    border-color var(--duration-base) var(--ease-out);
}

.cs-card:hover,
.cs-card:focus-within {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--color-border-action);
}

.cs-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
}

.cs-card__link:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

/* ── Media ── */

.cs-card__media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--color-bg-alt);
  line-height: 0;
}

.cs-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--duration-slow) var(--ease-out);
}

.cs-card:hover .cs-card__img { transform: scale(1.04); }

/* Shown when no image is set. Structured rather than flat so a card
   without artwork still reads as deliberate. */
.cs-card__placeholder {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 25% 20%, rgba(196, 92, 38, 0.16) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 78%, rgba(201, 150, 62, 0.14) 0%, transparent 50%),
    linear-gradient(135deg, var(--color-band-deep) 0%, var(--color-band) 50%, #2E4670 100%);
}

/* ── Body ── */

.cs-card__body {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex-grow: 1;
}

.cs-card__title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text-primary);
  margin: 0;
}

.cs-card__meta {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.cs-card__meta-row { display: flex; gap: var(--space-2); }

.cs-card__meta-row dt {
  margin: 0;
  min-width: 64px;
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
}

.cs-card__meta-row dd { margin: 0; }

.cs-card__figure {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-display);
  color: var(--color-action);
  font-variant-numeric: lining-nums tabular-nums;
  margin-top: var(--space-1);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border);
}

.cs-card__more {
  margin-top: auto;
  padding-top: var(--space-3);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-heading);
  font-size: var(--nav-link-size);
  font-weight: var(--weight-medium);
  color: var(--color-text-primary);
  transition: color var(--duration-fast) var(--ease-out);
}

.cs-card__more::after {
  content: '\2192';
  transition: transform var(--duration-base) var(--ease-out);
}

.cs-card:hover .cs-card__more { color: var(--color-action); }
.cs-card:hover .cs-card__more::after { transform: translateX(4px); }

/* ── Case study gallery, used on the single template ── */

.cs-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6);
}

.cs-gallery__item {
  margin: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg-alt);
}

.cs-gallery__item img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 767px) {
  .cs-grid { grid-template-columns: 1fr; }
  .cs-gallery { grid-template-columns: 1fr; gap: var(--space-4); }
}

@media (prefers-reduced-motion: reduce) {
  .cs-card,
  .cs-card__img,
  .cs-card__more,
  .cs-card__more::after { transition: none; }

  .cs-card:hover { transform: none; }
  .cs-card:hover .cs-card__img { transform: none; }
}

/* -------------------------------------------------
   HUB GRID COLUMNS
   -------------------------------------------------
   The default auto-fill gives four narrow cards at 1440px. The hub lets
   an editor choose, because three reads as a considered set and four
   suits a longer list. Both collapse the same way below.
   ------------------------------------------------- */

.cs-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cs-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1100px) {
  .cs-grid--3,
  .cs-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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

/* A case study without a featured image falls back to a block. Putting
   its headline figure in there makes the placeholder carry the one
   piece of information a browsing reader is scanning for. */
.cs-card__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cs-card__placeholder-figure {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  line-height: 1.1;
  text-align: center;
  padding: var(--space-5);
  color: var(--color-text-inverse);
}

.hub-intro { margin-bottom: var(--space-8); }

.hub-intro h2 { margin: 0 0 var(--space-3); }

.hub-intro p {
  margin: 0;
  color: var(--color-text-body);
}