/* ==========================
   ModalBox 基本レイアウト
   ========================== */

#mb-container {
  position: fixed;
  inset: 0;
  z-index: 9999999;
  display: none;        /* JSで制御 */
  align-items: center;
  justify-content: center;
  text-align: left;
  font-family: "HelveticaNeue-Light","Helvetica Neue",Helvetica,Arial,sans-serif;
}

/* オーバーレイ */
#mb-overlay {
  position: absolute;
  inset: 0;
  /* ★ ページごとに変えたいなら init の overlayColor / overlayBackgroundImage か
       ここをCSSで上書き */
  background-color: rgba(0, 0, 0, 0.8);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

/* コンテンツラッパー */
#mb-wrapper {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  margin: 0 auto;
  z-index: 1;
}

/* 実際の中身（画像/iframe） */
#mb-content {
  position: relative;
  background: #000;
  border-radius: 4px;
  overflow: hidden;
}

/* 中身のスクロール領域（iOS対応） */
#mb-content-inner {
  position: relative;
  max-height: 90vh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* 表示される画像 */
#mb-content-inner img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* 表示される YouTube などの iframe */
#mb-content-inner iframe {
  display: block;
  border: 0;
  margin: 0 auto;   /* 中央寄せ */
}

/* ローディング表示 */
#mb-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

#mb-loading span {
  display: inline-block;
  width: 80px;
  height: 80px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  /* ★ ローディング画像は init の loadingImage か、ここを上書き */
  background-image: url("../images/shadowbox/loading.svg");
  font-size: 0;
}

/* クローズボタン */
#mb-close {
  position: fixed;   /* 画面右上固定 */
  /* ★ 位置・サイズは init で変えられる */
  top: 3px;
  right: 3px;
  width: 68px;
  height: 68px;
  cursor: pointer;
  z-index: 10000000;
  background-repeat: no-repeat;
  background-size: cover;
  background-image: url("../images/shadowbox/close.png");
}

/* ホバー時 */
#mb-close:hover {
  background-image: url("../images/shadowbox/close_on.png");
}

/* スマホ向けサイズ調整 */
@media screen and (max-width: 480px) {
  #mb-close {
    width: 40px;
    height: 40px;
  }
  #mb-content-inner iframe {
    width: 95vw;
    height: calc(95vw * 9 / 16);
  }
}
