/* Phones: a grid of full-image case-study cards built by assets/js/case-cards.js.
   Two per row; an odd last card runs full width. Hidden above 720px, where the desktop
   showcase (detail panel + slats) is unchanged. */

.case-cards { display: none; }

@media (max-width: 720px) {
  .has-case-cards .showcase__stage,
  .has-case-cards .showcase__nav { display: none; }

  .case-cards { display: block; margin-top: 8px; }
  .case-cards__track { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }

  /* Full-image card: the picture fills the card, the copy sits on a dark fade at the bottom. */
  .case-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 18px;
    background: #1a2030;
    box-shadow: 0 18px 32px -24px rgb(20 20 22 / 45%);
    isolation: isolate;
  }
  .case-card--wide { grid-column: 1 / -1; aspect-ratio: 16 / 11; }

  .case-card__media { position: absolute; inset: 0; z-index: -1; }
  .case-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
  .case-card__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgb(10 14 24 / 0%) 28%, rgb(10 14 24 / 80%) 58%, rgb(10 14 24 / 97%) 100%);
  }
  .case-card__chip {
    position: absolute;
    top: 12px;
    left: 12px;
    display: none;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgb(255 255 255 / 92%);
    color: var(--ink);
    font-size: 11px;
    font-weight: 600;
  }
  .case-card--wide .case-card__chip { display: block; }

  .case-card__body { display: flex; flex-direction: column; gap: 4px; padding: 14px 12px 12px; color: var(--white); }
  .case-card__client { margin: 0; font-size: 10px; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase; color: var(--gold); }
  .case-card__title {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -.2px;
    color: var(--white);
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
  }
  .case-card__result { display: none; margin: 0; font-size: 13px; line-height: 1.5; color: rgb(255 255 255 / 80%); }
  .case-card__tags { display: none; }

  .case-card__cta {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    color: var(--white);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
  }
  .case-card__cta span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--gold); color: var(--ink); font-size: 12px; }
  .case-card__cta:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
  /* The whole card opens the case study, not just the link. */
  .case-card__cta::before { content: ""; position: absolute; inset: 0; }

  /* The wide last card has room for the result line and a larger title. */
  .case-card--wide .case-card__body { gap: 6px; padding: 18px 16px 16px; }
  .case-card--wide .case-card__title { font-size: 18px; -webkit-line-clamp: 2; }
  .case-card--wide .case-card__result { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}

/* Narrowest phones: a little smaller so "View case study" stays on one line in a half-width card. */
@media (max-width: 380px) {
  .case-card__cta { gap: 5px; font-size: 11.5px; }
  .case-card__cta span { width: 20px; height: 20px; }
}
