/* ============================================================
   記事ページ ポップアップ（Web集客コンサル導線）／めぐみや版
   - 30秒経過 または 50%スクロールで表示（先に来た方）
   - 閉じる：×／背景クリック／ESC
   - 閉じた後24時間は再表示しない
   流用元: 村上経営 popup-banner.css（レイアウト踏襲・紺×赤×游明朝に再設計）
============================================================ */

/* === オーバーレイ（モーダル背景） === */
.meg-popup-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(20, 31, 52, 0.62);
  z-index: 99999;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility .35s ease;
}
.meg-popup-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* === モーダル本体ラッパ === */
.meg-popup-modal {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: auto;
  transform: translateY(16px) scale(.98);
  transition: transform .35s ease;
}
.meg-popup-overlay.is-open .meg-popup-modal {
  transform: translateY(0) scale(1);
}
.meg-popup-modal:focus { outline: none; }

/* === 閉じる × ボタン === */
.meg-popup-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #304b72;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
  z-index: 5;
  transition: transform .2s ease, background .2s ease;
}
.meg-popup-close:hover { background: #f2f2f2; transform: scale(1.06); }
.meg-popup-close:focus-visible { outline: 2px solid #d35352; outline-offset: 2px; }

/* === 表示中は背景スクロール固定 === */
body.meg-popup-open { overflow: hidden; }

/* === ポップアップ本体（紺地＋白二重枠＋四隅コーナー） === */
.meg-popup {
  position: relative;
  background: #304b72;
  padding: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  max-width: 600px;
  margin: 0 auto;
  font-family: 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
}
.meg-popup::before {
  content: '';
  position: absolute;
  top: 8px; left: 8px; right: 8px; bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  pointer-events: none;
}
.meg-popup::after {
  content: '';
  position: absolute;
  top: 4px; left: 4px; right: 4px; bottom: 4px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  pointer-events: none;
}
.meg-popup .corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: #d35352;
  border-style: solid;
  z-index: 2;
}
.meg-popup .corner.tl { top: 4px; left: 4px; border-width: 2px 0 0 2px; }
.meg-popup .corner.tr { top: 4px; right: 4px; border-width: 2px 2px 0 0; }
.meg-popup .corner.bl { bottom: 4px; left: 4px; border-width: 0 0 2px 2px; }
.meg-popup .corner.br { bottom: 4px; right: 4px; border-width: 0 2px 2px 0; }

/* === 内側 白ボックス === */
.meg-popup__inner {
  background: #fff;
  padding: 34px 28px 28px;
  position: relative;
  text-align: center;
  font-family: "游明朝体", "YuMincho", "游明朝", "Yu Mincho", 'Noto Serif JP', "ヒラギノ明朝 ProN W3", serif;
}
.meg-popup__badge {
  display: inline-block;
  padding: 7px 22px;
  margin: 0 0 22px;
  background: #304b72;
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.16em;
  font-weight: 700;
  word-break: keep-all;
  font-family: 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
}
.meg-popup__headline {
  font-size: 23px;
  line-height: 1.6;
  color: #304b72;
  font-weight: 700;
  margin: 0 0 16px;
  letter-spacing: 0.02em;
}
.meg-popup__headline .accent { color: #d35352; }
.meg-popup__subtext {
  font-size: 14px;
  line-height: 1.9;
  color: #555;
  margin: 0 0 22px;
  font-family: 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
}
.meg-popup__subtext strong {
  color: #304b72;
  font-weight: 700;
}
.meg-popup__checklist {
  text-align: left;
  list-style: none;
  padding: 16px 18px;
  margin: 0 0 24px;
  background: #f3f6fb;
  border-radius: 6px;
  border: 1px solid #e1ebf6;
  font-family: 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
}
.meg-popup__checklist li {
  font-size: 13.5px;
  line-height: 1.55;
  color: #304b72;
  font-weight: 700;
  margin-bottom: 12px;
  padding-left: 28px;
  position: relative;
}
.meg-popup__checklist li:last-child { margin-bottom: 0; }
.meg-popup__checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1px;
  width: 20px;
  height: 20px;
  background: #304b72;
  border-radius: 50%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 12px;
}
.meg-popup__cta {
  display: inline-block;
  padding: 16px 38px;
  background: #d35352;
  color: #fff !important;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none !important;
  border-radius: 3px;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 14px rgba(211, 83, 82, 0.3);
  transition: all .3s;
  font-family: 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
}
.meg-popup__cta:hover {
  background: #c34342;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(211, 83, 82, 0.4);
}
.meg-popup__note {
  font-size: 11px;
  color: #888;
  margin: 18px 0 0;
  line-height: 1.6;
  font-family: 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
}
.meg-popup__note-strong {
  color: #d35352;
  font-weight: 700;
}

/* === スマホ === */
@media (max-width: 600px) {
  .meg-popup-overlay { padding: 16px; }
  .meg-popup-close { top: 6px; right: 6px; width: 32px; height: 32px; font-size: 22px; }
  .meg-popup { padding: 14px; }
  .meg-popup__inner { padding: 28px 16px 22px; }
  .meg-popup__headline { font-size: 18px; }
  .meg-popup__subtext { font-size: 13px; }
  .meg-popup__checklist { padding: 14px 14px; }
  .meg-popup__checklist li { font-size: 12px; padding-left: 24px; }
  .meg-popup__checklist li::before { width: 18px; height: 18px; background-size: 11px; }
  .meg-popup__cta { font-size: 14px; padding: 14px 22px; }
}

/* === モーション抑制設定を尊重 === */
@media (prefers-reduced-motion: reduce) {
  .meg-popup-overlay,
  .meg-popup-modal { transition: none; }
  .meg-popup-modal { transform: none; }
}
