/* ════════════════════════════════════════
   CASE STUDY — locked abyss surface, V5 nav clearance,
   redesigned pagination pills.
   Used by /client-stories-* pages.
════════════════════════════════════════ */

/* ── Body lock to abyss ──────────────────────────── */
body.case-dark,
body.case-dark .body-wrapper,
body.case-dark main {
  background: var(--jxm-abyss) !important;
  color: var(--jxm-tusk) !important;
}

/* V5 nav clearance — fixed nav is ~7.5rem tall */
body.case-dark .work-details-area-inner.section-spacing,
body.case-dark .work-details-area-inner {
  padding-top: 11rem;
}
@media (max-width: 1023px) {
  body.case-dark .work-details-area-inner.section-spacing,
  body.case-dark .work-details-area-inner { padding-top: 7rem; }
}

/* ── Pagination pills — V5 redesign ──────────────────────────── */
/* Replaces the legacy .pagination layout. Two large rounded panels
   with a stacked label + title and a translating arrow on hover. */
.case-pagination {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 5rem 0 6rem;
}
@media (max-width: 767px) {
  .case-pagination { grid-template-columns: 1fr; gap: 1rem; margin: 3.5rem 0 4rem; }
}

.case-nav-link {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem 1.75rem;
  border: 1px solid rgba(243, 241, 236, 0.18);
  border-radius: 1rem;
  text-decoration: none;
  color: var(--jxm-tusk);
  background: transparent;
  transition: border-color 240ms ease, background 240ms ease;
  min-height: 5.5rem;
}
.case-nav-link:hover {
  border-color: rgba(243, 241, 236, 0.5);
  background: rgba(243, 241, 236, 0.03);
}

.case-nav-link--next {
  justify-content: flex-end;
  text-align: right;
}

.case-nav-link .dir-stack {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0; /* allow text wrap inside flex */
}

.case-nav-link .dir-label {
  font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(243, 241, 236, 0.55);
  display: block;
}

.case-nav-link .dir-title {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--jxm-tusk);
  display: block;
}

.case-nav-link .arrow {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  color: var(--jxm-tusk);
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}
.case-nav-link:hover .arrow { transform: translateX(-4px); }
.case-nav-link--next:hover .arrow { transform: translateX(4px); }
.case-nav-link .arrow svg { width: 100%; height: 100%; display: block; }

/* ── Client logo (replaces .title-thumb cover image) ────────────
   Two variants used across case studies:
   • Inline <svg> with currentColor fills (advia) — picks up tusk via `color`
   • <img> + .cs-logo--inverted (harvard, nwfcu, capcom) — invert dark-fill SVG
*/
body.case-dark .cs-logo {
  width: 100%;
  max-width: 240px;
  height: auto;
  color: var(--jxm-tusk);
  display: block;
  margin-top: 0.75rem;
}
body.case-dark .cs-logo--inverted {
  /* squarespace-cdn SVGs ship as #202020 (dark gray). brightness(0)
     flattens any source variation, then the tuned invert+sepia chain
     lands close to JXM tusk (#f3f1ec) instead of cool gray. */
  filter: brightness(0) saturate(100%) invert(94%) sepia(7%) saturate(283%) hue-rotate(338deg) brightness(106%) contrast(92%);
}
body.case-dark .cs-logo--compact {
  /* square / heavy-border marks (capcom) overpower wide wordmarks at 240px */
  max-width: 144px;
}
@media (max-width: 767px) {
  body.case-dark .cs-logo { max-width: 180px; }
  body.case-dark .cs-logo--compact { max-width: 108px; }
}

/* ── Work-details surface adjustments for abyss ──────────────── */
/* Section meta/eyebrow chips read on dark surface */
body.case-dark .case-eyebrow,
body.case-dark .case-client-tag,
body.case-dark .case-chapter-label,
body.case-dark .case-channels-label {
  color: rgba(243, 241, 236, 0.65) !important;
}
body.case-dark .case-channels-list {
  color: var(--jxm-tusk) !important;
}

/* Funfact / counter numbers — kermit accent on abyss */
body.case-dark .funfact-item .number {
  color: var(--jxm-kermit) !important;
  -webkit-text-fill-color: var(--jxm-kermit) !important;
}

/* ── Video poster + play button (case film) ──────────────────── */
.case-video-poster {
  position: relative;
  display: block;
  cursor: pointer;
  text-decoration: none;
  outline: none;
}
.case-video-poster img {
  display: block;
  transition: filter 320ms ease;
}
.case-video-poster:hover img,
.case-video-poster:focus-visible img {
  filter: brightness(0.82);
}

.case-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(4rem, 7vw, 6rem);
  height: clamp(4rem, 7vw, 6rem);
  background: var(--jxm-kermit);
  color: var(--jxm-abyss);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 320ms ease;
  pointer-events: none;
}
.case-video-poster:hover .case-video-play,
.case-video-poster:focus-visible .case-video-play {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.case-video-play svg {
  width: 38%;
  height: 38%;
  fill: currentColor;
  margin-left: 6%;
}

/* Subtle ambient pulse so the play button reads as actionable from a distance */
@media (prefers-reduced-motion: no-preference) {
  .case-video-play::before {
    content: "";
    position: absolute;
    inset: -8%;
    border-radius: 50%;
    border: 2px solid rgba(73, 227, 133, 0.55);
    animation: case-video-pulse 2.4s ease-out infinite;
  }
  @keyframes case-video-pulse {
    0%   { transform: scale(1);   opacity: 0.7; }
    80%  { transform: scale(1.35); opacity: 0; }
    100% { transform: scale(1.35); opacity: 0; }
  }
}

/* Magnific Popup tweaks for video lightbox */
.mfp-iframe-holder .mfp-content { max-width: 1200px; }
.mfp-iframe-scaler iframe {
  background: var(--jxm-abyss);
}
