.lightbox-overlay {
  /* 初期状態では非表示 */
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s, visibility 0.3s; /* フェードイン・アウトのアニメーション */

  /* オーバーレイの基本スタイル */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8); /* 半透明の背景 */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* :target擬似クラスで表示状態を切り替える */
.lightbox-overlay:target {
  visibility: visible;
  opacity: 1;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  overflow: auto; /* 画像がはみ出す場合にスクロール */
  background: #fff;
  padding: 10px;
  border-radius: 5px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  transform: scale(0.8); /* ポップアップ時の初期サイズ */
  transition: transform 0.3s ease-out;
}

.lightbox-overlay:target .lightbox-content {
  transform: scale(1); /* ポップアップ時に元のサイズに */
}

.lightbox-content img {
  display: block; /* 余白をなくす */
  max-width: 100%;
  height: auto;
}

.lightbox-close{
  position: absolute;
  top: 15px;
  right: 25px;
  color: #fff;
  font-size: 40px;
  text-decoration: none;
  line-height: 1;
  z-index: 1001; /* 画像より手前に表示 */
}

.lightbox-close:link{
  color: #ccc;
}

.lightbox-close:hover{
  color: #ccc;
}

.lightbox-close:visited{
  color: #ccc;
}





/* オーバーレイクリックで閉じるための設定 (HTMLのa href="#_") */
.lightbox-overlay .lightbox-close-area {
  /* オーバーレイ全体をクリックで閉じるための要素を別途用意する場合 */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999;
}