/*
 * Mahiru Base
 * 値は直書きせず、theme.json のトークンだけを参照する。
 */

/* 約物（、。「」など）を半角に詰める。日本語のページだけ */
:lang(ja) body {
	font-feature-settings: var(--wp--custom--yakumono);
}

/* フォントが halt に対応していないときは、yakumono.js が約物を包み、余白の半分を詰める */
.has-yakumono-trim .yk-close {
	margin-right: -0.5em;
}

.has-yakumono-trim .yk-open {
	margin-left: -0.5em;
}

.has-yakumono-trim .yk-middle {
	margin-inline: -0.25em;
}

/* 文字サイズのクラスに、行間・字間・太さを合わせてつける */
.has-display-font-size {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: var(--wp--custom--type--display--font-weight);
	line-height: var(--wp--custom--type--display--line-height);
	letter-spacing: var(--wp--custom--type--display--letter-spacing);
}

.has-lead-font-size {
	font-weight: var(--wp--custom--type--lead--font-weight);
	line-height: var(--wp--custom--type--lead--line-height);
	letter-spacing: var(--wp--custom--type--lead--letter-spacing);
}

.has-small-font-size {
	line-height: var(--wp--custom--type--small--line-height);
	letter-spacing: var(--wp--custom--type--small--letter-spacing);
}

.has-caption-font-size {
	line-height: var(--wp--custom--type--caption--line-height);
	letter-spacing: var(--wp--custom--type--caption--letter-spacing);
}

/* 英字書体を使う役割 */
.has-en-label-font-size,
.has-en-deco-font-size,
.has-tel-font-size,
.has-date-font-size {
	font-family: var(--wp--preset--font-family--accent);
	font-feature-settings: normal;
}

.has-en-label-font-size {
	font-weight: var(--wp--custom--type--en-label--font-weight);
	line-height: var(--wp--custom--type--en-label--line-height);
	letter-spacing: var(--wp--custom--type--en-label--letter-spacing);
	color: var(--wp--preset--color--primary);
}

.has-en-deco-font-size {
	font-weight: var(--wp--custom--type--en-deco--font-weight);
	line-height: var(--wp--custom--type--en-deco--line-height);
	letter-spacing: var(--wp--custom--type--en-deco--letter-spacing);
	color: var(--wp--preset--color--primary-soft);
}

.has-tel-font-size {
	font-weight: var(--wp--custom--type--tel--font-weight);
	line-height: var(--wp--custom--type--tel--line-height);
	letter-spacing: var(--wp--custom--type--tel--letter-spacing);
}

.has-date-font-size {
	font-weight: var(--wp--custom--type--date--font-weight);
	line-height: var(--wp--custom--type--date--line-height);
	letter-spacing: var(--wp--custom--type--date--letter-spacing);
	color: var(--wp--preset--color--text-muted);
}

/* メニュー：スマホ（ドロワー内）では PC より少し大きくする */
.wp-block-navigation {
	font-size: var(--wp--preset--font-size--nav);
	font-weight: var(--wp--custom--type--nav--font-weight);
	line-height: var(--wp--custom--type--nav--line-height);
	letter-spacing: var(--wp--custom--type--nav--letter-spacing);
}

.wp-block-navigation__responsive-container.is-menu-open {
	font-size: var(--wp--custom--type--nav--font-size-sp);
}

/* 繁体字のページ */
:lang(zh-Hant) body,
:lang(zh-TW) body {
	font-family: var(--wp--preset--font-family--zh-hant);
}

/* 見出しも繁体字のフォントにする（日本語のフォントのままだと、句読点が日本式の位置になり、漢字の形も混ざる） */
:lang(zh-Hant) :is(h1, h2, h3, h4, h5, h6),
:lang(zh-TW) :is(h1, h2, h3, h4, h5, h6) {
	font-family: var(--wp--preset--font-family--zh-hant);
}

/* 電話番号 [mahiru_tel] */
.mahiru-tel {
	display: inline-grid;
	gap: 2px;
	color: inherit;
	text-decoration: none;
}

.mahiru-tel__num {
	font-family: var(--wp--preset--font-family--accent);
	font-size: var(--wp--preset--font-size--tel);
	font-weight: var(--wp--custom--type--tel--font-weight);
	line-height: var(--wp--custom--type--tel--line-height);
	letter-spacing: var(--wp--custom--type--tel--letter-spacing);
	font-feature-settings: normal;
	white-space: nowrap;
}

.mahiru-tel__note {
	font-size: var(--wp--preset--font-size--caption);
	line-height: var(--wp--custom--type--caption--line-height);
	color: var(--wp--preset--color--text-muted);
	white-space: nowrap;
}

/* 診療時間表 [mahiru_hours] */
.mahiru-hours__table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.5;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.mahiru-hours__table th,
.mahiru-hours__table td {
	padding: 12px 4px;
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.mahiru-hours__table thead th {
	font-weight: 500;
}

.mahiru-hours__table tbody th {
	text-align: left;
	font-family: var(--wp--preset--font-family--accent);
	font-weight: 500;
	letter-spacing: 0.04em;
	white-space: nowrap;
	padding-right: 12px;
	font-feature-settings: normal;
}

.mahiru-hours__caption {
	font-size: var(--wp--preset--font-size--caption);
}

.mahiru-hours__table .is-on {
	color: var(--wp--preset--color--primary);
}

.mahiru-hours__table .is-off {
	color: var(--wp--preset--color--text-muted);
}

.mahiru-hours__note {
	margin: 10px 0 0;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--text-muted);
}

@media (max-width: 781px) {
	.mahiru-hours__table th,
	.mahiru-hours__table td {
		padding: 10px 2px;
	}

	.mahiru-hours__table tbody th {
		padding-right: 6px;
	}
}
