/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: #080808;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-rows: minmax(0, 1fr);
  overflow-y: auto;
  color: var(--ink);
}
.stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 30px 40px;
}
.nav-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 35%;
  border: 0;
  background: none;
  z-index: 1;
  padding: 0;
}
.nav-zone.prev {
  left: 0;
  cursor: w-resize;
}
.nav-zone.next {
  right: 0;
  cursor: e-resize;
}
.frame {
  position: relative;
  overflow: hidden;
  user-select: none;
}
.frame .blur-bg {
  position: absolute;
  inset: 0;
  filter: blur(12px) saturate(0.6);
  transform: scale(1.1);
  opacity: 0.5;
}
.frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.frame img.preview {
  z-index: 1;
  opacity: 1;
}
.frame img.full-res {
  z-index: 2;
}
.frame img.full-res.is-loaded {
  opacity: 1;
}
.frame .full-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.frame .full-loading span {
  font: 500 12px "Geist Mono", monospace;
  color: var(--ink);
  background: rgba(8, 8, 8, 0.6);
  padding: 6px 10px;
  border-radius: 4px;
}
.watermark {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  font: 500 10px "Geist Mono", monospace;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.45);
  pointer-events: none;
}
.expand-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(8, 8, 8, 0.55);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.15s ease;
}
.expand-btn:hover {
  background: rgba(8, 8, 8, 0.8);
}
.lightbox.is-expanded {
  grid-template-columns: 1fr;
}
.lightbox.is-expanded aside {
  display: none;
}
aside {
  border-left: 1px solid var(--line);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  font: 400 12px "Geist", sans-serif;
}
.aside-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.aside-top .counter {
  font: 500 12px "Geist Mono", monospace;
  color: var(--muted);
}
.close-btn {
  width: 44px;
  height: 44px;
  margin: -12px -12px 0 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: 400 18px "Geist", sans-serif;
  cursor: pointer;
}
.title-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.title-block .place {
  font: 500 22px/1.2 "Geist", sans-serif;
  letter-spacing: -0.01em;
}
.title-block .sub {
  color: var(--muted);
}
.meta-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font: 400 12px "Geist Mono", monospace;
}
.meta-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 6px;
  align-items: baseline;
}
.meta-label {
  color: var(--muted);
}
.exif-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font: 400 12px "Geist Mono", monospace;
}
.exif-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.exif-row-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.exif-row-top .label {
  color: var(--muted);
}
.exif-scale {
  position: relative;
  height: 12px;
}
.exif-scale-base {
  position: absolute;
  left: 0;
  right: 0;
  top: 5.5px;
  height: 1px;
  background: var(--line-strong);
}
.exif-scale-tick {
  position: absolute;
  top: 3px;
  width: 1px;
  height: 6px;
  background: var(--tick);
  transition: top 0.25s, height 0.25s, background 0.25s;
}
.exif-scale-tick.is-near {
  top: 1px;
  height: 10px;
  background: var(--muted);
}
.exif-scale-marker {
  position: absolute;
  top: 0;
  width: 2px;
  height: 12px;
  margin-left: -1px;
  background: var(--ink);
  border-radius: 1px;
}
.exif-scale-marker.is-wander {
  opacity: 0.75;
  box-shadow: 0 0 8px rgba(230, 230, 227, 0.6);
  transition: opacity 0.3s;
}
.exif-scale-marker.is-reduced {
  opacity: 0;
}
.exif-scale-marker.is-locked {
  opacity: 1;
  box-shadow: none;
  transition: left 0.7s cubic-bezier(0.2, 1.5, 0.4, 1), opacity 0.3s;
}
.exif-row-top .value {
  transition: color 0.4s;
}
.exif-row-top .value.is-wander {
  color: var(--muted-dim);
}
.exif-row-top .value.is-locked {
  color: var(--ink);
}
.exif-scale-ends {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 10.5px;
  line-height: 1;
  color: var(--muted-dim);
}
.exif-scale-ends span {
  white-space: nowrap;
}
.exif-caption {
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--muted-dim);
}
.aside-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.nav-buttons {
  display: flex;
  gap: 8px;
}
.nav-buttons button {
  flex: 1;
  height: 44px;
  border: 1px solid var(--line-strong);
  background: none;
  color: var(--ink);
  border-radius: 6px;
  cursor: pointer;
  font: 500 13px "Geist", sans-serif;
}
.copyright-small {
  margin: 0;
  font: 400 10.5px/1.6 "Geist Mono", monospace;
  color: var(--muted-dim);
}

/* Mobile peek sheet: photo fills ~70% of the screen, EXIF sits in a peek
   sheet below it. Either can expand to fill — the sheet (handle/chevron) or
   the photo (⤢ button, double-tap). Three modes, driven by data-sheet-mode:
   default (peek), photo (full-bleed), exif (sheet fills, photo shrinks). */
.lightbox.is-mobile {
  display: block;
}
.lightbox.is-mobile .m-topbar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 52px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: env(safe-area-inset-top, 0) 8px 0 20px;
  background: linear-gradient(#080808 60%, rgba(8, 8, 8, 0));
  transition: opacity 0.3s;
}
.lightbox.is-mobile[data-sheet-mode="photo"] .m-topbar {
  opacity: 0;
  pointer-events: none;
}
.lightbox.is-mobile .m-topbar .counter {
  font: 500 12px "Geist Mono", monospace;
  color: var(--muted);
}
.lightbox.is-mobile .m-topbar .close-btn {
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  color: var(--ink);
  font: 400 18px "Geist", sans-serif;
  cursor: pointer;
}
.lightbox.is-mobile .m-stage {
  position: absolute;
  left: 0;
  right: 0;
  top: 52px;
  bottom: 134px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: top 0.45s cubic-bezier(0.3, 0.8, 0.3, 1), bottom 0.45s cubic-bezier(0.3, 0.8, 0.3, 1);
}
.lightbox.is-mobile[data-sheet-mode="photo"] .m-stage {
  top: 0;
  bottom: 0;
}
.lightbox.is-mobile[data-sheet-mode="exif"] .m-stage {
  bottom: calc(100% - 262px); /* 52px topbar + 210px photo peek */
}
.lightbox.is-mobile .frame {
  transition: width 0.45s cubic-bezier(0.3, 0.8, 0.3, 1), height 0.45s cubic-bezier(0.3, 0.8, 0.3, 1);
}
.lightbox.is-mobile .m-expand-btn {
  top: auto;
  right: 12px;
  bottom: 12px;
  width: 44px;
  height: 44px;
  backdrop-filter: blur(8px);
  transition: right 0.45s, bottom 0.45s;
}
.lightbox.is-mobile[data-sheet-mode="photo"] .m-expand-btn {
  right: 16px;
  bottom: 40px;
}
.exif-pill {
  position: absolute;
  left: 16px;
  bottom: 12px;
  z-index: 3;
  height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 22px;
  background: rgba(8, 8, 8, 0.55);
  color: var(--ink);
  font-size: 11px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, bottom 0.45s;
}
.lightbox.is-mobile[data-sheet-mode="photo"] .exif-pill {
  opacity: 1;
  pointer-events: auto;
  bottom: 40px;
}
.lightbox.is-mobile .m-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 134px;
  z-index: 5;
  background: #121212;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -1px 0 var(--line-strong);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0);
  transition: height 0.45s cubic-bezier(0.3, 0.8, 0.3, 1);
}
.lightbox.is-mobile[data-sheet-mode="photo"] .m-sheet {
  height: 0;
}
.lightbox.is-mobile[data-sheet-mode="exif"] .m-sheet {
  height: calc(100% - 262px);
}
.sheet-handle {
  flex: none;
  height: 22px;
  border: 0;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sheet-handle span {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--tick);
}
.sheet-header {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px 0 20px;
  cursor: pointer;
}
.sheet-header-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding-top: 4px;
}
.sheet-place {
  font: 500 17px/1.2 "Geist", sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sheet-summary {
  font: 400 11.5px "Geist Mono", monospace;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sheet-chevron {
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 22px;
  background: #1c1c1c;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sheet-chevron span {
  width: 8px;
  height: 8px;
  border-top: 1.5px solid var(--ink);
  border-left: 1.5px solid var(--ink);
  transform: translateY(2px) rotate(45deg);
  transition: transform 0.35s;
}
.sheet-chevron.is-open span {
  transform: translateY(-2px) rotate(225deg);
}
.sheet-detail {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 20px 44px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  font: 400 12px "Geist", sans-serif;
  opacity: 0;
  transition: opacity 0.3s;
}
.lightbox.is-mobile[data-sheet-mode="exif"] .sheet-detail {
  opacity: 1;
}
.sheet-sub {
  font: 400 12px "Geist", sans-serif;
  color: var(--muted);
}
