/* =========================================================
   緊急情報モーダル  emergency-modal.css
   - CSSのみで動作（JS不要）
   - 初期状態＝開いた状態。×ボタン／背景クリックで閉じる
   - クラス／ID接頭辞: emg-
   ========================================================= */

/* 背景オーバーレイ（初期表示＝開いている） */
.emg-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  background: rgba(0, 0, 0, .55);
  -webkit-overflow-scrolling: touch;
}

/* 「閉じる」用の隠しチェックボックス */
.emg-toggle { display: none; }

/* チェックされたらオーバーレイごと消す */
.emg-toggle:checked ~ .emg-overlay { display: none; }

/* 背景クリックで閉じるための全面ラベル */
.emg-backdrop {
  position: absolute;
  inset: 0;
  cursor: pointer;
}

/* モーダル本体 */
.emg-modal {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  margin: auto 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
  border-top: 6px solid #c8102e; /* 緊急を示す差し色 */
  overflow: hidden;
}

/* ヘッダー帯 */
.emg-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 56px 14px 20px;
  background: #fff5f5;
  border-bottom: 1px solid #f0d6d6;
}
.emg-badge {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: #fff;
  background: #c8102e;
  padding: 3px 10px;
  border-radius: 999px;
}
.emg-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
  font-weight: 700;
  color: #222;
}

/* 閉じる×ボタン（ラベル） */
.emg-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  color: #555;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 50%;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.emg-close:hover { background: #c8102e; color: #fff; border-color: #c8102e; }
/* キーボードでフォーカスした時にわかるように */
.emg-close:focus,
.emg-close:focus-within,
.emg-close:focus-visible { outline: 3px solid #c8102e; outline-offset: 2px; }

/* 本文エリア（ご指定の divbox） */
.emg-body {
  padding: 20px;
  font-size: 15px;
  line-height: 1.75;
  color: #333;
}
.emg-lead { margin: 0 0 6px; }
.emg-note { margin: 0 0 18px; color: #555; font-size: 14px; }

/* 小見出し */
.emg-subhead {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: #c8102e;
  border-left: 4px solid #c8102e;
  padding-left: 8px;
}

/* 受付時間テーブル（2列） */
.emg-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 18px;
  font-size: 14px;
}
.emg-table th,
.emg-table td {
  border: 1px solid #ddd;
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}
.emg-table thead th {
  background: #f4f4f4;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}
.emg-table tbody th {
  background: #fafafa;
  font-weight: 700;
  white-space: nowrap;
}

/* 夜間診療時間ブロック */
.emg-hours {
  margin: 0 0 20px;
  padding: 12px 14px;
  background: #fff5f5;
  border: 1px dashed #e3b9b9;
  border-radius: 6px;
}
.emg-hours .emg-subhead { margin-bottom: 4px; }
.emg-hours p { margin: 0; font-weight: 700; }

/* 詳しくはこちらリンク */
.emg-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: #c8102e;
  text-decoration: none;
  border-radius: 6px;
  transition: opacity .15s;
}
.emg-link:hover { opacity: .85; }

/* スマホ調整 */
@media (max-width: 480px) {
  .emg-title { font-size: 15px; }
  .emg-head { padding: 12px 50px 12px 14px; }
  .emg-body { padding: 16px 14px; }
  .emg-table { font-size: 13px; }
  .emg-table th, .emg-table td { padding: 7px 6px; }
}

/* アクセシビリティ：モーション抑制設定の尊重 */
@media (prefers-reduced-motion: reduce) {
  .emg-close { transition: none; }
}
