/* ─── CASE STUDY GALLERY + LIGHTBOX ───
   Shared by index.html and the case study pages. Relies on the page tokens
   (--lift, --surface, --gold, --mono, …) defined in each page's :root. */

.cs-gallery { display: flex; flex-direction: column; gap: 1.75rem; }
.cs-shot { margin: 0; }

.cs-img-wrap {
  position: relative; width: 100%;
  background: var(--lift); overflow: hidden;
  border-radius: 14px;
}
.cs-img-wrap img { width: 100%; height: auto; display: block; }

/* The image is the button: reset native button chrome */
.cs-zoom {
  padding: 0; border: 0; margin: 0;
  font: inherit; color: inherit; text-align: inherit;
  cursor: zoom-in;
}
.cs-zoom:focus-visible { outline: 2px solid var(--gold-border); outline-offset: 3px; }

/* Top-right icon badge; the image itself is never dimmed */
.cs-zoom-hint {
  position: absolute; top: .75rem; right: .75rem; z-index: 1;
  transform: translateY(-2px);
  display: flex; align-items: center; justify-content: center;
  padding: .45rem; border-radius: 999px;
  background: rgba(18,20,26,.88); color: #E4E7F2;
  opacity: 0; transition: opacity .18s, transform .18s;
  pointer-events: none;
}
.cs-zoom-hint svg {
  width: 16px; height: 16px; flex-shrink: 0;
  stroke: currentColor; fill: none; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round;
}

@media (hover: hover) {
  .cs-zoom:hover .cs-zoom-hint { opacity: 1; transform: none; }
}
.cs-zoom:focus-visible .cs-zoom-hint { opacity: 1; transform: none; }

/* Touch: no hover, so keep the badge visible */
@media (hover: none) {
  .cs-zoom-hint { top: .6rem; right: .6rem; transform: none; opacity: 1; }
}

/* ─── LIGHTBOX ─── */
.lb {
  position: fixed; inset: 0; z-index: 400;
  display: flex; flex-direction: column;
  background: rgba(10,11,15,.94);
  color: #E4E7F2;
  opacity: 0; transition: opacity .2s;
}
.lb[hidden] { display: none; }
.lb.open { opacity: 1; }

.lb-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; flex-shrink: 0;
}
.lb-count { font-family: var(--mono); font-size: var(--mono-sm); letter-spacing: .1em; color: #9AAAC8; }

.lb-stage {
  flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4.5rem;
}
.lb-figure {
  margin: 0; max-width: 100%; max-height: 100%;
  display: flex; flex-direction: column; align-items: center; gap: .85rem;
}
.lb-img {
  display: block; max-width: 100%; max-height: calc(100vh - 12rem);
  width: auto; height: auto; object-fit: contain;
  border-radius: 10px; background: #12141A;
}
.lb-caption {
  font-family: var(--mono); font-size: var(--mono-md);
  color: #9AAAC8; letter-spacing: .03em; text-align: center;
  max-width: 60rem;
}

.lb-btn {
  background: rgba(21,23,30,.9); border: 1px solid rgba(228,231,242,.16);
  color: #E4E7F2; cursor: pointer;
  width: 40px; height: 40px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, border-color .15s;
  flex-shrink: 0;
}
.lb-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.lb-btn[hidden] { display: none; }
.lb-btn:hover { color: #F5BC00; border-color: rgba(245,188,0,.5); }
.lb-btn:focus-visible { outline: 2px solid rgba(245,188,0,.6); outline-offset: 2px; }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { left: 1.25rem; }
.lb-next { right: 1.25rem; }

.lb-dots { display: flex; justify-content: center; gap: 6px; padding: 1rem 0 1.25rem; flex-shrink: 0; }
.lb-dot {
  height: 6px; width: 6px; padding: 0; border: 0; border-radius: 50%;
  background: #7A8AB6; cursor: pointer;
  transition: width .2s, background .2s, border-radius .2s;
}
.lb-dot[aria-current="true"] { width: 20px; border-radius: 3px; background: #F5BC00; }

@media (max-width: 640px) {
  .lb-stage { padding: 0 .75rem; }
  .lb-prev, .lb-next { top: auto; bottom: .75rem; transform: none; }
  .lb-prev { left: .75rem; }
  .lb-next { right: .75rem; }
  .lb-dots { padding: 1.6rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cs-zoom-hint, .lb { transition: none; }
}
