/* style_click_zoom_effect.css */

.cutin-face-image {
  transition: transform 0.4s ease, z-index 0.3s ease;
  transform-style: preserve-3d;
  cursor: pointer;
  z-index: var(--z-character);
  pointer-events: auto;
  transform-origin: center center;
  position: relative;
}

/* 拡大表示用モーダルエリア */
#cutinModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: var(--z-overlay);
  overflow-y: auto; /* スクロール可能にする */
}

/* 拡大画像の表示 */
#cutinModalImage {
  max-width: 80vw;
  max-height: 80vh;
  transform: scale(1.1);
  transition: transform 0.3s ease;
  border-radius: 12px;
  box-shadow: 0 0 40px rgba(255, 100, 100, 0.6);
  cursor: pointer;
}

/* 表示時の拡大 */
#cutinModal.show {
  display: flex;
}

#cutinModal.show #cutinModalImage {
  transform: scale(1);
}

/* レスポンシブ対応：モーダル表示中の画面幅変更に対応 */
@media (max-width: 1400px) {
  #cutinModal {
    /* モバイル幅でのモーダル調整 */
    padding: 20px;
    box-sizing: border-box;
    flex-direction: column; /* モバイルでは縦並び */
    justify-content: flex-start;
    align-items: center;
    overflow-y: auto; /* モーダル内でスクロール可能 */
  }
  
  #cutinModalImage {
    max-width: 90vw;
    max-height: 50vh; /* 高さを少し制限 */
    width: auto;
    height: auto;
    object-fit: contain;
    margin-bottom: 20px;
  }
  
  #cutinModalText {
    max-width: 90vw;
    max-height: 40vh;
    overflow-y: auto;
    padding: 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    color: #333;
    line-height: 1.6;
    margin-bottom: 20px;
  }
  
  /* モーダル表示中でもbodyスクロールを有効化 */
  body.modal-open {
    overflow: auto !important;
    position: static !important;
    height: auto !important;
  }
}

/* モーダル表示中のbodyスクロール制御を改善 */
@media (min-width: 1401px) {
  body.modal-open {
    overflow: hidden; /* デスクトップでは背景スクロール無効 */
  }
}
