/* ═══════════════════════════════════════════════════════════
   WORK SPOTLIGHT — editorial case-study cards
   Template: image → frosted pills on image → white content zone
   → bold title → 2-line desc → byline + read time
   ═══════════════════════════════════════════════════════════ */

#work-spotlight {
  background: var(--color-offwhite, #f5f5f0);
  position: relative;
  z-index: 10;
  margin-top: -2px;
  padding: 10vh 4vw 10vh;
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

#work-spotlight.is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* ── Mesh canvas ── */
.spotlight__mesh-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Lift content above canvas */
.spotlight__header,
.spotlight__grid {
  position: relative;
  z-index: 1;
}

/* ── Section header ── */
.spotlight__header {
  margin-bottom: clamp(2.5rem, 4vw, 4.5rem);
}

.spotlight__label {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(0.6rem, 0.75vw, 0.75rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-tangerine);
  margin-bottom: 1.25rem;
}

.spotlight__heading {
  font-family: var(--font-dm-serif);
  font-size: clamp(2rem, 4vw, 5rem);
  font-weight: 400;
  line-height: 1.1;
  color: var(--color-ink);
  letter-spacing: -0.02em;
  margin: 0;
}

.spotlight__heading em {
  font-family: var(--font-cormorant);
  font-style: italic;
  font-weight: 600;
  color: var(--color-cobalt);
}

.spotlight__desc {
  font-family: var(--font-body);
  font-size: clamp(0.88rem, 1.05vw, 1.1rem);
  font-weight: 300;
  line-height: 1.7;
  color: rgba(26, 26, 26, 0.68);
  margin: 1.5rem 0 0;
  max-width: min(540px, 60vw);
}

/* ── Metrics strip ── */
.spotlight__metrics {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin: 2rem 0 0;
}

.spotlight__metric {
  display: flex;
  flex-direction: column;
  gap: 0.44rem;
  padding: 0 clamp(1.1rem, 1.7vw, 2rem);
}

.spotlight__metric:first-child { padding-left: 0; }
.spotlight__metric:last-child  { padding-right: 0; }

.spotlight__metric + .spotlight__metric {
  border-left: 1px solid rgba(26, 26, 26, 0.11);
}

.spotlight__metric-num {
  font-family: var(--font-rajdhani);
  font-weight: 700;
  font-size: clamp(1.3rem, 2.6vw, 3.4rem);
  color: var(--color-ink);
  line-height: 1;
}

.spotlight__metric-label {
  font-family: var(--font-mono);
  font-size: clamp(0.52rem, 0.7vw, 0.78rem);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(26, 26, 26, 0.42);
  line-height: 1.3;
}


/* ── Card grid ── */
.spotlight__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.75rem, 1.2vw, 1.25rem);
  align-items: stretch; /* all cards grow to match the tallest in the row */
}


/* ── Individual card ──
   isolation: isolate gives the card its own stacking context so every
   child z-index is self-contained and cannot bleed into adjacent cards. */
.spotlight__card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  isolation: isolate;
  transition: box-shadow 0.2s ease;
}

.spotlight__card:hover {
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12), 0 3px 10px rgba(0, 0, 0, 0.07);
}


/* ── Thumbnail zone ── */
.spotlight__thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #1a1a1a;
  flex-shrink: 0;
}

/* Pre-promote to compositor layer via will-change so there is no
   layer creation/destruction on hover — the compositor slot exists
   from paint time and hover entry is always instantaneous. */
.spotlight__thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  filter: saturate(0.82) brightness(0.88);
  transform: scale(1);
  will-change: transform;
  transition: transform 0.35s ease, filter 0.25s ease;
}

.spotlight__card:hover .spotlight__thumb-img {
  transform: scale(1.05);
  filter: saturate(1) brightness(0.95);
}


/* ── Pills — overlaid on image, no backdrop-filter ──
   Plain dark fill keeps them legible on any image without creating
   a compositor layer that interferes with hover hit-testing. */
.spotlight__pills {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  pointer-events: none;
}

.spotlight__pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: clamp(0.58rem, 0.66vw, 0.65rem);
  font-weight: 500;
  letter-spacing: 0.03em;
  color: rgba(10, 10, 10, 0.82);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.5);
}


/* ── Content zone (below image) ── */
.spotlight__content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: clamp(1rem, 1.4vw, 1.35rem) clamp(1rem, 1.4vw, 1.35rem) clamp(0.9rem, 1.2vw, 1.2rem);
  gap: 0.55rem;
}


/* ── Title ── */
.spotlight__title {
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 1.1vw, 1.15rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--color-ink);
  margin: 0;
  /* Hover: subtle cobalt tint */
  transition: color 0.25s ease;
}

.spotlight__card:hover .spotlight__title {
  color: var(--color-cobalt);
}


/* ── Description — max 2 lines ── */
.spotlight__desc {
  font-family: var(--font-body);
  font-size: clamp(0.75rem, 0.85vw, 0.82rem);
  font-weight: 400;
  line-height: 1.6;
  color: rgba(26, 26, 26, 0.52);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* ── Footer: byline + read time ── */
.spotlight__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(26, 26, 26, 0.07);
}

.spotlight__byline {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Company logo circle */
.spotlight__logo {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-rajdhani);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: #ffffff;
  overflow: hidden;
}

/* VoltSafe — white bg, icon contained with breathing room */
.spotlight__logo--vs {
  background: #ffffff;
  border: 1px solid rgba(26, 26, 26, 0.1);
  padding: 5px;
}

/* Microsoft — white bg, icon contained with breathing room */
.spotlight__logo--ms {
  background: #ffffff;
  border: 1px solid rgba(26, 26, 26, 0.1);
  padding: 5px;
}

/* Shared icon image rules — contain so nothing is cropped */
.spotlight__logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

/* MS + VoltSafe icons: scale up 20% so they fill the circle better */
.spotlight__logo--ms .spotlight__logo-img,
.spotlight__logo--vs .spotlight__logo-img {
  transform: scale(1.2);
}

/* Samsung — white bg, wordmark contained */
.spotlight__logo--sg {
  background: #ffffff;
  border: 1px solid rgba(26, 26, 26, 0.1);
  padding: 5px;
}

.spotlight__logo--sg .spotlight__logo-img {
  transform: scale(1.3);
}

/* PropKeep monogram — warm teal */
.spotlight__logo--pk {
  background: linear-gradient(135deg, #1a4a3a 0%, #0e6b4a 100%);
}

.spotlight__byline-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.spotlight__company {
  font-family: var(--font-body);
  font-size: clamp(0.7rem, 0.78vw, 0.76rem);
  font-weight: 600;
  color: var(--color-ink);
  line-height: 1;
}

.spotlight__date {
  font-family: var(--font-body);
  font-size: clamp(0.62rem, 0.7vw, 0.68rem);
  font-weight: 400;
  color: rgba(26, 26, 26, 0.42);
  line-height: 1;
}

/* Read time */
.spotlight__readtime {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-body);
  font-size: clamp(0.62rem, 0.7vw, 0.68rem);
  font-weight: 400;
  color: rgba(26, 26, 26, 0.45);
  white-space: nowrap;
}

.spotlight__readtime svg {
  flex-shrink: 0;
  opacity: 0.6;
}


/* ── Spotlight entry: hide "Back" button inside player ── */
/* The back button is only meaningful when navigating within the player's
   own grid. When the user arrived via a spotlight card, X is the only
   exit — so the back button is suppressed. */
.morph__player.spotlight-entry #cs-detail-back {
  display: none !important;
}


/* ═══════════════════════════════════════════════════════════
   MOBILE — single column stack
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  #work-spotlight {
    padding: 5vh 1.25rem 6vh;
  }

  .spotlight__desc {
    max-width: 100%;
  }

  .spotlight__metrics {
    flex-wrap: wrap;
    margin: 1.5rem 0 0;
  }

  .spotlight__metric {
    width: 50%;
    padding: 0 1.25rem 1.5rem 0;
    border-left: none !important;
  }

  .spotlight__metric:nth-child(2),
  .spotlight__metric:nth-child(4) {
    padding-left: 1.25rem;
    padding-right: 0;
    border-left: 1px solid rgba(26, 26, 26, 0.11) !important;
  }

  .spotlight__metric:nth-child(3),
  .spotlight__metric:nth-child(4) {
    padding-top: 1.25rem;
    padding-bottom: 0;
    border-top: 1px solid rgba(26, 26, 26, 0.11);
  }

  .spotlight__grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .spotlight__heading {
    font-size: clamp(1.8rem, 7vw, 2.8rem);
  }

  .spotlight__pill {
    font-size: 0.65rem;
  }
}
