/*
Theme Name: moti_log
Theme URI: https://moti.pics/
Author: moti
Description: 写真とメモのための、読みやすさを優先したシンプルなブログテーマ。スマホ最優先。ダークモード、目次の自動生成、コードのシンタックスハイライト、カテゴリ別のトップセクション、アフィリエイト用の部品、連載、必須ページに対応。
Version: 1.2.8
Requires at least: 6.2
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: moti-log
*/

/* ==========================================================================
   1. トークン
   配色は白でも黒でもなく、少し緑に寄せた紙とインクの色。
   アクセントは深いティール。ダークでは同じ色相を明るくする。
   ========================================================================== */

:root {
	--bg: #f6f8f6;
	--surface: #ffffff;
	--ink: #18211d;
	--muted: #56635d;
	--rule: #dce3de;
	--accent: #0b6b61;
	--accent-ink: #ffffff;
	--tint: #e7f1ee;
	--code-bg: #edf2ef;
	--warn: #b45309;
	--warn-tint: #fcf1e1;

	--hl-keyword: #a21c5b;
	--hl-string: #0b6b61;
	--hl-number: #8a4b00;
	--hl-comment: #5b6962;
	--hl-title: #1d4e9e;
	--hl-builtin: #6b3fa0;

	--font: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif;
	--mono: ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace;

	--wrap: 46rem;
	--gutter: 1.25rem;
	--radius: 6px;

	color-scheme: light;
}

:root[data-theme="dark"] {
	--bg: #101513;
	--surface: #161c19;
	--ink: #e3eae6;
	--muted: #a1ada6;
	--rule: #27302b;
	--accent: #5fcdbe;
	--accent-ink: #0c1512;
	--tint: #1b2b27;
	--code-bg: #1a211e;
	--warn: #f0b76b;
	--warn-tint: #2c2515;

	--hl-keyword: #f29ac4;
	--hl-string: #7fd8c9;
	--hl-number: #f0b76b;
	--hl-comment: #8fa098;
	--hl-title: #8db6f2;
	--hl-builtin: #c3a6f0;

	color-scheme: dark;
}

/* JSが無効でも、端末の設定に合わせてダークにする */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme]) {
		--bg: #101513;
		--surface: #161c19;
		--ink: #e3eae6;
		--muted: #a1ada6;
		--rule: #27302b;
		--accent: #5fcdbe;
		--accent-ink: #0c1512;
		--tint: #1b2b27;
		--code-bg: #1a211e;
		--warn: #f0b76b;
		--warn-tint: #2c2515;

		--hl-keyword: #f29ac4;
		--hl-string: #7fd8c9;
		--hl-number: #f0b76b;
		--hl-comment: #8fa098;
		--hl-title: #8db6f2;
		--hl-builtin: #c3a6f0;

		color-scheme: dark;
	}
}

/* ==========================================================================
   2. ベース
   ========================================================================== */

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

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font);
	font-size: 1rem;
	line-height: 1.95;
	letter-spacing: 0.02em;
	overflow-wrap: anywhere;
	-webkit-font-smoothing: antialiased;
}

@media (min-width: 640px) {
	body {
		font-size: 1.0625rem;
	}
}

img,
svg,
video,
canvas {
	max-width: 100%;
	height: auto;
}

iframe {
	max-width: 100%;
}

a {
	color: var(--accent);
}

a:hover {
	text-decoration-thickness: 2px;
}

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

[id] {
	scroll-margin-top: 1rem;
}

/* 見出しとタイトルは、日本語の文節で折り返し、字間を詰める */
h1,
h2,
h3,
h4,
.site-title,
.row-title {
	font-feature-settings: "palt";
	line-height: 1.5;
	letter-spacing: 0.01em;
	text-wrap: balance;
}

@supports (word-break: auto-phrase) {
	h1,
	h2,
	h3,
	h4,
	.site-title,
	.row-title {
		word-break: auto-phrase;
	}
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	left: 0.5rem;
	top: -4rem;
	z-index: 100;
	padding: 0.6rem 1rem;
	background: var(--accent);
	color: var(--accent-ink);
	border-radius: var(--radius);
}

.skip-link:focus {
	top: 0.5rem;
}

.wrap {
	width: 100%;
	max-width: var(--wrap);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

/* ==========================================================================
   3. ヘッダー
   ========================================================================== */

.site-header {
	border-bottom: 1px solid var(--rule);
}

.site-header__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 1.25rem;
	padding-block: 0.9rem;
}

.site-branding {
	flex: 1 1 auto;
	min-width: 0;
}

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

.site-title a {
	color: var(--ink);
	text-decoration: none;
}

.site-description {
	display: none;
	margin: 0;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: var(--muted);
}

@media (min-width: 640px) {
	.site-description {
		display: block;
	}
}

.custom-logo {
	display: block;
	max-height: 2.5rem;
	width: auto;
}

.header-tools {
	display: flex;
	gap: 0.5rem;
}

.icon-btn {
	display: none;
	align-items: center;
	justify-content: center;
	min-width: 2.75rem;
	height: 2.75rem;
	padding: 0 0.5rem;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	background: transparent;
	color: var(--ink);
	font: inherit;
	font-size: 0.875rem;
	letter-spacing: 0;
	cursor: pointer;
}

.icon-btn:hover {
	background: var(--tint);
}

.js .icon-btn {
	display: inline-flex;
}

.icon-btn svg {
	width: 1.25rem;
	height: 1.25rem;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.icon-sun {
	display: none;
}

:root[data-theme="dark"] .icon-sun {
	display: block;
}

:root[data-theme="dark"] .icon-moon {
	display: none;
}

.nav-toggle {
	gap: 0.4rem;
}

@media (min-width: 640px) {
	.js .nav-toggle {
		display: none;
	}
}

/* ナビゲーション:狭い画面では折りたたみ、広い画面では横並び */
.site-nav {
	flex: 1 1 100%;
	order: 5;
}

.js .site-nav {
	display: none;
}

.js .site-nav.is-open {
	display: block;
}

.site-nav ul {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-nav li {
	margin: 0;
}

.site-nav a {
	display: block;
	padding: 0.7rem 0;
	border-top: 1px solid var(--rule);
	color: var(--muted);
	text-decoration: none;
}

.site-nav a:hover,
.site-nav .current-menu-item > a,
.site-nav .current-cat > a,
.site-nav .current_page_item > a {
	color: var(--ink);
}

.site-nav .current-menu-item > a,
.site-nav .current-cat > a,
.site-nav .current_page_item > a {
	font-weight: 700;
}

/* 広い画面では、1段目にタイトルと道具、2段目にメニューを置く。
   メニューの項目数が変わっても、段が崩れない。 */
@media (min-width: 640px) {
	.site-nav,
	.js .site-nav {
		display: block;
	}

	.site-nav ul {
		flex-direction: row;
		flex-wrap: wrap;
		gap: 0.25rem 1.25rem;
	}

	.site-nav a {
		padding: 0.25rem 0;
		border-top: 0;
		border-bottom: 2px solid transparent;
	}

	.site-nav .current-menu-item > a,
	.site-nav .current-cat > a,
	.site-nav .current_page_item > a {
		border-bottom-color: var(--accent);
	}
}

/* 検索 */
.site-search {
	flex: 1 1 100%;
	order: 6;
	padding-bottom: 0.25rem;
}

.js .site-search {
	display: none;
}

.js .site-search.is-open {
	display: block;
}

.search-form {
	display: flex;
	gap: 0.5rem;
}

.search-field {
	flex: 1 1 auto;
	min-width: 0;
	height: 2.75rem;
	padding: 0 0.9rem;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--ink);
	font: inherit;
	font-size: 1rem;
}

.search-submit {
	height: 2.75rem;
	padding: 0 1.1rem;
	border: 0;
	border-radius: var(--radius);
	background: var(--accent);
	color: var(--accent-ink);
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 700;
	cursor: pointer;
}

.search-submit:hover {
	filter: brightness(1.08);
}

/* ==========================================================================
   4. メイン
   ========================================================================== */

.site-main {
	padding-block: 2rem 4rem;
}

.meta {
	font-size: 0.8125rem;
	line-height: 1.6;
	color: var(--muted);
	font-variant-numeric: tabular-nums;
}

/* ---- ホーム:最新の記事 ---- */

.feature {
	margin-bottom: 3rem;
}

.feature__thumb {
	display: block;
	margin-bottom: 1rem;
	aspect-ratio: 16 / 9;
	border-radius: var(--radius);
	overflow: hidden;
	background: var(--tint);
}

.feature__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.feature__title {
	margin: 0.15rem 0 0.6rem;
	font-size: 1.5rem;
	font-weight: 700;
}

.feature__title a {
	color: var(--ink);
	text-decoration: none;
}

.feature__title a:hover {
	text-decoration: underline;
	text-decoration-color: var(--accent);
	text-underline-offset: 0.2em;
}

.feature__excerpt {
	margin: 0;
	color: var(--muted);
	line-height: 1.85;
}

/* ---- セクション:日付を先頭に置いた記録の一覧 ---- */

.section {
	margin-top: 2.75rem;
}

.section__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.25rem;
	padding-bottom: 0.45rem;
	border-bottom: 2px solid var(--ink);
}

.section__title {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 700;
}

.section__title a {
	color: var(--ink);
	text-decoration: none;
}

.section__more {
	flex: none;
	font-size: 0.8125rem;
}

.row {
	display: grid;
	grid-template-columns: 5.25rem minmax(0, 1fr);
	gap: 0 0.75rem;
	align-items: baseline;
	padding: 0.8rem 0;
	border-bottom: 1px solid var(--rule);
}

.row-date {
	font-size: 0.8125rem;
	color: var(--muted);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.row-title {
	margin: 0;
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.65;
}

.row-title a {
	color: var(--ink);
	text-decoration: none;
}

.row-title a:hover {
	text-decoration: underline;
	text-decoration-color: var(--accent);
	text-underline-offset: 0.2em;
}

/* ---- カード ---- */

.card-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1rem;
	margin-top: 0.9rem;
}

@media (min-width: 640px) {
	.card-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.card {
	position: relative;
	overflow: hidden;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	background: var(--surface);
}

.card:hover {
	border-color: var(--accent);
}

.card__thumb {
	aspect-ratio: 16 / 9;
	background: var(--tint);
}

.card__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.card__body {
	padding: 0.85rem 1rem 1rem;
}

.card__title {
	margin: 0.1rem 0 0.4rem;
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 1.55;
}

.card__title a {
	color: var(--ink);
	text-decoration: none;
}

/* リンクをカード全体に広げる */
.card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.card__title a:hover {
	text-decoration: underline;
	text-decoration-color: var(--accent);
	text-underline-offset: 0.2em;
}

.card__excerpt {
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.8;
	color: var(--muted);
}

/* ---- 写真のグリッド ---- */

.gallery-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.375rem;
	margin-top: 0.9rem;
}

@media (min-width: 640px) {
	.gallery-grid--wide {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.gallery-item {
	display: block;
	position: relative;
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: 4px;
	background: var(--tint);
	color: var(--ink);
	text-decoration: none;
}

.gallery-item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.gallery-item__title {
	display: flex;
	align-items: center;
	height: 100%;
	padding: 0.5rem;
	font-size: 0.8125rem;
	line-height: 1.5;
}

/* ---- ページ送り ---- */

.pagination {
	margin-top: 2.5rem;
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.75rem;
	height: 2.75rem;
	padding: 0 0.8rem;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	color: var(--ink);
	font-size: 0.9375rem;
	font-variant-numeric: tabular-nums;
	text-decoration: none;
}

a.page-numbers:hover {
	background: var(--tint);
}

.page-numbers.current {
	border-color: var(--accent);
	background: var(--accent);
	color: var(--accent-ink);
	font-weight: 700;
}

.page-numbers.dots {
	border-color: transparent;
}

/* ---- アーカイブ・検索 ---- */

.archive-header {
	margin-bottom: 1.25rem;
}

.archive-title {
	margin: 0 0 0.35rem;
	font-size: 1.5rem;
	font-weight: 700;
}

.archive-description {
	margin: 0.5rem 0 0;
	color: var(--muted);
	font-size: 0.9375rem;
	line-height: 1.8;
}

.archive-header .search-form {
	margin-top: 1rem;
}

.empty {
	margin: 1.5rem 0 0;
	color: var(--muted);
}

/* ==========================================================================
   5. 記事
   ========================================================================== */

.entry-header {
	margin-bottom: 1.75rem;
}

.entry-cats {
	margin: 0 0 0.35rem;
	font-size: 0.8125rem;
}

.entry-cats a {
	color: var(--accent);
	text-decoration: none;
}

.entry-cats a:hover {
	text-decoration: underline;
}

.entry-cats a + a::before {
	content: "/";
	margin: 0 0.5em 0 0.2em;
	color: var(--muted);
}

.entry-title {
	margin: 0 0 0.75rem;
	font-size: 1.65rem;
	font-weight: 700;
	line-height: 1.5;
}

@media (min-width: 640px) {
	.entry-title {
		font-size: 2rem;
	}
}

.entry-hero {
	margin: 0 0 2rem;
	border-radius: var(--radius);
	overflow: hidden;
}

.entry-hero img {
	display: block;
	width: 100%;
}

/* 本文 */
.entry-content {
	line-height: 2;
}

.entry-content::after {
	content: "";
	display: block;
	clear: both;
}

.entry-content > :first-child {
	margin-top: 0;
}

.entry-content p {
	margin: 0 0 1.6em;
}

.entry-content a {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

.entry-content a:hover {
	text-decoration-thickness: 2px;
}

.entry-content h2 {
	margin: 3em 0 1.1em;
	font-size: 1.4rem;
	font-weight: 700;
}

.entry-content h2::after {
	content: "";
	display: block;
	width: 2.25rem;
	height: 3px;
	margin-top: 0.45rem;
	background: var(--accent);
}

.entry-content h3 {
	margin: 2.4em 0 0.9em;
	font-size: 1.15rem;
	font-weight: 700;
}

.entry-content h4,
.entry-content h5,
.entry-content h6 {
	margin: 2em 0 0.7em;
	font-size: 1rem;
	font-weight: 700;
	color: var(--muted);
}

.entry-content ul,
.entry-content ol {
	margin: 0 0 1.6em;
	padding-left: 1.5em;
}

.entry-content li + li {
	margin-top: 0.35em;
}

.entry-content blockquote {
	margin: 0 0 1.6em;
	padding: 0.1em 0 0.1em 1.1em;
	border-left: 3px solid var(--rule);
	color: var(--muted);
}

.entry-content blockquote p:last-child {
	margin-bottom: 0;
}

.entry-content hr {
	margin: 2.75rem 0;
	border: 0;
	border-top: 1px solid var(--rule);
}

.entry-content figure,
.entry-content .wp-caption {
	max-width: 100%;
	margin: 0 0 1.8em;
}

.entry-content img {
	border-radius: 4px;
}

.entry-content figcaption,
.entry-content .wp-caption-text {
	margin-top: 0.5rem;
	font-size: 0.8125rem;
	line-height: 1.7;
	color: var(--muted);
	text-align: center;
}

.alignleft {
	float: left;
	max-width: 50%;
	margin: 0.25rem 1.25rem 1rem 0;
}

.alignright {
	float: right;
	max-width: 50%;
	margin: 0.25rem 0 1rem 1.25rem;
}

.aligncenter {
	display: block;
	margin-inline: auto;
}

.entry-content table {
	display: block;
	max-width: 100%;
	margin: 0 0 1.8em;
	overflow-x: auto;
	border-collapse: collapse;
	font-size: 0.9375rem;
	line-height: 1.7;
}

.entry-content th,
.entry-content td {
	padding: 0.55rem 0.8rem;
	border: 1px solid var(--rule);
	text-align: left;
}

.entry-content th {
	background: var(--tint);
	font-weight: 700;
}

.entry-content code,
.entry-content kbd,
.entry-content samp {
	padding: 0.1em 0.4em;
	border-radius: 4px;
	background: var(--code-bg);
	font-family: var(--mono);
	font-size: 0.88em;
	letter-spacing: 0;
}

.entry-content pre {
	margin: 0 0 1.8em;
	padding: 1rem 1.1rem;
	overflow-x: auto;
	border-radius: var(--radius);
	background: var(--code-bg);
	font-family: var(--mono);
	font-size: 0.875rem;
	line-height: 1.7;
	letter-spacing: 0;
	tab-size: 4;
	overflow-wrap: normal;
	-webkit-overflow-scrolling: touch;
}

.entry-content pre code {
	padding: 0;
	background: none;
	font-size: inherit;
	white-space: pre;
}

/* ---- 装飾ブロック(ブロックのスタイルから選ぶ) ---- */

.entry-content .is-style-moti-note,
.entry-content .is-style-moti-point,
.entry-content .is-style-moti-warning {
	margin: 0 0 1.8em;
	padding: 1rem 1.1rem;
	border-radius: var(--radius);
}

.entry-content .is-style-moti-note > :first-child,
.entry-content .is-style-moti-point > :first-child,
.entry-content .is-style-moti-warning > :first-child {
	margin-top: 0;
}

.entry-content .is-style-moti-note > :last-child,
.entry-content .is-style-moti-point > :last-child,
.entry-content .is-style-moti-warning > :last-child {
	margin-bottom: 0;
}

.entry-content .is-style-moti-note {
	background: var(--tint);
}

.entry-content .is-style-moti-point {
	border: 1px solid var(--rule);
	border-left: 4px solid var(--accent);
	background: var(--surface);
}

.entry-content .is-style-moti-warning {
	border-left: 4px solid var(--warn);
	background: var(--warn-tint);
}

/* 申し込みボタン。スマホでは横幅いっぱい */
.entry-content .wp-block-button.is-style-moti-cta {
	width: 100%;
}

.entry-content .wp-block-button.is-style-moti-cta .wp-block-button__link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 3rem;
	padding: 0.7rem 1.5rem;
	border-radius: var(--radius);
	background: var(--accent);
	color: var(--accent-ink);
	font-weight: 700;
	text-align: center;
	text-decoration: none;
}

.entry-content .wp-block-button.is-style-moti-cta .wp-block-button__link:hover {
	filter: brightness(1.08);
}

@media (min-width: 640px) {
	.entry-content .wp-block-button.is-style-moti-cta {
		width: auto;
	}

	.entry-content .wp-block-button.is-style-moti-cta .wp-block-button__link {
		width: auto;
		min-width: 16rem;
	}
}

/* 比較表。1列目を見出しのように見せ、横にスクロールしても残す */
.entry-content .wp-block-table.is-style-moti-compare {
	margin: 0 0 1.8em;
}

.entry-content .wp-block-table.is-style-moti-compare table {
	margin-bottom: 0;
}

.entry-content .wp-block-table.is-style-moti-compare td:first-child,
.entry-content .wp-block-table.is-style-moti-compare th:first-child {
	position: sticky;
	left: 0;
	background: var(--tint);
	font-weight: 700;
}

/* ---- Rinker(商品リンク)。外枠と文字の色だけ、ダークモードでも読めるようにする ---- */

.entry-content .yyi-rinker-contents {
	max-width: 100%;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--ink);
	overflow: hidden;
}

.entry-content .yyi-rinker-contents .yyi-rinker-title a,
.entry-content .yyi-rinker-contents .yyi-rinker-detail {
	color: var(--ink);
}

/* highlight.js のトークン色 */
.hljs {
	color: inherit;
	background: none;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-doctag,
.hljs-meta .hljs-keyword {
	color: var(--hl-keyword);
}

.hljs-string,
.hljs-regexp,
.hljs-addition,
.hljs-attribute,
.hljs-meta .hljs-string {
	color: var(--hl-string);
}

.hljs-number,
.hljs-symbol,
.hljs-bullet,
.hljs-link {
	color: var(--hl-number);
}

.hljs-comment,
.hljs-quote,
.hljs-deletion {
	color: var(--hl-comment);
	font-style: italic;
}

.hljs-title,
.hljs-section,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class,
.hljs-variable,
.hljs-template-variable,
.hljs-attr {
	color: var(--hl-title);
}

.hljs-built_in,
.hljs-type,
.hljs-class .hljs-title,
.hljs-params {
	color: var(--hl-builtin);
}

.hljs-emphasis {
	font-style: italic;
}

.hljs-strong {
	font-weight: 700;
}

/* 目次 */
.toc {
	margin: 0 0 2.25rem;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	background: var(--surface);
	line-height: 1.7;
}

.toc summary {
	padding: 0.85rem 1.1rem;
	font-weight: 700;
	cursor: pointer;
}

.toc ol {
	margin: 0;
	padding: 0 1.1rem 1rem 2.6rem;
	font-size: 0.9375rem;
}

.toc ol ol {
	margin-top: 0.3rem;
	padding: 0 0 0 1.2rem;
	list-style: disc;
}

.toc li + li {
	margin-top: 0.3rem;
}

.toc a {
	color: var(--ink);
	text-decoration: none;
}

.toc a:hover {
	color: var(--accent);
	text-decoration: underline;
}

/* 広告 */
.ad {
	margin: 2.25rem 0;
	overflow: hidden;
	text-align: center;
}

/* 広告の読み込みでレイアウトがずれないよう、上と途中の枠には高さを確保する */
.ad-before,
.ad-mid,
.ad-home {
	min-height: 280px;
}

/* 広告が出なかった枠は、枠ごと隠す(AdSenseが data-ad-status を付ける) */
.ad:has(ins[data-ad-status="unfilled"]) {
	display: none;
}

.ad-label {
	margin: 0 0 0.35rem;
	font-size: 0.6875rem;
	line-height: 1.4;
	color: var(--muted);
}

/* 連載 */
.series-box {
	margin: 2.25rem 0 0;
	padding: 0.9rem 1.1rem 1rem;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	background: var(--surface);
	line-height: 1.7;
}

.series-box__title {
	margin: 0 0 0.5rem;
	font-weight: 700;
}

.series-box__list {
	margin: 0 0 0.75rem;
	padding-left: 1.6rem;
	font-size: 0.9375rem;
}

.series-box__list li + li {
	margin-top: 0.2rem;
}

.series-box__list a {
	color: var(--ink);
	text-decoration: none;
}

.series-box__list a:hover {
	color: var(--accent);
	text-decoration: underline;
}

.series-box__all {
	margin: 0 0 0.75rem;
	font-size: 0.9375rem;
}

.series-box__nav {
	display: grid;
	gap: 0.5rem;
	margin-top: 0.25rem;
}

@media (min-width: 640px) {
	.series-box__nav {
		grid-template-columns: 1fr 1fr;
	}
}

.series-box__nav a {
	display: block;
	padding: 0.6rem 0.9rem;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	color: var(--ink);
	font-size: 0.9375rem;
	text-decoration: none;
}

.series-box__nav a:hover {
	background: var(--tint);
}

.series-box__next {
	text-align: right;
}

@media (min-width: 640px) {
	.series-box__next {
		grid-column: 2;
	}
}

/* PR表記 */
.pr-note {
	display: inline-block;
	margin: 0.5rem 0 0;
	padding: 0.15rem 0.6rem;
	border: 1px solid var(--rule);
	border-radius: 4px;
	font-size: 0.75rem;
	line-height: 1.6;
	color: var(--muted);
}

/* 免責表示 */
.disclaimer {
	margin: 2.25rem 0 0;
	padding: 0.9rem 1.1rem;
	border-radius: var(--radius);
	background: var(--tint);
	font-size: 0.8125rem;
	line-height: 1.8;
	color: var(--muted);
}

.disclaimer__title {
	margin: 0 0 0.25rem;
	font-weight: 700;
	color: var(--ink);
}

.disclaimer p {
	margin: 0;
}

.disclaimer p + p {
	margin-top: 0.5em;
}

.disclaimer .disclaimer__more {
	margin-top: 0.5em;
	font-size: 0.75rem;
}

/* 著者ボックス */
.author-box {
	display: grid;
	grid-template-columns: 4rem minmax(0, 1fr);
	gap: 1rem;
	margin-top: 2.25rem;
	padding: 1.1rem;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	background: var(--surface);
}

.author-box__avatar img {
	display: block;
	width: 4rem;
	height: 4rem;
	border-radius: 50%;
}

.author-box__label {
	margin: 0;
	font-size: 0.75rem;
	line-height: 1.5;
	color: var(--muted);
}

.author-box__name {
	margin: 0 0 0.4rem;
	font-weight: 700;
	line-height: 1.5;
}

.author-box__bio {
	font-size: 0.875rem;
	line-height: 1.8;
}

.author-box__bio p {
	margin: 0 0 0.6em;
}

.author-box__bio p:last-child {
	margin-bottom: 0;
}

.author-box__more {
	margin: 0.6rem 0 0;
	font-size: 0.875rem;
}

.author-box__more a + a {
	margin-left: 1rem;
}

/* タグ */
.tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 2.25rem 0 0;
	padding: 0;
	list-style: none;
}

.tags a {
	display: inline-block;
	padding: 0.2rem 0.75rem;
	border: 1px solid var(--rule);
	border-radius: 999px;
	color: var(--muted);
	font-size: 0.8125rem;
	text-decoration: none;
}

.tags a::before {
	content: "#";
}

.tags a:hover {
	border-color: var(--accent);
	color: var(--accent);
}

/* 前後の記事 */
.post-nav {
	display: grid;
	gap: 0.75rem;
	margin-top: 3rem;
}

@media (min-width: 640px) {
	.post-nav {
		grid-template-columns: 1fr 1fr;
	}
}

.post-nav a {
	display: block;
	height: 100%;
	padding: 0.9rem 1.1rem;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	color: var(--ink);
	line-height: 1.6;
	text-decoration: none;
}

.post-nav a:hover {
	background: var(--tint);
}

.post-nav__label {
	display: block;
	margin-bottom: 0.2rem;
	font-size: 0.75rem;
	color: var(--muted);
}

.post-nav__next {
	text-align: right;
}

.page-links {
	margin: 2rem 0 0;
}

/* ==========================================================================
   6. コメント
   ========================================================================== */

.comments-area {
	margin-top: 3.5rem;
}

.comments-title {
	margin: 0 0 1rem;
	font-size: 1.125rem;
}

.comment-list,
.comment-list .children {
	margin: 0;
	padding: 0;
	list-style: none;
}

.comment-list .children {
	padding-left: 1.25rem;
	border-left: 2px solid var(--rule);
}

.comment-body {
	padding: 1rem 0;
	border-bottom: 1px solid var(--rule);
	font-size: 0.9375rem;
	line-height: 1.8;
}

.comment-meta {
	font-size: 0.8125rem;
	color: var(--muted);
}

.comment-meta a {
	color: inherit;
}

.comment-respond {
	margin-top: 2rem;
}

.comment-form label,
.contact-form label {
	display: block;
	font-size: 0.875rem;
	font-weight: 700;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea,
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form select,
.contact-form textarea {
	width: 100%;
	padding: 0.6rem 0.8rem;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--ink);
	font: inherit;
	font-size: 1rem;
}

.comment-form .submit,
.contact-form__submit {
	height: 2.75rem;
	padding: 0 1.4rem;
	border: 0;
	border-radius: var(--radius);
	background: var(--accent);
	color: var(--accent-ink);
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 700;
	cursor: pointer;
}

/* お問い合わせフォーム(入力欄とボタンは、コメント欄と共通) */

.contact-form p {
	margin: 0 0 1.25rem;
}

.contact-form label {
	margin-bottom: 0.3rem;
}

.contact-form select {
	height: 2.75rem;
}

.form-req {
	margin-left: 0.4em;
	padding: 0.05rem 0.45rem;
	border: 1px solid var(--rule);
	border-radius: 4px;
	color: var(--muted);
	font-size: 0.6875rem;
	font-weight: 400;
}

.form-req--must {
	border-color: var(--accent);
	color: var(--accent);
}

.form-check {
	display: flex;
	gap: 0.6rem;
	align-items: flex-start;
	font-weight: 400;
}

.form-check input {
	flex: none;
	width: 1.25rem;
	height: 1.25rem;
	margin-top: 0.3rem;
}

.form-error {
	margin: 0.35rem 0 0;
	color: var(--warn);
	font-size: 0.875rem;
	line-height: 1.6;
}

.contact-form input[aria-invalid="true"],
.contact-form select[aria-invalid="true"],
.contact-form textarea[aria-invalid="true"] {
	border-color: var(--warn);
}

.form-notice {
	margin: 0 0 1.5rem;
	padding: 0.85rem 1.1rem;
	border-radius: var(--radius);
	line-height: 1.7;
}

.form-notice--ok {
	background: var(--tint);
}

.form-notice--error {
	border-left: 4px solid var(--warn);
	background: var(--warn-tint);
}

/* 人には見えない、スパム対策の欄 */
.form-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* プロフィール */

.profile-head {
	display: flex;
	align-items: center;
	gap: 1.25rem;
}

.profile-head__avatar img {
	display: block;
	width: 5rem;
	height: 5rem;
	border-radius: 50%;
}

.profile-head .entry-title {
	margin-bottom: 0.15rem;
}

.profile-head__name {
	margin: 0;
	color: var(--muted);
}

.profile-list {
	margin: 0 0 1.6em;
	padding-left: 1.5em;
}

/* ==========================================================================
   7. フッター
   ========================================================================== */

.site-footer {
	border-top: 1px solid var(--rule);
	padding-block: 2rem;
	font-size: 0.8125rem;
	line-height: 1.8;
	color: var(--muted);
}

.footer-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.25rem;
	margin: 0 0 0.75rem;
	padding: 0;
	list-style: none;
}

.footer-nav a,
.footer-legal a {
	color: var(--muted);
}

.footer-legal ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.25rem;
	margin: 0 0 0.75rem;
	padding: 0;
	list-style: none;
}

.site-footer p {
	margin: 0;
}

.footer-disclosure {
	margin-bottom: 0.75rem;
}

/* ==========================================================================
   8. 動きを減らす設定・印刷
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition: none !important;
		animation: none !important;
		scroll-behavior: auto !important;
	}
}

@media print {
	.site-header,
	.site-footer,
	.ad,
	.post-nav,
	.comments-area,
	.pagination,
	.toc {
		display: none !important;
	}

	body {
		background: #fff;
		color: #000;
		font-size: 11pt;
	}
}
