/*
Theme Name:        Abira
Theme URI:         https://369theme.com/themes/abira
Description:       Calm colors. Clean foundation. Abira is a light block starter theme with soft, readable colors — a sage green accent, fourteen light tints, and gentle gradients — so you can build without clearing away what someone else put there first.
Version:           1.6
Author:            miroku
Author URI:        https://profiles.wordpress.org/369work/
Tags:              blog, one-column, block-patterns, full-site-editing, accessibility-ready, block-styles, editor-style, style-variations, custom-colors, featured-images, translation-ready
Text Domain:       abira
Domain Path:       /languages
Requires at least: 6.5
Tested up to:      7.1
Requires PHP:      7.4
License: GNU General Public License v3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html

This theme, like WordPress, is licensed under the GPL.
*/


/* ============================================================
   CSS Reset
   Modern, minimal reset as a foundation.
============================================================ */

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

* {
	margin: 0;
	padding: 0;
}

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

body {
	min-height: 100svh;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
	display: block;
	max-width: 100%;
}

input,
button,
textarea,
select {
	font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
	overflow-wrap: break-word;
}

p {
	text-wrap: pretty;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	text-wrap: balance;
}

button {
	cursor: pointer;
	-webkit-user-select: none;
	user-select: none;
	touch-action: manipulation;
}


/* ============================================================
   Layout: Sticky Footer
============================================================ */

/*
 * コンテンツ幅は theme.json の settings.layout で変更してください。
 *
 * 推奨値の目安:
 *   contentSize — 通常コンテンツの最大幅
 *     現在: 800px  |  タブレット向け: 680px  |  ワイドモニター向け: 1000px
 *   wideSize — ワイド整列ブロックの最大幅
 *     現在: 1200px  |  大画面向け: 1440px
 *
 * 大画面で幅をさらに広げたい場合は、style.css にメディアクエリを追加して
 * --wp--style--global--content-size を上書きする方法もあります。
 */

.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: 100svh;
}

/* ヘッダーとフッターの余白は、parts/*.html のブロック属性で付けている。
   クラスで付けると、サイトエディターでは .has-global-padding（ルートの
   余白。Abira では 0）に負けて、左右の余白が消える。 */

/* フッターは暗い背景（contrast）。アクセント色のフォーカスリングは
   見えにくい（Bloom の accent × contrast で約 2:1）ので、背景色で描く。 */
.site-footer :focus-visible {
	outline: 2px solid var(--wp--preset--color--base);
	outline-offset: 2px;
}

.site-main {
	flex: 1;
	padding: 0;
}

@media (max-width: 781px) {
	.site-header .wp-block-navigation__responsive-container.is-menu-open {
		padding: var(--wp--preset--spacing--m);
	}

	.site-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
		padding-inline: var(--wp--preset--spacing--s);
	}
}

.site-header .wp-block-navigation .wp-block-navigation-item__content {
	white-space: nowrap;
}


/* ============================================================
   Post list
============================================================ */

.main-content {
	padding-top: var(--wp--preset--spacing--xl);
	padding-bottom: var(--wp--preset--spacing--xl);
}

.post-item {
	border-bottom: 1px solid var(--wp--preset--color--subtle);
	padding-bottom: var(--wp--preset--spacing--l);
	margin-bottom: var(--wp--preset--spacing--l);
}

.post-meta {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
}


/* ============================================================
   Category badge
============================================================ */

.wp-block-post-terms a {
	display: inline-block;
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	padding: 0.2em 0.6em;
	border-radius: 3px;
	text-decoration: none;
}

.wp-block-post-terms a:hover {
	background-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}


/* ============================================================
   Card (archive)

   アイキャッチ画像のプレースホルダー処理は
   assets/css/block-styles.css の .post-card__media に統一。
============================================================ */

.post-card {
	border: 1px solid var(--wp--preset--color--subtle);
	border-radius: 6px;
	overflow: hidden;
	height: 100%; /* グリッドの各セルいっぱいに広げて高さを揃える */
}

.post-card__body {
	padding: var(--wp--preset--spacing--s) var(--wp--preset--spacing--m) var(--wp--preset--spacing--m);
}


/* ============================================================
   Links on light palette colors
   淡い色・明るい色・Accent Light・Contrast（暗い帯）・グラデーションの背景の上では、リンクを
   文字色にする。下線は theme.json の指定のまま残るので、
   リンクであることは色に頼らず分かる。

   アクセント色のままだと、配色によっては背景との比が
   4.5:1 を下回る（例: Dusty Rose のアクセント × Coral で 3.58:1）。
   文字色ならどの配色・どの色でも 8.7:1 以上ある。

   :where() で詳細度を a 要素1つ分（0-0-1）に抑えている。
   ブロックごとにリンク色を選んだ場合（.wp-elements-* 0-1-1）は
   そちらが勝つ。
============================================================ */

:where(
	.has-pale-yellow-background-color,
	.has-pale-red-background-color,
	.has-pale-pink-background-color,
	.has-pale-purple-background-color,
	.has-pale-indigo-background-color,
	.has-pale-sky-background-color,
	.has-pale-mint-background-color,
	.has-pale-green-background-color,
	.has-coral-background-color,
	.has-purple-background-color,
	.has-indigo-background-color,
	.has-sky-background-color,
	.has-mint-background-color,
	.has-light-green-background-color,
	.has-accent-light-background-color,
	.has-contrast-background-color,
	.has-hero-gradient-background,
	.has-base-to-accent-light-gradient-background,
	.has-pale-yellow-to-pale-pink-gradient-background,
	.has-pale-sky-to-subtle-gradient-background
) a:where(:not(.wp-element-button)) {
	color: inherit;
}

/* theme.json のリンクのホバーは文字色（contrast）になる。
   暗い背景の上では背景と同じ色になって消えるので、色を変えない。
   詳細度はホバーの指定（0-1-1）と同じにして、後に書くことで勝たせる。 */
:where(.has-contrast-background-color) a:where(:not(.wp-element-button)):hover {
	color: inherit;
}


/* ============================================================
   High contrast
   OS / ブラウザ側で「コントラストを上げる」設定にしている
   利用者には、境界線と控えめな文字色を強める。

   配色プリセット自体は上書きしない。subtle は境界線だけでなく
   フッターやアイキャッチ枠の背景色にも使っているため、
   トークンを差し替えると背景まで黒くなってしまう。
============================================================ */

@media (prefers-contrast: more) {

	/* 境界線を見えるようにする（対白 1.09:1 → 18.88:1） */
	.post-item {
		border-bottom-color: var(--wp--preset--color--contrast);
	}

	.post-card {
		border-color: var(--wp--preset--color--contrast);
	}

	/* 控えめな文字色を濃くする（対白 4.95:1 → 18.88:1） */
	.post-meta {
		color: var(--wp--preset--color--contrast);
	}

	/* フッターは暗い背景なので、淡い文字色を背景色（base）まで明るくする。
	   WordPress の配色クラス（.has-accent-light-color）は !important 付きで
	   出力されるため、こちらも !important でないと上書きできない。 */
	.site-footer .has-accent-light-color {
		color: var(--wp--preset--color--base) !important;
	}

	/* フォーカスリングを太く・濃くする */
	a:focus,
	a:focus-visible,
	button:focus,
	button:focus-visible,
	input:focus,
	input:focus-visible,
	select:focus,
	select:focus-visible,
	textarea:focus,
	textarea:focus-visible {
		outline: 3px solid var(--wp--preset--color--contrast);
		outline-offset: 2px;
	}

	/* 暗い背景のフッターの上では、contrast のリングが背景に溶けるので、
	   背景色（base）で描く。トップページの帯は front-page.css 側で同じことをする。 */
	.site-footer :focus,
	.site-footer :focus-visible {
		outline: 3px solid var(--wp--preset--color--base);
		outline-offset: 2px;
	}
}


/* ============================================================
   Reduced motion
   「動きを減らす」設定のユーザーには、アニメーションと
   スムーズスクロールを無効化する。
============================================================ */

@media (prefers-reduced-motion: reduce) {

	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}