.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  /* display: flex; */
  align-items: center;   /* 縦中央 */
  justify-content: center; /* 横中央 */
  z-index: 1050;
}
.modal.active {
  display: flex;
}
.modal:target {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 背景 */
.modal-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  z-index: 1;
}

/* モーダル本体 */
.modal-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  width: 50%;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* 閉じるボタン */
.modal-close {
  position: absolute;
  top: 0;
  right:20px;
  color: #fff;
  font-size: 2em;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  z-index: 1100;
}

/* レスポンシブ動画 */
.video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 16:9 アスペクト比 */
}
.video-wrapper.portrait {
  padding-top: 167.5%; /* 1280x2144 の比率 ≒ 1:1.675 */
}

.video-wrapper.landscape {
  padding-top: 56.25%; /* 16:9 比率 (9 / 16 * 100) */
}

.video-wrapper video {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* サムネイル（お好みで） */
a[data-modal] img {
  cursor: pointer;
  border-radius: 8px;
  transition: opacity 0.3s;
}

a[data-modal] img:hover {
  opacity: 0.8;
}
