/* movie-gallery-modal.css */

:root { --modal-gap: 16px; }

.gallery-modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.7);
    display: none;                 /* JSでdisplay:flexにする */
    justify-content: center;
    align-items: center;
    z-index: 10000;

    /* 画面の四辺に必ず隙間（safe-area対応） */
    padding:
      max(var(--modal-gap), env(safe-area-inset-top))
      max(var(--modal-gap), env(safe-area-inset-right))
      max(var(--modal-gap), env(safe-area-inset-bottom))
      max(var(--modal-gap), env(safe-area-inset-left));
    box-sizing: border-box;
}

.gallery-modal .modal-content {
    background: #fff;
    padding: 56px 20px 20px;       /* レビューと同一 */
    border-radius: 8px;
    max-width: 600px;
    width: min(600px, 92vw);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    position: relative;

    /* 横向きでも内側スクロール可能に */
    max-height: calc(100dvh - (var(--modal-gap) * 2));
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

/* 閉じるボタン（レビュー投稿フォームと同じ） */
.gallery-close-modal {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 15px;
  background-color: transparent;
  color: #333;
  border: none;
  cursor: pointer;
  font-size: 16px;
  transition: color 0.3s ease;
  z-index: 1000;
}
.gallery-close-modal:hover { color: #007BFF; }

/* 投稿ボタン */
#movie-gallery-form input[type="submit"] {
  padding: 10px 20px;
  background-color: #6bcB77;
  color: #000;
  font-weight: bold;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}
#movie-gallery-form input[type="submit"]:hover {
  background-color: #000;
  color: #fff;
}

/* 「関連映画」フィールドを完全に隠す */
.gallery-modal #movie-gallery-form .acf-field-683dfcce9f0fc {
  display: none !important;
}
