/* ベース */
* { box-sizing: border-box; }
body {
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  margin: 0;
  color: #333;
  line-height: 1.7;
  background: #fafafa;
}
.container {
  padding: 40px 20px;
  max-width: 900px;
  margin: 0 auto;
}
h2 {
  border-left: 5px solid #0066cc;
  padding-left: 10px;
  margin-bottom: 20px;
}

/* ヒーロー：高さ固定、余白は背景色 */
.hero {
  position: relative;
  width: 100%;
  height: 320px;              /* ← 固定高さ。必要なら数値だけ調整 */
  background: var(--page-bg); /* 横余白はこの色で表示 */
  overflow: hidden;
}

/* 画像：高さにフィット、幅は自動。中央配置。縦は絶対に切れない */
.hero img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%); /* 中央寄せ */
  height: 100%;    /* 高さをヒーローに合わせる */
  width: auto;     /* 比率維持、横は自動で余白発生 */
  max-width: none; /* ブラウザのデフォ制約を無効化 */
  background: var(--page-bg); /* 画像の外側も背景と同化 */
  opacity: 0;
  animation: fade 14s infinite ease-in-out; /* 7秒切替×2 */
}
.hero img:nth-child(2) { animation-delay: 7s; }
.hero img:nth-child(2) {
  animation-delay: 7s; /* 2枚目は7秒遅らせて交互表示 */
}

/* 0-50%: フェードイン→表示 → 50-100%: フェードアウト */
@keyframes fade {
  0%   { opacity: 0; }
  7%   { opacity: 1; }
  43%  { opacity: 1; }  /* 約7秒表示 */
  50%  { opacity: 0; }
  100% { opacity: 0; }
}

/* Googleマップ */
.map { text-align: center; }
.map iframe {
  width: 100%;
  max-width: 800px;
  height: 400px;
  border: 0;
}

/* フッター */
footer {
  text-align: center;
  padding: 20px;
  background: #0066cc;
  color: #fff;
}
/* 診療案内の見出し（任意で少し小さめ） */
.subheading { margin: 8px 0 14px; font-size: 1.25rem; }

/* アクセシビリティ用（画面には非表示） */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* 表全体のラッパー：スマホは横スクロール可 */
.table-wrap {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
  overflow-x: auto;
}

/* 診療時間テーブル */
.clinic-hours {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;                 /* 狭い画面では横スクロール */
  font-variant-numeric: tabular-nums;
}
.clinic-hours thead th {
  background: #f3f6fb;
  color: #1f3b5b;
  font-weight: 700;
  text-align: center;
  padding: 14px 10px;
  border-bottom: 1px solid #e2e8f0;
}
.clinic-hours tbody th {
  text-align: left;
  font-weight: 600;
  background: #f9fafb;
  padding: 12px 12px;
  border-bottom: 1px solid #eef2f7;
  white-space: nowrap;
}
.clinic-hours td {
  text-align: center;
  padding: 12px 8px;
  border-bottom: 1px solid #eef2f7;
  font-size: 1.05rem;
}

/* ステータス色 */
.clinic-hours td.open   { background: #e9f7f0; color: #146c43; font-weight: 700; }
.clinic-hours td.closed { background: #f8e9e9; color: #8b2c2c; font-weight: 700; }
/* ---- 色の共通変数（セル/凡例で共有） ---- */
:root{
  --open-bg:   #e9f7f0;
  --open-fg:   #146c43;
  --closed-bg: #f8e9e9;
  --closed-fg: #8b2c2c;
  --cell-bd:   #eef2f7;
}

/* 診療時間テーブル（既存の open/closed 定義を変数で書き換え） */
.clinic-hours td.open   { background: var(--open-bg);   color: var(--open-fg);   font-weight: 700; }
.clinic-hours td.closed { background: var(--closed-bg); color: var(--closed-fg); font-weight: 700; }

/* ---- 凡例（セル風スウォッチ） ---- */
.legend{
  display: flex; gap: 20px;
  list-style: none; padding: 10px 0 0; margin: 8px 0 0;
  color: #4b5563; align-items: center;
}
.legend li{ display: flex; align-items: center; gap: 8px; }
.legend .swatch{
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.6em; height: 2.0em;
  border: 1px solid var(--cell-bd);
  border-radius: 6px;
  font-weight: 700; line-height: 1;
}
.legend .swatch.open   { background: var(--open-bg);   color: var(--open-fg); }
.legend .swatch.closed { background: var(--closed-bg); color: var(--closed-fg); }

.notes { margin: 14px 0 0; color: #555; font-size: 0.95rem; }

/* 小さめ画面で余白最適化 */
@media (max-width: 600px) {
  .clinic-hours thead th,
  .clinic-hours tbody th,
  .clinic-hours td { padding: 10px 8px; }
}
/* ========== 医療DXお知らせボックス ========== */
:root{
  --dx-green: #2f7d32;     /* 文字の緑 */
  --dx-green-bg: #eaf6ec;  /* 見出しの淡い緑 */
  --dx-border: #dfe3e8;    /* 外枠のグレー */
}

.notice-dx{
  background: #fff;
  border: 2px solid var(--dx-border);
  border-radius: 10px;
  padding: 16px 18px 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

/* タイトル：中央・緑系 */
.notice-dx__title{
  margin: 0 0 14px;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--dx-green);
  background: var(--dx-green-bg);
  border: 1px solid #cfe6d2;
  border-radius: 6px;
  padding: 8px 10px;
}

/* 番号付き本文（緑の数字） */
.notice-dx__list{
  list-style: none;
  padding: 0;
  margin: 10px 0 6px;
  counter-reset: dx;
}
.notice-dx__list > li{
  counter-increment: dx;
  position: relative;
  padding-left: 2.2em;
  margin: 0.35em 0;
  line-height: 1.8;
}
.notice-dx__list > li::before{
  content: counter(dx) ".";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--dx-green);
  font-weight: 800;
}

/* 下部の「■〜」行（見た目を揃える） */
.notice-dx__mark{
  position: relative;
  padding-left: 1.5em;
  margin: 0.4em 0;
  line-height: 1.8;
}
.notice-dx__mark::before{
  content: "■";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--dx-green);
  font-weight: 800;
}

/* リンクの色（緑系＋下線） */
.notice-dx a{
  color: var(--dx-green);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* スマホ微調整 */
@media (max-width: 600px){
  .notice-dx{ padding: 14px; }
  .notice-dx__title{ font-size: 1.05rem; }
}
