/* 108 蒼城整形外科 — K01 1画面完結。PC は1画面を5つの面に分け、切り替える。スマホ・JSなしは縦に並ぶ。
   色と書体は共通の13変数だけ。区切りの色は .t-* クラスで同じ名前の変数を上書きする */
:root {
  --c-bg: #e6eef8;
  --c-bg-alt: #fbfcfe;
  --c-text: #374151;
  --c-sub: #4b5563;
  --c-line: #6f87ad;
  --c-accent: #1f5fd6;
  --c-accent-text: #1747a6;
  --c-on-accent: #ffffff;
  --c-2: #2f7dff;
  --c-3: #7fb2ff;
  --font-ja: "Noto Sans JP", sans-serif;
  --font-head: "Noto Sans JP", sans-serif;
  --font-en: "Red Hat Display", "Noto Sans JP", sans-serif;
  --ease: cubic-bezier(.7, 0, .2, 1);
  --header-h: 64px;
  --footer-h: 44px;
}
.t-navy  { --c-bg: #0b1d3a; --c-bg-alt: #12294d; --c-text: #f3f6fb; --c-sub: #b8c3d6; --c-line: #4a6aa0; --c-accent-text: #7fb2ff; }
.t-black { --c-bg: #070b14; --c-bg-alt: #0e1626; --c-text: #f3f6fb; --c-sub: #b8c3d6; --c-line: #4a6aa0; --c-accent-text: #7fb2ff; }
.t-ice   { --c-bg: #e6eef8; --c-bg-alt: #fbfcfe; --c-text: #374151; --c-sub: #4b5563; --c-line: #6f87ad; --c-accent-text: #1747a6; }
.t-white { --c-bg: #fbfcfe; --c-bg-alt: #e6eef8; --c-text: #374151; --c-sub: #4b5563; --c-line: #6f87ad; --c-accent-text: #1747a6; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--c-bg); color: var(--c-text); font-family: var(--font-ja); font-size: 16px; line-height: 1.8; overflow-x: hidden; }
figure { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, dd, li { word-break: auto-phrase; overflow-wrap: anywhere; }
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
ul, ol { padding: 0; list-style: none; }

/* ===== ヘッダー ===== */
.header { position: sticky; top: 0; z-index: 30; background: var(--c-bg); color: var(--c-text); border-bottom: 1px solid var(--c-line); transition: background-color .6s var(--ease); }
.header__inner { height: var(--header-h); padding: 0 20px; display: flex; align-items: center; gap: 12px; justify-content: space-between; position: relative; }
.logo { min-height: 44px; display: flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap; flex: none; }
.logo__mark { display: grid; place-items: center; width: 34px; height: 34px; background: var(--c-accent); color: var(--c-on-accent); font-family: var(--font-en); font-weight: 900; font-size: 18px; }
.logo__ja { font-family: var(--font-head); font-weight: 900; font-size: 18px; letter-spacing: .04em; }
.gnav { display: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px; background: var(--c-accent); color: var(--c-on-accent); font-weight: 700; text-decoration: none; white-space: nowrap; flex: none; border: 2px solid var(--c-accent); }
.btn--lg { min-height: 52px; padding: 0 28px; font-size: 16px; }
.btn--line { background: transparent; color: var(--c-text); border-color: var(--c-line); }
.btn--dark { background: var(--c-text); color: var(--c-bg); border-color: var(--c-text); }
.header__btn { display: none; }

.spmenu { flex: none; }
.spmenu summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
.spmenu summary::-webkit-details-marker { display: none; }
.spmenu__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.spmenu__bar, .spmenu__bar::before, .spmenu__bar::after { display: block; width: 24px; height: 3px; background: currentColor; position: relative; }
.spmenu__bar::before, .spmenu__bar::after { content: ""; position: absolute; left: 0; }
.spmenu__bar::before { top: -8px; } .spmenu__bar::after { top: 8px; }
.spmenu[open] .spmenu__bar { background: transparent; }
.spmenu[open] .spmenu__bar::before { top: 0; transform: rotate(45deg); }
.spmenu[open] .spmenu__bar::after { top: 0; transform: rotate(-45deg); }
.spmenu__nav { position: absolute; right: 0; top: 100%; width: min(100%, 380px); background: var(--c-bg); border: 1px solid var(--c-line); padding: 8px 24px 20px; display: flex; flex-direction: column; }
.spmenu__nav a { display: flex; align-items: center; min-height: 52px; text-decoration: none; font-weight: 700; border-bottom: 1px solid var(--c-line); }

/* ===== 面の共通 ===== */
.panel { position: relative; background: var(--c-bg); color: var(--c-text); padding: 64px 20px; }
.en { font-family: var(--font-en); font-weight: 900; font-size: 15px; letter-spacing: .14em; color: var(--c-accent-text); margin-bottom: 12px; }
.h2 { font-family: var(--font-head); font-weight: 900; font-size: clamp(30px, 8vw, 44px); line-height: 1.25; letter-spacing: .01em; margin-bottom: 20px; }

/* ===== 面0 コラージュ（スマホ：上の帯と下の帯にカード） ===== */
.hero { padding: 0; overflow: hidden; }
.hero__center { position: relative; z-index: 2; padding: 58vw 20px 66vw; text-align: center; }
.hero__en { font-family: var(--font-en); font-weight: 900; font-size: 15px; letter-spacing: .12em; color: var(--c-accent-text); margin-bottom: 16px; }
.hero__title { font-family: var(--font-head); font-weight: 900; font-size: clamp(40px, 13vw, 56px); line-height: 1.15; letter-spacing: .01em; }
.hero__lead { margin: 18px 0 26px; color: var(--c-sub); }
.hero__btns { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.collage { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.card { position: absolute; transform: rotate(var(--r, 0deg)); }
.card img { width: 100%; height: 100%; object-fit: cover; }
.c-runner { left: -2vw; bottom: 0; height: 60vw; --r: 0deg; }
.c-runner img { width: auto; max-width: none; object-fit: contain; }
.c-knee { right: 2vw; bottom: 2vw; height: 54vw; }
.c-knee img { width: auto; max-width: none; object-fit: contain; }
.c-photo1, .c-photo2, .c-photo3 { border: 2px solid var(--c-line); box-shadow: 0 10px 30px color-mix(in srgb, black 40%, transparent); overflow: hidden; }
.c-photo1 img, .c-photo2 img, .c-photo3 img { filter: grayscale(.85) contrast(1.08); }
.c-photo1 { left: 4vw; top: 16vw; width: 26vw; aspect-ratio: 2/3; --r: -4deg; }
.c-photo2 { right: 4vw; top: 16vw; width: 26vw; aspect-ratio: 2/3; --r: 4deg; }
.c-photo3 { left: 41vw; bottom: 6vw; width: 31vw; aspect-ratio: 3/2; --r: -3deg; }
.word { display: grid; place-items: center; padding: 6px 12px; background: var(--c-accent); color: var(--c-on-accent); font-family: var(--font-en); font-weight: 900; font-size: 15px; letter-spacing: .08em; line-height: 1.2; }
.word--line { background: transparent; color: var(--c-text); border: 2px solid var(--c-text); }
.word--white { background: var(--c-text); color: var(--c-bg); }
.word--sky { background: var(--c-3); color: var(--c-bg); }
.c-w1 { left: 33vw; top: 6vw; --r: -5deg; }
.c-w2 { left: 38vw; top: 26vw; --r: 4deg; }
.c-w3, .c-w4 { display: none; }

/* ===== 面1 診療内容 ===== */
.care { overflow: hidden; }
.care__model { display: none; }
.parts { display: grid; gap: 12px; }
.parts li { display: grid; grid-template-columns: 56px 1fr; column-gap: 12px; align-items: baseline; padding: 16px; background: var(--c-bg-alt); border: 1px solid var(--c-line); }
.parts__no { grid-row: 1 / 3; font-family: var(--font-en); font-weight: 900; font-size: 36px; line-height: 1; color: var(--c-accent-text); }
.parts h3 { font-family: var(--font-head); font-weight: 900; font-size: 20px; line-height: 1.4; }
.parts p { color: var(--c-sub); }
.parts .parts__cta { display: block; background: var(--c-text); color: var(--c-bg); border-color: var(--c-text); }
.parts__cta p { color: var(--c-bg); margin: 6px 0 16px; }
.parts__cta .btn { background: var(--c-accent); }

/* ===== 面2 リハビリ ===== */
.rehab { padding: 0 0 64px; }
.rehab__photo { aspect-ratio: 3 / 2; overflow: hidden; }
.rehab__photo img { width: 100%; height: 100%; object-fit: cover; }
.rehab__body { padding: 36px 20px 0; }
.rehab__body > p:not(.en) { color: var(--c-sub); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 28px; }
.stats div { border-top: 3px solid var(--c-2); padding-top: 10px; }
.stats dt { font-size: 15px; color: var(--c-sub); }
.stats dd { font-weight: 700; color: var(--c-text); }
.stats b { font-family: var(--font-en); font-weight: 900; font-size: 28px; line-height: 1.1; color: var(--c-accent-text); margin-right: 2px; }

/* ===== 面3 スポーツ外来（A11） ===== */
.sports { overflow: hidden; padding-top: 68vw; }
.sports__canvas { position: absolute; left: 0; top: 0; width: 100%; height: 64vw; display: block; }
.sports__word { position: absolute; left: 0; right: 0; top: 6vw; text-align: center; font-family: var(--font-en); font-weight: 900; font-size: 16vw; line-height: 1; letter-spacing: .02em; color: var(--c-2); }
.is-dots .sports__word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sports__body { position: relative; display: grid; gap: 28px; }
.points { display: grid; gap: 14px; counter-reset: p; }
.points li { counter-increment: p; position: relative; padding: 16px 16px 16px 60px; background: var(--c-bg-alt); border-left: 4px solid var(--c-2); color: var(--c-sub); }
.points li::before { content: "0" counter(p); position: absolute; left: 16px; top: 14px; font-family: var(--font-en); font-weight: 900; font-size: 26px; line-height: 1; color: var(--c-accent-text); }
.points b { display: block; color: var(--c-text); font-weight: 900; font-size: 17px; margin-bottom: 4px; }

/* ===== 面4 医師・診療時間・アクセス ===== */
.visit { display: grid; gap: 44px; }
.visit__doctor > p:not(.en) { color: var(--c-sub); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: var(--c-bg-alt); text-align: center; }
.table th, .table td { border: 1px solid var(--c-line); padding: 10px 6px; font-weight: 400; }
.table thead th { background: var(--c-accent); color: var(--c-on-accent); font-weight: 700; }
.table tbody th { white-space: nowrap; text-align: left; padding-left: 10px; font-weight: 700; }
.visit__note { margin-top: 14px; color: var(--c-sub); }
.info { display: grid; gap: 0; border-top: 1px solid var(--c-line); }
.info div { display: grid; grid-template-columns: 4em 1fr; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--c-line); }
.info dt { font-weight: 700; }
.info dd { color: var(--c-sub); }
.visit__btns { display: grid; gap: 12px; margin-top: 24px; }
.visit__btns .btn { white-space: normal; text-align: center; }

/* ===== フッター ===== */
.footer { background: var(--c-bg); color: var(--c-text); border-top: 1px solid var(--c-line); padding: 28px 20px; text-align: center; }
.footer__logo { font-family: var(--font-head); font-weight: 900; font-size: 18px; }
.footer__count { display: none; }
.footer__fiction { margin-top: 8px; font-size: 15px; color: var(--c-sub); }

@media (min-width: 768px) {
  .header__inner { padding: 0 32px; }
  .c-w3, .c-w4 { display: grid; }
  .hero__center { padding: 300px 32px 340px; }
  .c-runner { height: 330px; }
  .c-knee { height: 300px; }
  .c-photo1, .c-photo2 { width: 150px; top: 60px; }
  .c-photo3 { width: 210px; left: calc(50% - 105px); bottom: 24px; }
  .c-w1 { left: calc(50% - 150px); top: 24px; } .c-w2 { left: calc(50% + 70px); top: 40px; }
  .c-w3 { right: calc(50% + 70px); left: auto; top: 48px; } .c-w4 { display: none; }
  .sports { padding-top: 360px; } .sports__canvas { height: 340px; } .sports__word { top: 60px; font-size: 120px; }
  .parts { grid-template-columns: 1fr 1fr; }
  .visit { max-width: 760px; margin: 0 auto; width: 100%; }
}

/* ===== PC：1画面完結（JS が .is-tabs を付けたときだけ） ===== */
@media (min-width: 1080px) {
  .gnav { display: flex; gap: 6px; margin-left: auto; }
  .gnav a { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; text-decoration: none; font-weight: 700; border-bottom: 3px solid transparent; }
  .gnav a:hover { color: var(--c-accent-text); }
  .gnav a[aria-current="true"] { border-bottom-color: var(--c-accent-text); color: var(--c-accent-text); }
  .gnav__no { font-family: var(--font-en); font-weight: 900; font-size: 15px; color: var(--c-accent-text); }
  .header__btn { display: inline-flex; }
  .spmenu { display: none; }

  .panel { padding: 56px 64px; }
  .hero { padding: 0; }
  .h2 { font-size: clamp(40px, 4vw, 60px); }

  /* 面0：外周を囲む */
  .hero__center { position: absolute; inset: 0; padding: 0 31% 0 31%; display: flex; flex-direction: column; justify-content: center; align-items: center; }
  .hero__title { font-size: clamp(52px, 5.6vw, 92px); line-height: 1.12; }
  .hero__lead { font-size: 17px; }
  .c-runner { left: 1%; bottom: -1%; height: 70%; }
  .c-knee { right: 2%; bottom: 3%; height: 62%; }
  .c-photo1 { left: 21%; top: 8%; width: 9.5%; }
  .c-photo2 { right: 21%; top: 8%; width: 9.5%; }
  .c-photo3 { left: auto; right: 21%; bottom: 5%; width: 16%; }
  .c-w1 { left: 3%; top: 8%; font-size: clamp(18px, 1.6vw, 26px); padding: 8px 18px; }
  .c-w2 { left: 11%; top: 19%; font-size: clamp(18px, 1.6vw, 26px); padding: 8px 18px; }
  .c-w3 { right: 3%; left: auto; top: 8%; font-size: clamp(18px, 1.6vw, 26px); padding: 8px 18px; }
  .c-w4 { display: grid; right: 7%; top: 19%; font-size: clamp(18px, 1.6vw, 26px); padding: 8px 18px; }

  /* 面1 */
  .care { display: grid; grid-template-columns: minmax(180px, 24%) 1fr; gap: 56px; align-items: center; }
  .care__model { display: block; height: 100%; max-height: 640px; }
  .care__model img { height: 100%; width: auto; margin: 0 auto; object-fit: contain; max-width: none; }
  .care__body { min-width: 0; }
  .parts { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .parts li { display: block; padding: 22px 20px; }
  .parts__no { display: block; margin-bottom: 14px; font-size: 52px; }

  /* 面2 */
  .rehab { padding: 0; display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
  .rehab__photo { aspect-ratio: auto; height: 100%; }
  .rehab__body { align-self: center; padding: 0 64px; }

  /* 面3 */
  .sports { padding: 0; }
  .sports__canvas { height: 100%; }
  .sports__word { top: 14%; font-size: clamp(120px, 13vw, 210px); }
  .sports__body { position: absolute; left: 64px; right: 64px; bottom: 44px; grid-template-columns: 34% 1fr; gap: 48px; align-items: end; }
  .points { grid-template-columns: repeat(3, 1fr); }
  .points li { padding: 56px 18px 18px; border-left: 0; border-top: 4px solid var(--c-2); }
  .points li::before { left: 18px; top: 14px; }

  /* 面4 */
  .visit { max-width: none; margin: 0; grid-template-columns: 1fr 1.25fr 1fr; gap: 56px; align-items: start; align-content: center; }
  .visit__col { min-width: 0; }
  .visit .h2 { font-size: clamp(30px, 2.7vw, 40px); }

  /* 1画面にする */
  .is-tabs body { height: 100svh; overflow: hidden; display: grid; grid-template-rows: var(--header-h) minmax(0, 1fr) var(--footer-h); }
  .is-tabs .header { position: relative; }
  .is-tabs .stage { position: relative; display: grid; min-height: 0; overflow: hidden; }
  .is-tabs .panel { grid-area: 1 / 1; min-height: 0; overflow: hidden; }
  .is-tabs .panel:not(.is-on):not(.is-leaving) { display: none; }
  .is-tabs .is-leaving { z-index: 1; }
  .is-tabs .is-on { z-index: 2; }
  .is-tabs .is-enter-fwd { animation: wipe-fwd .6s var(--ease) both; }
  .is-tabs .is-enter-back { animation: wipe-back .6s var(--ease) both; }
  .is-tabs .footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 32px; text-align: left; transition: background-color .6s var(--ease); }
  .is-tabs .footer__logo { display: none; }
  .is-tabs .footer__count { display: block; font-family: var(--font-en); font-weight: 700; font-size: 15px; letter-spacing: .08em; color: var(--c-text); }
  .is-tabs .footer__fiction { margin: 0; color: var(--c-sub); }
}
@keyframes wipe-fwd { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
@keyframes wipe-back { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .is-tabs .is-enter-fwd, .is-tabs .is-enter-back { animation: none; }
  .header, .footer { transition: none; }
}
