/*
Theme Name: Koereko
Theme URI: https://voice-rec.com/
Author: Koereko
Description: 声の宅録・DAW・機材レビュー向けの軽量ブロックテーマ。
Version: 0.1.16
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: koereko
*/

:root {
	--koereko-shadow: 0 10px 30px rgba(20, 40, 38, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { text-wrap: pretty; }
a { text-underline-offset: 0.18em; }
img { height: auto; }

.koereko-header {
	position: sticky;
	top: 0;
	z-index: 20;
	border-bottom: 1px solid var(--wp--preset--color--line);
	backdrop-filter: blur(14px);
}

.koereko-brand .wp-block-site-title {
	letter-spacing: 0.06em;
}

.koereko-brand .wp-block-site-tagline {
	margin-top: 0.2rem;
}

.koereko-nav-desktop ul,
.koereko-footer-nav ul {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1.2rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.koereko-nav-desktop a,
.koereko-footer-nav a {
	color: inherit;
	font-size: 0.94rem;
	font-weight: 700;
	text-decoration: none;
}

.koereko-nav-desktop a:hover { color: var(--wp--preset--color--primary); }
.koereko-nav-mobile { display: none; }
.koereko-nav-mobile summary { cursor: pointer; font-weight: 700; }
.koereko-nav-mobile ul { margin: 0.8rem 0 0; padding-left: 1.2rem; }
.koereko-nav-mobile li { margin: 0.55rem 0; }

.koereko-hero {
	box-shadow: var(--koereko-shadow);
}

.koereko-hero p { max-width: 760px; }

.koereko-guide-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 1rem;
	margin-bottom: var(--wp--preset--spacing--60);
}

.koereko-guide-grid a {
	color: inherit;
	text-decoration: none;
}

.koereko-guide-title {
	display: block;
	font-size: 1.1rem;
	font-weight: 700;
	line-height: 1.45;
}

.koereko-guide-description {
	display: block;
	margin-top: 0.9rem;
	color: var(--wp--preset--color--muted);
	line-height: 1.75;
}

.koereko-card {
	height: 100%;
	border: 1px solid var(--wp--preset--color--line);
	box-shadow: 0 8px 24px rgba(20, 40, 38, 0.05);
	transition: transform 160ms ease, box-shadow 160ms ease;
}

.koereko-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--koereko-shadow);
}

.koereko-archive-hero {
	border: 1px solid var(--wp--preset--color--line);
	box-shadow: var(--koereko-shadow);
}

.koereko-archive-hero .wp-block-query-title {
	margin-top: 0;
}

.koereko-archive-hero .wp-block-term-description > *:last-child {
	margin-bottom: 0;
}

.koereko-archive-grid > li {
	border-bottom: 0;
	padding-bottom: 0;
}

.koereko-archive-card {
	height: 100%;
}

.koereko-archive-card .wp-block-post-title {
	margin-top: 0;
}

.koereko-archive-card .wp-block-post-excerpt__more-link {
	font-weight: 700;
}

.entry-content > h2 {
	margin-top: 2.8em;
	padding: 0.65em 0.8em;
	border-left: 5px solid var(--wp--preset--color--primary);
	background: var(--wp--preset--color--soft);
}

.entry-content > h3 {
	margin-top: 2.2em;
	padding-bottom: 0.4em;
	border-bottom: 2px solid var(--wp--preset--color--line);
}

.entry-content p,
.entry-content li {
	line-height: 1.9;
}

.entry-content table {
	font-size: 0.94rem;
}

.entry-content :where(.wp-block-table) {
	overflow-x: auto;
}

.entry-content :where(.wp-block-quote) {
	border-left-color: var(--wp--preset--color--primary);
	background: var(--wp--preset--color--soft);
	padding: 1rem 1.25rem;
}

.koereko-summary,
.koereko-note,
.koereko-cta,
.koereko-toc {
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 16px;
	padding: clamp(1.2rem, 3vw, 2rem);
}

.koereko-summary { background: var(--wp--preset--color--soft); }
.koereko-note { background: #fffaf3; border-color: #efd8bd; }
.koereko-cta { background: var(--wp--preset--color--surface); box-shadow: var(--koereko-shadow); }
.koereko-toc { background: var(--wp--preset--color--surface); }

.koereko-toc-title {
	margin: 0 0 0.8rem;
	font-size: 1.05rem;
	font-weight: 700;
}

.koereko-toc ol {
	margin: 0;
	padding-left: 1.4rem;
}

.koereko-toc li + li { margin-top: 0.4rem; }
.koereko-toc a { font-weight: 600; text-decoration: none; }

.koereko-summary > *:first-child,
.koereko-note > *:first-child,
.koereko-cta > *:first-child,
.koereko-toc > *:first-child { margin-top: 0; }

.koereko-summary > *:last-child,
.koereko-note > *:last-child,
.koereko-cta > *:last-child,
.koereko-toc > *:last-child { margin-bottom: 0; }

.koereko-choice-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
}

.koereko-choice-card {
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 16px;
	padding: 1.25rem;
	background: var(--wp--preset--color--surface);
}

.koereko-choice-card > *:first-child { margin-top: 0; }
.koereko-choice-card > *:last-child { margin-bottom: 0; }

.koereko-related-list {
	display: grid;
	gap: 1rem;
}

.koereko-post-navigation-wrap {
	margin-top: var(--wp--preset--spacing--60);
}

.koereko-post-navigation-title {
	margin-bottom: 1rem;
	font-size: 1.25rem;
	font-weight: 700;
}

.koereko-related-card {
	display: flex;
	align-items: stretch;
	overflow: hidden;
	min-height: 132px;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 16px;
	background: var(--wp--preset--color--surface);
	box-shadow: 0 7px 22px rgba(20, 40, 38, 0.06);
	color: inherit;
	text-decoration: none;
	transition: transform 160ms ease, box-shadow 160ms ease;
}

.koereko-related-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--koereko-shadow);
}

.koereko-related-image {
	flex: 0 0 34%;
	max-width: 240px;
}

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

.koereko-related-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	justify-content: center;
	padding: 1rem 1.2rem;
}

.koereko-related-label {
	margin-bottom: 0.35rem;
	color: var(--wp--preset--color--primary);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.04em;
}

.koereko-related-title {
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.5;
}

.koereko-related-excerpt {
	margin-top: 0.45rem;
	color: var(--wp--preset--color--muted);
	font-size: 0.88rem;
	line-height: 1.65;
}

.koereko-related-arrow {
	align-self: center;
	padding-right: 1.2rem;
	color: var(--wp--preset--color--primary);
	font-size: 1.4rem;
}

.wp-block-button__link {
	box-shadow: 0 5px 14px rgba(11, 107, 97, 0.2);
}

/* Sound House button in Pochipp product cards */
body .pochipp-box .pochipp-box__btnwrap.-custom .pochipp-box__btn {
	background-color: #6b3f8f !important;
	border-color: #6b3f8f !important;
	color: #fff !important;
}

body .pochipp-box .pochipp-box__btnwrap.-custom .pochipp-box__btn:hover,
body .pochipp-box .pochipp-box__btnwrap.-custom .pochipp-box__btn:focus-visible {
	background-color: #563074 !important;
	border-color: #563074 !important;
	color: #fff !important;
}

.wp-block-post-featured-image img {
	border-radius: 16px;
}

.koereko-post-date {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	margin: 0;
	color: var(--wp--preset--color--muted);
	font-size: 0.875rem;
}

.koereko-post-date-label {
	font-weight: 700;
}

.koereko-ad-unit {
	width: 100%;
	min-height: 90px;
	margin: 2.5rem 0;
	overflow: hidden;
	text-align: center;
}

.wp-block-post-template > li {
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding-bottom: 2rem;
}

@media (max-width: 781px) {
	.koereko-header { position: static; }
	.koereko-brand .wp-block-site-tagline { display: none; }
	.koereko-nav-desktop { display: none; }
	.koereko-nav-mobile { display: block; }
	.entry-content > h2 { font-size: 1.35rem; }
	body { --wp--style--root--padding-left: 18px; --wp--style--root--padding-right: 18px; }
	.koereko-choice-grid { grid-template-columns: 1fr; }
	.koereko-related-card { min-height: 112px; }
	.koereko-related-image { flex-basis: 32%; }
	.koereko-related-body { padding: 0.8rem; }
	.koereko-related-excerpt { display: none; }
	.koereko-related-arrow { padding-right: 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.koereko-card { transition: none; }
}
