/* ライトボックス（LP・Works詳細共通） */
.lightbox-overlay {
  --lightbox-top-space-base: 40px;
  --lightbox-short-top-extra: 0px;
  --lightbox-top-space: calc(var(--lightbox-top-space-base) + var(--lightbox-short-top-extra));
  --lightbox-side-padding: 40px;
  --lightbox-counter-bottom: 24px;
  --lightbox-counter-height: 14px;
  --lightbox-stack-gap: 12px;
  --lightbox-zoom-size: 44px;
  --lightbox-controls-space: calc(
    var(--lightbox-counter-bottom) +
    var(--lightbox-counter-height) +
    var(--lightbox-stack-gap) +
    var(--lightbox-zoom-size) +
    var(--lightbox-stack-gap)
  );
  --lightbox-meta-space: 64px;
  --lightbox-meta-gap: 20px;
  --lightbox-img-max: calc(
    100vh -
    var(--lightbox-top-space-base) -
    var(--lightbox-controls-space) -
    var(--lightbox-meta-space) -
    var(--lightbox-meta-gap)
  );
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  align-items: center;
  flex-direction: column;
  justify-content: flex-start;
  padding: var(--lightbox-top-space) var(--lightbox-side-padding) var(--lightbox-controls-space);
  cursor: pointer;
}
.lightbox-overlay.active { display: flex; cursor: pointer; }
.lightbox-overlay.is-short-image {
  --lightbox-short-top-extra: calc(var(--lightbox-top-space-base) * 4);
}
.lightbox-inner {
  position: relative;
  cursor: default;
  width: min(90vw, 1200px);
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}
.lightbox-img-viewport {
  overflow: hidden;
  width: 100%;
  flex: 0 1 auto;
  max-height: var(--lightbox-img-max);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-img-viewport:not(.is-natural) {
  width: auto;
  height: auto;
  max-width: 100%;
}
.lightbox-img-viewport.is-natural {
  display: block;
  width: 100%;
  height: var(--lightbox-img-max);
  max-height: var(--lightbox-img-max);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  cursor: grab;
}
.lightbox-img-viewport.is-natural.is-dragging {
  cursor: grabbing;
  user-select: none;
}
.lightbox-inner img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: var(--lightbox-img-max);
  height: auto;
  border-radius: var(--r-md);
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}
.lightbox-inner img.is-natural {
  max-width: none;
  max-height: none;
  margin: 0 auto;
  cursor: inherit;
}
.lightbox-meta {
  flex: 0 0 auto;
  width: 100%;
  margin-top: var(--lightbox-meta-gap);
  text-align: center;
  pointer-events: none;
}
.lightbox-title {
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.04em;
  margin: 0 0 4px;
  line-height: 1.5;
}
.lightbox-scope {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.5;
}
.lightbox-scope.is-empty {
  display: none;
}
.lightbox-scope-label {
  margin-right: 0.35em;
}
.lightbox-close {
  position: fixed;
  top: 24px;
  right: 32px;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--r-circle);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10000;
}
.lightbox-close:hover { background: rgba(255,255,255,0.25); }
.lightbox-video-wrap {
  display: none;
  width: min(90vw, 1200px);
  max-width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--r-md);
  flex: 0 0 auto;
}
.lightbox-video-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--r-circle);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10000;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.25); }
.lightbox-nav-icon {
  display: inline-block;
  line-height: 1;
}
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }
.lightbox-counter {
  position: fixed;
  bottom: var(--lightbox-counter-bottom);
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.5);
}
.lightbox-zoom-tools {
  position: fixed;
  bottom: calc(var(--lightbox-counter-bottom) + var(--lightbox-counter-height) + var(--lightbox-stack-gap));
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 10px;
  z-index: 10001;
}
.lightbox-zoom-btn {
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--r-circle);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  padding: 0;
  line-height: 1;
}
.lightbox-zoom-btn:hover { background: rgba(255,255,255,0.25); }

@media (min-width: 769px) {
  .lightbox-overlay {
    --lightbox-controls-space: calc(
      var(--lightbox-counter-bottom) +
      var(--lightbox-counter-height) +
      var(--lightbox-stack-gap)
    );
  }
  .lightbox-overlay.is-short-image .lightbox-inner img:not(.is-natural) {
    cursor: default;
  }
  .lightbox-inner img:not(.is-natural) {
    cursor: zoom-in;
  }
  .lightbox-inner img.is-natural {
    cursor: zoom-out;
  }
  .lightbox-meta {
    margin-top: 24px;
  }
  .lightbox-title {
    margin-bottom: 10px;
  }
  .lightbox-scope {
    line-height: 1.85;
  }
}

@media (max-width: 768px) {
  .lightbox-overlay {
    --lightbox-top-space-base: 40px;
    --lightbox-side-padding: 20px;
    --lightbox-stack-gap: 10px;
    --lightbox-meta-space: 56px;
    --lightbox-meta-gap: 14px;
    --lightbox-controls-space: calc(
      var(--lightbox-counter-bottom) +
      var(--lightbox-counter-height) +
      var(--lightbox-stack-gap)
    );
    --lightbox-img-max: calc(
      100vh -
      var(--lightbox-top-space-base) -
      var(--lightbox-controls-space) -
      var(--lightbox-meta-space) -
      var(--lightbox-meta-gap) -
      64px
    );
  }
  .lightbox-overlay.is-short-image {
    --lightbox-short-top-extra: calc(var(--lightbox-top-space-base) * 4);
  }
  .lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  .lightbox-prev { left: 12px; }
  .lightbox-next { right: 12px; }
  .lightbox-overlay.is-image-mode .lightbox-zoom-tools { display: none; }

  .lightbox-overlay.is-banner-expanded {
    --lightbox-short-top-extra: 0;
    --lightbox-top-space-base: 48px;
    --lightbox-top-space: var(--lightbox-top-space-base);
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 8px;
    justify-content: center;
    touch-action: none;
  }
  .lightbox-overlay.is-banner-expanded .lightbox-meta,
  .lightbox-overlay.is-banner-expanded .lightbox-counter,
  .lightbox-overlay.is-banner-expanded .lightbox-nav {
    display: none !important;
  }
  .lightbox-overlay.is-banner-expanded .lightbox-inner {
    width: 100%;
    flex: 1;
    min-height: 0;
    justify-content: center;
  }
  .lightbox-overlay.is-banner-expanded .lightbox-img-viewport {
    flex: 1;
    width: 100%;
    max-height: none;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .lightbox-overlay.is-banner-expanded .lightbox-inner img {
    max-width: none;
    max-height: none;
    transform-origin: center center;
    cursor: default;
  }
}
