/* ==========================================================================
   Lightbox
   single-works.php の Gallery / Concept 画像クリックで全画面表示
   ========================================================================== */

/* トリガー（figure 内に置く button）の見た目を画像と同等に */
/* height: 100% は、Gallery で figure が grid stretch されたとき
   button が高さ追従できず左下に空白が出るのを防ぐため */
.hd-lb-trigger {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  position: relative;
  overflow: hidden;
}

.hd-lb-trigger img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.hd-lb-trigger:hover img,
.hd-lb-trigger:focus-visible img {
  transform: scale(1.03);
}

.hd-lb-trigger:focus-visible {
  outline: 3px solid #4a90d9;
  outline-offset: 2px;
}

/* オーバーレイ本体 */
.hd-lb {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.hd-lb.is-open {
  display: flex;
}

body.hd-lb-locked {
  overflow: hidden;
}

.hd-lb__stage {
  margin: 0;
  max-width: min(100%, 1400px);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.hd-lb__img {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.hd-lb__caption {
  color: #fff;
  font-size: 0.875rem;
  text-align: center;
  max-width: 100%;
  margin: 0;
  padding: 0 16px;
}

/* 閉じるボタン */
.hd-lb__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}

.hd-lb__close:hover,
.hd-lb__close:focus-visible {
  background: rgba(255, 255, 255, 0.25);
  outline: none;
}

/* 前後ナビ */
.hd-lb__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}

.hd-lb__nav:hover,
.hd-lb__nav:focus-visible {
  background: rgba(255, 255, 255, 0.25);
  outline: none;
}

.hd-lb__nav--prev { left: 16px; }
.hd-lb__nav--next { right: 16px; }

@media (max-width: 600px) {
  .hd-lb { padding: 12px; }
  .hd-lb__close {
    top: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
    font-size: 24px;
  }
  .hd-lb__nav {
    width: 44px;
    height: 44px;
    font-size: 28px;
  }
  .hd-lb__nav--prev { left: 4px; }
  .hd-lb__nav--next { right: 4px; }
  .hd-lb__img { max-height: calc(100vh - 100px); }
}
