/*
Theme Name: Enjoy of Wonder
Description: enjoyofwonder.com（林王子のブログ）の自作クラシックテーマ
Version: 0.1.0
Requires at least: 6.5
Requires PHP: 8.1
Text Domain: enjoyofwonder
*/

/* 仮の見た目。デザインを決めたら作り直す */
:root {
	--c-text: #1a1a1a;
	--c-muted: #666;
	--c-line: #e5e5e5;
	--c-bg: #fff;
	--w-content: 720px;
}

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

body {
	margin: 0;
	background: var(--c-bg);
	color: var(--c-text);
	font-family: "Noto Sans JP", system-ui, sans-serif;
	line-height: 1.9;
}

img {
	max-width: 100%;
	height: auto;
}

.site-header,
.site-footer,
.site-main {
	max-width: var(--w-content);
	margin: 0 auto;
	padding: 24px 16px;
}

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

.site-title {
	margin: 0;
	font-size: 1.5rem;
}

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

.post-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.post-list li {
	padding: 16px 0;
	border-bottom: 1px solid var(--c-line);
}

.post-meta {
	color: var(--c-muted);
	font-size: 0.875rem;
}

.site-footer {
	border-top: 1px solid var(--c-line);
	color: var(--c-muted);
	font-size: 0.875rem;
}

/* ---- 本文（移行した記事の書き方に合わせる） ---- */
/* magic-ouji.com では段落の間を「空の段落」で空けていたので、空の段落にも1行分の高さを持たせる */
.entry-content p:empty {
	min-height: 1lh;
}

.entry-content p {
	margin: 0;
}

.entry-content :is(h2, h3, h4) {
	margin: 2em 0 0.75em;
	line-height: 1.5;
}

.entry-content .wp-block-image {
	margin: 1em 0;
}

.entry-content .wp-block-image img {
	border-radius: 6px;
}

/* 目次 */
.eow-toc {
	margin: 1.5em 0;
	padding: 16px 20px;
	border: 1px solid var(--c-line);
	border-radius: 8px;
}

.eow-toc__title {
	margin: 0 0 8px;
	font-weight: 700;
}

.eow-toc__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.eow-toc__item a {
	display: flex;
	gap: 10px;
	color: inherit;
	text-decoration: none;
}

.eow-toc__item--depth-1 {
	padding-left: 1.5em;
}

.eow-toc__item--depth-2 {
	padding-left: 3em;
}

.eow-toc__num {
	color: var(--c-muted);
	font-variant-numeric: tabular-nums;
}

/* お問い合わせボタン */
.eow-contact {
	margin: 1.5em 0;
	text-align: center;
}

.eow-contact__button {
	display: inline-block;
	padding: 12px 28px;
	border-radius: 999px;
	background: var(--c-text);
	color: var(--c-bg);
	text-decoration: none;
}

/* 記事カード */
.eow-card {
	margin: 1em 0;
}

.eow-card__link {
	display: flex;
	gap: 16px;
	padding: 12px;
	border: 1px solid var(--c-line);
	border-radius: 8px;
	color: inherit;
	text-decoration: none;
}

.eow-card__image {
	flex: 0 0 160px;
	width: 160px;
	height: 100px;
	object-fit: cover;
	border-radius: 4px;
}

.eow-card__body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.eow-card__title {
	font-weight: 700;
	line-height: 1.5;
}

.eow-card__excerpt {
	display: -webkit-box;
	overflow: hidden;
	color: var(--c-muted);
	font-size: 0.875rem;
	line-height: 1.6;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.eow-card__date {
	color: var(--c-muted);
	font-size: 0.75rem;
}

@media (max-width: 600px) {
	.eow-card__link {
		flex-direction: column;
	}

	.eow-card__image {
		width: 100%;
		height: auto;
		aspect-ratio: 16 / 9;
	}
}

/* 有料区切り */
.eow-paywall {
	margin: 2em 0;
	padding: 16px;
	border: 1px dashed #b45309;
	border-radius: 8px;
	text-align: center;
}

.eow-paywall__label {
	display: inline-block;
	padding: 2px 12px;
	border-radius: 999px;
	background: #b45309;
	color: #fff;
	font-size: 0.875rem;
}

.eow-paywall__note {
	display: block;
	margin: 8px 0 0;
	color: var(--c-muted);
	font-size: 0.875rem;
}

/* アイキャッチ（magic-ouji.com と同じく 16:9 の枠いっぱいに表示） */
.entry-thumbnail {
	margin: 0 0 24px;
}

.entry-thumbnail img,
.post-list__thumb {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: 8px;
}

.post-list__link {
	display: grid;
	grid-template-columns: 160px 1fr;
	gap: 16px;
	align-items: start;
	color: inherit;
	text-decoration: none;
}

/* アイキャッチの無い記事（下書きの一部）はタイトルを横いっぱいに */
.post-list__link:not(:has(img)) {
	grid-template-columns: 1fr;
}

.post-list__title {
	display: block;
	font-weight: 700;
	line-height: 1.6;
}

.post-list .post-meta {
	display: block;
}
