.item-img {
  position: relative;
}

.button-video {
  position: absolute;
  right: 8px;
  bottom: 26px;
  z-index: 100;
}

img.lightbox-thumbnail {
  width: 40px;
}

.button-video::before {
  content: '作り方動画';
  font-weight: bold;
  vertical-align: -50%;
  margin-right: 5px;
}
.fff::before {
  color: #fff;
}

.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 {
  overflow: hidden;
  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 video {
  width: 100%;
  /* 動画をレスポンシブ化 */
}

.lightbox-close {
  position: absolute;
  top: 15px;
  right: 25px;
  color: #fff;
  font-size: 40px;
  text-decoration: none;
  line-height: 1;
  z-index: 1001;
  /* 画像より手前に表示 */
}

.lightbox-close:hover {
  color: #ccc;
}

/* オーバーレイクリックで閉じるための設定 (HTMLのa href="#_") */
.lightbox-overlay .lightbox-close-area {
  /* オーバーレイ全体をクリックで閉じるための要素を別途用意する場合 */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999;
}

@media (max-width: 768px) {
  .lightbox-content {
    width: 95%;
    /* 画面幅に合わせてコンテンツ幅を調整 */
    max-height: 95vh;
    /* 縦方向の表示領域も考慮 */
  }

  .lightbox-close {
    font-size: 30px;
    top: 10px;
    right: 15px;
  }
}
