/* =========================================================
   テーマ用の追加スタイル（base.css → friendly.css → このファイルの順に読む）
   モックに無かったWordPress側の部品と、記号のSVG化への対応
   ========================================================= */

/* ---------- ページ内リンクで飛んだとき、固定ヘッダーの下に見出しが来るようにする ---------- */
/* --hdr はヘッダーの実際の高さ（site.js が設定。読み込み前はPCの高さを仮に使う） */
html { scroll-padding-top: calc(var(--hdr, 140px) + 16px); }
/* ログイン中は管理バー（上部の黒い帯）の下にヘッダーを固定する */
@media (min-width: 601px) { .admin-bar .site-header { top: 32px; } }
@media (min-width: 601px) and (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

/* ---------- TOP以外のページの本文の幅を1つにそろえる（PCで左右に余白。1行が長くなりすぎないように） ---------- */
/* 見出し帯・パンくず・本文・受診の帯を同じ 960px の列に。本文中の style="max-width:…" より優先する */
body:not(.home) .page-hero > .wrap,
body:not(.home) .crumbs,
body:not(.home) #main .section > .wrap { max-width: 960px !important; }
body:not(.home) #main .wrap .content { max-width: none; } /* 列の中にさらに狭い枠を作らない */

/* ---------- 固定ページ・一覧の見出し帯とパンくず（画面の高さを取りすぎないように詰める） ---------- */
.page-hero { padding: 28px 0 24px; }
.page-hero h1 { font-size: 1.75em; line-height: 1.35; }
.page-hero .en { margin-bottom: 2px; }
.page-hero p { margin-top: 6px; font-size: .95em; }
.crumbs { padding: 10px 0 0; line-height: 1.6; }
.crumbs + .section { padding-top: 24px; }
@media (max-width: 760px) {
  .page-hero { padding: 20px 0 18px; }
  .page-hero h1 { font-size: 1.4em; }
  .page-hero p { font-size: .9em; line-height: 1.6; }
  .crumbs { padding-top: 8px; font-size: .82em; }
  .crumbs + .section { padding-top: 18px; }
}

/* ---------- 共通 ---------- */
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.skip-link:focus { position: fixed; left: 12px; top: 12px; width: auto; height: auto; clip: auto; z-index: 100; background: #fff; color: var(--navy-ink); padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
.alertbar a { color: #fff; }
.sec-head-row { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.read-more { color: #C8502E; font-weight: 700; }
.fmed-wide .go { margin-left: auto; color: var(--orange); font-weight: 700; }
.muted { color: var(--muted); }

/* ---------- 写真（アイキャッチ） ---------- */
.photo .frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb { overflow: hidden; background: var(--sky-2); }
.thumb img { width: 100%; height: auto !important; aspect-ratio: 16 / 10; object-fit: cover; display: block; } /* 小さい画像はWPの切り抜きサイズが作られないので、CSSで比率をそろえる */
.news-feature .thumb img { aspect-ratio: 16 / 9; }
.post-card .ph { color: #8AA6B8; }
.post-card .ph svg { width: 48px; height: 48px; }
.article-thumb { margin: 0 0 28px; }
.article-thumb img { width: 100%; height: auto; border-radius: var(--radius); }

/* ---------- 診療時間（記号はSVG） ---------- */
.mk, .mk.ha, .mk.off { display: inline-block; width: auto; height: auto; background: none; border-radius: 0; vertical-align: middle; line-height: 0; }
.mk .mk-svg { display: block; width: 30px; height: 30px; }
.legend .mk .mk-svg { width: 22px; height: 22px; }
.htable tbody th .time { font-weight: 500; font-size: .92em; }
.doctor-note { margin: 10px 0 0; font-weight: 700; color: var(--navy-ink); }
/* 診療時間表：記号の下の補足（例：土曜「〜13:00」） */
.htable td .cell-note { display: block; margin-top: 2px; font-size: .78em; font-weight: 700; line-height: 1.2; color: var(--navy-ink); white-space: nowrap; letter-spacing: 0; }
.ft-hours td .cell-note { display: block; font-size: .72em; line-height: 1.2; white-space: nowrap; letter-spacing: 0; }
@media (max-width: 760px) { .htable td .cell-note { font-size: .68em; } }
.legend .legend-link { color: var(--navy); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.legend .legend-link::after { content: " →"; }
.hours-note p { margin: 0 0 .3em; }
.ft-hours-note { margin-top: 10px; }

/* ---------- 地図 ---------- */
.map-block { display: flex; flex-direction: column; gap: 12px; }
.map-block > .map-embed, .map-block > .map-ph { flex: 1; }
.map-app-btn { display: none; }
@media (max-width: 760px) { .map-app-btn { display: flex; width: 100%; } }
.map-embed { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: var(--sky-2); }
.map-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- 絞り込み（リンク） ---------- */
.news-filter a { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 16px; font-size: .9em; color: var(--navy); text-decoration: none; }
.news-filter a:hover { border-color: var(--navy); }
.news-filter a[aria-current="page"] { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- ページ送り ---------- */
.pagination { margin-top: 32px; }
.pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pagination .page-numbers { display: inline-grid; place-items: center; min-width: 48px; height: 48px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; text-decoration: none; font-weight: 700; color: var(--navy); }
.pagination .page-numbers.current { background: var(--navy); color: #fff; border-color: var(--navy); }
.pagination .page-numbers.dots { border: 0; background: none; }

/* ---------- 記事本文（ブロックエディタで書いた内容） ---------- */
.entry > * + * { margin-top: 0; }
.entry h2 { font-size: 1.45em; margin: 2em 0 .7em; padding-left: 14px; border-left: 6px solid var(--orange); }
.entry h3 { font-size: 1.18em; margin: 1.6em 0 .6em; color: var(--navy); }
.entry img { height: auto; border-radius: 12px; }
.entry figure { margin: 1.5em 0; }
.entry figcaption { font-size: .9em; color: var(--muted); margin-top: .5em; text-align: center; }
.entry table { width: 100%; border-collapse: collapse; margin: 1em 0 1.5em; }
.entry th, .entry td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.entry th { background: #FFF8EF; }
.entry .wp-block-table { overflow-x: auto; }
.entry blockquote { margin: 1.5em 0; padding: 14px 20px; background: var(--sky-2); border-left: 4px solid var(--navy); border-radius: 0 12px 12px 0; }
.entry .wp-block-embed iframe, .entry video { max-width: 100%; }
.entry .wp-block-embed__wrapper { position: relative; }
.entry .wp-block-button__link { background: var(--navy); color: #fff; border-radius: 999px; padding: .7em 1.6em; text-decoration: none; font-weight: 700; }
.entry .aligncenter { margin-left: auto; margin-right: auto; text-align: center; }
.entry .alignleft { float: left; margin: 0 1.5em 1em 0; }
.entry .alignright { float: right; margin: 0 0 1em 1.5em; }
.entry::after { content: ""; display: table; clear: both; }
.article .pager a { color: var(--navy-ink); }

/* ---------- ロゴ ---------- */
.brand-logo { width: 52px; height: 48px; flex: none; }

/* ---------- 本文中の写真（現行サイトから移したもの） ---------- */
.ph-photo { width: 100%; height: auto; border-radius: var(--radius); display: block; }
.ph-photo.contain { object-fit: contain; background: transparent; max-height: 320px; width: auto; margin: 0 auto; }
.photo-fig { margin: 1em 0 1.5em; }
.photo-fig figcaption { font-size: .88em; color: var(--muted); margin-top: .4em; }
.route li img { width: 100%; height: 110px; object-fit: cover; border-radius: 10px; display: block; }
.post-card .yt-thumb { width: 100%; aspect-ratio: 582 / 252; object-fit: cover; display: block; }

/* ---------- チェックリスト：✓を文字でなく図で描き、丸の中央にそろえる ---------- */
.checklist li { padding-left: 2em; }
.checklist li::before {
  content: ""; top: .3em; margin-top: 0; width: 1.3em; height: 1.3em; border-radius: 50%;
  background: var(--teal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 72% no-repeat;
}

/* ---------- 小児診療：動物が看板を持つ症状カード（現行サイトのイラスト） ---------- */
.sym-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 48px 28px; margin-top: 12px; }
.sym-card { display: flex; flex-direction: column; align-items: center; }
.sym-animal { width: 150px; height: auto; display: block; position: relative; z-index: 1; margin-bottom: -3px; }
.sym-board { align-self: stretch; flex: 1; background: #fff; border: 6px solid var(--board, var(--logo-aqua)); border-radius: 22px; padding: 20px 26px 18px; }
.sym-board h3 { text-align: center; font-size: 1.25em; margin: 0 0 .7em; }
.sym-list { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 28px; }
.sym-list li { break-inside: avoid; position: relative; padding-left: 1em; line-height: 1.6; margin-bottom: .5em; }
.sym-list li::before { content: ""; position: absolute; left: 0; top: .62em; width: .45em; height: .45em; border-radius: 50%; background: var(--board, var(--teal)); }
.sym-card.wide { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 24px; }
.sym-card.wide .sym-animal { width: 140px; margin: 0; flex: none; }
.sym-card.wide .sym-board { align-self: auto; }

/* ---------- 受付方法：取り方の手順 ---------- */
.howto { list-style: none; padding: 0; margin: 1.5em 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.howto li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 20px; }
.howto img { width: 170px; max-width: 100%; height: auto; margin: 0 auto 14px; display: block; }
.howto p { margin: 0; line-height: 1.7; }
.step-no { display: inline-grid; place-items: center; width: 1.8em; height: 1.8em; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; font-size: .9em; margin-right: .4em; vertical-align: .1em; }
.key { display: inline-grid; place-items: center; min-width: 1.8em; height: 1.8em; padding: 0 .3em; border: 2px solid var(--navy); border-radius: 8px; background: #fff; color: var(--navy); font-weight: 700; line-height: 1; margin: 0 .15em; font-family: inherit; font-size: .95em; }
.flow .no.round { border-radius: 50%; width: 56px; height: 56px; }

/* ---------- このページの目次（自動） ---------- */
.toc-auto { margin: 1.5em 0 2em; }
.toc-auto summary { cursor: pointer; font-weight: 700; color: var(--navy); list-style: none; display: flex; align-items: center; gap: .5em; }
.toc-auto summary::-webkit-details-marker { display: none; }
.toc-auto summary::after { content: ""; width: .55em; height: .55em; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-top: -.2em; transition: transform .15s; }
.toc-auto details[open] summary::after { transform: rotate(-135deg); margin-top: .25em; }
.toc-auto ol { margin: .6em 0 0; }
.toc-auto li { margin-bottom: .25em; }

/* ---------- 小児診療：分類へのボタン ---------- */
.sym-jump { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 32px; padding: 0; list-style: none; }
.sym-jump a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; background: #fff; border: 3px solid var(--board, var(--logo-aqua)); color: var(--navy-ink); font-weight: 700; text-decoration: none; }
.sym-jump a:hover { background: var(--sky-2); }

/* =========================================================
   押せる所・押せない所を見分けやすく
   ・押せないラベルはボタンに見せない（影・白い丸ボタン風をやめる）
   ・押せるカードには「→」を付け、マウスを乗せると動く
   ・電話番号：PC（マウス操作）では押しても何も起きないので文字として表示、
     スマホ（タッチ）では「タップで電話」の印を付ける
   ========================================================= */
/* 押せないラベル */
.ffv .eyebrow { box-shadow: none; background: transparent; padding: 0; }
.ffv-badges li { box-shadow: none; background: transparent; padding: 0 12px 0 0; }
.qual li { border: 0; background: var(--navy); color: #fff; border-radius: 4px; padding: 4px 12px; font-size: .9em; }

/* 押せるカードに矢印 */
.tel-card { position: relative; padding-right: 48px; transition: transform .15s, box-shadow .15s, filter .15s; }
.tel-card::before { content: "→"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-weight: 700; font-size: 1.3em; opacity: .9; }
.tel-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.ffv-cta a::after { content: "→"; margin-left: auto; font-weight: 700; font-size: 1.2em; }

/* PC（マウス操作）：電話番号は押せない文字として表示 */
@media (hover: hover) and (pointer: fine) {
  a[href^="tel:"] { pointer-events: none; cursor: text; text-decoration: none; }
  .tel-card[href^="tel:"] { padding-right: 22px; }
  .tel-card[href^="tel:"]::before { content: none; }
  .tel-card[href^="tel:"]:hover { transform: none; box-shadow: none; filter: none; }
  .ffv-tel a { color: var(--navy-ink); }
  .card .btn[href^="tel:"] { display: none; }                 /* 受付方法の「電話をかける」 */
  .cta-band .btn[href^="tel:"] { background: transparent; border-color: transparent; color: #fff; padding-left: 4px; }
}
/* スマホ（タッチ）：電話番号に「タップで電話」の印 */
@media (hover: none) {
  .tel-card[href^="tel:"]::before { content: none; }
  .tel-card[href^="tel:"]::after { content: "タップで電話をかける"; display: inline-block; margin-top: 10px; padding: 4px 14px; border-radius: 999px; background: rgba(255,255,255,.22); font-weight: 700; font-size: .88em; }
  .ffv-tel a { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 6px 16px; border-radius: 999px; background: var(--teal); color: #fff; font-size: 1.05em; }
  .ffv-tel a::before { content: "☎"; font-size: .9em; }
  .ft-tels a { text-decoration: underline; text-underline-offset: 4px; }
}

/* 受診の流れ：3つのボタンの高さ（位置）をそろえる（縦1列のスマホでは影響なし） */
.fstep { display: flex; flex-direction: column; }
.fstep p { margin-bottom: 18px; }
.fstep .btn { margin-top: auto; align-self: center; }

/* ---------- 問診票（小窓と受付方法ページ） ---------- */
.monshin-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 1em 0; }
.monshin-opt { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; text-align: center; }
.monshin-opt .btn { width: 100%; }
.monshin-opt p { margin: .8em 0 0; font-size: .95em; }
.monshin-opt .pdf-en { display: inline-block; margin-top: .6em; font-weight: 700; }
.monshin-notes { list-style: none; padding: 0; margin: 0; font-size: .92em; color: var(--muted); }
.monshin-notes li { position: relative; padding-left: 1.1em; margin-bottom: .3em; }
.monshin-notes li::before { content: "※"; position: absolute; left: 0; }
.monshin-dialog { width: min(560px, calc(100vw - 32px)); border: 0; border-radius: var(--radius-lg); padding: 28px 24px 22px; background: var(--cream); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.monshin-dialog::backdrop { background: rgba(18, 40, 44, .55); }
.monshin-dialog h2 { font-size: 1.4em; margin: 0 0 .2em; }
.monshin-dialog .monshin-options { grid-template-columns: 1fr; }
.dialog-close { position: absolute; right: 12px; top: 10px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; font-size: 28px; line-height: 1; color: var(--navy-ink); cursor: pointer; }
.dialog-close:hover { background: var(--sky); }

/* ---------- 院長のイラスト（ブログの著者欄・TOPの吹き出し） ---------- */
.author .av-img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; object-position: center 20%; background: #fff; border: 3px solid #fff; box-shadow: var(--shadow-sm); flex: none; }
.bubble:has(.bubble-av) { display: flex; align-items: center; gap: 12px; max-width: 300px; }
.bubble-av { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; object-position: center 20%; background: var(--sky); flex: none; }

/* ---------- めまい診療：検査機器の写真・動画 ---------- */
.test-media { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.test-media img { width: calc(50% - 4px); height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: #fff; }
.test-media img:only-child { width: 100%; }
.test-media video { width: 100%; border-radius: 10px; background: #000; }
.test-media figure { width: calc(50% - 4px); margin: 0; }
.test-media figure img { width: 100%; }
.test-media figcaption { margin-top: 4px; font-size: .85em; text-align: center; color: var(--muted); }
/* 本文（.entry/.content）の h3 上余白がカード内でも効いてしまうため、カード先頭の見出しは詰める */
.card > h3:first-child { margin-top: 0; }

/* ---------- めまいの病気一覧：解説へ移動できる項目 ---------- */
/* 多くの項目がリンクになっても落ち着いて見えるよう、色は増やさず「右端の矢印」と「小さな補足文」だけで示す。
   枠・背景のオレンジはマウスを重ねたときだけ。ページ内へ移動するリンク（#〜）は下向き、別ページは右向きの矢印。 */
.dz-list li.is-link { position: relative; padding-right: 44px; transition: background .15s, border-color .15s;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C64F24' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") no-repeat right 14px center / 18px; }
.dz-list li.is-link:has(a[href^="#"]) { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C64F24' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
.dz-list li.is-link a { color: inherit; text-decoration: none; }
.dz-list li.is-link a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.dz-list li.is-link .dz-more { display: block; margin-top: 2px; font-size: .8em; font-weight: 400; color: var(--muted); }
.dz-list li.is-link:hover { border-color: var(--orange); background-color: #FDF6F2; }
.dz-list li.is-link:hover .dz-more { color: var(--orange); text-decoration: underline; text-underline-offset: 3px; }
.dz-list li.is-link:has(a:focus-visible) { outline: 3px solid var(--orange); outline-offset: 2px; }
.callout:target { animation: ff-flash 1.6s ease-out; }
@keyframes ff-flash { from { box-shadow: 0 0 0 4px var(--orange); } to { box-shadow: 0 0 0 4px transparent; } }

/* ---------- 一時的に休止している項目（例：機器故障中の検査） ---------- */
.card.is-paused { background: #F3F5F5; border-style: dashed; }
.card.is-paused h3 { color: var(--muted); }
.paused-note { margin: 0 0 .5em; font-size: .92em; color: var(--text); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.paused-note .pill { font-size: .85em; }

/* ---------- 補聴器外来などの子ページリンク ---------- */
.card.link h3 { color: var(--navy-ink); }

@media (max-width: 760px) {
  .brand-logo { width: 40px; height: 37px; }
  /* メニューボタン：「メニュー」が2行に割れないように（iPhoneのボタンの余白を消し、改行させない） */
  .menu-btn { width: 58px; padding: 0; letter-spacing: 0; white-space: nowrap; -webkit-appearance: none; appearance: none; flex: none; }
  .menu-btn span { line-height: 1.1; margin-bottom: 2px; }
  .sym-grid { grid-template-columns: 1fr; gap: 40px; }
  .sym-card.wide { flex-direction: column; }
  .sym-board { padding: 18px 18px 14px; }
  .howto { grid-template-columns: 1fr; }
  .route li img { height: 180px; }
  .mk .mk-svg { width: 24px; height: 24px; }
  .legend .mk .mk-svg { width: 20px; height: 20px; }
  .htable tbody th .time { font-size: .85em; }
  .entry .alignleft, .entry .alignright { float: none; margin: 1em 0; }
  .grid[style*="grid-template-columns:320px"] { grid-template-columns: 1fr !important; } /* 院長あいさつの2列 */
  .pager { flex-direction: column; }
  .dtable.center th, .dtable.center td { padding: 8px 2px; font-size: .9em; } /* 補聴器外来の実施日（7列） */
}
@media (max-width: 420px) {
  .sym-list { columns: 1; }
}
