/* ============================================================
   tf-lightbox.css — click-to-zoom image overlay
   Auto-applies to .tf-fleet-img, .htb-step-shot img, and any
   <img data-lightbox> element. See tf-lightbox.js for wiring.
   ============================================================ */

/* Affordance on eligible images */
.tf-lb-trigger {
  cursor: zoom-in;
  transition: transform .18s ease, filter .18s ease;
}
.tf-lb-trigger:hover {
  filter: brightness(1.04);
}

/* The overlay */
.tf-lb {
  position: fixed; inset: 0;
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 14, 24, 0.86);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  /* When closed the overlay stays in the DOM (so the fade-out can play),
     but it must NOT block clicks on the page underneath. */
  pointer-events: none;
  transition: opacity .22s ease;
  padding: 56px 24px 96px;
  box-sizing: border-box;
}
.tf-lb.is-open { opacity: 1; pointer-events: auto; }

/* Image stage */
.tf-lb-stage {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.tf-lb-img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 152px);
  width: auto; height: auto;
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  background: #0A1F33;
  opacity: 0;
  transform-origin: 50% 50%;
  transition: transform .26s cubic-bezier(.2,.8,.2,1), opacity .22s ease;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}
.tf-lb.is-open .tf-lb-img { opacity: 1; }

/* While the user is dragging-to-pan, kill the transform transition so the
   image tracks the cursor 1:1 instead of easing behind it. */
.tf-lb-img.is-panning {
  transition: opacity .22s ease;
  cursor: grabbing !important;
}
.tf-lb-img.is-zoomed { cursor: grab; }

/* Close button */
.tf-lb-close {
  position: absolute; top: 14px; right: 14px;
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: #fff; cursor: pointer;
  transition: background .15s ease, transform .15s ease;
  z-index: 2;
}
.tf-lb-close:hover { background: rgba(255,255,255,.18); transform: scale(1.06); }
.tf-lb-close::before,
.tf-lb-close::after {
  content: ''; position: absolute;
  width: 18px; height: 2px; background: #fff; border-radius: 1px;
}
.tf-lb-close::before { transform: rotate(45deg); }
.tf-lb-close::after  { transform: rotate(-45deg); }

/* Prev / next nav */
.tf-lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: #fff; cursor: pointer;
  transition: background .15s ease, transform .15s ease;
  z-index: 2;
}
.tf-lb-nav:hover { background: rgba(255,255,255,.18); }
.tf-lb-nav.is-prev { left: 14px; }
.tf-lb-nav.is-next { right: 14px; }
.tf-lb-nav::before {
  content: ''; width: 14px; height: 14px;
  border-top: 2px solid #fff; border-right: 2px solid #fff;
  display: block;
}
.tf-lb-nav.is-prev::before { transform: rotate(-135deg); margin-left: 4px; }
.tf-lb-nav.is-next::before { transform: rotate(45deg);   margin-right: 4px; }
.tf-lb-nav[hidden] { display: none; }

/* Caption + counter strip */
.tf-lb-foot {
  position: absolute; left: 0; right: 0; bottom: 18px;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 0 24px;
  color: rgba(255,255,255,.85);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px; letter-spacing: .3px;
  pointer-events: none;
}
.tf-lb-caption {
  max-width: 70vw;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-align: center;
}
.tf-lb-counter {
  font-variant-numeric: tabular-nums;
  font-size: 12px; letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,.6);
  padding: 4px 10px;
  background: rgba(255,255,255,.06);
  border-radius: 999px;
  flex-shrink: 0;
}

/* Lock body scroll while open */
body.tf-lb-locked { overflow: hidden; }

/* Mobile tweaks */
@media (max-width: 640px) {
  .tf-lb { padding: 44px 8px 80px; }
  .tf-lb-img { max-height: calc(100vh - 130px); border-radius: 6px; }
  .tf-lb-nav { width: 40px; height: 40px; }
  .tf-lb-nav.is-prev { left: 6px; }
  .tf-lb-nav.is-next { right: 6px; }
  .tf-lb-close { top: 8px; right: 8px; width: 38px; height: 38px; }
  .tf-lb-caption { max-width: 60vw; font-size: 12px; }
}

/* Respect reduced motion: kill the transition animation, but NOT the
   transform itself — the user-driven zoom/pan still needs `transform` to work. */
@media (prefers-reduced-motion: reduce) {
  .tf-lb,
  .tf-lb-img,
  .tf-lb-trigger,
  .tf-lb-close,
  .tf-lb-nav { transition: none !important; }
}
