/* =========================================================
   Case-study work lightbox — click any tile in .case-grid to
   view it full-screen, with left/right navigation. Plus small
   premium touches on the grid tiles themselves.
   ========================================================= */

/* --- Grid polish: quiet zoom on hover, zoom-in affordance --- */
.case-tile { cursor: zoom-in; }
.case-tile img {
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.case-tile:hover img { transform: scale(1.04); }

/* --- Overlay --- */
.case-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 8, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.case-lightbox.is-open { opacity: 1; }

body.clb-lock { overflow: hidden; }

/* --- Stage & media --- */
.clb-stage {
  margin: 0;
  max-width: min(1024px, calc(100vw - 128px));
  max-height: 84vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.clb-media {
  max-width: 100%;
  max-height: 84vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
  background: #000;
}
.clb-stage.is-in .clb-media {
  animation: clb-in 0.3s cubic-bezier(0.2, 0.7, 0.3, 1);
}
@keyframes clb-in {
  from { opacity: 0; transform: scale(0.965); }
  to   { opacity: 1; transform: scale(1); }
}

/* --- Controls --- */
.clb-btn {
  position: fixed;
  z-index: 2;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.25s ease, border-color 0.25s ease;
}
.clb-btn:hover {
  background: rgba(13,13,13, 0.55);
  border-color: rgba(13,13,13, 0.8);
}
.clb-btn:focus-visible {
  outline: 2px solid var(--accent-2, #B2ED3A);
  outline-offset: 3px;
}
.clb-close { top: 22px; right: 22px; font-size: 17px; }
.clb-prev  { left: 22px;  top: 50%; margin-top: -24px; }
.clb-next  { right: 22px; top: 50%; margin-top: -24px; }

.clb-counter {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: monospace;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.65);
  pointer-events: none;
}

/* --- Mobile --- */
@media (max-width: 640px) {
  .clb-stage { max-width: calc(100vw - 24px); max-height: 78vh; }
  .clb-media { max-height: 78vh; }
  .clb-btn { width: 40px; height: 40px; font-size: 13px; }
  .clb-close { top: 14px; right: 14px; }
  .clb-prev { left: 10px; }
  .clb-next { right: 10px; }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .case-lightbox { transition: none; }
  .clb-stage.is-in .clb-media { animation: none; }
  .case-tile img { transition: none; }
  .case-tile:hover img { transform: none; }
}
