/* ============================================================
   川田クリニック オンライン診療LP
   配色・タイポグラフィは kawataclinic-brand スキルに準拠（2026-08-02 移行）
   旧配色（テック系ダークティール）は各変数のコメントに併記。
   ============================================================ */

:root {
  /* --- ブランドカラー（kawataclinic-brand） --- */
  --navy: #1F4E79;          /* メイン。旧: #0D252D */
  --navy-deep: #163A5B;     /* ヘッダー/フッターの締め。旧: #081A20 */
  --navy-light: #5B8FB9;    /* メイン淡 */
  --accent: #3DA47C;        /* アクセント（信頼）。旧: #66D9B7 */
  --cta: #2A7D5C;           /* CTA背面。--accent を WCAG AA(白文字5.0:1)まで暗くした値 */
  --cta-hover: #31936C;
  --green-on-dark: #6FD3AC; /* 濃紺背景上のアクセント文字（対 --navy 4.7:1） */
  --signal: #C9462C;        /* 警告・注釈。旧: #F08A5D */
  --signal-bg: #FDF3F1;
  --mist: #F4F7FA;          /* 背景（淡） */
  --ink: #1A1A1A;           /* 本文テキスト */
  --white: #FFFFFF;
  --muted: #5A6470;         /* 補助テキスト（対白 6.0:1） */
  --on-dark: #DCE7F0;       /* 濃紺背景上の本文（対 --navy 6.8:1） */
  --line: #D7DDE3;          /* ボーダー */
  --page: min(100% - 2rem, 72rem);
  --radius-sm: .5rem;
  --shadow: 0 1.5rem 4rem rgba(12, 34, 56, .16);

  /* --- タイポグラフィ（kawataclinic-brand）---
     Noto Sans JP / Noto Serif JP を第一候補にしつつ、Webフォント配信はしない。
     日本語Webフォントは数百KB〜数MBでLCPを確実に悪化させるため、
     ブランド定義のフォールバック（Hiragino / Yu Gothic / Yu Mincho）で代替する。 */
  --font-sans: "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, -apple-system, sans-serif;
  --font-serif: "Hiragino Mincho ProN", "Noto Serif JP", "Yu Mincho", YuMincho, "Hiragino Mincho Pro", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-family: var(--font-sans);
  /* 高齢患者配慮：本文17px、広い画面では18px（kawataclinic-brand レイアウト原則） */
  font-size: 1.0625rem;
  line-height: 1.85;
  overflow-x: clip;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: .2rem solid var(--navy);
  outline-offset: .2rem;
}

.site-header :focus-visible,
.hero :focus-visible,
.section--ink :focus-visible,
.final-cta :focus-visible,
footer :focus-visible,
.mobile-booking-bar :focus-visible {
  outline-color: var(--green-on-dark);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: .5rem;
  left: .5rem;
  transform: translateY(-200%);
  padding: .75rem 1rem;
  background: var(--white);
  color: var(--ink);
}

.skip-link:focus {
  transform: none;
}

/* ---------- 緊急症状ストリップ ---------- */

.emergency-strip {
  display: flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  padding: .55rem max(1rem, calc((100% - 72rem) / 2));
  border-block: 1px solid var(--signal);
  background: var(--signal-bg);
  color: #7A2A16;
  font-size: .9rem;
  line-height: 1.6;
}

.emergency-strip p {
  margin: 0;
}

.emergency-strip strong {
  color: #9A2F16;
}

.emergency-strip a {
  margin-left: .5rem;
  font-weight: 700;
  text-underline-offset: .2em;
  white-space: nowrap;
}

/* ---------- 共通セクション ---------- */

.section {
  width: var(--page);
  margin-inline: auto;
  padding-block: 4.5rem;
}

.section-label {
  margin: 0 0 .75rem;
  color: var(--navy);
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .16em;
}

.section-label--signal {
  color: var(--signal);
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  line-height: 1.35;
  letter-spacing: -.01em;
  /* 末尾に1文字だけ残る折り返しを避ける（未対応ブラウザでは無視される） */
  text-wrap: balance;
}

/* 見出し内で固有名詞が分断されるのを防ぐ */
.nw {
  white-space: nowrap;
}

h2 {
  /* ch は半角基準で日本語見出しには狭すぎる（22ch≒11文字）。em で1行17文字前後に */
  max-width: 17em;
  margin: 0 0 1.25rem;
  font-size: clamp(1.75rem, 5vw, 2.75rem);
}

h3 {
  margin: .75rem 0 .6rem;
  font-size: 1.2rem;
}

p {
  margin-block: 0 1em;
}

.section-lead {
  max-width: 52rem;
  margin-bottom: 2rem;
}

.section-note {
  max-width: 52rem;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.75;
}

.section-note small {
  font-size: 1em;
}

/* ---------- ボタン ---------- */

.button {
  display: inline-flex;
  min-height: 3.5rem;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  border-radius: var(--radius-sm);
  padding: .9rem 1.4rem;
  color: var(--white);
  background: var(--cta);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 .5rem 1.5rem rgba(42, 125, 92, .25);
  transition: transform .2s ease, background-color .2s ease;
}

.button:hover {
  transform: translateY(-.1rem);
  background: var(--cta-hover);
}

.button--ghost {
  color: var(--white);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .55);
  box-shadow: none;
}

.button--ghost:hover {
  background: rgba(255, 255, 255, .12);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 3rem;
  color: var(--navy);
  font-weight: 700;
  text-underline-offset: .3em;
}

/* ---------- ヘッダー（電話・診療時間を常時表示） ---------- */

.site-header {
  display: flex;
  width: 100%;
  min-height: 4.75rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.25rem;
  padding: .75rem max(1rem, calc((100% - 72rem) / 2));
  color: var(--white);
  background: var(--navy);
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.5rem;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50% 50% 50% .5rem;
  color: var(--navy);
  background: var(--green-on-dark);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
}

.brand-name {
  display: grid;
  line-height: 1.3;
}

.brand small {
  color: #B9CEE2;
  font-size: .8125rem;
  font-weight: 400;
}

.header-contact {
  display: none;
  line-height: 1.35;
}

.header-tel {
  display: grid;
  text-decoration: none;
}

.header-tel-label {
  color: #B9CEE2;
  font-size: .75rem;
}

.header-tel-number {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: .01em;
}

.header-hours {
  margin: .15rem 0 0;
  color: #B9CEE2;
  font-size: .78125rem;
}

.header-hours a {
  color: var(--green-on-dark);
  text-underline-offset: .2em;
}

.button--compact {
  display: none;
  min-height: 2.75rem;
  padding: .65rem 1rem;
  font-size: .875rem;
}

/* ---------- ヒーロー ---------- */

.hero {
  display: grid;
  grid-template-areas: "intro" "visual" "details";
  color: var(--white);
  background:
    radial-gradient(circle at 82% 16%, rgba(111, 211, 172, .16), transparent 26rem),
    var(--navy);
}

.hero-intro {
  grid-area: intro;
  padding: 3rem 1rem 1.75rem;
}

.hero-details {
  grid-area: details;
  padding: 2rem 1rem 3rem;
}

.eyebrow {
  color: #B9CEE2;
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .08em;
}

.eyebrow span {
  margin-right: .65rem;
  color: var(--green-on-dark);
}

.hero h1 {
  max-width: 18ch;
  margin: 1rem 0 0;
  font-size: clamp(1.875rem, 7.4vw, 3rem);
  line-height: 1.4;
}

.hero h1 em {
  color: var(--green-on-dark);
  font-style: normal;
  /* 「オンライン／診療」と語中で割れるのを防ぐ */
  white-space: nowrap;
}

.hero-lead {
  max-width: 34rem;
  margin-bottom: 1.75rem;
  color: var(--on-dark);
  font-size: 1.03125rem;
}

.hero-actions,
.final-actions {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
  margin: 1.5rem 0 0;
  padding: 0;
  color: var(--on-dark);
  font-size: .875rem;
  list-style: none;
}

.hero-facts li::before {
  content: "";
  display: inline-block;
  width: .45rem;
  height: .45rem;
  margin-right: .45rem;
  border-radius: 50%;
  background: var(--green-on-dark);
}

.hero-visual {
  position: relative;
  grid-area: visual;
  min-height: min(105vw, 30rem);
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  display: block;
}

.hero-media,
.hero-media img {
  width: 100%;
  height: 100%;
}

.hero-media img {
  object-fit: cover;
  object-position: 62% center;
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--navy), transparent 35%, rgba(31, 78, 121, .3));
  pointer-events: none;
}

.care-rail {
  position: absolute;
  z-index: 2;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  display: grid;
  gap: .3rem;
  margin: 0;
  padding: .7rem;
  color: var(--ink);
  background: rgba(255, 255, 255, .95);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  list-style: none;
}

.care-rail li {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .45rem;
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.4;
}

.care-rail span {
  color: var(--navy);
  font-size: .8125rem;
  font-weight: 800;
  line-height: 1;
}

/* ---------- 症状 ---------- */

.symptom-list {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}

.symptom-list li {
  padding: .7rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-weight: 700;
}

/* ---------- 受付条件テーブル ---------- */

.cond-table,
.fee-table,
.hours-table {
  width: 100%;
  margin: 0 0 1.5rem;
  border-collapse: collapse;
  background: var(--white);
  font-size: 1rem;
}

.cond-table th,
.cond-table td,
.fee-table th,
.fee-table td {
  padding: 1rem .75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.cond-table th {
  width: 34%;
  color: var(--navy);
  font-weight: 700;
}

.cond-table tr:first-child th,
.cond-table tr:first-child td {
  border-top: 2px solid var(--navy);
}

/* ---------- ベネフィット（濃紺セクション） ---------- */

.section--ink {
  width: 100%;
  padding-inline: max(1rem, calc((100% - 72rem) / 2));
  color: var(--white);
  background: var(--navy);
}

.section--ink .section-label {
  color: var(--green-on-dark);
}

.section--ink .section-lead {
  color: var(--on-dark);
}

.benefit-grid {
  display: grid;
  gap: 1px;
  background: rgba(255, 255, 255, .16);
}

.benefit-grid article {
  padding: 2rem;
  background: var(--navy);
}

.benefit-grid article > span,
.flow-list > li > span {
  font-size: .875rem;
  font-weight: 800;
  line-height: 1;
}

.benefit-grid article > span {
  color: var(--green-on-dark);
}

.benefit-grid p {
  margin-bottom: 0;
  color: var(--on-dark);
}

/* ---------- 受診の流れ ---------- */

.flow-list {
  display: grid;
  gap: 0;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}

.flow-list li {
  position: relative;
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 1rem;
  padding-block: 1.25rem;
  border-top: 1px solid var(--line);
}

.flow-list li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 3rem;
  bottom: -1.25rem;
  left: 1rem;
  width: 1px;
  background: var(--line);
  pointer-events: none;
}

.flow-list > li > span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: var(--navy);
  background: var(--white);
}

.flow-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.flow-list h3,
.flow-list p {
  margin-top: 0;
}

.flow-list p {
  margin-bottom: 0;
  color: var(--muted);
}

/* ---------- オンライン診療の限界 ---------- */

.limits {
  border-left: .35rem solid var(--navy-light);
  padding-left: clamp(1.25rem, 5vw, 3rem);
  background: var(--mist);
}

.limits-list {
  display: grid;
  gap: .75rem;
  margin: 0 0 1.5rem;
  padding-left: 1.25rem;
}

/* ---------- 料金 ---------- */

.fee-table thead th {
  border-bottom: 2px solid var(--navy);
  color: var(--navy);
  font-weight: 700;
}

.fee-table th[scope="row"] {
  width: 55%;
  font-weight: 700;
}

.fee-table td {
  text-align: right;
}

.fee-table strong {
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.2;
}

.fee-table small {
  display: block;
  margin-top: .35rem;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 400;
  line-height: 1.6;
}

/* ---------- 救急受診の案内 ---------- */

.safety {
  border-left: .35rem solid var(--signal);
  padding-left: clamp(1.25rem, 5vw, 3rem);
  background: var(--signal-bg);
}

.safety ul {
  display: grid;
  gap: .75rem;
  padding-left: 1.25rem;
}

.safety strong {
  color: #9A2F16;
}

/* ---------- 慢性疾患 ---------- */

.section--mist {
  width: 100%;
  padding-inline: max(1rem, calc((100% - 72rem) / 2));
  background: var(--mist);
}

.followup > p:last-child {
  max-width: 52rem;
  margin-bottom: 0;
}

/* ---------- クリニック情報・医師 ---------- */

.clinic {
  display: grid;
  gap: 2.5rem;
}

.doctor-heading {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 1.125rem;
}

.doctor-list {
  margin: 0;
}

.doctor-list dt {
  font-size: 1.125rem;
  font-weight: 700;
}

.doctor-role {
  margin-left: .5rem;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 400;
}

.doctor-list dd {
  margin: .5rem 0 0;
}

.doctor-credentials {
  color: var(--muted);
  font-size: .9rem;
}

.clinic address {
  display: grid;
  gap: .4rem;
  padding: 1.5rem;
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-style: normal;
}

.clinic-tel {
  width: fit-content;
  margin-top: .5rem;
  color: var(--navy);
  font-size: 1.5rem;
  font-weight: 800;
  text-underline-offset: .2em;
}

.clinic-map {
  width: fit-content;
  color: var(--navy);
  font-weight: 700;
  text-underline-offset: .2em;
}

.clinic-info h3 {
  margin-top: 2rem;
  font-size: 1.125rem;
}

.hours-table {
  display: block;
  overflow-x: auto;
  white-space: nowrap;
  font-size: .9375rem;
}

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

.hours-table thead th {
  border-bottom: 2px solid var(--navy);
  color: var(--navy);
}

.hours-table th[scope="row"] {
  text-align: left;
  font-weight: 700;
  white-space: nowrap;
}

/* ---------- FAQ ---------- */

.faq-list {
  border-top: 1px solid var(--line);
}

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-item h3 {
  margin: 0;
  font-family: var(--font-sans);
}

.faq-item button {
  display: flex;
  width: 100%;
  min-height: 4rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 0;
  padding: 1rem 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-weight: 700;
  line-height: 1.6;
  text-align: left;
  cursor: pointer;
}

.faq-icon {
  flex: none;
  color: var(--navy);
  font-size: 1.4rem;
  line-height: 1;
}

.faq-answer {
  padding: 0 2rem 1.5rem 0;
  color: var(--muted);
}

.faq-answer p {
  margin-bottom: 0;
}

/* JSが無い環境では回答を常時開く（CSPでインラインstyleを使えないためクラスで分岐） */
.faq-answer[hidden] {
  display: block;
}

html.js .faq-answer[hidden] {
  display: none;
}

/* ---------- 最終CTA ---------- */

.final-cta {
  width: 100%;
  padding-inline: max(1rem, calc((100% - 72rem) / 2));
  color: var(--white);
  background: var(--navy);
  text-align: center;
}

.final-cta .section-label {
  color: var(--green-on-dark);
}

.final-cta h2 {
  margin-inline: auto;
}

.final-cta p {
  margin-inline: auto;
  max-width: 44rem;
  color: var(--on-dark);
}

.final-actions {
  justify-content: center;
  margin-top: 2rem;
}

/* ---------- フッター ---------- */

footer {
  display: grid;
  gap: 1.25rem;
  padding: 2.5rem max(1rem, calc((100% - 72rem) / 2)) 10rem;
  color: #C4D4E2;
  background: var(--navy-deep);
  font-size: .9rem;
  line-height: 1.8;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.75rem;
}

footer a {
  text-underline-offset: .2em;
}

footer strong {
  display: block;
  color: var(--white);
}

footer p {
  margin: 0;
}

.footer-address {
  font-style: normal;
}

.footer-updated,
.footer-copy {
  color: #9FB4C6;
  font-size: .85rem;
}

/* ---------- モバイル固定バー（予約＋電話） ---------- */

.mobile-booking-bar {
  position: fixed;
  z-index: 20;
  display: grid;
  gap: .4rem;
  right: 0;
  bottom: 0;
  left: 0;
  padding: .6rem max(1rem, env(safe-area-inset-right, 0px)) calc(.6rem + env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
  background: rgba(22, 58, 91, .97);
  box-shadow: 0 -.75rem 2rem rgba(12, 34, 56, .22);
}

.mobile-emergency {
  margin: 0;
  color: #FFD3C6;
  font-size: .8125rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.mobile-actions {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: .5rem;
}

.mobile-actions .button {
  min-height: 3.25rem;
  padding-inline: .75rem;
  font-size: .9375rem;
}

/* ============================================================
   レスポンシブ
   ============================================================ */

@media (min-width: 48rem) {
  .button--compact {
    display: inline-flex;
  }

  .header-contact {
    display: block;
    margin-left: auto;
    text-align: right;
  }

  .hero {
    min-height: calc(100svh - 7.75rem);
    grid-template-areas: "intro visual" "details visual";
    grid-template-columns: minmax(0, 1.05fr) minmax(22rem, .95fr);
    grid-template-rows: auto 1fr;
  }

  .hero-intro {
    align-self: end;
    padding: 4rem 3rem 0 max(1rem, calc((100vw - 72rem) / 2));
  }

  .hero-details {
    align-self: start;
    padding: 1.5rem 3rem 4rem max(1rem, calc((100vw - 72rem) / 2));
  }

  .hero h1 {
    font-size: clamp(2.25rem, 3.4vw, 3rem);
  }

  .hero-visual {
    min-height: calc(100svh - 7.75rem);
  }

  .hero-visual::after {
    background: linear-gradient(90deg, var(--navy), transparent 30%, rgba(31, 78, 121, .18));
  }

  .hero-actions,
  .final-actions {
    /* 横並びにするが、カラム幅に収まらなければ折り返す（はみ出させない） */
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 1rem;
  }

  .final-actions {
    justify-content: center;
  }

  .care-rail {
    top: 1.5rem;
    right: auto;
    bottom: auto;
    left: 1.5rem;
    width: 13rem;
  }

  .benefit-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .pricing {
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(24rem, 1.2fr);
    gap: 1rem 4rem;
    align-items: start;
  }

  .pricing .section-note {
    grid-column: 1 / -1;
  }

  .clinic {
    grid-template-columns: 1.15fr .85fr;
    align-items: start;
  }

  .hours-table {
    display: table;
    white-space: normal;
  }

  .mobile-booking-bar {
    display: none;
  }

  footer {
    padding-bottom: 2.5rem;
  }
}

@media (min-width: 64rem) {
  body {
    font-size: 1.125rem;  /* 高齢患者配慮の推奨値 18px */
  }
}

@media (min-width: 75rem) {
  .hero-intro,
  .hero-details {
    padding-left: max(2rem, calc((100vw - 72rem) / 2));
  }

  .care-rail {
    left: 2rem;
    width: 14rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* 見出しの語中改行を防ぐ（2026-08-22） */
.nowrap{white-space:nowrap;}
