/*
 * Clinic Media — final design: "Soft Care" (C) with B's navy/blue accents.
 * Reference: Claude Design canvas, page 最終案 (docs/design/site-b-canvas).
 */

:root {
	--navy: #16324f;          /* site name, headings, primary buttons, footer */
	--navy-dark: #0f2a44;
	--blue: #2a6db0;          /* links, category labels, accent bars */
	--blue-soft: #e3f1fb;     /* chips, icon circles, active states */
	--blue-pale: #eef6fc;     /* table headers */
	--ground: #f3f8fc;        /* page background */
	--surface: #ffffff;
	--border: #d3e6f4;
	--text: #24384a;
	--muted: #4f6477;
	--footer-text: #dbe7f2;
	--pr: #7a5a12;
	--pr-bg: #fbf3dc;
	--pr-border: #c9a646;
	--note-bg: #fff8e8;
	--note-text: #4a3c14;

	--font: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
	--leading: 1.9;

	--radius-s: 12px;
	--radius: 20px;
	--radius-l: 28px;
	--pill: 999px;

	--space-1: 0.5rem;
	--space-2: 1rem;
	--space-3: 1.5rem;
	--space-4: 2.5rem;

	--wide: 1160px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--ground);
	color: var(--text);
	font-family: var(--font);
	font-size: 1rem;
	font-weight: 500;
	line-height: var(--leading);
}

img { max-width: 100%; height: auto; }
a { color: var(--blue); }
a:hover { color: var(--navy); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
h1, h2, h3, h4 { color: var(--navy); font-weight: 700; line-height: 1.5; word-break: auto-phrase; } /* Japanese: break at phrase boundaries where supported. */

.container { width: min(100% - 2 * var(--space-3), var(--wide)); margin-inline: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: var(--space-2); top: var(--space-2); z-index: 100; background: var(--surface); padding: var(--space-1) var(--space-2); }

/* ---------- Header ---------- */
.site-header { padding-top: 20px; }
.site-header__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); background: var(--surface); border-radius: var(--radius); padding: 14px 22px; }
.site-title { margin: 0; font-size: 1.3rem; }
.site-title a { display: flex; align-items: center; gap: 10px; color: var(--navy); text-decoration: none; }
.site-title__mark::before { content: attr(data-initial); }
.site-title__mark { flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.site-title .custom-logo-link { display: block; line-height: 0; }
.site-title .custom-logo { display: block; width: auto; max-width: min(240px, 60vw); max-height: 48px; }
.site-nav ul { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.site-nav a { display: block; padding: 10px 14px; border-radius: var(--pill); color: var(--text); text-decoration: none; font-size: 0.95rem; }
.site-nav a:hover { background: var(--blue-soft); color: var(--navy); }
.site-nav .current-menu-item > a,
.site-nav .current-menu-parent > a,
.site-nav .current-post-ancestor > a { background: var(--blue-soft); color: var(--navy); font-weight: 700; }
.site-nav .is-cta > a { padding-inline: 18px; background: var(--navy); color: #fff; }
.site-nav .is-cta > a:hover { background: var(--navy-dark); color: #fff; }
.site-header__bar { position: relative; }
.site-header__end { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* Header search: <details> opens a search box under the header (no JavaScript needed). */
.header-search__toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--pill); background: var(--navy); color: #fff; font-weight: 700; font-size: 0.95rem; cursor: pointer; list-style: none; }
.header-search__toggle::-webkit-details-marker { display: none; }
.header-search__toggle:hover { background: var(--navy-dark); }
.header-search[open] .header-search__toggle { background: var(--blue); }
.header-search__panel { position: absolute; right: 0; top: calc(100% + 10px); z-index: 20; width: min(480px, 100%); padding: 18px; border-radius: var(--radius); background: var(--surface); box-shadow: 0 12px 32px rgb(22 50 79 / 0.14); }
.header-search__panel .search-form { max-width: none; }

/* ---------- Layout ---------- */
.site-main { flex: 1; padding-block: var(--space-3) var(--space-4); }
.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.breadcrumbs { font-size: 0.82rem; color: var(--muted); margin-bottom: var(--space-2); }

.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: var(--space-2); }
.section-title { margin: 0; font-size: 1.4rem; }
.section-title::after { content: ""; display: block; width: 36px; height: 4px; margin-top: 8px; border-radius: var(--pill); background: var(--blue); }
.section-head a { font-weight: 700; font-size: 0.9rem; }
.section-note { margin: 0; font-size: 0.85rem; color: var(--muted); }

.panel { background: var(--surface); border-radius: var(--radius-l); padding: clamp(24px, 4vw, 40px); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--surface); border-radius: var(--radius-l); padding: clamp(32px, 5vw, 56px) clamp(24px, 4vw, 48px); }
.hero::before,
.hero::after { content: ""; position: absolute; z-index: 0; border-radius: 50%; pointer-events: none; }
.hero::before { right: -60px; top: -60px; width: 300px; height: 300px; background: var(--blue-soft); }
.hero::after { right: 140px; bottom: -90px; width: 200px; height: 200px; background: var(--blue-pale); }
.hero > * { position: relative; z-index: 1; } /* Decorative circles must never cover the search button. */
.hero__kicker { margin: 0 0 var(--space-1); font-weight: 700; color: var(--blue); }
.hero__title { margin: 0 0 var(--space-3); font-size: clamp(1.6rem, 3.4vw, 2.25rem); }

.search-form { display: flex; flex-wrap: wrap; gap: var(--space-1); max-width: 540px; }
.search-form label { flex: 1 1 260px; }
.search-field { width: 100%; height: 52px; padding: 0 20px; font: inherit; border: 2px solid var(--border); border-radius: var(--pill); background: #f9fcfe; }
.search-field:focus { border-color: var(--blue); outline: none; }
.search-submit,
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 28px; font: inherit; font-weight: 700; color: #fff; background: var(--navy); border: 0; border-radius: var(--pill); text-decoration: none; cursor: pointer; }
.search-submit:hover,
.button:hover { background: var(--navy-dark); color: #fff; }
.button--ghost { color: var(--navy); background: var(--surface); border: 1px solid var(--border); }
.button--ghost:hover { background: var(--blue-soft); color: var(--navy); }

/* ---------- Topics (お悩みから探す) ---------- */
.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.topic { display: flex; flex-direction: column; align-items: center; gap: 10px; height: 100%; padding: 20px 12px; background: var(--surface); border-radius: var(--radius); color: var(--navy); font-weight: 700; text-decoration: none; text-align: center; }
.topic:hover { color: var(--navy); box-shadow: 0 0 0 2px var(--blue-soft); }
.topic__icon { width: 52px; height: 52px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); display: flex; align-items: center; justify-content: center; }

/* ---------- Cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.card { display: flex; flex-direction: column; height: 100%; background: var(--surface); border-radius: 22px; overflow: hidden; color: var(--text); text-decoration: none; }
.card:hover { color: var(--text); box-shadow: 0 0 0 2px var(--blue-soft); }
.card__thumb { aspect-ratio: 16 / 9; margin: 10px 10px 0; border-radius: 16px; overflow: hidden; background: #dceefa; }
.card__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card__body { display: flex; flex-direction: column; gap: 8px; padding: 14px 20px 20px; }
.card__title { margin: 0; font-size: 1.05rem; line-height: 1.6; }
.card__meta { margin: 0; font-size: 0.82rem; color: var(--muted); }
.card__labels { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.card__labels:empty { display: none; }
.chip { align-self: flex-start; display: inline-block; padding: 2px 12px; border-radius: var(--pill); background: var(--blue-soft); color: var(--blue); font-size: 0.75rem; font-weight: 700; text-decoration: none; }
a.chip:hover { color: var(--navy); }
.pr-label { display: inline-block; padding: 0 10px; border: 1px solid var(--pr-border); border-radius: var(--pill); background: var(--pr-bg); color: var(--pr); font-size: 0.75rem; font-weight: 700; line-height: 1.7; vertical-align: middle; }
.card--interview { background: var(--ground); }
.card__credit { margin: 0; font-size: 0.72rem; color: var(--muted); }

/* ---------- Notice ---------- */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 16px 20px; border-radius: 18px; background: var(--note-bg); color: var(--note-text); font-size: 0.88rem; line-height: 1.8; }
.notice svg { flex: none; margin-top: 3px; }
.notice p { margin: 0; }
.site-disclaimer { margin: 0; padding: 16px 22px; border-radius: 16px; background: var(--surface); color: #43586b; font-size: 0.82rem; }

/* ---------- Single article ---------- */
/* Article card and its content span the full container, aligned with the header and breadcrumbs (user's choice). */
.article-wrap { width: 100%; }
.entry { background: var(--surface); border-radius: var(--radius-l); padding: clamp(24px, 5vw, 56px); }
.entry-header { display: flex; flex-direction: column; gap: 12px; margin-bottom: var(--space-3); }
.entry-title { margin: 0; font-size: clamp(1.5rem, 3vw, 1.95rem); line-height: 1.55; }
.entry-meta { margin: 0; font-size: 0.82rem; color: var(--muted); }
.entry-thumb { margin-block: 0 var(--space-3); }
.entry-thumb img { display: block; width: 100%; border-radius: var(--radius); }
.entry-thumb figcaption { margin-top: 6px; font-size: 0.8rem; color: var(--muted); }

.toc { margin-block: var(--space-3); padding: 20px 26px; border-radius: var(--radius); background: var(--ground); }
.toc__title { margin: 0 0 6px; font-weight: 700; color: var(--navy); }
.toc ol { margin: 0; padding-left: 1.4em; font-size: 0.95rem; }

.entry-content > * { margin-block: 0; }
.entry-content > * + * { margin-top: 1.1em; }
.entry-content h2 { margin: 2.2em 0 0; padding: 12px 20px; border-radius: 16px; background: var(--navy); color: #fff; font-size: 1.4rem; scroll-margin-top: 16px; }
.entry-content h3 { margin: 1.8em 0 0; font-size: 1.15rem; }
.entry-content h3::after { content: ""; display: block; width: 32px; height: 4px; margin-top: 6px; border-radius: var(--pill); background: var(--blue); }
.entry-content ul,
.entry-content ol { padding-left: 1.5em; }
.entry-content li + li { margin-top: 0.3em; }
.entry-content table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--border); border-radius: 18px; overflow: hidden; font-size: 0.95rem; }
.entry-content th,
.entry-content td { padding: 12px 16px; text-align: left; vertical-align: top; }
.entry-content tr + tr > * { border-top: 1px solid var(--border); }
.entry-content th { background: var(--blue-pale); color: var(--navy); }
.entry-content .wp-block-table { overflow-x: auto; }
.entry-content img { border-radius: 16px; }
.entry-content blockquote { margin-inline: 0; padding: 16px 20px; border-radius: 16px; background: var(--ground); }

.entry-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-block: var(--space-3) 0; padding: 0; list-style: none; font-size: 0.82rem; }
.entry-tags a { display: inline-block; padding: 4px 14px; border-radius: var(--pill); background: var(--blue-soft); font-weight: 700; text-decoration: none; }
.entry .notice { margin-top: var(--space-3); }
.related { margin-top: var(--space-4); }
.related .card-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }

/* ---------- Article layout: content + sidebar (posts) ---------- */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; }
.article-main { min-width: 0; }
.article-side { display: flex; flex-direction: column; gap: 20px; }
.side-box { background: var(--surface); border-radius: var(--radius); padding: 20px; }
.side-box__title { margin: 0 0 14px; font-size: 1rem; }
.side-box__title::after { content: ""; display: block; width: 28px; height: 3px; margin-top: 6px; border-radius: var(--pill); background: var(--blue); }
.side-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.side-list a { display: flex; align-items: flex-start; gap: 12px; color: var(--text); text-decoration: none; }
.side-list__thumb { flex: none; width: 76px; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: #dceefa; }
.side-list__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.side-list__body { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.side-list__title { color: var(--navy); font-size: 0.88rem; font-weight: 700; line-height: 1.55; }
.side-list a:hover .side-list__title { color: var(--blue); }
.topics--list { grid-template-columns: 1fr; gap: 6px; }
.topics--list .topic { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 8px 10px; border-radius: 14px; background: var(--ground); font-size: 0.9rem; text-align: left; }
.topics--list .topic__icon { width: 34px; height: 34px; background: var(--surface); }
.toc--side { position: sticky; top: 20px; margin: 0; background: var(--surface); }
.admin-bar .toc--side { top: 52px; }
.toc--side ol { font-size: 0.88rem; }
.toc--side li + li { margin-top: 4px; }
/* Wide screens: TOC lives in the sidebar. Narrow screens: sidebar drops below the article, TOC stays inline. */
/* Inquiry forms ([cmc_form] from clinic-media-core) */
.cmc-form { margin-top: var(--space-3); }
.cmc-form__field { margin: 0 0 var(--space-3); padding: 0; border: 0; }
.cmc-form__field > label, .cmc-form__field > legend { display: block; margin-bottom: 8px; font-weight: 700; color: var(--navy); }
.cmc-form__req, .cmc-form__opt { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: var(--pill); font-size: 0.72rem; font-weight: 700; vertical-align: 2px; }
.cmc-form__req { background: var(--navy); color: #fff; }
.cmc-form__opt { background: var(--blue-soft); color: var(--muted); }
.cmc-form input[type="text"], .cmc-form input[type="email"], .cmc-form input[type="url"], .cmc-form input[type="tel"], .cmc-form select, .cmc-form textarea {
	width: 100%; padding: 12px 16px; font: inherit; color: var(--text); border: 2px solid var(--border); border-radius: var(--radius-s); background: #f9fcfe;
}
.cmc-form textarea { line-height: 1.8; resize: vertical; }
.cmc-form input:focus, .cmc-form select:focus, .cmc-form textarea:focus { border-color: var(--blue); outline: none; background: var(--surface); }
.cmc-form [aria-invalid="true"] { border-color: #b32d2e; }
.cmc-form__check { display: flex; gap: 10px; align-items: center; margin: 6px 0; font-weight: 400; color: var(--text); cursor: pointer; }
.cmc-form__check input { width: 20px; height: 20px; accent-color: var(--navy); }
.cmc-form__help { margin: 0 0 8px; font-size: 0.84rem; color: var(--muted); }
.cmc-form__error { margin: 6px 0 0; font-size: 0.86rem; font-weight: 700; color: #b32d2e; }
.cmc-form__alert { margin: 0 0 var(--space-3); padding: 14px 18px; border-radius: var(--radius-s); background: #fcf0f1; color: #8a1f1f; font-weight: 700; }
.cmc-form__submit { margin-top: var(--space-4); text-align: center; }
.cmc-form__submit .button { min-width: 240px; }
.cmc-form--sent { padding: var(--space-3); border-radius: var(--radius); background: var(--blue-pale); border: 1px solid var(--border); }
.cmc-form--sent p { margin: 0 0 8px; }
/* Honeypot: off-screen for people, still in the form for bots. */
.cmc-form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (min-width: 1024px) {
	.toc--inline { display: none; }
}
@media (max-width: 1023px) {
	.article-layout { grid-template-columns: minmax(0, 1fr); }
	.toc--side { display: none; }
}

/* ---------- Interview articles ---------- */
.chip--interview { background: var(--navy); color: #fff; }
.card__thumb { display: flex; align-items: center; justify-content: center; }
.card__placeholder { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; background: rgb(255 255 255 / 0.7); color: var(--blue); }
.entry-jump { margin: 0; font-size: 0.88rem; font-weight: 700; }

.info-table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--border); border-radius: 18px; overflow: hidden; font-size: 0.95rem; }
.info-table th,
.info-table td { padding: 12px 16px; text-align: left; vertical-align: top; }
.info-table th { width: 9em; background: var(--blue-pale); color: var(--navy); white-space: nowrap; }
.info-table tr + tr > * { border-top: 1px solid var(--border); }
.info-table a { overflow-wrap: anywhere; }

.treatment-box,
.clinic-box { margin-top: var(--space-4); padding: clamp(20px, 3vw, 28px); border: 2px solid var(--border); border-radius: var(--radius); scroll-margin-top: 16px; }
.treatment-box__title,
.clinic-box__name { margin: 0 0 14px; font-size: 1.2rem; }
.treatment-box__note { margin: 12px 0 0; font-size: 0.82rem; color: var(--muted); }
.clinic-box { background: var(--ground); border-color: transparent; }
.clinic-box__kicker { margin: 0 0 4px; font-size: 0.8rem; font-weight: 700; color: var(--blue); }
.clinic-box__name a { color: var(--navy); }
.clinic-box .info-table { background: var(--surface); }
.clinic-box p:last-child { margin: 16px 0 0; }

/* FAQ: every h3 is a question. */
.interview-faq .entry-content h3 { display: flex; align-items: flex-start; gap: 10px; }
.interview-faq .entry-content h3::before { content: "Q"; flex: none; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 1rem; line-height: 1; }
.interview-faq .entry-content h3::after { content: none; }
.interview-faq .entry-content h3 + p { padding-left: 42px; }

/* ---------- Clinic page ---------- */
.clinic__overview { display: grid; gap: 24px; }
.clinic__overview.has-thumb { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; }
.clinic__thumb { margin: 0; }
.clinic__thumb img { display: block; width: 100%; border-radius: var(--radius); }
.clinic__thumb figcaption { margin-top: 6px; font-size: 0.8rem; color: var(--muted); }
.clinic__section { margin-top: var(--space-4); }
.clinic__heading { margin: 0 0 var(--space-2); font-size: 1.25rem; }
.clinic__heading::after { content: ""; display: block; width: 32px; height: 4px; margin-top: 6px; border-radius: var(--pill); background: var(--blue); }
.clinic-map { overflow: hidden; aspect-ratio: 16 / 9; border-radius: var(--radius); background: var(--blue-pale); }
.clinic-map iframe { display: block; width: 100%; height: 100%; border: 0; }
.clinic-map__link { margin: 8px 0 0; font-size: 0.88rem; font-weight: 700; }
.clinic__note { margin: var(--space-4) 0 0; font-size: 0.82rem; color: var(--muted); }

.clinic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.clinic-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; height: 100%; padding: 20px 22px; border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; }
.clinic-card:hover { color: var(--text); box-shadow: 0 0 0 2px var(--blue-soft); }
.clinic-card__name { color: var(--navy); font-size: 1.1rem; font-weight: 700; }
.clinic-card__line { font-size: 0.85rem; color: var(--muted); }

@media (max-width: 760px) {
	.clinic__overview.has-thumb { grid-template-columns: minmax(0, 1fr); }
	.info-table th { width: 6.5em; white-space: normal; }
}

/* ---------- Pages / archives ---------- */
.page-header { margin-bottom: var(--space-3); }
.page-title { margin: 0; font-size: 1.6rem; }
.page-title::after { content: ""; display: block; width: 36px; height: 4px; margin-top: 8px; border-radius: var(--pill); background: var(--blue); }
.archive-description { margin-top: var(--space-1); color: var(--muted); }

.pagination { margin-top: var(--space-4); text-align: center; }
.pagination .page-numbers { display: inline-block; min-width: 44px; padding: 8px 12px; margin: 0 2px; border-radius: var(--pill); background: var(--surface); color: var(--navy); text-decoration: none; }
.pagination .current { background: var(--navy); color: #fff; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: var(--footer-text); font-size: 0.9rem; }
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); padding-block: 36px; }
.site-footer__name { font-size: 1.15rem; font-weight: 700; color: #fff; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 0; list-style: none; }
.footer-links a { color: var(--footer-text); text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.site-footer__copy { width: 100%; margin: 0; color: #b9cde0; }

@media (max-width: 600px) {
	.site-header__bar { padding: 12px 16px; }
	.site-nav a { padding: 8px 10px; }
	.hero::before { width: 200px; height: 200px; }
	.entry-content h2 { font-size: 1.2rem; padding: 10px 16px; }
}
