/* ============================================================
   宮平医院 — 共通スタイル
   白基調・高コントラスト・大きめの文字で読みやすさを優先する
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* 面 */
  --bg: #ffffff;
  --bg-subtle: #f4f7f9;
  --surface: #ffffff;
  --border: #dde5ea;
  --border-strong: #c4d1da;

  /* 文字 */
  --text: #16323f;
  --text-muted: #5b7180;

  /* ブランド（落ち着いた青緑） */
  --brand: #0e7490;
  --brand-dark: #0a5871;
  --brand-soft: #e9f4f7;

  /* 小児科らしい差し色（控えめに使う） */
  --accent: #c2701a;
  --accent-soft: #fdf4e8;

  /* 状態 */
  --open: #16745a;
  --open-soft: #e7f3ef;
  --closed: #a8443a;
  --closed-soft: #fbefed;

  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(22, 50, 63, 0.06);
  --font: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Yu Gothic', sans-serif;
  --wrap: 860px;
}

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-subtle);
  color: var(--text);
  line-height: 1.85;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  display: block;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  color: var(--brand);
}

.brand-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.brand-dept {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

/* ---------- ナビゲーション ---------- */
.site-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.nav-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 0.75rem;
  display: flex;
  gap: 0.25rem;
  white-space: nowrap;
}

.nav-link {
  display: inline-block;
  padding: 0.7rem 0.9rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.nav-link:hover {
  color: var(--brand);
}

.nav-link[aria-current='page'] {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* ---------- ページ本体 ---------- */
.page {
  flex: 1;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}

.section {
  margin-bottom: 2.25rem;
}

.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 0.9rem;
  padding-left: 0.7rem;
  border-left: 4px solid var(--brand);
  line-height: 1.5;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.page-lead {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.75rem;
}

/* ---------- カード ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card + .card {
  margin-top: 1rem;
}

/* ---------- 待ち人数（トップのヒーロー） ---------- */
.wait-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  text-align: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.status-pill.is-open {
  background: var(--open-soft);
  color: var(--open);
}

.status-pill.is-closed {
  background: var(--closed-soft);
  color: var(--closed);
}

.status-pill::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.wait-label {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 1.1rem;
}

.wait-count {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.35rem;
  margin: 0.2rem 0 0.4rem;
}

.wait-number {
  font-size: 5rem;
  font-weight: 700;
  line-height: 1.05;
  color: var(--brand);
  font-feature-settings: 'tnum';
  transition: transform 0.25s ease;
}

.wait-number.bump {
  transform: scale(1.08);
}

.wait-unit {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-muted);
}

.wait-message {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.wait-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.conn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d0a020;
  display: inline-block;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.conn-dot.connected {
  background: var(--open);
}

.conn-dot.disconnected {
  background: var(--closed);
}

/* 受付終了時の表示 */
.wait-closed-note {
  padding: 1rem 0 0.25rem;
}

.wait-closed-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 0.4rem;
}

.wait-closed-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ---------- 告知バナー ---------- */
.notice-banner {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: var(--accent-soft);
  border: 1px solid #f0dcc0;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
}

.notice-banner svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--accent);
  margin-top: 0.28rem;
}

.notice-banner p {
  font-size: 0.95rem;
  font-weight: 700;
  color: #7a4a12;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- 診療時間テーブル ---------- */
.hours-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* 月〜日の7列がスマホでも横スクロールなしで収まるように詰めている。
   それでも入らない極端に狭い画面向けに .hours-table-wrap が横スクロールを担保する。 */
.hours-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.hours-table th,
.hours-table td {
  padding: 0.65rem 0.1rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hours-table thead th {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-subtle);
}

.hours-table thead th:first-child {
  text-align: left;
  padding-left: 0.35rem;
  font-size: 0.78rem;
}

.hours-table tbody th {
  text-align: left;
  padding-left: 0.35rem;
  padding-right: 0.4rem;
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--text);
  white-space: nowrap;
}

.hours-table .yes {
  color: var(--brand);
  font-weight: 700;
}

.hours-table .no {
  color: #9aa9b3;
}

.hours-table .sun {
  color: var(--closed);
}

.hours-table tbody tr:last-child th,
.hours-table tbody tr:last-child td {
  border-bottom: none;
}

.hours-note {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.hours-note strong {
  color: var(--text);
  font-weight: 700;
}

.hours-fever {
  margin-top: 0.6rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.75;
}

/* ---------- リンクカード ---------- */
.link-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.link-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, transform 0.15s;
}

.link-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
}

.link-card-icon {
  /* span は既定でインラインのため、幅・高さを効かせるのに display 指定が必要 */
  display: block;
  width: 30px;
  height: 30px;
  color: var(--brand);
  margin-bottom: 0.5rem;
}

.link-card-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.link-card-title {
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.link-card-desc {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ---------- お知らせ一覧 ---------- */
.news-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.news-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
}

.news-item.is-pinned {
  border-left: 4px solid var(--accent);
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}

.news-date {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-feature-settings: 'tnum';
}

.tag {
  display: inline-block;
  padding: 0.12rem 0.55rem;
  border-radius: 4px;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.tag.tag-closure {
  background: var(--closed-soft);
  color: var(--closed);
}

.tag.tag-vaccine {
  background: var(--open-soft);
  color: var(--open);
}

.tag.tag-checkup {
  background: var(--accent-soft);
  color: var(--accent);
}

.tag-pin {
  background: var(--accent);
  color: #fff;
}

.news-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 0.3rem;
}

.news-body {
  font-size: 0.93rem;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.empty-state {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 2.5rem 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.93rem;
}

/* ---------- 情報リスト（予防接種・健診） ---------- */
.info-list {
  list-style: none;
}

.info-row {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.5rem 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.info-row:last-child {
  border-bottom: none;
}

.info-row dt {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.pending {
  display: inline-block;
  background: var(--accent-soft);
  color: #7a4a12;
  border: 1px solid #f0dcc0;
  border-radius: 6px;
  padding: 0.15rem 0.6rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.callout {
  background: var(--brand-soft);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  font-size: 0.92rem;
  color: var(--brand-dark);
  margin-top: 1rem;
}

.callout strong {
  font-weight: 700;
}

.card-intro {
  font-size: 0.98rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.card-intro strong {
  font-weight: 700;
  color: var(--brand-dark);
}

/* ---------- 料金表 ---------- */
.price-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* 横幅いっぱいに広げると項目名と金額が離れて対応が読み取りにくくなるため、
   広い画面では最大幅で止める（スマホでは 100% が効く） */
.price-table {
  width: 100%;
  max-width: 480px;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.price-table th,
.price-table td {
  padding: 0.7rem 0.3rem;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}

.price-table thead th {
  background: var(--bg-subtle);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
}

.price-table thead th:first-child,
.price-table tbody th {
  text-align: left;
  padding-left: 0.4rem;
}

.price-table tbody th {
  font-weight: 700;
  white-space: normal;
  line-height: 1.5;
}

.price-sub {
  display: block;
  font-size: 0.76rem;
  font-weight: 400;
  color: var(--text-muted);
}

.price-table .pay {
  font-weight: 700;
  color: var(--brand-dark);
  font-size: 1rem;
  padding-right: 0.4rem;
}

.price-table tbody tr:last-child th,
.price-table tbody tr:last-child td {
  border-bottom: none;
}

.free-badge {
  display: inline-block;
  background: var(--open-soft);
  color: var(--open);
  border-radius: 6px;
  padding: 0.15rem 0.7rem;
  font-size: 1.05rem;
  font-weight: 700;
}

/* ---------- 検診の一覧 ---------- */
.checkup-list {
  list-style: none;
}

.checkup-list li {
  position: relative;
  padding: 0.65rem 0 0.65rem 1.6rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.98rem;
  font-weight: 700;
}

.checkup-list li:last-child {
  border-bottom: none;
}

.checkup-list li::before {
  content: '';
  position: absolute;
  left: 0.25rem;
  top: 1.25rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}

/* 検診リストの直後に詳細が続く場合の区切り */
.checkup-list + .info-list {
  margin-top: 0.9rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
}

.hours-note a {
  color: var(--brand);
  font-weight: 700;
}

.tel-block {
  margin-top: 1.1rem;
}

/* ---------- 医院情報 ---------- */
.clinic-info dt {
  white-space: nowrap;
}

.tel-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.tel-link svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

/* ---------- 院長紹介 ---------- */
.doctor-role {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.doctor-name {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.4;
  margin-top: 0.1rem;
}

.doctor-kana {
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  margin-top: 0.1rem;
}

.doctor-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.doctor-tags li {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border-radius: 999px;
  padding: 0.25rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 700;
}

/* ---------- PRバナー ---------- */
.pr-banner {
  display: block;
  line-height: 0;
}

.pr-banner img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- 外部サイトへのリンク ---------- */
.ext-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.ext-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
}

.ext-link:hover {
  text-decoration: underline;
}

.ext-link svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.tel-note {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0;
}

.subhead {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.highlight {
  font-weight: 700;
  color: var(--brand-dark);
  font-size: 1.05rem;
}

.prose p + p {
  margin-top: 0.85rem;
}

.prose ul {
  margin: 0.6rem 0 0 1.2rem;
}

.prose li {
  margin-bottom: 0.3rem;
  font-size: 0.95rem;
}

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-dark);
}

.btn-outline {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.btn-row {
  display: flex;
  justify-content: center;
  margin-top: 1.1rem;
}

/* ---------- フッター ---------- */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1.75rem 1.25rem 2.25rem;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-name {
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.footer-inner p a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.footer-links a {
  color: var(--brand);
  text-decoration: none;
  font-size: 0.85rem;
}

.footer-links a:hover {
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

/* ---------- レスポンシブ ---------- */
@media (max-width: 560px) {
  html {
    font-size: 16px;
  }

  .page {
    padding: 1.25rem 1rem 2.5rem;
  }

  .card,
  .wait-card {
    padding: 1.25rem 1.1rem;
  }

  .wait-number {
    font-size: 4.2rem;
  }

  .link-grid {
    grid-template-columns: 1fr;
  }

  .info-row {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .brand-name {
    font-size: 1.1rem;
  }
}

@media (min-width: 768px) {
  .wait-number {
    font-size: 6rem;
  }
}
