/*
Theme Name: The Enchanted Library
Theme URI: https://example.com/enchanted-library
Author: Codex
Author URI: https://example.com
Description: A clean, warm, mobile-friendly custom WordPress theme scaffold for The Enchanted Library podcast website.
Version: 0.1.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
Text Domain: enchanted-library
*/

/*
 * Base stylesheet placeholder.
 *
 * Shared design system and core layout styles.
 * Cozy, readable, and lightweight.
 */

:root {
	--el-font-body: "Alegreya", Georgia, "Times New Roman", serif;
	--el-font-display: "Benedict", "Palatino Linotype", "Book Antiqua", Georgia, serif;
	--el-font-ui: "Alegreya", Georgia, "Times New Roman", serif;
	--el-color-background: #f6f1e8;
	--el-color-surface: #fffdf8;
	--el-color-surface-strong: #ede4d6;
	--el-color-surface-deep: #e1d3bf;
	--el-color-border: #d8c9b4;
	--el-color-text: #352b24;
	--el-color-text-soft: #645447;
	--el-color-heading: #2f4a39;
	--el-color-accent: #556b4f;
	--el-color-accent-strong: #42553e;
	--el-color-accent-soft: #e7eee4;
	--el-color-warm: #8c6440;
	--el-shadow-soft: 0 12px 30px rgba(53, 43, 36, 0.08);
	--el-radius-sm: 12px;
	--el-radius: 22px;
	--el-content-width: 74rem;
	--el-space-1: 0.5rem;
	--el-space-2: 0.75rem;
	--el-space-3: 1rem;
	--el-space-4: 1.5rem;
	--el-space-5: 2rem;
	--el-space-6: 3rem;
	--el-space-7: 4.5rem;
}

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

body {
	margin: 0;
	background: var(--el-color-background);
	color: var(--el-color-text);
	font-family: var(--el-font-body);
	font-size: 1.0625rem;
	line-height: 1.6;
}

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

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

a:hover,
a:focus {
	color: var(--el-color-accent-strong);
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin-top: 0;
	color: var(--el-color-heading);
	font-family: var(--el-font-display);
	font-weight: 700;
	line-height: 1.1;
}

p {
	margin-top: 0;
}

.content-shell {
	width: min(100% - 2rem, var(--el-content-width));
	margin: 0 auto;
}

.section {
	padding: var(--el-space-6) 0;
}

.site-header,
.site-footer {
	background: var(--el-color-surface);
}

.site-header {
	position: relative;
	border-bottom: 1px solid var(--el-color-border);
}

.site-header::after {
	content: "";
	position: absolute;
	inset: auto 0 0 0;
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(85, 107, 79, 0.4), transparent);
}

.site-footer {
	border-top: 1px solid var(--el-color-border);
	border-bottom: 0;
	margin-top: var(--el-space-6);
	padding: var(--el-space-5) 0;
}

.site-header-inner,
.site-footer-inner {
	display: grid;
	gap: var(--el-space-4);
	padding: var(--el-space-4) 0;
}

.site-kicker,
.eyebrow {
	margin-bottom: var(--el-space-1);
	color: var(--el-color-warm);
	font-size: 0.9rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.site-title {
	color: var(--el-color-text);
	font-family: var(--el-font-display);
	font-size: clamp(1.75rem, 3vw, 2.5rem);
	font-weight: 700;
	text-decoration: none;
}

.site-tagline {
	margin: 0.25rem 0 0;
	color: var(--el-color-text-soft);
	font-size: 0.95rem;
}

.primary-nav .menu,
.footer-nav .menu {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 0.75rem;
	padding: 0;
	margin: 0;
	list-style: none;
}

.primary-nav a,
.footer-nav a {
	display: inline-flex;
	padding: 0.5rem 0.85rem;
	border-radius: 999px;
	color: var(--el-color-text);
	text-decoration: none;
}

.primary-nav a:hover,
.primary-nav a:focus,
.footer-nav a:hover,
.footer-nav a:focus {
	background: var(--el-color-surface-strong);
	color: var(--el-color-heading);
}

.site-main {
	padding: 0 0 var(--el-space-6);
}

.site-main > .section:first-child,
.site-main > .hero:first-child {
	padding-top: var(--el-space-5);
}

.page-header {
	margin-bottom: var(--el-space-4);
}

.page-header h1,
.page-header h2,
.section-heading h2 {
	margin: 0 0 var(--el-space-1);
	line-height: 1.2;
}

.section-heading,
.section-copy {
	max-width: 42rem;
}

.hero {
	padding: var(--el-space-6) 0 var(--el-space-5);
}

.hero-home {
	background:
		radial-gradient(circle at top right, rgba(85, 107, 79, 0.08), transparent 28rem),
		linear-gradient(180deg, rgba(255, 253, 248, 0.8), rgba(246, 241, 232, 0.2));
}

.hero-grid,
.section-grid,
.promo-panel,
.featured-book {
	display: grid;
	gap: var(--el-space-4);
}

.hero-copy {
	max-width: 38rem;
}

.hero h1 {
	font-size: clamp(2.3rem, 7vw, 4.5rem);
	margin-bottom: var(--el-space-3);
}

.hero-text {
	font-size: 1.125rem;
	color: var(--el-color-text-soft);
}

.button-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: var(--el-space-4);
}

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.85rem 1.25rem;
	border: 1px solid transparent;
	border-radius: 999px;
	font-family: var(--el-font-ui);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
}

.button-primary {
	background: var(--el-color-accent);
	border-color: var(--el-color-accent);
	color: #fff;
}

.button-primary:hover,
.button-primary:focus {
	background: var(--el-color-accent-strong);
	border-color: var(--el-color-accent-strong);
	color: #fff;
}

.button-secondary {
	background: var(--el-color-surface);
	border-color: var(--el-color-border);
	color: var(--el-color-heading);
}

.button-secondary:hover,
.button-secondary:focus {
	background: var(--el-color-surface-strong);
}

.card,
.book-card,
.book-entry,
.support-box {
	background: var(--el-color-surface);
	border: 1px solid var(--el-color-border);
	border-radius: var(--el-radius);
	box-shadow: var(--el-shadow-soft);
}

.card {
	padding: var(--el-space-4);
}

.card-soft {
	background: linear-gradient(180deg, var(--el-color-surface), var(--el-color-accent-soft));
}

.simple-list {
	padding-left: 1.25rem;
	margin: 0;
}

.simple-list li + li {
	margin-top: 0.45rem;
}

.promo-panel {
	display: grid;
	align-items: center;
	gap: var(--el-space-4);
	padding: var(--el-space-4);
	background: linear-gradient(180deg, var(--el-color-accent-soft), var(--el-color-surface));
	border: 1px solid var(--el-color-border);
	border-radius: var(--el-radius);
	box-shadow: var(--el-shadow-soft);
}

.promo-content {
	display: grid;
	gap: var(--el-space-4);
}

.promo-media {
	width: 100%;
}

.promo-media img,
.promo-media-placeholder {
	display: block;
	width: 100%;
	max-width: 20rem;
	margin-inline: auto;
	border-radius: calc(var(--el-radius) - 4px);
}

.promo-media img {
	height: auto;
	object-fit: contain;
}

.promo-media-placeholder {
	min-height: 14rem;
	padding: var(--el-space-4);
	background: var(--el-color-surface-strong);
	color: var(--el-color-text-soft);
	text-align: center;
}

.featured-book-media img,
.featured-book-media .book-cover-placeholder {
	width: 100%;
	height: 100%;
	border-radius: calc(var(--el-radius) - 4px);
	object-fit: cover;
}

.meta-line {
	color: var(--el-color-text-soft);
}

.inline-note {
	display: inline-block;
	color: var(--el-color-text-soft);
}

.direction-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--el-space-4);
}

.direction-card h3 {
	margin-bottom: var(--el-space-2);
}

.text-link {
	font-weight: 700;
	text-decoration: none;
}

.page-hero {
	background:
		radial-gradient(circle at top left, rgba(140, 100, 64, 0.08), transparent 22rem),
		linear-gradient(180deg, rgba(255, 253, 248, 0.7), rgba(246, 241, 232, 0.12));
}

.page-stack,
.page-section-grid {
	display: grid;
	gap: var(--el-space-4);
}

.page-panel {
	height: 100%;
}

.page-panel h2 {
	margin-bottom: var(--el-space-2);
}

.embed-placeholder {
	display: grid;
	place-items: center;
	min-height: 14rem;
	padding: var(--el-space-4);
	border: 1px dashed var(--el-color-border);
	border-radius: var(--el-radius-sm);
	background: var(--el-color-surface-strong);
	text-align: center;
	color: var(--el-color-text-soft);
}

.gallery-embed {
	position: relative;
	width: 100%;
	padding-bottom: 56.25%;
	margin: 0 0 var(--el-space-3);
	overflow: hidden;
	border-radius: var(--el-radius-sm);
}

.gallery-embed iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.disclosure-note {
	padding: var(--el-space-3);
	border-radius: var(--el-radius-sm);
	background: var(--el-color-surface-deep);
	color: var(--el-color-text);
}

.section-editor-content .entry-content > *:last-child {
	margin-bottom: 0;
}

.book-search-form {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.75rem;
	margin: 1.5rem 0 2rem;
	padding: 1rem;
	background: var(--el-color-surface);
	border: 1px solid var(--el-color-border);
	border-radius: var(--el-radius);
	box-shadow: var(--el-shadow-soft);
}

.book-search-form input,
.book-search-form button {
	width: 100%;
	padding: 0.85rem 1rem;
	border-radius: 999px;
	border: 1px solid var(--el-color-border);
	font: inherit;
}

.book-search-form button {
	background: var(--el-color-accent);
	color: #fff;
	border-color: var(--el-color-accent);
	cursor: pointer;
}

.books-featured,
.books-all {
	margin-top: var(--el-space-5);
}

.book-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.25rem;
}

.book-card {
	overflow: hidden;
}

.book-card-cover {
	display: block;
	background: var(--el-color-surface-strong);
	aspect-ratio: 4 / 5;
}

.book-card-cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.book-card-cover-placeholder,
.book-cover-placeholder {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	min-height: 14rem;
	padding: 1rem;
	color: var(--el-color-text-soft);
	text-align: center;
	background: var(--el-color-surface-strong);
}

.book-card-content,
.book-entry {
	padding: 1.25rem;
}

.book-card h3 {
	margin-top: 0;
	margin-bottom: 0.75rem;
}

.book-card-author,
.book-card-description,
.book-meta p,
.book-summary p,
.support-box p {
	margin: 0 0 0.85rem;
}

.book-layout {
	display: grid;
	gap: 1.5rem;
	margin-bottom: 1.5rem;
}

.book-cover {
	overflow: hidden;
	border-radius: calc(var(--el-radius) - 4px);
}

.book-links {
	padding-left: 1.25rem;
	margin: 0;
}

.support-box {
	padding: 1rem 1.1rem;
	background: var(--el-color-accent-soft);
}

.back-link {
	margin-top: 1.5rem;
}

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

@media (min-width: 700px) {
	.site-header-inner,
	.site-footer-inner,
	.hero-grid,
	.section-grid,
	.featured-book {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.promo-panel {
		grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
	}

	.site-header-inner {
		align-items: end;
	}

	.primary-nav {
		justify-self: end;
	}

	.footer-nav {
		justify-self: end;
		align-self: center;
	}

	.promo-media {
		justify-self: end;
		align-self: center;
	}

	.promo-media img,
	.promo-media-placeholder {
		max-width: 18rem;
	}

	.book-search-form {
		grid-template-columns: 1fr auto;
		align-items: center;
	}

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

	.book-layout {
		grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
		align-items: start;
	}

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

	.page-section-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.page-panel-wide {
		grid-column: 1 / -1;
	}
}

@media (min-width: 980px) {
	.book-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

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