@charset "UTF-8";

/* =========================================================
   MODAL SYSTEM 1
   checkbox modal
========================================================= */

.modal .modal-overlay {
  position: fixed;
  inset: 0;
  z-index: -100;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background-color: rgba(0, 0, 0, 0.7);
  transition: all 0.3s ease;
}

.modal .modal-overlay .close {
  position: absolute;
  top: 5px;
  right: 15px;
  width: 30px;
  font-size: 40px;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  color: #282c34;
  cursor: pointer;
}

.modal .modal-overlay .close:hover {
  color: #f00;
}

.modal .o-close {
  position: fixed;
  inset: 0;
  z-index: -100;
}

.modal input:checked ~ .modal-overlay {
  z-index: 99;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  overflow: auto;
  display: flex;
  animation: fade-in .5s ease;
}

.modal input:checked ~ .modal-overlay .modal-wrap {
  z-index: 100;
  transform: translateY(0);
}

.modal-wrap iframe {
  display: block;
  width: 100%;
  height: 650px;
  border: none;
}

/* =========================================================
   EVENT.HTML ONLY MODAL SYSTEM（パソコン用・通常表示）
========================================================= */

/* ① イベントページの時だけモーダルを画面の85%のサイズで中央に配置 */
.events-page #modal-content {
  width: 90% !important;
  max-width: 1000px !important;
  height: 85vh !important;
  max-height: 85vh !important;
  padding: 10px !important;
  border-radius: 8px !important;
  overflow: auto !important;
}

/* PDFを包む専用のコンテナ（PC用） */
.events-page .pdf-scroll-container {
  width: 100%;
  height: 100%;
  overflow: auto;
}

/* モーダルの中にあるPDFを枠いっぱいに広げる */
.events-page .pdf-scroll-container iframe,
.events-page .pdf-scroll-container object,
.events-page .pdf-scroll-container embed {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
}

/* =========================================================
   FACILITY MODAL
========================================================= */

#modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  z-index: 10000;
}

#modal-content {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(850px, 90vw);
  height: 90vh;
  max-height: 90vh;
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  box-sizing: border-box;
  overflow: visible;
  z-index: 10001;
}

#modal-content .modal-prev,
#modal-content .modal-next {
  opacity: 0.5 !important;
  transition: opacity 0.2s ease;
}

#modal-content .modal-prev:hover,
#modal-content .modal-next:hover {
  opacity: 1 !important;
}

/* =========================================================
   MODAL SLIDER
========================================================= */

.modal-slider-mask {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  border-radius: 6px;
}

#modal-slider-container {
  display: flex;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  will-change: transform;
}

.modal-slide-page {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  height: 100%;
  flex-shrink: 0;
  box-sizing: border-box;
}

/* =========================================================
   MODAL STRUCTURE
========================================================= */

.modal-main {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  position: relative;
}

.modal-upper-section {
  display: flex;
  width: 100%;
  height: 70%;
  margin-bottom: 20px;
}

.main-photo-area {
  width: 76%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.main-photo-area img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.thumb-photo-area {
  width: 160px;
  height: 100%;
  margin-left: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.thumb-click {
  width: 100%;
  aspect-ratio: 16 / 9;
  flex: 1 1 0;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid transparent;
  box-sizing: border-box;
}

.thumb-click:hover {
  border-color: #00a1e9;
}

.modal-thumb-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* =========================================================
   MODAL LOWER SECTION
========================================================= */

.modal-lower-section {
  display: flex;
  width: calc(76% + 160px + 15px);
  align-self: flex-start;
  height: calc(30% - 20px);
  background: #eee;
}

.modal-title-box {
  width: 25%;
  padding: 0 10px;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.modal-title-box h4 {
  width: 80%;
  margin: 0;
  padding-bottom: 5px;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
  color: #333;
  border-bottom: 2px solid #00a1e9;
}

.modal-title-box p {
  margin: 5px 0 0;
  font-size: 11px;
  text-align: center;
  color: #666;
}

.modal-equipment-box {
  width: 75%;
  padding: 15px 25px;
  overflow-y: auto;
  box-sizing: border-box;
}

.modal-equipment-box ul {
  margin: 0;
  padding-left: 20px;
}

.modal-equipment-box li {
  margin-bottom: 5px;
  font-size: 13px;
  line-height: 1.4;
}

.modal-equipment-box p {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: #666;
}

/* =========================================================
   MODAL NAVIGATION（戻る・進むボタン：枠内配置＆大型化）
========================================================= */

#modal-content .modal-prev,
#modal-content .modal-next {
  position: absolute;
  top: 35%;                 /* 上下の中央付近に配置 */
  width: 50px;              /* ★ボタン全体の横幅を 35px から 50px に拡大 */
  height: 50px;             /* ★ボタン全体の縦幅を 35px から 50px に拡大 */
  cursor: pointer;
  z-index: 10005;           /* 最前面に表示 */
  opacity: 0.6;             /* 初期状態の薄さを少し濃くして見やすく */
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* マウスを乗せた（ホバー）ときの動き */
#modal-content .modal-prev:hover,
#modal-content .modal-next:hover {
  opacity: 1 !important;
  transform: scale(1.1);    /* ホバー時に少し大きくしてクリック感を出す */
}

/* ★ここが重要：配置位置を「マイナス」から「プラス」に変えて白い枠の内側に入れます */
#modal-content .modal-prev {
  left: 3px;               /* ★枠の左端から 5px 内側に配置 */
}

#modal-content .modal-next {
  right: 3px;              /* ★枠の右端から 5px 内側に配置 */
}

/* 中の矢印画像（prev.png / next.png）をボタンいっぱいに大きく広げる */
.modal-prev img,
.modal-next img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;      /* 矢印の縦横比を崩さずに拡大 */
}

#modal-close {
  position: absolute;
  top: 5px;
  right: 15px;
  font-size: 26px;
  font-weight: bold;
  color: #999;
  cursor: pointer;
  z-index: 300;
}

#modal-close:hover {
  color: #333;
}

/* =========================================================
   ANIMATION
========================================================= */

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* =========================================================
   STATIC MODAL CONTENT
========================================================= */

.modal-content {
  display: none;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media screen and (max-width: 768px) {
  #modal-content {
    width: 95% !important;
    height: auto !important;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 20px 15px 15px;
  }

  .modal-main {
    height: auto;
    min-height: 100%;
  }

  .modal-upper-section {
    flex-direction: column;
    height: auto;
    margin-bottom: 10px;
  }

  .main-photo-area {
    width: 100%;
    height: 280px;
  }

  .thumb-photo-area {
    width: 100%;
    height: auto;
    margin-left: 0;
    margin-top: 10px;
    flex-direction: row;
    gap: 8px;
  }

  .thumb-click {
    width: calc((100% - 16px) / 3);
    height: 90px;
    aspect-ratio: auto;
    flex: none;
  }

  .modal-lower-section {
    flex-direction: column;
    width: 100%;
    align-self: stretch;
    height: auto;
    flex-shrink: 0;
  }

  .modal-title-box,
  .modal-equipment-box {
    width: 100%;
  }

  .modal-title-box {
    padding: 12px 10px;
  }

  .modal-equipment-box {
    padding: 12px 15px;
    overflow-y: visible;
  }
}
