/*
Theme Name: crearlife-nx
Description: クレアライフのスターターテーマ
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: crearlife-nx
*/

/* 基本リセット */
*,
*::before,
*::after {
	box-sizing: border-box;
}

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

body {
	min-height: 100vh;
	margin: 0;
	color: var(--wp--preset--color--text-primary, #262626);
	background-color:
		var(--wp--preset--color--background, #ffffff);
	font-family:
		var(
			--wp--preset--font-family--system,
			-apple-system,
			BlinkMacSystemFont,
			"Helvetica Neue",
			"Segoe UI",
			"Hiragino Kaku Gothic ProN",
			"Hiragino Sans",
			"Yu Gothic",
			YuGothic,
			Meiryo,
			sans-serif
		);
	font-size:
		var(--wp--preset--font-size--medium, 1rem);
	line-height: 1.8;
	overflow-wrap: anywhere;
	text-rendering: optimizeLegibility;
}

main {
	display: block;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
	margin-top: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin-bottom: 0;
}

/* 見出し階層ごとに、前のコンテンツとの区切りを明確にする */
.is-layout-flow > h1,
.is-layout-constrained > h1 {
	margin-block-start: 0;
}

.is-layout-flow > h2,
.is-layout-constrained > h2 {
	margin-block-start: 4rem;
}

.is-layout-flow > h3,
.is-layout-constrained > h3 {
	margin-block-start: 3rem;
}

.is-layout-flow > h4,
.is-layout-constrained > h4 {
	margin-block-start: 2.5rem;
}

.is-layout-flow > h5,
.is-layout-constrained > h5,
.is-layout-flow > h6,
.is-layout-constrained > h6 {
	margin-block-start: 2rem;
}

.is-layout-flow > :is(h2, h3, h4, h5, h6):first-child,
.is-layout-constrained > :is(h2, h3, h4, h5, h6):first-child {
	margin-block-start: 0;
}

p {
	text-wrap: pretty;
}

address {
	margin-bottom:
		var(--wp--preset--spacing--md, 1.5rem);
	font-style: normal;
}

small {
	font-size: 0.875em;
}

mark {
	padding-inline: 0.15em;
	color: inherit;
	background-color: #fff3a3;
}

abbr[title] {
	text-decoration: underline dotted;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	cursor: help;
}

sub,
sup {
	position: relative;
	font-size: 0.75em;
	line-height: 0;
	vertical-align: baseline;
}

sub {
	bottom: -0.25em;
}

sup {
	top: -0.5em;
}

/* リスト */
ul,
ol {
	margin-top: 0;
	padding-left: 1.5em;
}

li > ul,
li > ol {
	margin-bottom: 0;
}

hr {
	height: 1px;
	margin:
		var(--wp--preset--spacing--lg, 2rem)
		0;
	border: 0;
}

pre {
	max-width: 100%;
	margin-bottom:
		var(--wp--preset--spacing--md, 1.5rem);
	overflow: auto;
}

code,
kbd,
samp {
	font-family:
		var(
			--wp--preset--font-family--monospace,
			ui-monospace,
			SFMono-Regular,
			Menlo,
			Monaco,
			Consolas,
			"Liberation Mono",
			"Courier New",
			monospace
		);
}

table {
	width: 100%;
	border-collapse: collapse;
}

th,
td {
	padding:
		var(--wp--preset--spacing--xs, 0.5rem);
	border:
		1px solid
		var(--wp--preset--color--line, #dddddd);
	text-align: left;
	vertical-align: top;
}

/* リンク */
a {
	color:
		var(--wp--preset--color--link-blue, #315b8a);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

a:hover {
	color:
		var(--wp--preset--color--link-dark, #1e3d61);
}

a:focus-visible {
	outline:
		2px solid
		var(--wp--preset--color--link-blue, #315b8a);
	outline-offset: 3px;
}

/* 画像・メディア */
img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
	max-width: 100%;
}

img,
svg,
video,
canvas {
	height: auto;
}

img {
	display: block;
}

picture {
	display: contents;
}

figure {
	margin-right: 0;
	margin-bottom:
		var(--wp--preset--spacing--md, 1.5rem);
	margin-left: 0;
}

figcaption {
	margin-top:
		var(--wp--preset--spacing--xs, 0.5rem);
	text-align: center;
}

iframe {
	border: 0;
}

audio {
	width: 100%;
}

/* フォーム */
button,
input,
select,
textarea {
	font: inherit;
}

button,
input[type="button"],
input[type="reset"],
input[type="submit"] {
	padding: 0.75em 1.25em;
	border:
		1px solid
		var(--wp--preset--color--line, #dddddd);
	cursor: pointer;
}

button:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
input[type="submit"]:hover {
	opacity: 0.85;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
select,
textarea {
	width: 100%;
	padding: 0.75em;
	border:
		1px solid
		var(--wp--preset--color--line, #dddddd);
	border-radius:
		var(--wp--custom--radius--base, 4px);
	background-color:
		var(--wp--preset--color--background, #ffffff);
	color:
		var(--wp--preset--color--text-primary, #262626);
}

textarea {
	min-height: 8rem;
	resize: vertical;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
	outline:
		2px solid
		var(--wp--preset--color--link-blue, #315b8a);
	outline-offset: 2px;
}

/* サイト全体 */
.site {
	min-height: 100vh;
}

.site-main {
	width: min(
		calc(
			100% -
				(
					var(
						--wp--custom--site--content-padding,
						20px
					) +
					var(
						--wp--custom--site--content-padding,
						20px
					)
				)
		),
		var(
			--wp--custom--site--content-width,
			1200px
		)
	);
	margin-inline: auto;
}

/* 固定ページ・LPは親側で横幅を制限しません */
.site-main.site-page,
.site-main.lp-main {
	width: 100%;
	max-width: none;
	margin-inline: 0;
}

/* ヘッダー
-------------------------------------------------------------- */

.site-header {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 1100;
	display: grid;
	grid-template-columns:
		minmax(48px, 1fr)
		auto
		minmax(48px, 1fr);
	align-items: center;
	width: 100%;
	padding: 16px 20px;
	border-bottom: 1px solid transparent;
	background:
		var(
			--wp--preset--color--background,
			#ffffff
		);
	transition:
		top 0.28s ease,
		border-color 0.28s ease,
		box-shadow 0.28s ease;
}

/* 下方向へスクロールしたときに上へ隠します */
.site-header.is-scroll-hidden {
	top:
		calc(
			var(--wp-admin--admin-bar--height, 0px)
			- var(--site-header-height, 88px)
			- 1px
		);
}

/* スクロール後のヘッダー境界 */
.site-header.is-scrolled {
	border-bottom-color: rgba(0, 0, 0, 0.08);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

/* 将来追加するサイドバーボタンの配置枠 */
.site-header .drawer-sidebar-toggle {
	grid-column: 1;
	justify-self: start;
}

/* ロゴ・サイト名を常に中央へ配置します */
.site-header .site-branding {
	grid-column: 2;
	justify-self: center;
	display: flex;
	align-items: center;
	gap: 16px;
}

.custom-logo-link {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	line-height: 0;
}

.site-branding .custom-logo {
	display: block;
	width: auto;
	max-height: 56px;
}

.site-title {
	margin: 0;
	font-size: 1.3rem;
	font-weight: 700;
	line-height: 1.2;
}

.site-title a {
	color: inherit;
	text-decoration: none;
}

.site-description {
	margin-top: 4px;
	color:
		var(
			--wp--preset--color--text-muted,
			#666666
		);
	font-size: 0.875rem;
	line-height: 1.4;
	opacity: 0.8;
}

/* ナビゲーションを右端へ配置します */
.main-navigation {
	grid-column: 3;
	justify-self: end;
	display: flex;
	align-items: center;
	margin-left: 0;
}

@media (min-width: 769px) {
	.site-header {
		padding: 16px 32px;
		display: flex;
		justify-content: center;
	}
	.main-navigation {
		margin-left: 1rem;
	}
}

@media (max-width: 768px) {
	.site-header {
		padding:
			12px
			max(16px, env(safe-area-inset-right))
			12px
			max(16px, env(safe-area-inset-left));
	}

	.site-title,
	.site-description {
		display: none;
	}

	.site-branding .custom-logo {
		max-height: 48px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.site-header {
		transition: none;
	}
}

/* 投稿・固定ページ */
.post,
.page {
	margin-bottom:
		var(--wp--preset--spacing--xl, 3rem);
}

.post .entry-content {
    margin-top: 3rem;
}

.entry-header {
	/*margin-bottom:
		var(--wp--preset--spacing--md, 1.5rem);*/
}

.entry-title {
	margin-bottom:
		var(--wp--preset--spacing--sm, 1rem);
}

/* 投稿日・カテゴリー */
.entry-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem 1rem;
	margin-bottom: 1rem;
	font-size: 0.875rem;
	justify-content: space-between;
}

.entry-meta,
.entry-meta a {
	color:
		var(
			--wp--preset--color--text-muted,
			#666666
		);
	font-size: 0.875rem;
}

/* 投稿日・カテゴリー共通 */
.entry-meta .posted-on a,
.entry-meta .cat-links a {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	text-decoration: none;
}

/* 投稿日：時計 */
.entry-meta .posted-on a::before {
	font-family: "Font Awesome 6 Free";
	font-weight: 900;
	content: "\f017";
}

/* カテゴリー：フォルダ */
.entry-meta .cat-links {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	padding: 0.2rem 0.7rem;
	border-radius: 14px;
	border:1px solid var(--wp--preset--color--beige);
	font-size: 0.78rem;
	line-height: 1.4;
}

.entry-meta .cat-links::before {
	font-family: "Font Awesome 6 Free";
	font-weight: 900;
	content: "\f07b";
	padding-right:0.2rem;
	color:var(--wp--preset--color--beige);
}

/* 投稿日 */
.entry-meta .posted-on a {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	color:
		var(
			--wp--preset--color--text-muted,
			#666666
		);
}

@media (max-width: 768px) {
	.entry-meta {
		gap: 0.5rem 0.8rem;
		margin-bottom: 0.8rem;
	}

	.entry-meta .cat-links {
		padding: 0.1rem 0.6rem;
		font-size: 0.75rem;
	}

	.entry-meta .posted-on a {
		font-size: 0.8rem;
	}
}

.entry-content,
.entry-summary {
	margin-top:
		var(--wp--preset--spacing--ze, 0rem);
}

.entry-content::after,
.entry-summary::after {
	display: table;
	clear: both;
	content: "";
}

.entry-footer {
	margin-top:
		var(--wp--preset--spacing--md, 1.5rem);
	color:
		var(
			--wp--preset--color--text-muted,
			#666666
		);
	font-size: 0.875rem;
}

.updated:not(.published) {
	display: none;
}

.page-links {
	clear: both;
	margin-top:
		var(--wp--preset--spacing--md, 1.5rem);
}

/* 投稿ナビゲーション */
.posts-navigation,
.post-navigation {
	margin:
		var(--wp--preset--spacing--xl, 3rem)
		0;
}

.posts-navigation .nav-links,
.post-navigation .nav-links {
	display: grid;
	gap:
		var(--wp--preset--spacing--md, 1.5rem);
}

.nav-next {
	text-align: right;
}

.nav-subtitle {
	display: block;
	color:
		var(
			--wp--preset--color--text-muted,
			#666666
		);
	font-size: 0.875rem;
}

.nav-title {
	display: block;
}

/* WordPress標準メディア */
.wp-caption {
	max-width: 100%;
	margin-bottom:
		var(--wp--preset--spacing--md, 1.5rem);
}

.wp-caption-text {
	margin-top:
		var(--wp--preset--spacing--xs, 0.5rem);
	color:
		var(
			--wp--preset--color--text-muted,
			#666666
		);
	font-size: 0.875rem;
	text-align: center;
}

.gallery {
	display: grid;
	grid-template-columns: 1fr;
	gap:
		var(--wp--preset--spacing--md, 1.5rem);
	margin-bottom:
		var(--wp--preset--spacing--md, 1.5rem);
}

.gallery-item {
	margin: 0;
	text-align: center;
}

.gallery-columns-2,
.gallery-columns-3,
.gallery-columns-4,
.gallery-columns-5,
.gallery-columns-6,
.gallery-columns-7,
.gallery-columns-8,
.gallery-columns-9 {
	grid-template-columns:
		repeat(2, minmax(0, 1fr));
}

/* WordPress配置クラス */
.alignleft,
.alignright,
.aligncenter {
	display: block;
	margin-bottom:
		var(--wp--preset--spacing--md, 1.5rem);
}

.aligncenter {
	margin-right: auto;
	margin-left: auto;
}

.alignwide,
.alignfull {
	width: auto;
}

.alignfull {
	max-width: 100vw;
	margin-right: calc(50% - 50vw);
	margin-left: calc(50% - 50vw);
}

/* アクセシビリティ */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	overflow: hidden;
	white-space: nowrap;
}

.screen-reader-text:focus {
	top: 5px;
	left: 5px;
	z-index: 100000;
	display: block;
	width: auto;
	height: auto;
	padding: 0.75rem 1rem;
	clip: auto !important;
	clip-path: none;
	background-color:
		var(--wp--preset--color--background, #ffffff);
	color:
		var(--wp--preset--color--text-primary, #262626);
	font-weight: 700;
	white-space: normal;
}

@media (min-width: 768px) {
	.site-main {
		width: min(
			calc(
				100% -
					(
						var(
							--wp--custom--site--content-padding-desktop,
							32px
						) +
						var(
							--wp--custom--site--content-padding-desktop,
							32px
						)
					)
			),
			var(
				--wp--custom--site--content-width,
				1200px
			)
		);
	}

	.menu-toggle {
		display: none;
	}

	.main-navigation ul {
		display: flex;
		align-items: center;
		gap:
			var(--wp--preset--spacing--md, 1.5rem);
	}

	.main-navigation ul ul {
		position: absolute;
		top: 100%;
		left: 0;
		z-index: 100;
		display: none;
		min-width: 200px;
		padding:
			var(--wp--preset--spacing--xs, 0.5rem);
		background-color:
			var(
				--wp--preset--color--background,
				#ffffff
			);
		box-shadow:
			0 8px 24px rgba(0, 0, 0, 0.12);
	}

	.main-navigation ul ul ul {
		top: 0;
		left: 100%;
	}

	.main-navigation li:hover > ul,
	.main-navigation li:focus-within > ul {
		display: block;
	}

	.posts-navigation .nav-links,
	.post-navigation .nav-links {
		grid-template-columns:
			repeat(2, minmax(0, 1fr));
	}

	.gallery-columns-3 {
		grid-template-columns:
			repeat(3, minmax(0, 1fr));
	}

	.gallery-columns-4 {
		grid-template-columns:
			repeat(4, minmax(0, 1fr));
	}

	.gallery-columns-5 {
		grid-template-columns:
			repeat(5, minmax(0, 1fr));
	}

	.gallery-columns-6 {
		grid-template-columns:
			repeat(6, minmax(0, 1fr));
	}

	.gallery-columns-7 {
		grid-template-columns:
			repeat(7, minmax(0, 1fr));
	}

	.gallery-columns-8 {
		grid-template-columns:
			repeat(8, minmax(0, 1fr));
	}

	.gallery-columns-9 {
		grid-template-columns:
			repeat(9, minmax(0, 1fr));
	}

	.alignleft {
		float: left;
		margin-right:
			var(--wp--preset--spacing--md, 1.5rem);
	}

	.alignright {
		float: right;
		margin-left:
			var(--wp--preset--spacing--md, 1.5rem);
	}
}