/* /wp-content/themes/deer_child/assets/css/movie-review-modal.css */

/* 共通 */
:root { --modal-gap: 16px; }

/* オーバーレイ本体（ページ内に1つだけ） */
.movie-review-modal {
  position: fixed;
  inset: 0;
  display: none;            /* JSで表示 */
  justify-content: center;  /* 中央寄せ */
  align-items: center;
  background: rgba(0,0,0,.7);
  z-index: 999999;
  /* 画面の四辺に必ず隙間（安全域も考慮） */
  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;
}


/* モーダルの中身 */
.movie-review-modal .review-modal-content {
  position: relative;
  background: #fff;
  width: min(680px, 92vw);
  /* 100dvhベースで高さ制御（スマホのアドレスバー伸縮対応） */
  max-height: calc(100dvh - (var(--modal-gap) * 2));
  overflow-y: auto;         /* 縦スクロール */
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  /* 上は「閉じる」ボタン分の余白を確保 */
  padding: 56px 20px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,.3);
  box-sizing: border-box;
}

/* 閉じるボタン */
.movie-close-review-modal {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 15px;
  background: transparent;
  color: #333;
  border: none;
  cursor: pointer;
  font-size: 16px;
  transition: color .2s ease;
  z-index: 1;
}
.movie-close-review-modal:hover { color: #007BFF; }

/* タイトル（映画名のみ表示） */
.movie-review-modal .movie-modal-title {
  font-weight: 600;
  font-size: clamp(14px, 4.2vw, 18px); /* 画面が狭いほど小さく */
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 48px 8px 0; /* 右上の閉じるぶん + 下マージン */
}

/* 「対象のレビュー」ACF行を隠す（値はPHPで自動セット） */
#movie-review-form .acf-field-6849f19b12c95 { display: none !important; }

/* 星評価の行 微調整 */
.movie-review-modal #movie-review-form .acf-field[data-name="rating"] {
  padding-top: 8px;
  padding-bottom: 8px;
}
.movie-review-modal #movie-review-form .acf-field[data-name="rating"] .acf-label {
  margin-bottom: 4px;
}
.movie-review-modal #movie-review-form .acf-field[data-name="rating"] .acf-label label {
  margin: 0 0 4px 0;
  line-height: 1.2;
}
.movie-review-modal #movie-review-form .acf-field[data-name="rating"] .acf-input {
  display: flex;
  align-items: center;
  gap: .4rem;
  line-height: 1;
  min-height: 50px;   /* 擬似要素が大きい環境でも切れないよう余裕 */
  overflow: visible;
}
/* 星UIの元selectは非表示（星UIのみ見せる） */
.movie-review-modal .acf-field[data-key="field_682b5686f9c0c"] .acf-input select,
.movie-review-modal .acf-field[data-name="rating"] .acf-input select {
  display: none !important;
}

/* 必須エラー（フロントJSが挿入） */
.movie-field-error {
  color: #e53935;
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
}

/* 送信ボタン（button / input / ACFボタンの全部に効かせる） */
#movie-review-submit,
#movie-review-form input[type="submit"],
#movie-review-form .acf-button.button.button-primary.button-large {
  padding: 10px 20px;
  background-color: #6bcb77;
  color: #000;
  font-weight: bold;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color .3s ease, color .3s ease;
}
#movie-review-submit:hover,
#movie-review-form input[type="submit"]:hover,
#movie-review-form .acf-button.button.button-primary.button-large:hover {
  background-color: #000;
  color: #fff;
}
