/* スイッチを隠す */
.modal-switch {
  display: none;
}

/* モーダル外枠（初期状態：透明でクリック不可） */
.modal-overlay {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
  /* ふわっとさせる */
}

/* スイッチON時の動き */
.modal-switch:checked+.modal-open-btn+.modal-overlay {
  opacity: 1;
  visibility: visible;
}

/* 背景の暗幕 */
.modal-overlay-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  /* 暗さの調整 */
  cursor: pointer;
}

/* 白い箱のアニメーション */
.modal-body {
  position: relative;
  background: #ffffff;
  width: 85%;
  max-width: 450px;
  padding: 40px 25px;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  transform: translateY(30px);
  /* 最初は少し下に下げておく */
  transition: transform 0.4s ease;
}

/* スイッチON時に箱がスッと上がる */
.modal-switch:checked+.modal-open-btn+.modal-overlay .modal-body {
  transform: translateY(0);
}

/* ×ボタンのデザイン */
.modal-close-icon {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 32px;
  color: #999;
  cursor: pointer;
  z-index: 5;
}

.modal-close-icon:hover {
  color: #333;
}

/* コンテンツ内クリックで閉じるための透明カバー */
.modal-inner-closer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

/* 開くボタンの装飾（お好みで） */
.modal-open-btn {
  display: inline-block;
  background-color: #21759b;
  /* WPメインカラー風 */
  color: #fff;
  padding: 12px 24px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
}

.modal-open-btn:hover {
  background-color: #d54e21;
}

/* 既存のボタンデザインを継承するための調整 */
.modal-open-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  /* 必要に応じて元の <a> タグと同じスタイルをここに追加 */
}

.modal-open-label img {
  margin-right: 8px; /* アイコンと文字の間隔 */
}

/* モーダル表示中のスクロール禁止（CSSのみでは限界がありますが、一応の対策） */
body:has(.modal-switch:checked) {
  overflow: hidden;
}