/* =========================
   Shared Lightbox
========================= */

body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 18, 0.9);
  padding: 28px;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.lightbox.is-open {
  display: flex;
}

.lightbox.is-visible {
  opacity: 1;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
}

.lightbox-dialog {
  position: relative;
  z-index: 2;
  width: min(1100px, 100%);
  max-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  pointer-events: none;
}

.lightbox-topbar,
.lightbox-bottombar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #fff;
  pointer-events: auto;
}

.lightbox-counter {
  font-size: 0.94rem;
  color: rgba(255, 255, 255, 0.82);
}

.lightbox-close {
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  transition: 0.24s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-stage {
  position: relative;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.lightbox-figure {
  margin: 0;
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 14px;
  pointer-events: auto;
}

.lightbox-image-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: calc(100vh - 190px);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
  background: rgba(255, 255, 255, 0.04);
}

.lightbox-image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 190px);
  width: auto;
  height: auto;
}

.lightbox-caption {
  min-height: 1.5em;
  text-align: center;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.95rem;
  max-width: 840px;
}

.lightbox-nav {
  appearance: none;
  border: 0;
  position: absolute;
  top: 50%;
  transform: translateY(-60%);
  z-index: 3;
  width: 52px;
  height: 50%;
  /* border-radius: 999px; */
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  /* font-size: 1.4rem; */

  font-size: 42px;     /* 原本太小 → 調大 */
  font-weight: 300;    /* 讓箭頭更優雅 */
  display: flex;
  align-items: center;
  justify-content: center;

  line-height: 1;
  transition: 0.24s ease;
  pointer-events: auto;


}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.24);
}

.lightbox-prev {
  left: 18px;
}

.lightbox-next {
  right: 18px;
}

.lightbox-nav[disabled] {
  opacity: 0.35;
  cursor: default;
}

@media (max-width: 640px) {
  .lightbox {
    padding: 16px;
  }

  .lightbox-image-wrap,
  .lightbox-image {
    max-height: calc(100vh - 220px);
  }

  .lightbox-nav {
    width: 44px;
    /* height: 44px; */
  }

  .lightbox-prev {
    left: 8px;
  }

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