/*
Theme Name: HMC Story 好事花生新聞
Theme URI: https://hmcstory.com
Author: HMC Story
Author URI: https://hmcstory.com
Description: 好事花生新聞 HMC Story 的原生區塊佈景主題（Block Theme）。以 Full Site Editing 與 theme.json 打造，頁首、首頁新聞模組、新聞卡片、文章頁、分類頁、側邊欄與頁尾皆可在「外觀 → 編輯器」中視覺化調整，並利用 WordPress 7.1 原生的響應式樣式設定電腦／平板／手機各自的欄數、字級與間距。
Requires at least: 7.1
Tested up to: 7.1
Requires PHP: 8.1
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hmc-story
Tags: news, blog, block-patterns, block-styles, full-site-editing, editor-style, wide-blocks, style-variations, custom-colors, custom-logo, custom-menu, featured-images, one-column, two-columns, left-sidebar, right-sidebar, accessibility-ready, translation-ready
*/

/*
 * 這裡只放 theme.json 無法表達的少量全域規則。
 * 版面、顏色、字型、間距請一律透過「外觀 → 編輯器 → 樣式」調整，不需要修改這個檔案。
 */

/* 中英混排：避免標點落在行首、長網址不撐破版面 */
body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	line-break: strict;
	overflow-wrap: break-word;
	text-size-adjust: 100%;
}

/* 頁首、主要內容、頁尾之間不自動加空隙，間距由各區塊自己的邊距（可在編輯器調整）決定 */
.wp-site-blocks > * {
	margin-block-start: 0;
}

/* 清楚可見的鍵盤焦點 */
:where(.wp-site-blocks) :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent, #A3500F);
	outline-offset: 2px;
}

/* 圖片在卡片內不溢出圓角 */
:where(.wp-block-post-featured-image),
:where(.is-style-hmc-card, .is-style-hmc-card-outline) {
	overflow: hidden;
}

/* 橫式卡片中，圖片維持設定的寬度，不被長標題擠壓 */
:where(.is-layout-flex) > :where(.wp-block-post-featured-image) {
	flex-shrink: 0;
}

/* 文章正文的連結保留底線，方便辨識 */
:where(.wp-block-post-content) a:where(:not(.wp-element-button)) {
	text-underline-offset: 0.2em;
	text-decoration-thickness: 1px;
}

/* 手機版觸控區域：導覽、分頁連結至少 44px 高 */
@media (pointer: coarse) {
	:where(.wp-block-navigation-item__content, .wp-block-query-pagination a, .wp-block-social-link a) {
		min-height: 44px;
		display: inline-flex;
		align-items: center;
	}
}

/* 尊重「減少動態效果」的系統偏好 */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
}
