@charset "utf-8";
/* --- マスターアップ画像モーダルのスタイル --- */

/* htmlとbodyの高さを確保 */
html {
  height: 100%;
  min-height: 100%;
}

body {
  min-height: 100%;
}

/* モーダル表示時のbodyスタイル */
body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

.modal-overlay {
  /* 画面全体を覆う設定 */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  min-height: -webkit-fill-available; /* iOSサファリ対応 */
  background-color: rgba(255, 255, 255, 0.75); /* 半透明の白背景 */
  z-index: 9999; /* 最前面に表示 */
  cursor: pointer;

  /* 中央揃えのための設定 */
  display: none; /* JavaScriptで 'flex' に変更して表示 */
  justify-content: center;
  align-items: center;
  
  /* モバイルブラウザのアドレスバー対応 */
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* モーダルが表示されている状態 */
.modal-overlay.active {
  display: flex;
}

.modal-content {
  position: relative;
  text-align: center;
  max-width: 90%; /* 画面幅の90%を最大幅に */
  max-height: 90vh; /* 画面の高さの90%を最大高に */
  cursor: default;
  z-index: 10000;
}

.modal-content img {
  max-width: 100%;
  max-height: 90vh; /* コンテンツの高さに合わせて調整 */
}

.modal-close-btn {
  position: absolute;
  top: -10px;
  right: 0px;
  font-size: 40px;
  color: white;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  text-shadow: 0 0 5px black; /* 文字を見やすくするための影 */
  z-index: 10001;
}

/* モバイル対応の追加スタイル */
@media screen and (max-width: 767px) {
  .modal-content {
    max-width: 95%;
    max-height: 85vh;
  }
  
  .modal-content img {
    max-height: 85vh;
  }
}
