/**
 * layout — l-header / l-drawer / l-bottom-bar / l-footer
 * 仕様: docs/build-specs/chrome.md / DECISIONS.md。mobile-first（600/1000/1280pxのみ）
 * Arkhe 親の .l-header/.l-footer 基本則（背景・z-index）は本ファイルの宣言で上書きする
 */

/* --- 共通: クローム内の準備中（Coming Soon）表示 ----------- */

.l-header .is-coming-soon,
.l-drawer .is-coming-soon,
.l-footer .is-coming-soon {
	color: var(--color-text-muted);
	opacity: 0.65;
	pointer-events: none;
	cursor: default;
	text-decoration: none;
}

/* クローム内のリストはプレーンに */
.l-header ul,
.l-drawer ul,
.l-footer__sitemap ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* =========================================================
   l-header
   ========================================================= */

.l-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(255, 255, 255, 0.9);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--color-line);
	width: 100%;
	color: var(--color-text);
}

.l-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 2rem;
	height: 3.75rem; /* SP 60px */
	padding-inline: var(--space-header-x);
}

.l-header__brand {
	display: flex;
	align-items: center;
	transition: opacity 150ms ease-out;
}

.l-header__brand img {
	display: block;
	width: auto;
	height: 2.25rem; /* SP 36px */
}

@media (hover: hover) {
	.l-header__brand:hover {
		opacity: 0.8;
	}
}

/* --- PCナビ（≥1280pxのみ） --- */

.l-header__nav {
	display: none;
}

/* --- PC actions（電話＋WEB予約） --- */

.l-header__actions {
	display: none;
}

.l-header__tel {
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	line-height: 1.4;
}

.l-header__tel-label {
	font-size: var(--fs-caption);
	color: var(--color-text-muted);
}

.l-header__tel-number {
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: var(--fs-title-s);
	color: var(--color-text);
}

/* --- SPハンバーガー --- */

.l-header__menu-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.375rem;
	width: var(--tap-min);
	height: var(--tap-min);
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	cursor: pointer;
	flex-shrink: 0;
}

.l-header__menu-bar {
	display: block;
	width: 1.5rem;
	height: 0.15625rem; /* 2.5px */
	border-radius: 0.125rem;
	background: var(--color-secondary);
}

@media (min-width: 1280px) { /* クローム切替: PCナビが収まる下限（下は SPドロワー） */
	.l-header__inner {
		height: 5.125rem; /* PC 82px */
	}

	.l-header__brand img {
		height: 2.5rem; /* PC 40px */
	}

	.l-header__menu-btn {
		display: none;
	}

	.l-header__actions {
		display: flex;
		align-items: center;
		gap: 1rem;
		flex-shrink: 0;
	}

	.l-header__nav {
		display: block;
		margin-left: auto;
		align-self: stretch;
	}

	.l-header__nav-list {
		display: flex;
		align-items: stretch;
		gap: 0.75rem; /* 12px。「アクセス・診療時間」を 1280px で収めるため 20px から詰めた（2026-10-04） */
		height: 100%;
	}

	.l-header__nav-item {
		display: flex;
		align-items: stretch;
	}

	.l-header__nav-link {
		position: relative;
		display: inline-flex;
		align-items: center;
		font-family: var(--font-heading);
		font-weight: 400;
		font-size: var(--fs-nav);
		letter-spacing: 0.04em;
		color: var(--color-text);
		text-decoration: none;
		transition: color 150ms ease-out;
	}

	/* ティール下線（ホバーで左から伸びる／カレントは常時） */
	.l-header__nav-link::after {
		content: "";
		position: absolute;
		left: 0;
		right: 0;
		bottom: 1.65rem;
		height: 0.125rem;
		border-radius: 1px;
		background: var(--color-secondary);
		transform: scaleX(0);
		transform-origin: left center;
		transition: transform 150ms ease-out;
	}

	.l-header__nav-link[aria-current="page"] {
		color: var(--color-text-secondary);
	}

	.l-header__nav-link[aria-current="page"]::after {
		transform: none;
		transition: none;
	}

	.l-header__nav-link:focus-visible {
		color: var(--color-text-secondary);
	}

	/* --- ドロップダウン（診療案内） --- */

	.l-header__dropdown {
		position: absolute; /* 位置基準は .l-header（sticky） */
		top: 100%;
		right: var(--space-header-x);
		width: 43.5rem; /* 696px */
		padding: 1.5rem;
		background: var(--color-base);
		border: 1px solid var(--color-line);
		border-radius: var(--radius);
		display: grid;
		gap: 1rem;
		opacity: 0;
		visibility: hidden;
		transform: translateY(-0.5rem);
		transition: opacity 150ms ease-out, transform 150ms ease-out, visibility 0s linear 150ms;
	}

	.l-header__dropdown.is-open {
		opacity: 1;
		visibility: visible;
		transform: none;
		transition: opacity 150ms ease-out, transform 150ms ease-out;
	}

	.l-header__dropdown-grid {
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		gap: 0.5rem 0.75rem;
	}

	.l-header__dropdown-item {
		display: flex;
		align-items: center;
		gap: 0.625rem;
		min-height: var(--tap-min);
		padding: 0.625rem 0.5rem;
		border-radius: var(--radius);
		font-family: var(--font-heading);
		font-size: var(--fs-note);
		color: var(--color-text);
		text-decoration: none;
		transition: background-color 150ms ease-out;
	}

	.l-header__dropdown-item img {
		width: 1.75rem;
		height: 1.75rem;
		flex-shrink: 0;
	}

	.l-header__dropdown-more {
		display: inline-flex;
		align-items: center;
		gap: 0.5rem;
		padding-top: 1rem;
		border-top: 1px solid var(--color-line);
		font-family: var(--font-heading);
		font-weight: 700;
		font-size: var(--fs-note);
		color: var(--color-text-accent);
		text-decoration: none;
	}
}

@media (hover: hover) and (min-width: 1280px) {
	.l-header__nav-link:hover {
		color: var(--color-text-secondary);
	}

	.l-header__nav-link:hover::after {
		transform: scaleX(1);
	}

	.l-header__dropdown-item:hover {
		background: var(--color-bg-cream);
	}

	.l-header__dropdown-more:hover {
		text-decoration: underline;
	}
}

/* =========================================================
   l-drawer（<1280px）
   ========================================================= */

.l-drawer__overlay {
	position: fixed;
	inset: 0;
	z-index: 190;
	background: rgba(74, 64, 56, 0.5); /* --color-text ベース */
	opacity: 0;
	pointer-events: none;
	transition: opacity 240ms ease-out;
}

.l-drawer__overlay.is-open {
	opacity: 1;
	pointer-events: auto;
}

.l-drawer {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 200;
	width: 100%;
	display: flex;
	flex-direction: column;
	background: var(--color-bg-cream);
	overflow-y: auto;
	overscroll-behavior: contain;
	transform: translateX(100%);
	visibility: hidden;
	transition: transform 180ms ease-in, visibility 0s linear 180ms; /* 閉 180ms */
}

.l-drawer.is-open {
	transform: none;
	visibility: visible;
	transition: transform 240ms ease-out; /* 開 240ms */
}

.l-drawer__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 3.75rem;
	padding-inline: 1rem;
	background: var(--color-base);
	flex-shrink: 0;
}

.l-drawer__brand {
	display: flex;
	align-items: center;
}

.l-drawer__brand img {
	display: block;
	width: auto;
	height: 2.25rem;
}

.l-drawer__close {
	width: var(--tap-min);
	height: var(--tap-min);
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	cursor: pointer;
}

.l-drawer__close img {
	display: block;
}

/* --- navRow --- */

.l-drawer__item {
	border-bottom: 1px solid var(--color-line);
}

.l-drawer__row {
	display: flex;
	align-items: stretch;
}

.l-drawer__link {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	min-height: 3.75rem; /* 60px */
	padding-inline: 1.5rem;
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: var(--fs-title-s);
	color: var(--color-text);
	text-decoration: none;
}

.l-drawer__row .l-drawer__link {
	padding-right: 0.5rem;
}

.l-drawer__chevron img {
	display: block;
}

.l-drawer__sub-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--tap-min);
	min-height: 3.75rem;
	margin: 0;
	margin-right: 0.75rem;
	padding: 0;
	background: none;
	border: 0;
	cursor: pointer;
}

.l-drawer__sub-icon {
	display: block;
}

.l-drawer__sub-icon img {
	display: block;
}

.l-drawer__sub-icon--minus {
	display: none;
}

.l-drawer__sub-toggle[aria-expanded="true"] .l-drawer__sub-icon--plus {
	display: none;
}

.l-drawer__sub-toggle[aria-expanded="true"] .l-drawer__sub-icon--minus {
	display: block;
}

/* --- サブメニュー（診療案内 12科目） --- */

.l-drawer__sub {
	background: var(--color-base);
}

.l-drawer__sub li + li {
	border-top: 1px solid var(--color-line);
}

.l-drawer__sub-link {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	min-height: 3rem; /* 48px */
	padding-left: 2.5rem; /* 左インデント40px */
	padding-right: 1.5rem;
	font-family: var(--font-heading);
	font-size: var(--fs-nav);
	color: var(--color-text);
	text-decoration: none;
}

.l-drawer__sub-link img {
	width: 1.5rem;
	height: 1.5rem;
	flex-shrink: 0;
}

/* --- ドロワー下部CTA --- */

.l-drawer__cta {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	padding: 1.5rem;
	margin-top: auto;
}

.l-drawer__hours {
	margin: 0;
	font-size: var(--fs-eyebrow);
	line-height: 1.7;
	color: var(--color-text-muted);
}

/* Instagram（アイコンのみ・中央寄せ） */
.l-drawer__sns {
	align-self: center;
	justify-content: center;
	min-width: var(--tap-min);
	color: var(--color-text);
}

.l-drawer__sns .c-sns-link__icon {
	width: 1.75rem;
	height: 1.75rem;
}

@media (min-width: 600px) {
	.l-drawer {
		width: min(26.25rem, 100%);
		box-shadow: -0.5rem 0 2rem rgba(74, 64, 56, 0.2);
	}
}

@media (min-width: 1280px) {
	.l-drawer,
	.l-drawer__overlay {
		display: none;
	}
}

/* body スクロールロック（ドロワー表示中） */
body.is-drawer-open {
	overflow: hidden;
}

/* =========================================================
   l-bottom-bar（<1280px・固定）
   ========================================================= */

.l-bottom-bar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 90;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.75rem;
	padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
	background: var(--color-base);
	border-top: 1px solid var(--color-line);
}

.l-bottom-bar > * {
	min-width: 0;
}

body.is-drawer-open .l-bottom-bar {
	visibility: hidden;
}

/* トップのFV表示中は隠す（site.js が付与）。FVを通過したらせり上がる */
.l-bottom-bar {
	transition: transform 0.25s ease-out, opacity 0.25s ease-out;
}

.l-bottom-bar.is-hidden {
	transform: translateY(100%);
	opacity: 0;
	pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
	.l-bottom-bar {
		transition: none;
	}
}

@media (min-width: 1280px) {
	.l-bottom-bar {
		display: none;
	}
}

/* =========================================================
   l-footer
   ========================================================= */

.l-footer {
	background: var(--color-text); /* ダーク帯の地。[A]は白で上書き */
	color: var(--color-base);
	position: relative;
	z-index: 0;
	/* SPは固定ボトムバーの高さぶんを確保 */
	padding-bottom: calc(4.375rem + env(safe-area-inset-bottom));
}

@media (min-width: 1280px) { /* 固定ボトムバーぶんの余白を外す＝バー非表示と同じ境界 */
	.l-footer {
		padding-bottom: 0;
	}
}

/* --- [A] 診療時間・アクセス帯 --- */

.l-footer__access {
	background: var(--color-base);
	color: var(--color-text);
	padding-block: 3rem;
}

.l-footer__access-grid {
	display: grid;
	gap: 1.5rem;
	margin-top: 1.5rem;
}

.l-footer__access-note {
	margin: 0.75rem 0 0;
	font-size: var(--fs-caption);
	line-height: 1.7;
	color: var(--color-text-muted);
}

.l-footer__address {
	margin-top: 1.5rem;
	display: grid;
	gap: 0.5rem;
}

.l-footer__address p {
	margin: 0;
}

.l-footer__address-main {
	font-size: var(--fs-caption);
	line-height: 1.7;
	color: var(--color-text);
}

.l-footer__address-note {
	font-size: var(--fs-caption);
	line-height: 1.7;
	color: var(--color-text-muted);
}

.l-footer__access-tel {
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: var(--fs-title-s);
	color: var(--color-text);
}

.l-footer__access-tel a {
	color: inherit;
	text-decoration: none;
}

.l-footer__map {
	border-radius: var(--radius);
	overflow: hidden;
	height: 13.75rem; /* SP 220px */
	background: var(--color-bg-cream);
}

.l-footer__map iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

@media (min-width: 1000px) {
	.l-footer__access {
		padding-block: 5rem;
	}

	.l-footer__access-grid {
		grid-template-columns: 1fr 31.25rem; /* 右カラム=マップ 500px */
		gap: 3rem;
		margin-top: 2.25rem;
	}

	.l-footer__access-note {
		font-size: var(--fs-note);
	}

	.l-footer__address-main {
		font-size: var(--fs-nav);
	}

	.l-footer__address-note {
		font-size: var(--fs-note);
	}

	.l-footer__access-tel {
		font-size: 1.5rem; /* 24px */
		letter-spacing: -0.02em;
	}

	.l-footer__map {
		height: 26.25rem; /* 420px */
	}
}

/* --- [B] ダーク帯 --- */

.l-footer__main {
	padding-block: 3rem 1.5rem;
}

.l-footer__main .c-eyebrow {
	color: var(--color-base);
}

.l-footer__main-grid {
	display: grid;
	gap: 1.5rem;
}

.l-footer__clinic {
	display: grid;
	gap: 0.5rem;
	justify-items: start;
	align-content: start;
}

.l-footer__clinic-logo img {
	display: block;
	width: auto;
	height: 2.5rem;
	/* 白文字版をフッターの背景に直接配置。 */
}

.l-footer__clinic-address {
	margin: 0;
	font-size: var(--fs-eyebrow);
	line-height: 1.7;
}

.l-footer__clinic-tel {
	margin: 0;
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: var(--fs-body);
}

.l-footer__clinic-tel a {
	color: inherit;
	text-decoration: none;
}

.l-footer__reserve {
	margin-top: 0.5rem;
}

/* PC専用: OPENING HOURS ミニ時間表 */
.l-footer__hours-table {
	margin-top: 0.75rem;
	border-collapse: collapse;
	font-size: var(--fs-caption);
	line-height: 1.6;
}

.l-footer__hours-table th,
.l-footer__hours-table td {
	padding: 0.125rem 0.25rem;
	font-weight: 400;
	text-align: center;
	white-space: nowrap;
	background: transparent; /* Arkhe 親の th 背景を無効化 */
	color: inherit;
	border: 0;
}

.l-footer__hours-table tbody th {
	text-align: left;
	padding-right: 0.5rem;
}

.l-footer__hours-note {
	margin: 0.5rem 0 0;
	font-size: var(--fs-caption);
	line-height: 1.7;
}

/* サイトマップ */
.l-footer__sitemap {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid rgba(255, 255, 255, 0.24);
}

.l-footer__sitemap-col {
	display: grid;
	gap: 1.25rem;
	align-content: start;
}

.l-footer__sitemap-title {
	margin: 0 0 0.625rem;
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: var(--fs-caption);
}

.l-footer__sitemap ul {
	display: grid;
	gap: 0.625rem;
}

.l-footer__sitemap a {
	font-size: var(--fs-eyebrow);
	color: var(--color-base);
	opacity: 0.85;
	text-decoration: none;
}

.l-footer__sitemap .is-coming-soon {
	font-size: var(--fs-eyebrow);
	color: var(--color-base);
	opacity: 0.5;
}

@media (hover: hover) {
	.l-footer__sitemap a:hover {
		opacity: 1;
		text-decoration: underline;
	}
}

@media (min-width: 1000px) {
	/* base.css の .u-sp-only より後に読み込まれる本ファイルの display 指定
	   （grid / inline-flex 等）が勝たないよう、フッター内は明示的に非表示にする */
	.l-footer .u-sp-only {
		display: none;
	}

	.l-footer__main {
		padding-block: 4rem 2rem;
	}

	.l-footer__main-grid {
		grid-template-columns: 1fr auto auto;
		gap: 4rem;
	}

	.l-footer__clinic {
		gap: 1rem;
	}

	.l-footer__clinic-address {
		font-size: var(--fs-note);
	}

	.l-footer__clinic-tel {
		font-size: var(--fs-lead); /* 21px */
	}

	.l-footer__sitemap {
		display: flex;
		gap: 3rem;
		padding-top: 0;
		border-top: 0;
	}

	.l-footer__sitemap-col {
		display: contents; /* PCは3グループを横並びに */
	}

	.l-footer__sitemap-title {
		font-size: var(--fs-title-s);
		margin-bottom: 0.75rem;
	}

	.l-footer__sitemap a,
	.l-footer__sitemap .is-coming-soon {
		font-size: var(--fs-caption);
	}
}

/* --- [C] コピーライト --- */

.l-footer__copyright {
	border-top: 1px solid var(--color-line);
	padding-block: 1rem 2rem;
	text-align: center;
}

.l-footer__copyright small {
	font-family: var(--font-en);
	font-weight: 600;
	font-size: var(--fs-eyebrow);
	letter-spacing: 0.08em;
	opacity: 0.7;
}

@media (min-width: 1000px) {
	.l-footer__copyright {
		text-align: left;
	}

	.l-footer__copyright small {
		letter-spacing: var(--ls-eyebrow);
		opacity: 1;
	}
}

/* =========================================================
   動きの抑制
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
	.l-drawer,
	.l-drawer__overlay,
	.l-header__dropdown,
	.l-header__nav-link,
	.l-header__nav-link::after,
	.c-btn,
	.c-btn__arrow {
		transition: none !important;
	}
}
