/* ==========================================================================
   Muratsu Dental テーマ 共通ベース
   デザイントークン・リセット・全ページ共通パーツ（フッター／右下スティッキー予約ボタン）。
   トップページ固有のスタイルは front-page.css、下層ページ固有のスタイルは subpages.css。

   2026-09 配色・書体刷新：トップページの新デザイン（design_handoff_top_page/README.md、
   ティール系配色＋明朝）をサイト全体のベースに採用。明朝は 2026-10-13 に BIZ UDPMincho から Noto Serif JP へ統一。値はfront-page.cssの
   --tf-*と合わせている。下層ページ（subpages.css・article-single.css）はこの
   :root の変数を参照しているだけなので、ここを差し替えるだけで自動的に配色が揃う
   （特設ページ5つは専用CSSで別管理のため対象外）。
   ========================================================================== */
:root {
  /* 書体はここで決める(2026-10-13 一本化)。ページごとのCSSにある書体の名前(--tf-font-mincho・--pd-serif など)は、すべてここを指すだけ。
     書体を変えるときはここと functions.php の読み込みだけを直す。--font-latin は日本語の文字を持たないので、後ろに明朝を続ける。 */
  --font-serif: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", YuMincho, serif;
  --font-sans: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", YuGothic, Meiryo, sans-serif;
  --font-latin: "Cormorant Garamond", var(--font-serif);
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --primary: #0D899C;
  --primary-dark: #0A6F7D;
  --primary-light: #EAF4F4;
  --primary-lighter: #F5FAFA;
  --navy: #123C42;
  --navy-deep: #0A2B30;
  --text: #3C5F64;
  --text-muted: #6B8B90;
  --border: #D4E9E9;
  --white: #ffffff;
  --line-green: #06c755;
  --line-green-dark: #05a648;
  --yt-red: #e0554f;
  --yt-bg: #fdf4f3;
  --radius-lg: 6px;
  --radius-md: 5px;
  --radius-sm: 3px;
  --shadow: 0 4px 16px rgba(18,60,66,0.08);
  --shadow-hover: 0 10px 28px rgba(18,60,66,0.16);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-serif);
  background: #fbfcfe;
  color: var(--text);
  line-height: 1.7;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

/* ===== ヘッダー（全ページ共通。特設サイト5つは template-parts/special/header.php を使うため対象外）
   2026-09デザイン刷新：sticky、ロゴ左＋横並びナビ＋WEB予約ボタン。「診療案内」はホバーで
   診療科目のプルダウンを表示する（.tf-nav-dropdown、JS不要のCSSのみ実装）。
   このほかにヘッダーを触っている所(2026-10-13 整理後): 予約ボタンの立体感 = button-depth.css /
   スマホでFVを過ぎたらロゴを小さく・総合トップへのリンク・予約ボタンの四角 = site-chrome-extras.css(どのヘッダーにも共通の機能) /
   トップだけのヘッダーの出方(.fv-late) = front-page.css ===== */
/* top：ログイン中の管理バー（PCは画面上部に固定）の分だけ下げる。幅600px以下では管理バーが
   ページと一緒に流れて画面外へ出るので下げない（すぐ下の @media）。2026-10-03 */
.tf-header {
  position: sticky; top: var(--wp-admin--admin-bar--height, 0px); z-index: 50; background: #FFFFFF; border-bottom: 1px solid #EAF4F4;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 28px; flex-wrap: wrap;
}
@media (max-width: 600px) { .tf-header { top: 0; } }
/* ページ内移動・AI相談の画面切り替えで、行き先を追従ヘッダー（高さは theme.js が実測）＋ログイン中の管理バーの下8pxに止める。
   幅600px以下では管理バーが流れて画面外へ出るので足さない。 2026-10-03 */
html:has(#js-tf-header) { scroll-padding-top: calc(var(--tf-header-h, 84px) + var(--wp-admin--admin-bar--height, 0px) + 8px); }
@media (max-width: 600px) { html:has(#js-tf-header) { scroll-padding-top: calc(var(--tf-header-h, 84px) + 8px); } }
.tf-logo-box { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.tf-logo-box img { height: 36px; width: auto; display: block; }
.tf-hamburger { display: none; background: none; border: none; padding: 6px; cursor: pointer; }
.tf-nav { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; font-size: 16px; font-weight: 500; }
.tf-nav-link { color: #123C42; text-decoration: none; }
.tf-nav-item-wrap { position: relative; }
/* 「診療案内」の文字とプルダウンの間には見た目上の余白（.tf-nav-dropdownのmargin-top）があり、
   その隙間にカーソルを移動する間はどちらの要素にも乗っていないためホバーが外れてしまう。
   見えない橋渡し領域を敷いて、隙間の途中でカーソルが外れてもホバーが続くようにする。 */
.tf-nav-item-wrap::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 14px;
}
.tf-nav-dropdown {
  display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  margin-top: 14px; min-width: 220px; max-height: 60vh; overflow-y: auto;
  background: #FFFFFF; border: 1px solid #EAF4F4; border-radius: 14px; box-shadow: 0 10px 28px rgba(18,60,66,0.16);
  padding: 10px; flex-direction: column; gap: 2px; z-index: 51;
}
.tf-nav-dropdown a {
  display: block; padding: 10px 14px; border-radius: 9px; font-size: 14px; font-weight: 500;
  color: #123C42; text-decoration: none; white-space: nowrap; transition: background .15s ease, color .15s ease;
}
.tf-nav-dropdown a:hover { background: #EAF4F4; color: #0D899C; }
.tf-nav-item-wrap:hover .tf-nav-dropdown { display: flex; }
.tf-nav-cta {
  background: #FA6E59; color: #FFFFFF; padding: 11px 22px; border-radius: 6px;
  font-weight: 700; white-space: nowrap; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease;
}
.tf-nav-cta:hover { color: #FFFFFF; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(250,110,89,0.35); }
.tf-mobile-panel {
  display: none; position: relative; z-index: 49; background: #FFFFFF; border-bottom: 1px solid #EAF4F4;
  padding: 20px 28px; flex-direction: column; gap: 16px;
}
.tf-mobile-panel.is-open { display: flex; }
.tf-mobile-panel a { color: #123C42; font-size: 16px; font-weight: 700; font-family: var(--font-serif); text-decoration: none; }
/* ハンバーガーメニュー内「診療案内」のアコーディオン（押すと全診療科目が開く） */
.tf-mobile-acc-btn {
  display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 0; background: none; border: none;
  cursor: pointer; color: #123C42; font-size: 16px; font-weight: 700; font-family: var(--font-serif); text-align: left;
}
.tf-mobile-acc-icon { color: #0D899C; font-size: 20px; line-height: 1; }
.tf-mobile-acc-list {
  display: flex; flex-direction: column; gap: 14px; overflow: hidden; max-height: 0;
  padding-left: 14px; border-left: 2px solid #EAF4F4; transition: max-height .35s ease, margin-top .35s ease;
}
.tf-mobile-acc.is-open .tf-mobile-acc-list { max-height: 900px; margin-top: 14px; }
.tf-mobile-panel .tf-mobile-acc-list a { font-weight: 500; }
.tf-mobile-panel .tf-mobile-acc-list a.tf-mobile-acc-all { color: #0D899C; font-weight: 700; }

@media (max-width: 767px) {
  .tf-nav-link { display: none; }
  .tf-nav-item-wrap { display: none; }
  .tf-header { justify-content: center; }
  .tf-logo-box { order: 1; flex: 1 0 100%; justify-content: center; }
  .tf-hamburger { display: flex; order: 2; align-items: center; }
  .tf-nav { order: 3; flex: 0 0 auto; margin-left: auto; }
  /* 開いたメニューは画面に固定し、スクロールした位置でもヘッダーのすぐ下に出す。
     --tf-panel-top（ヘッダーの下端の位置）は assets/js/theme.js が開くたびに設定する。 */
  .tf-mobile-panel {
    position: fixed; left: 0; right: 0; top: var(--tf-panel-top, 120px); z-index: 49;
    max-height: calc(100vh - var(--tf-panel-top, 120px)); max-height: calc(100dvh - var(--tf-panel-top, 120px));
    overflow-y: auto; overscroll-behavior: contain; box-shadow: 0 10px 24px rgba(18,60,66,0.14);
  }
}

/* ===== レイアウトの基本単位 =====
   各 section（header/footer含む）は幅いっぱいまで広がり、背景（色・画像）をフルブリードにできる。
   .section-inner がその中で実際のコンテンツ幅（最大1200px）を揃える。 */
.site-content { position: relative; }
.site-content section, .site-content > nav.breadcrumb { position: relative; padding: 44px 0; } /* 共通のパンくず(template-parts/breadcrumb.php)は 2026-10-16 に section から nav へ。余白は前と同じ。「>」はホワイトニングの見出しの中のパンくずに当てないため */
.section-inner { max-width: 1200px; margin: 0 auto; padding: 0 40px; }

/* 記事カード（記事一覧ページ／記事詳細ページの関連記事、共通）のリンクラッパー。
   .article-card 自身は display:flex; flex-direction:column; の想定なので、
   中の <a> は display:contents で消して、直下の thumb/title を直接のflexアイテムにする。 */
.article-card-link { display: contents; text-decoration: none; color: inherit; }

/* ===== 右下スティッキー予約ボタン群（全ページ共通） =====
   このほかに触っている所(2026-10-13 整理後): 立体感 = button-depth.css / AI相談のLPが画面に出ている間は隠す = front-page.css ===== */
.sticky-reserve {
  position: fixed; right: 22px; bottom: 22px; z-index: 250;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
}
.sticky-btn {
  width: 168px; height: 54px; border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 13.5px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 14px rgba(27,53,84,0.18);
  transition: transform .15s ease, box-shadow .15s ease; border: none; text-decoration: none;
}
.sticky-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(27,53,84,0.24); }
.sticky-btn img { width: 20px; height: 20px; }
.sticky-btn.web { background: var(--primary); color: #fff; }
.sticky-btn.tel { background: #fff; color: var(--navy); border: 1.5px solid var(--border); }
.sticky-btn.line { background: var(--line-green); color: #fff; }
.tel-info-card {
  display: none; position: absolute; right: 0; bottom: 64px; width: 280px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-hover); padding: 16px; font-size: 12.5px; text-align: left; color: var(--text);
}
.tel-info-card.open { display: block; }
/* 電話予約ボタンと番号カードの間（10px）の見えない橋渡し。カードへカーソルを動かす途中で閉じないように */
.tel-info-card::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 12px; }
.tel-info-card .tel-number { display: block; white-space: nowrap; font-size: 18px; font-weight: 900; margin-bottom: 8px; color: var(--navy); text-decoration: none; }
.tel-info-card .tel-line { margin-bottom: 4px; color: var(--text-muted); }
/* PCでは「ご予約はこちら」ボタン1つだけを出し、マウスを乗せるか押すと電話・LINE・WEB予約の3つが上に開く。
   開閉のクリック処理は assets/js/theme.js。スマホ（640px以下）は下端の横並びバーのまま（下のメディアクエリ）。 */
.sticky-btn.sticky-toggle { background: #FA6E59; color: #fff; font-family: inherit; transition: background .2s ease, transform .15s ease, box-shadow .15s ease; }
/* 閉じている間はピンク、開いている間（押した・マウスを乗せた）は元の濃色 */
.sticky-reserve.is-open .sticky-toggle { background: var(--navy); }
.sticky-toggle-icon { font-size: 11px; transition: transform .2s ease; }
.sticky-reserve { pointer-events: none; }
.sticky-reserve > * { pointer-events: auto; }
/* 開いている間は、ボタン同士のすき間（10px）もマウスに反応させる。反応しないままだと、下の「ご予約はこちら」から
   上のボタンへカーソルを動かす途中ですき間を通った瞬間に閉じてしまっていた（2026-09-28 ユーザー指摘）。
   閉じている間は今までどおり反応しない（見えない範囲で下のページのクリックを邪魔しないため）。 */
.sticky-reserve:hover, .sticky-reserve.is-open { pointer-events: auto; }
.sticky-reserve > :not(.sticky-toggle) {
  opacity: 0; visibility: hidden; transform: translateY(10px); pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
}
.sticky-reserve.is-open > :not(.sticky-toggle),
.sticky-reserve:has(:focus-visible) > :not(.sticky-toggle) {
  opacity: 1; visibility: visible; transform: none; pointer-events: auto; transition-delay: 0s;
}
.sticky-reserve.is-open .sticky-toggle-icon { transform: rotate(180deg); }
@media (hover: hover) {
  .sticky-reserve:hover > :not(.sticky-toggle) { opacity: 1; visibility: visible; transform: none; pointer-events: auto; transition-delay: 0s; }
  .sticky-reserve:hover .sticky-toggle-icon { transform: rotate(180deg); }
  .sticky-reserve:hover .sticky-toggle { background: var(--navy); }
}

/* ===== フッター（全ページ共通。特設サイト5つは template-parts/special/footer.php を使うため対象外）
   2026-09デザイン刷新：design_handoff_top_page/README.mdのフッター仕様に合わせた配色・書体。
   このほかにフッターを触っている所(2026-10-13 整理後): 背景の飾りより前に出す(z-index) = parallax-bg.css・subpage-alt.css(医院紹介) /
   トップ・別案ページの補足の書体は下の .tf-footer-hours-note のすぐ後ろ。
   トップページ本体（front-page.css）とは独立して、このファイル単体で完結させる
   （subpages.css を読み込むページでもフッターは同じ見た目にするため）。 ===== */
.tf-footer { padding: 56px 28px 24px; background-color: #EAF4F4; font-family: var(--font-serif); color: #3C5F64; }
.tf-footer a { color: #123C42; text-decoration: none; }
.tf-footer a:hover { color: #0D899C; }
.tf-footer-inner { max-width: 1200px; margin: 0 auto; }
.tf-footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.4fr 1fr; gap: 24px; margin-bottom: 40px; }
.tf-footer-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; text-decoration: none; }
.tf-footer-logo img { height: 30px; width: auto; display: block; }
.tf-footer-address { font-size: 16px; line-height: 2; }
.tf-footer-hours-wrap { margin-top: 18px; max-width: 520px; overflow-x: auto; border: 1px solid #A9D2D1; border-radius: 5px; }
.tf-footer-hours { border-collapse: collapse; width: 100%; font-size: 13px; text-align: center; }
/* 最低380pxの幅は1000px以上(フッターが横に5列のとき)だけ。左の欄の幅もこれで決まる。
   999px以下は欄の幅に収める(2026-10-15。以前はどの幅でも380pxで、タブレット・スマホの幅で「日」の列などが横スクロールしないと見えなかった) */
@media (min-width: 1000px) { .tf-footer-hours { min-width: 380px; } }
.tf-footer-hours thead tr { background: #0D899C; color: #FFFFFF; }
.tf-footer-hours th { padding: 10px 6px; font-weight: 700; }
.tf-footer-hours thead th:first-child { text-align: left; padding-left: 12px; }
.tf-footer-hours tbody tr:first-child { background: #FFFFFF; color: #123C42; }
.tf-footer-hours tbody td { padding: 10px 6px; }
.tf-footer-hours tbody tr:first-child td:first-child { text-align: left; padding-left: 12px; white-space: nowrap; }
.tf-footer-hours-note { padding: 10px 12px; background: #F5FAFA; color: #0D899C; font-style: italic; font-size: 13px; }
/* トップ・別案ページ(ドクター紹介・医院紹介・アクセス・診療案内)は補足だけゴシックの中太(2026-10-13 まとめ。元は top-font-shippori.css・chrome-alt.css に同じ指定) */
:is(body.top-font-shippori, body.chrome-alt) .tf-footer-hours-note { font-family: var(--font-sans); font-weight: 400; } /* ゴシックの太さ500は使わない(2026-10-15。補足は400・ラベルは700) */
.tf-footer-sns { display: flex; gap: 12px; margin-top: 18px; }
.tf-footer-sns a { width: 40px; height: 40px; border-radius: 50%; background: #EAF4F4; display: flex; align-items: center; justify-content: center; }
.tf-footer-col-title { font-size: 16px; font-weight: 700; color: #123C42; border-bottom: 2px solid #A9D2D1; padding-bottom: 8px; margin-bottom: 12px; }
.tf-footer-col-links { display: flex; flex-direction: column; gap: 8px; font-size: 16px; }
/* リンクの折り返しは全ページ共通の文節での折り返し(typography.css)に任せ、分けたくない所だけ footer.php でひとまとまり(.tf-footer-nowrap)にする。
   (2026-10-15 午後に keep-all を入れたが、文節での折り返しを上書きしてしまい、特設ページの細い列で「医院サイトトッ／プ」と割れたためやめた) */
.tf-footer-nowrap { white-space: nowrap; }
.tf-footer-col-links + .tf-footer-col-title { margin-top: 20px; }
.tf-footer-bottom { border-top: 1px solid #D4E9E9; padding-top: 18px; text-align: center; font-size: 14px; color: #3C5F64; }
.tf-footer-bottom a { color: #3C5F64; font-size: 12px; margin-left: 10px; }
/* 特設ページ（footer.php の tf-footer-grid--cols{列数}）：左の医院情報＋特設ページごとのリンク列。注意書きは列の下に全幅で出す */
.tf-footer-grid--cols1 { grid-template-columns: 1.6fr 2fr; }
.tf-footer-grid--cols2 { grid-template-columns: 1.6fr 1fr 1fr; }
.tf-footer-grid--cols3 { grid-template-columns: 1.6fr 1fr 1fr 1fr; }
.tf-footer-grid--cols4 { grid-template-columns: 1.6fr 1fr 1fr 1.2fr 1fr; }
.tf-footer-notes { margin: -16px 0 24px; font-size: 13px; line-height: 1.8; color: #3C5F64; }
.tf-footer-notes p { margin: 0; }
.tf-footer-notes .tf-footer-sources { margin-top: 6px; }
.tf-footer-notes .tf-footer-sources a { text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 999px) { .tf-footer-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 999px) { .tf-footer-grid--cols1 { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 767px) { .tf-footer-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
/* 999px以下は、医院情報の欄(ロゴ・住所・診療時間表)を横幅いっぱいに置き、リンクの列はその下に並べる(2026-10-15)。
   3列・2列の1つ分の幅では診療時間表が入りきらず、768pxで表の右側が約160px隠れていた */
/* 特設ページのフッター(リンクの列が3〜4つ)は、PCの幅でも医院情報を上に置き、リンクの列をその下に横に並べる(2026-10-15)。
   横に5列並べるとリンクの列が117〜162pxしかなく、「サロンと医療ホワイト／ニングの違い」などが割れていた */
@media (min-width: 1000px) {
  .tf-footer-grid--cols3 { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .tf-footer-grid--cols4 { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .tf-footer-grid--cols3 > :first-child, .tf-footer-grid--cols4 > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 999px) {
  .tf-footer-grid > :first-child { grid-column: 1 / -1; }
  .tf-footer-hours th, .tf-footer-hours tbody td { padding: 9px 4px; }
  .tf-footer-hours thead th:first-child, .tf-footer-hours tbody tr:first-child td:first-child { padding-left: 10px; }
}
/* 1列時も minmax(0,1fr) にする(2026-09-25修正)。単なる1frだと列の最小幅が中身に合わせて広がり、
   スマホ幅でページ全体が横にはみ出していた。表が入りきらないときは.tf-footer-hours-wrap(overflow-x:auto)の中で横スクロールする(2026-10-15 以降は320pxでも収まる)。 */
@media (max-width: 480px) { .tf-footer-grid { grid-template-columns: minmax(0,1fr); } }

@media (max-width: 640px) {
  .site-content section, .site-content > nav.breadcrumb { padding: 30px 0; }
  .section-inner { padding: 0 20px; }
  .tf-footer { padding: 36px 20px calc(20px + 58px); }
  /* 開いたメニューの最後の項目が、画面下端の予約バー（高さ58px）の裏に隠れないようにする */
  .tf-mobile-panel { padding-bottom: calc(20px + 58px); }

  /* スマホでは縦積みの浮きボタンをやめ、画面下端に貼り付く横並びバーにする */
  .sticky-reserve {
    left: 0; right: 0; bottom: 0; width: 100%;
    flex-direction: row; align-items: stretch; gap: 0;
    box-shadow: 0 -3px 12px rgba(27,53,84,0.15);
  }
  .sticky-reserve > div,
  .sticky-reserve > a.sticky-btn {
    flex: 1 1 0; min-width: 0;
  }
  .sticky-btn {
    width: 100%; height: 58px; border-radius: 0;
    font-size: 12px; gap: 4px;
  }
  .sticky-btn:hover { transform: none; box-shadow: none; }
  /* スマホは3つを常に表示し、「ご予約はこちら」ボタンは使わない */
  .sticky-btn.sticky-toggle { display: none; }
  .sticky-reserve > :not(.sticky-toggle) { opacity: 1; visibility: visible; transform: none; pointer-events: auto; transition: none; }
  /* 電話予約ボタンの枠(1/3幅)ではなく、画面下端の予約バー全体を基準に、画面幅いっぱいに開く */
  .sticky-reserve > div:first-child { position: static !important; }
  .tel-info-card {
    left: 0; right: 0; width: auto; bottom: 58px; padding: 16px 20px; border-radius: 12px 12px 0 0;
  }
}
