/*
Theme Name: Clinic Simple
Theme URI: https://example.com/
Author: You
Author URI: https://example.com/
Description: クリニック（医療機関）向けのシンプルで更新しやすいWordPressテーマ。1カラム、カスタマイザー対応、電話/予約CTA、OGP/SEOの基礎対応。
Version: 1.0.0
Text Domain: clinic-simple
*/

/* 基本リセット */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: #2b2b2b;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Arial, "Noto Sans JP", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  line-height: 1.7;
  background: #fff;
}

/* カラー変数（青×白ベース） */
:root {
  --color-primary: #1677cc;  /* 基調色（変更したい時はカスタマイザーの色設定と合わせて変更） */
  --color-primary-weak: #e8f2fb;
  --color-text: #222;
  --color-muted: #666;
  --color-border: #e5e7eb;
  --color-bg: #ffffff;
  --color-footer: #0a1f33;
  --max-content: 1080px;
}

/* ユーティリティ */
.container {
  width: 92%;
  max-width: var(--max-content);
  margin: 0 auto;
}
.section {
  padding: 56px 0;
}
.section-title {
  position: relative;
  font-size: 22px;
  margin: 0 0 20px;
  color: #0d2540;
  text-align: center; /* 中央寄せ */
  padding: 12px 0; /* 背景帯とのバランス */
  z-index: 1;
}
.section-title::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100vw; /* 画面幅いっぱい */
  height: 10px; /* 細い帯 */
  background: var(--color-primary-weak); /* 青系の帯 */
  z-index: -1;
}
.lead {
  color: var(--color-muted);
  margin: 8px 0 24px;
  text-align: center; /* 見出し直下の説明は中央寄せ */
}

/* ボタン */
.btn {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: transform .05s ease, box-shadow .2s ease, background .2s ease;
  box-shadow: 0 2px 8px rgba(22, 119, 204, .25);
}
.btn:hover {
  background: #0f66b2;
}
.btn-outline {
  background: #fff;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  box-shadow: none;
}

/* ヘッダー */
.site-header {
  border-bottom: 1px solid var(--color-border);
  background: #fff;
  position: sticky; /* スクロール時も上部に残る */
  top: 0;
  z-index: 100;
}
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--color-text);
}
.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
}
.brand-name {
  font-size: 18px;
  font-weight: 700;
}
.header-cta {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-phone {
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
}
.header-access {
  white-space: nowrap;
}

/* ナビゲーション */
.navbar {
  border-top: 1px solid var(--color-border);
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 0; /* 文字は非表示（アクセシビリティはボタンテキストで担保） */
  padding: 12px 0;
  width: 44px;
  height: 36px;
  position: relative;
  cursor: pointer;
  margin-left: auto; /* 右寄せ */
}
.nav-toggle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 2px;
  background: #0d2540;
  transform: translate(-50%, -10px);
  box-shadow: 0 8px 0 #0d2540, 0 16px 0 #0d2540; /* 3本線 */
}
.menu {
  display: flex;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 10px 0;
}
.menu a {
  color: #0d2540;
  text-decoration: none;
  font-weight: 600;
  padding: 10px 4px;
}
.menu a:hover {
  color: var(--color-primary);
}

/* ヒーロー */
.hero {
  position: relative;
  background: #eaf4ff; /* フォールバック */
  overflow: hidden;
}
.hero-inner {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: flex-end; /* 下寄せ */
  padding: 18vh 0 8vh; /* 下1/3あたりに配置 */
}
.hero-copy h1 {
  font-size: 28px;
  margin: 0 0 8px;
  color: #0d2540;
}
.hero-copy p {
  margin: 0 0 16px;
  color: var(--color-muted);
}
.hero-visual {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover; /* 画面いっぱい */
  filter: saturate(1) contrast(1.05);
}
.glass {
  background: rgba(255,255,255,.38);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,.12);
  padding: 20px;
}

/* カードグリッド */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.card {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.card img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  margin-bottom: 10px;
}
.card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  color: #0d2540;
}
.card p {
  margin: 0 0 10px;
  color: var(--color-muted);
  font-size: 14px;
}

/* 表示用の簡易テーブル（自由入力HTMLを想定） */
.table-like {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}
.table-like th,
.table-like td {
  border: 1px solid var(--color-border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

/* ギャラリー */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.gallery-item {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.gallery-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}
.gallery-item .caption {
  font-size: 13px;
  color: var(--color-muted);
  padding: 8px 10px 12px;
  text-align: center; /* キャプション中央 */
}

/* ニュース一覧 */
.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.news-list li {
  border-bottom: 1px solid var(--color-border);
  padding: 12px 0;
}
.news-meta {
  color: var(--color-muted);
  font-size: 13px;
}

/* フッター */
.site-footer {
  background: var(--color-footer);
  color: #e6eef6;
  margin-top: 40px;
}
.footer-inner {
  padding: 28px 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr;
  gap: 24px;
}
.footer-title {
  font-size: 18px;
  margin: 0 0 8px;
}
.footer-table {
  width: 100%;
  border-collapse: collapse;
}
.footer-table th,
.footer-table td {
  border-bottom: 1px dashed rgba(255,255,255,.15);
  color: #d5e2ee;
  padding: 8px 0;
  text-align: left;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 12px 0;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-links a {
  color: #a9c7e1;
  margin-left: 12px;
  text-decoration: none;
}
.footer-links a:hover {
  color: #fff;
}

/* スマホ固定フッターCTA（電話・予約） */
.mobile-cta {
  display: none; /* モバイルでのみ表示（下のメディアクエリ） */
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #fff;
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 20px rgba(0,0,0,.06);
  z-index: 200;
}
.mobile-cta .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 10px 0;
}
.mobile-cta a {
  text-align: center;
  padding: 12px 8px;
  border-radius: 10px;
  font-weight: 700;
}
.mobile-cta .tel {
  background: #0f66b2;
  color: #fff;
}
.mobile-cta .reserve {
  background: #0db36c;
  color: #fff;
}

/* 記事/ページ */
.post-header {
  margin: 10px 0 16px;
}
.post-header h1 {
  margin: 0 0 8px;
  font-size: 26px;
  color: #0d2540;
}
.post-meta {
  color: var(--color-muted);
  font-size: 13px;
}
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
.wp-block-image img {
  border-radius: 8px;
}

/* レスポンシブ */
@media (max-width: 980px) {
  .hero-inner { min-height: 360px; padding: 12vh 0 6vh; }
  .info-heading, .info-list { width: 86%; }
  .grid-diseases { width: 86%; }
  .firsttime .grid-firsttime { width: 86%; }
  .grid-firsttime { grid-template-columns: repeat(2, 1fr); }
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .grid-firsttime { grid-template-columns: 1fr; }
  /* 病気の説明：1列・全幅 */
  .grid-diseases { grid-template-columns: 1fr; width: 100%; }
  /* 予防接種・健診：1列・全幅 */
  .grid-vaccines { grid-template-columns: 1fr; width: 100%; }
  /* 初めての方へ：全幅 */
  .firsttime .grid-firsttime { width: 100%; }
  /* 院長挨拶：テキスト→画像の縦並び、マスク無効 */
  .director-text { width: 100%; }
  .director-intro-inner { min-height: 0; }
  .director-photo {
    position: static;
    transform: none;
    width: 100%;
    max-width: 100%;
    margin-top: 12px;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .menu {
    display: none; /* ハンバーガーで切替 */
    flex-direction: column;
    padding: 10px 0 16px;
  }
  .menu.is-open {
    display: flex;
  }
  .nav-toggle {
    display: block;
  }
  .header-cta {
    display: none; /* 上部は簡素化。電話はモバイル固定CTAで常時表示 */
  }
  .mobile-cta {
    display: block;
  }
  .hero-inner {
    min-height: 0;
  }
  .hero-visual {
    min-height: 200px;
  }
}

/* アクセシビリティ補助 */
.screen-reader-text {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px,1px,1px,1px);
  white-space: nowrap;
}

/* --- インフォメーション --- */
.info-heading {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  width: 60%;
  margin-left: auto;
  margin-right: auto;
}
.info-heading > span {
  display: block;
  width: 100%;
  background: var(--color-primary); /* 全面青 */
  color: #fff; /* 白文字 */
  padding: 14px 18px; /* 縦も少し大きく */
  border-radius: 12px;
  font-weight: 700;
  text-align: center;
}
.info-list {
  display: grid;
  gap: 14px;
  width: 60%;
  margin: 12px auto 0;
}
.info-item-title {
  margin: 0 0 6px;
  font-size: 16px;
  color: #0d2540;
}
.info-item-text { margin: 0; color: var(--color-muted); }

/* --- 病気の説明（2x2） --- */
.grid-diseases {
  grid-template-columns: repeat(2, 1fr);
  width: 50%; /* 画面幅の約50% */
  margin: 0 auto; /* 中央寄せ */
}
.card-disease {
  text-align: center;
  background: #CFE1EE; /* 薄い青（指定色） */
  border: none;
  min-height: 240px; /* サイズ揃え */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; /* 上部固定 */
  padding-top: 16px;
}
.card-disease img { margin-left: auto; margin-right: auto; }

/* --- 予防接種・健診（3列） --- */
.grid-vaccines {
  grid-template-columns: repeat(3, 1fr);
  width: 80%; /* 画面幅の約80% */
  margin: 0 auto;
}
.card-vaccine { text-align: center; }
.grid-vaccines .card img {
  width: 90%;
  height: auto;
  border-radius: 12px;
  display: block;
  margin: 0 auto 10px;
}

/* --- 初めての方へ（3列） --- */
.grid-firsttime { grid-template-columns: repeat(3, 1fr); }
.firsttime .grid-firsttime { width: 80%; margin: 0 auto; }
.firsttime-card {
  min-height: 140px; /* 横長感 */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.firsttime-card img {
  width: 100%;
  height: 160px; /* 高さを揃えてズレ防止 */
  border-radius: 12px;
  display: block;
  margin: 0 0 10px;
  object-fit: cover; /* 画像比率の違いを吸収 */
}

/* --- 院内紹介：院長挨拶レイアウト --- */
.director-intro {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}
.director-intro-inner {
  position: relative;
  width: 80vw; /* 中央80%程度 */
  max-width: var(--max-content);
  min-height: 260px;
}
.director-text {
  position: relative;
  width: 60%; /* 左60%をテキスト */
  z-index: 2;
}
.director-text h3 { margin-top: 0; }
.director-photo {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 72%; /* 現状の約2倍に拡大 */
  height: auto;
  object-fit: contain;
  z-index: 1;
  /* 中央付近(50%)は90%不透明 → 左端(0%)で0%不透明へ滑らかに遷移 */
  -webkit-mask-image: linear-gradient(to right,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,0.1) 10%,
    rgba(0,0,0,0.2) 20%,
    rgba(0,0,0,0.3) 30%,
    rgba(0,0,0,0.4) 40%,
    rgba(0,0,0,0.7) 46%,
    rgba(0,0,0,0.8) 48%,
    rgba(0,0,0,0.9) 50%,
    rgba(0,0,0,1) 60%,
    rgba(0,0,0,1) 100%
  );
  mask-image: linear-gradient(to right,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,0.1) 10%,
    rgba(0,0,0,0.2) 20%,
    rgba(0,0,0,0.3) 30%,
    rgba(0,0,0,0.4) 40%,
    rgba(0,0,0,0.7) 46%,
    rgba(0,0,0,0.8) 48%,
    rgba(0,0,0,0.9) 50%,
    rgba(0,0,0,1) 60%,
    rgba(0,0,0,1) 100%
  );
}
.director-shade {
  display: none; /* 画像側でマスク処理するため重ねの白グラデは不要 */
}

/* 院長挨拶のテキスト：スマートな段落化（改行は段落間で反映） */
.director-text p { white-space: normal; margin: 0 0 1em; }

/* クリニック情報（表＋地図の2カラム） */
.clinic-info-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 20px;
  align-items: start;
}
.clinic-info-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.clinic-info-table th,
.clinic-info-table td {
  border: 1px solid var(--color-border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
.clinic-map iframe {
  width: 100%;
  height: 360px;
  border: 0;
}

@media (max-width: 980px) {
  .clinic-info-grid { grid-template-columns: 1fr; }
  .clinic-map iframe { height: 300px; }
}

/* 最終優先のスマホ用上書き（病気の説明） */
@media (max-width: 720px) {
  .grid-diseases { grid-template-columns: 1fr !important; width: 100% !important; }
  .grid-vaccines  { grid-template-columns: 1fr !important; width: 100% !important; }
  .grid-firsttime { grid-template-columns: 1fr !important; width: 100% !important; }
  .firsttime .grid-firsttime { width: 100% !important; }
  /* ヒーロー（アイキャッチ）: ぼかしを下部に限定し、h1とCTAのみ */
  .hero-inner { position: relative; min-height: 300px !important; padding: 0 !important; align-items: stretch; }
  .hero-visual { min-height: 300px !important; }
  .hero-copy { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px; }
  .hero-copy p { display: none; } /* サブテキスト非表示（h1とCTAのみ残す） */
  .hero-copy h1 { margin-bottom: 10px; }
  /* インフォメーション幅をモバイルで全幅に */
  .info-heading, .info-list { width: 100% !important; }
}

/* ヒーロー（スマホ最終上書き）：下部25vhにガラス、h1小さめ、CTA中央 */
@media (max-width: 720px) {
  .hero-inner { min-height: 60vh !important; }
  .hero-visual { min-height: 60vh !important; }
  .hero-copy {
    height: 25vh !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  .hero-copy h1 { font-size: 20px !important; line-height: 1.3; }
  .hero-copy .btn { margin-top: 6px; }
}

/* 院長挨拶（スマホ最終上書き）：テキスト→画像、全幅、マスク無効 */
@media (max-width: 720px) {
  .director-intro-inner { min-height: 0 !important; }
  .director-text { width: 100% !important; position: static; }
  .director-photo {
    position: static !important;
    right: auto; top: auto;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 12px !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
  }
  .director-shade { display: none !important; }
}
