/* Elevate Systems - case gallery: phone image viewer with thumbnails and lightbox */

.gallery { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: 5%; align-items: start; }

/* stage */
.galleryStage { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 26px 24px; }
.galleryView { position: relative; display: flex; justify-content: center; align-items: center; padding: 0 58px; }
.galleryZoom { appearance: none; -webkit-appearance: none; border: 0; background: transparent; padding: 0; margin: 0; cursor: zoom-in; position: relative; border-radius: 22px; display: block; }
.galleryZoom img { display: block; width: auto; height: 480px; max-width: 100%; border-radius: 22px; border: 1px solid #d7dce6; background: #f6f5fb; transition: opacity .22s ease; }
.galleryZoom img.isSwapping { opacity: 0; }
.galleryZoomHint {
  position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 999px; background: rgba(18, 27, 34, .84); color: #fff;
  font-size: 12px; font-weight: 560; letter-spacing: .01em; white-space: nowrap;
  opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; pointer-events: none;
}
.galleryZoomHint i { font-style: normal; font-size: 14px; line-height: 1; }
.galleryZoom:hover .galleryZoomHint, .galleryZoom:focus-visible .galleryZoomHint { opacity: 1; transform: none; }
.galleryZoom:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 4px; }
.galleryArrow {
  position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 17px; line-height: 1;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s, border-color .2s, color .2s;
}
.galleryPrev { left: 0; }
.galleryNext { right: 0; }
.galleryArrow:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.galleryArrow:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; }
.galleryCaption { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr; gap: 3px 18px; align-items: baseline; }
.galleryCount { font-family: "Geist Mono", ui-monospace, monospace; font-size: 11.5px; letter-spacing: .1em; color: var(--accent-text); grid-row: 1 / span 2; padding-top: 3px; }
.galleryCaption b { font-size: 17px; font-weight: 570; letter-spacing: -.015em; }
.galleryCaption p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.6; max-width: 50ch; }

/* thumbnails as steps */
.galleryLabel { display: block; font-family: "Geist Mono", ui-monospace, monospace; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); margin: 4px 12px 12px; }
.galleryThumbs { display: flex; flex-direction: column; gap: 6px; }
.galleryThumbs button {
  appearance: none; -webkit-appearance: none; width: 100%; display: grid; grid-template-columns: 58px 1fr; gap: 16px; align-items: center;
  text-align: left; background: transparent; border: 1px solid transparent; border-radius: 12px; padding: 10px 12px;
  font: inherit; color: inherit; cursor: pointer; transition: background .2s, border-color .2s, box-shadow .2s;
}
.galleryThumbs button:hover { background: rgba(255, 255, 255, .65); }
.galleryThumbs button[aria-selected="true"] { background: var(--surface); border-color: var(--line); box-shadow: 0 8px 24px rgba(18, 27, 34, .06); }
.galleryThumbs img { display: block; width: 58px; height: 124px; object-fit: cover; object-position: top; border-radius: 9px; border: 1px solid #d7dce6; background: #f6f5fb; }
.galleryThumbs button > span { display: block; min-width: 0; }
.galleryThumbs small { display: block; font-family: "Geist Mono", ui-monospace, monospace; font-size: 11px; letter-spacing: .1em; color: var(--muted); margin-bottom: 4px; transition: color .2s; }
.galleryThumbs button[aria-selected="true"] small { color: var(--accent-text); }
.galleryThumbs b { display: block; font-size: 16.5px; font-weight: 570; letter-spacing: -.015em; }
.galleryThumbs em { display: block; font-style: normal; margin-top: 3px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.galleryThumbs button:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }

/* lightbox */
html.lightboxOpen { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 72px 90px;
  background: rgba(18, 27, 34, .94); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .25s ease;
}
.lightbox[hidden] { display: none; }
.lightbox.isOpen { opacity: 1; }
.lightboxFigure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 16px; max-width: 100%; max-height: 100%; transform: scale(.97); transition: transform .3s cubic-bezier(.16, 1, .3, 1); }
.lightbox.isOpen .lightboxFigure { transform: none; }
.lightboxFigure img { display: block; height: min(80vh, 1400px); width: auto; max-width: 100%; border-radius: 28px; border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 40px 100px rgba(0, 0, 0, .55); background: #f6f5fb; }
.lightboxFigure figcaption { color: #fff; text-align: center; max-width: 62ch; }
.lightboxFigure figcaption b { display: block; font-size: 16px; font-weight: 570; letter-spacing: -.01em; }
.lightboxFigure figcaption span { display: block; margin-top: 4px; color: rgba(255, 255, 255, .66); font-size: 14px; line-height: 1.6; }
.lightboxBar { position: absolute; top: 18px; left: 22px; right: 22px; display: flex; justify-content: space-between; align-items: center; }
.lightboxCount { font-family: "Geist Mono", ui-monospace, monospace; font-size: 12px; letter-spacing: .1em; color: rgba(255, 255, 255, .7); }
.lightboxClose, .lightboxArrow {
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, .28); background: rgba(18, 27, 34, .35); color: #fff; font: inherit; line-height: 1;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background .2s, color .2s, border-color .2s;
}
.lightboxClose { width: 44px; height: 44px; font-size: 22px; }
.lightboxClose:hover { background: #fff; color: var(--ink); border-color: #fff; }
.lightboxArrow { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 18px; }
.lightboxPrev { left: 22px; }
.lightboxNext { right: 22px; }
.lightboxArrow:hover { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.lightbox :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (max-width: 1080px) {
  .gallery { grid-template-columns: 1fr; gap: 26px; }
}
@media (max-width: 620px) {
  .galleryStage { padding: 18px 12px 16px; }
  .galleryView { padding: 0 46px; }
  .galleryZoom img { height: 400px; }
  .galleryArrow { width: 38px; height: 38px; font-size: 15px; }
  .galleryCaption { grid-template-columns: 1fr; gap: 4px; padding-top: 14px; margin-top: 16px; }
  .galleryCount { grid-row: auto; }
  .galleryThumbs button { grid-template-columns: 46px 1fr; gap: 12px; padding: 8px 10px; }
  .galleryThumbs img { width: 46px; height: 98px; }
  .lightbox { padding: 70px 16px 84px; }
  .lightboxFigure img { height: auto; max-height: 72vh; max-width: 100%; border-radius: 20px; }
  .lightboxFigure figcaption b { font-size: 15px; }
  .lightboxArrow { top: auto; bottom: 18px; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .lightbox, .lightboxFigure, .galleryZoom img, .galleryZoomHint { transition: none; }
}
