/**
 * Final compatibility layer.
 * Loaded after legacy AFFINGER/custom CSS. Cross-plugin typography and small
 * responsive guards belong here; component colors, borders and layouts stay in
 * each plugin stylesheet so the same rule is not copied into every plugin.
 */
:root {
	--aoki-final-font: var(--aoki-reading-font, -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif);
}

/* 本文・サイドバーのいずれでも、商品カードの文字だけ別書体にならないようにする。 */
:where(.aam-product, .aam-ranking, .aam-textlink, .aam-product-link) {
	font-family: var(--aoki-final-font);
}

body.wp-singular #content .entry-content :where(
	.st-mybox,
	.st-in-mybox,
	.st-user-comment-text,
	.st-point,
	.st-cmemo,
	.st-midasibox,
	.st-flexbox,
	.aoki-pm-section,
	.aoki-pm-richtext,
	.aoki-pm-taste,
	.aoki-pm-cultivation,
	.aam-product,
	.aam-ranking,
	.yyi-rinker-box,
	.yyi-rinker-contents
) {
	font-family: var(--aoki-final-font);
}

body.wp-singular #content .entry-content :where(
	.st-mybox,
	.st-in-mybox,
	.st-user-comment-text,
	.st-point,
	.st-cmemo,
	.st-midasibox,
	.aoki-pm-section,
	.aoki-pm-richtext,
	.aoki-pm-taste,
	.aoki-pm-cultivation,
	.aam-product,
	.aam-ranking,
	.yyi-rinker-box,
	.yyi-rinker-contents
) :where(p, li, dt, dd, a, strong, small, span, div, button):not(.fa):not(.fas):not(.far):not(.fab):not(.dashicons) {
	font-family: var(--aoki-final-font);
}

body.wp-singular #content .entry-content :where(
	.st-in-mybox,
	.st-user-comment-text,
	.aoki-pm-richtext,
	.aoki-pm-cultivation
) :where(p, li, dt, dd) {
	font-size: 17px;
	font-weight: 400;
	line-height: 1.7;
	letter-spacing: normal;
}

body.wp-singular #content .entry-content :where(
	.st-mybox-title,
	.st-user-comment-title,
	.aoki-pm-section-title,
	.aoki-pm-card-title,
	.aam-product__title,
	.aam-product__title-link,
	.aam-ranking__title,
	.aam-ranking__product-title,
	.yyi-rinker-title,
	.yyi-rinker-title a
) {
	font-family: var(--aoki-final-font);
	font-weight: 700;
	line-height: 1.55;
	letter-spacing: .01em;
}

body.wp-singular #content .entry-content :where(
	.yyi-rinker-link a,
	.yyi-rinker-links a,
	.yyi-rinker-button,
	.aoki-affiliate-button
) {
	min-height: 44px;
	font-family: var(--aoki-final-font);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.45;
}

:where(
	.aoki-fm-sales-notice,
	.aoki-fm-shop,
	.aoki-fm-harvest,
	.aoki-fm-store-guide
) {
	font-family: var(--aoki-final-font);
}

:where(
	.aoki-fm-sales-notice,
	.aoki-fm-shop,
	.aoki-fm-harvest,
	.aoki-fm-store-guide
) :where(p, li, dt, dd, a, strong, small, span, div, button, h2, h3, h4):not(.fa):not(.fas):not(.far):not(.fab):not(.dashicons) {
	font-family: var(--aoki-final-font);
}

:where(
	.aoki-fm-sales-status,
	.aoki-fm-shop-title,
	.aoki-fm-cal-title,
	.aoki-fm-harvest-title,
	.aoki-fm-store-guide h2,
	.aoki-fm-store-guide h3
) {
	font-family: var(--aoki-final-font);
	font-weight: 700;
	line-height: 1.55;
	letter-spacing: .01em;
}

:where(
	.aoki-fm-sales-notice > p,
	.aoki-fm-sales-link,
	.aoki-fm-shop-info,
	.aoki-fm-store-guide p,
	.aoki-fm-store-guide li,
	.aoki-fm-store-guide dt,
	.aoki-fm-store-guide dd,
	.aoki-fm-harvest-heading p,
	.aoki-fm-cal-legend
) {
	font-family: var(--aoki-final-font);
	font-size: 17px;
	font-weight: 400;
	line-height: 1.7;
	letter-spacing: normal;
}

/* Aokiアフィリエイトは商品説明を本文と同じ基準へ寄せ、カードの役割・配色は維持する。 */
body.wp-singular #content .entry-content :where(
	.aam-product__decision-row dd,
	.aam-product__cta-note,
	.aam-ranking__reason,
	.aam-ranking__note
) {
	font-family: var(--aoki-final-font);
	line-height: 1.7;
	overflow-wrap: anywhere;
}

body.wp-singular #content .entry-content .aam-product__decision-row dd {
	font-size: 15px;
}

body.wp-singular #content .entry-content :where(
	.aam-product__button,
	.aam-textlink,
	.aam-product-link,
	.aam-ranking__link
) {
	font-family: var(--aoki-final-font);
}

@media (max-width: 600px) {
	body.wp-singular #content .entry-content :where(
		.st-in-mybox,
		.st-user-comment-text,
		.aoki-pm-richtext,
		.aoki-pm-cultivation
	) :where(p, li, dt, dd) {
		font-size: 17px;
		line-height: 1.75;
	}

	body.wp-singular #content .entry-content :where(.st-mybox, .aoki-pm-section, .yyi-rinker-box) {
		max-width: 100%;
		overflow-wrap: anywhere;
	}

	body.wp-singular #content .entry-content .aam-product__body {
		gap: 16px;
		padding: 18px 16px 20px 20px;
	}

	body.wp-singular #content .entry-content .aam-product__actions {
		grid-template-columns: 1fr;
	}

	body.wp-singular #content .entry-content .aam-product__button {
		min-height: 48px;
		font-size: 16px;
	}
}
