/* ## ---- [File Index] ---- ##
1) Lightbox layout and dim
2) Stage and image layers
3) Controls: close, nav, zoom
4) Meta info: title, year, description
5) Motion states and responsive
*/

/* ## ---- [2026-03-02 Lightbox Base] ---- ## */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox-dim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.lightbox-content-nav {
  position: fixed;
  top: 50%;
  z-index: 2;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  transform: translateY(-50%);
  background: rgba(78, 78, 78, 0.78);
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.22s ease, opacity 0.22s ease;
}

.lightbox-content-nav:hover {
  background: rgba(0, 0, 0, 0.62);
}

.lightbox-content-nav svg {
  display: block;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
}

.lightbox-content-prev {
  left: 16px;
}

.lightbox-content-next {
  right: 16px;
}

.lightbox-shell {
  position: relative;
  z-index: 1;
  --lightbox-shell-reduce: 84px;
  width: min(100%, calc(740px - var(--lightbox-shell-reduce)));
  max-height: calc(100vh - 56px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18), 0 6px 16px rgba(0, 0, 0, 0.1);
}

/* ## ---- [Close Button] ---- ## */
.lightbox-close {
  position: fixed;
  top: 18px;
  right: 20px;
  width: 34px;
  height: 34px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  opacity: 0.9;
}

.lightbox-close svg {
  width: 100%;
  height: 100%;
}

.lightbox-close:hover {
  opacity: 1;
}

/* ## ---- [Stage and Layers] ---- ## */
.lightbox-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #1f1f1f;
}

.lightbox-bg,
.lightbox-img-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  transition: opacity 0.32s ease, transform 0.32s ease, filter 0.32s ease;
}

.lightbox-bg {
  z-index: 1;
  object-fit: cover;
  transform: scale(1.14);
  filter: blur(30px);
  opacity: 0;
}

.lightbox-img-cover {
  z-index: 2;
  object-fit: cover;
  opacity: 1;
}

.lightbox-img-fit {
  z-index: 2;
  object-fit: contain;
  opacity: 0;
}

/* ## ---- [Fit Toggle States] ---- ## */
.lightbox.is-fit .lightbox-bg {
  opacity: 0.8;
}

.lightbox.is-fit .lightbox-img-cover {
  opacity: 0;
  transform: scale(0.98);
}

.lightbox.is-fit .lightbox-img-fit {
  opacity: 1;
  transform: scale(1);
}

.lightbox-stage.is-switching .lightbox-img-layer,
.lightbox-stage.is-switching .lightbox-bg {
  opacity: 0.18;
  transform: scale(1.03);
}

.lightbox-stage.is-zooming .lightbox-img-layer,
.lightbox-stage.is-zooming .lightbox-bg {
  transition: opacity 0.34s ease, transform 0.34s ease, filter 0.34s ease;
}

/* ## ---- [Stage Controls] ---- ## */
.lightbox-count {
  position: absolute;
  top: 14px;
  right: 14px;
  margin: 0;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.1em;
  z-index: 4;
}

.lightbox-progress-wrap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: transparent;
  z-index: 4;
  pointer-events: none;
}

.lightbox-progress-track {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.4);
}

.lightbox-progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: #0056b3;
  transition: width 0.28s ease;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  background: rgba(78, 78, 78, 0.78);
  color: #ffffff;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, background-color 0.22s ease;
  z-index: 4;
}

.lightbox-stage:hover .lightbox-nav {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-nav:hover {
  background: rgba(0, 0, 0, 0.62);
}

.lightbox-nav.is-disabled,
.lightbox-content-nav.is-disabled {
  opacity: 0.2;
  pointer-events: none;
}

.lightbox-nav svg {
  display: block;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
}

.lightbox-nav-prev {
  left: 14px;
}

.lightbox-nav-next {
  right: 14px;
}

.lightbox-zoom-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 4;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0;
  background: rgba(0, 0, 0, 0.4);
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.22s ease;
}

.lightbox-zoom-btn:hover {
  background: rgba(0, 0, 0, 0.62);
}

.zoom-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
}

.zoom-icon svg {
  width: 100%;
  height: 100%;
}

.zoom-expand {
  display: none;
}

.lightbox.is-fit .zoom-shrink {
  display: none;
}

.lightbox.is-fit .zoom-expand {
  display: inline-flex;
}

/* ## ---- [Meta Panel] ---- ## */
.lightbox-meta {
  width: 100%;
  background: #ffffff;
  height: 192px;
  padding: 18px 18px 18px;
  border-top: 1px solid #dfdfdf;
  overflow-y: auto;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(80, 80, 80, 0.5) transparent;
}

.lightbox-meta::-webkit-scrollbar {
  width: 6px;
}

.lightbox-meta::-webkit-scrollbar-track {
  background: transparent;
}

.lightbox-meta::-webkit-scrollbar-thumb {
  background: rgba(80, 80, 80, 0.5);
  border-radius: 6px;
}

.lightbox-meta::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.lightbox-title {
  margin: 0;
  color: #161616;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.025em;
}

.lightbox-year {
  margin: 24px 0 0;
  color: #767676;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.025em;
}

.lightbox-divider {
  margin: 10px 0 8px;
  height: 1px;
  background: #dfdfdf;
}

/* ## ---- [2026-03-02 Year-Below Body Line] ---- ## */
.lightbox-desc {
  margin: 0;
  color: #767676;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.025em;
  white-space: normal;
  word-break: break-word;
}

/* ## ---- [Responsive] ---- ## */
@media (max-width: 860px) {
  .lightbox-shell {
    --lightbox-shell-reduce: 60px;
    width: min(100%, calc(100vw - 36px));
  }

  .lightbox-content-nav {
    width: 52px;
    height: 52px;
  }

  .lightbox-content-nav svg {
    width: 24px;
    height: 24px;
  }

  .lightbox-close {
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 640px) {
  .lightbox-shell {
    --lightbox-shell-reduce: 0px;
  }

  .lightbox-content-nav {
    display: none;
  }

  .lightbox-nav {
    opacity: 1;
    pointer-events: auto;
    width: 32px;
    height: 32px;
  }

  .lightbox-nav-prev {
    left: 8px;
  }

  .lightbox-nav-next {
    right: 8px;
  }

  .lightbox-meta {
    height: 192px;
    padding: 14px 14px 12px;
  }
}
