/* 梶の木内科医院 内視鏡検査 説明サイト 共通スタイル（3ページ共通） */

:root {
  color-scheme: light;
  /* 緑 */
  --green: #3CA339;
  --green-dark: #2E7D2B;
  --green-light: #EBF6EA;
  /* 水色 */
  --blue: #2CADE0;
  --blue-dark: #1A73A8;
  --blue-light: #E8F6FC;
  /* ピンク */
  --pink: #E57F8B;
  --pink-dark: #B8475A;
  --pink-light: #FDF0F2;
  /* 文字・背景・線 */
  --text: #333333;
  --text-sub: #666666;
  --bg: #FFFFFF;
  --bg-gray: #F5F5F3;
  --line: #DDDDDD;
  /* 注意 */
  --alert: #B42318;
  --alert-bg: #FEF3F2;
  --alert-line: #F2C4BF;
  /* 仮テキスト */
  --tbd: #FFF4CC;
  --tbd-text: #8A6D00;

  --header-h: 64px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg-gray);
  color: var(--text);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  font-size: 17px;
  line-height: 1.8;
  letter-spacing: 0.02em;
  /* 改行位置：文節の区切り（<wbr>）で折り返し、入りきらないときだけ途中で折る */
  word-break: keep-all;
  overflow-wrap: anywhere;
  line-break: strict;
}

img { max-width: 100%; height: auto; display: block; }
p, ul, ol, h1, h2, h3 { margin: 0; }
strong { font-weight: 700; }
a { color: var(--blue-dark); }
a:hover { color: #145A84; }
a:focus-visible, summary:focus-visible, button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

/* ページ全体（PCでは中央600px、左右グレー） */
.page {
  max-width: 600px;
  margin: 0 auto;
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== ヘッダー（固定） ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
}
.site-header__bar {
  min-height: 60px;
  padding: 0 16px 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.site-header__logo { width: 180px; height: auto; flex-shrink: 1; min-width: 0; }
.exam-label {
  font-size: 15px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--green-dark);
  background: var(--green-light);
  border-radius: 999px;
  padding: 6px 12px;
  text-align: center;
}
.tricolor {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  height: 4px;
}
.tricolor span:nth-child(1) { background: var(--pink); }
.tricolor span:nth-child(2) { background: var(--blue); }
.tricolor span:nth-child(3) { background: var(--green); }

/* ===== 本文 ===== */
main {
  display: flex;
  flex-direction: column;
  gap: 48px;
  padding: 32px 20px 64px;
}

.fv {
  height: 210px;
  overflow: hidden;
  background: var(--green-light);
}
.fv img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 55%;
}
@media (min-width: 480px) {
  .fv { height: 280px; }
}
.page-title-wrap {
  position: relative;
  margin: -64px -20px 0;
  padding: 24px 20px 0;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
}

.page-title {
  font-size: 24px;
  line-height: 1.45;
  font-weight: 700;
}

/* ごあいさつ */
.greeting {
  background: var(--pink-light);
  border-radius: 16px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.greeting__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 700;
  color: var(--pink-dark);
}

/* もくじ */
.toc {
  background: var(--green-light);
  border-radius: 16px;
  padding: 20px 16px;
}
.toc__title {
  margin: 0 4px 12px;
  font-size: 18px;
  font-weight: 700;
  color: var(--green-dark);
}
.toc ol {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toc a {
  min-height: 52px;
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  line-height: 1.5;
}
.toc a:active { background: #F7FBF7; }
.toc__num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--green-dark);
  color: #FFFFFF;
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.toc__text { flex: 1; }

/* 大見出しのセクション */
.section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--green);
}
.section-head__num {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--green-dark);
  color: #FFFFFF;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.section-head h2 {
  font-size: 21px;
  line-height: 1.4;
  font-weight: 700;
}

/* 折りたたみ */
.fold {
  border: 1.5px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
}
.fold[open] { border-color: var(--green); }
.fold summary {
  list-style: none;
  min-height: 64px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.fold summary::-webkit-details-marker { display: none; }
.fold[open] summary { background: var(--green-light); }
.fold__label { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.fold__title { font-size: 17px; font-weight: 700; line-height: 1.5; }
.fold__hint { font-size: 15px; line-height: 1.5; color: var(--text-sub); }
.fold__hint--close { display: none; }
.fold[open] .fold__hint--open { display: none; }
.fold[open] .fold__hint--close { display: inline; }
.fold__icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fold[open] .fold__icon { background: var(--bg); }
.fold__icon .icon-minus { display: none; }
.fold[open] .fold__icon .icon-plus { display: none; }
.fold[open] .fold__icon .icon-minus { display: block; }
.fold__body {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 丸つき箇条書き */
.dot-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dot-list li { display: flex; gap: 10px; }
.dot-list li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  margin-top: 12px;
  flex-shrink: 0;
}

/* 注意ボックス */
.alert {
  background: var(--alert-bg);
  border: 1.5px solid var(--alert-line);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.alert__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 700;
  color: var(--alert);
}
.alert ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--alert);
  font-weight: 700;
}

/* ボタン（PDF・電話） */
.btn {
  min-height: 56px;
  background: var(--green-dark);
  color: #FFFFFF;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  text-align: center;
}
.btn:hover, .btn:visited { color: #FFFFFF; }
.btn:hover { background: #26692A; }
.btn svg { flex-shrink: 0; }
.btn-wrap { display: flex; flex-direction: column; gap: 6px; }
.btn-note {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-sub);
  text-align: center;
}

/* カード（費用など） */
.card {
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ※注記 */
.note-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-sub);
}

/* 仮テキスト（確定後に差し替え） */
.tbd {
  background: var(--tbd);
  color: inherit;
  padding: 2px 4px;
}
.tbd-note {
  font-size: 15px;
  line-height: 1.5;
  color: var(--tbd-text);
}

/* 費用の箇条書き（緑の丸＋区切り線） */
.cost-list {
  list-style: none;
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: 12px;
}
.cost-list > li {
  position: relative;
  padding: 16px 16px 16px 36px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cost-list > li + li { border-top: 1px solid var(--line); }
.cost-list > li::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 28px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

/* 持ち物リスト */
.item-list {
  list-style: none;
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: 12px;
}
.item-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
}
.item-list li + li { border-top: 1px solid var(--line); }
.item-list__icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--green-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.item-list__text { display: flex; flex-direction: column; font-weight: 700; }
.item-list__sub { font-size: 15px; line-height: 1.5; color: var(--text-sub); font-weight: 400; }

/* タイムライン */
.timeline {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.timeline > li { display: flex; gap: 14px; }
.timeline__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 34px;
}
.timeline__num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green-dark);
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.timeline__line {
  flex: 1;
  width: 3px;
  background: var(--blue);
  margin: 4px 0;
}
.timeline > li:last-child .timeline__line { display: none; }
.timeline__body {
  flex: 1;
  min-width: 0;
  padding-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.timeline > li:last-child .timeline__body { padding-bottom: 0; }
.timeline__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 34px;
}
.timeline__step {
  display: block;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 700;
  color: var(--green-dark);
}
.timeline__title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.6;
}
.now-label {
  font-size: 15px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--pink-dark);
  border: 1.5px solid var(--pink);
  background: var(--bg);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

/* 道案内 */
.route { display: flex; flex-direction: column; gap: 10px; }
.route img { width: 100%; border-radius: 8px; }
.route__step { display: flex; gap: 10px; }
.route__num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue-dark);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 3px;
}

/* 外観写真（高さを抑える） */
.photo-short {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 8px;
}

/* 水色の囲み（オンライン診療・動画） */
.box-blue {
  background: var(--blue-light);
  border-radius: 16px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.box-blue__lead { display: flex; align-items: flex-start; gap: 12px; }
.box-blue__icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.price-table {
  list-style: none;
  padding: 4px 14px;
  background: var(--bg);
  border-radius: 10px;
}
.price-table li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 10px 0;
}
.price-table li + li { border-top: 1px solid var(--line); }
.price-table__value { font-weight: 700; }
.price-table__value small { font-size: 15px; font-weight: 400; }

/* 動画 */
.video {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.video__title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  line-height: 1.6;
  font-weight: 700;
  color: var(--blue-dark);
}
.video__frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 8px;
  background: #000;
  display: block;
}
.video__link {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}
.sub-head {
  font-size: 18px;
  line-height: 1.6;
  font-weight: 700;
}

/* ===== フッター ===== */
.site-footer {
  margin-top: auto;
  background: var(--bg-gray);
  border-top: 1px solid var(--line);
  padding: 32px 20px 96px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.site-footer__logo { width: 180px; }
.site-footer__address {
  font-style: normal;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-sub);
}

/* 上に戻るボタン */
.to-top {
  position: fixed;
  right: 16px;
  bottom: 20px;
  z-index: 20;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--green-dark);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.to-top.is-visible { opacity: 1; visibility: visible; }
@media (min-width: 600px) {
  .to-top { right: calc(50% - 300px + 16px); }
}

.nowrap { white-space: nowrap; }

/* 読み上げ専用の文字 */
.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;
}

/* トップ・404 用 */
.simple {
  padding: 48px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
