/*
Theme Name: Emma Wells
Theme URI: https://emmawellsbooks.com
Author: Emma Wells
Description: A simple author website for Emma Wells and the Port St Michael novellas. Sets up its own pages when activated.
Version: 1.1
Requires at least: 6.0
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: emma-wells
*/

:root {
	--sand: #fbf6ef;
	--paper: #fffdf9;
	--shell: #f4e9de;
	--ink: #2b2d38;
	--muted: #6c6870;
	--navy: #1f3b57;
	--rose: #a3324e;
	--rose-dark: #84243c;
	--sunset: #e3a06a;
	--line: #e8dccd;
	--serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
	--sans: "Nunito Sans", "Helvetica Neue", Arial, sans-serif;
	--wrap: 1120px;
	--narrow: 720px;
}

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

html { scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--sand);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 18px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
}

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

a { color: var(--rose); text-underline-offset: 3px; }
a:hover { color: var(--rose-dark); }

h1, h2, h3, h4 {
	font-family: var(--serif);
	font-weight: 600;
	color: var(--navy);
	line-height: 1.15;
	margin: 0 0 .5em;
}
h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); }
h2 { font-size: clamp(2rem, 4vw, 2.8rem); }
h3 { font-size: 1.6rem; }

p { margin: 0 0 1.1em; }

.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.narrow { width: min(var(--narrow), 100% - 32px); margin-inline: auto; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto; z-index: 100; top: 8px; left: 8px;
	background: var(--paper); padding: 8px 14px;
}

/* ---------- Header ---------- */
.site-header {
	background: var(--paper);
	border-bottom: 1px solid var(--line);
	position: sticky; top: 0; z-index: 50;
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; position: relative; } }

.site-header .wrap {
	display: flex; align-items: center; justify-content: space-between;
	gap: 20px; min-height: 76px;
}
.site-title {
	font-family: var(--serif); font-size: 1.9rem; font-weight: 600;
	color: var(--navy); text-decoration: none; letter-spacing: .02em; line-height: 1;
}
.site-title span {
	display: block; font-family: var(--sans); font-size: .68rem; font-weight: 600;
	letter-spacing: .22em; text-transform: uppercase; color: var(--rose); margin-top: 6px;
}

.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 28px; }
.main-nav a {
	color: var(--ink); text-decoration: none; font-size: .95rem; font-weight: 600;
	padding: 6px 0; border-bottom: 2px solid transparent;
}
.main-nav a:hover,
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a,
.main-nav .current_page_parent > a { color: var(--rose); border-color: var(--rose); }

.nav-toggle {
	display: none; background: none; border: 1px solid var(--line); border-radius: 6px;
	padding: 8px 12px; font: 600 .9rem var(--sans); color: var(--navy); cursor: pointer;
}

@media (max-width: 860px) {
	.nav-toggle { display: block; }
	.main-nav { display: none; position: absolute; left: 0; right: 0; top: 100%;
		background: var(--paper); border-bottom: 1px solid var(--line); }
	.main-nav.is-open { display: block; }
	.main-nav ul { flex-direction: column; gap: 0; padding: 8px 16px 16px; }
	.main-nav a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
}

/* ---------- Buttons ---------- */
.button, button.button, input.button {
	display: inline-block; background: var(--rose); color: #fff; border: 0;
	border-radius: 999px; padding: 12px 26px; font: 700 .95rem var(--sans);
	letter-spacing: .02em; text-decoration: none; cursor: pointer;
	transition: background .2s ease, transform .2s ease;
}
.button:hover { background: var(--rose-dark); color: #fff; transform: translateY(-1px); }
.button.ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.button.ghost:hover { background: var(--navy); color: #fff; }

/* ---------- Hero ---------- */
.hero {
	position: relative; min-height: clamp(460px, 72vh, 720px);
	background-size: cover; background-position: 40% center;
	display: flex; align-items: center;
}
.hero::after {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(90deg, rgba(31,59,87,0) 30%, rgba(31,59,87,.42) 100%);
}
.hero .wrap { position: relative; z-index: 1; display: flex; justify-content: flex-end; }
.hero-text { max-width: 500px; color: #fff; text-shadow: 0 2px 18px rgba(20,30,50,.45); }
.hero-text h1 { color: #fff; font-size: clamp(3rem, 7vw, 5rem); margin-bottom: .2em; }
.hero-text p { font-family: var(--serif); font-size: clamp(1.35rem, 2.4vw, 1.7rem); line-height: 1.35; font-style: italic; }
.hero-text .button { text-shadow: none; margin-top: 10px; }

@media (max-width: 700px) {
	.hero { align-items: flex-end; background-position: 58% center; }
	.hero::after { background: linear-gradient(180deg, rgba(31,59,87,0) 25%, rgba(31,59,87,.65) 100%); }
	.hero .wrap { justify-content: flex-start; padding-bottom: 36px; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section.alt { background: var(--paper); border-block: 1px solid var(--line); }
.section.shell { background: var(--shell); }
.eyebrow {
	display: block; font-family: var(--sans); font-size: .75rem; font-weight: 700;
	letter-spacing: .22em; text-transform: uppercase; color: var(--rose); margin-bottom: 10px;
}
.center { text-align: center; }
.lead { font-family: var(--serif); font-size: 1.45rem; line-height: 1.5; color: var(--ink); }

.entry-content > * { max-width: 100%; }
.entry-content h2 { margin-top: 1.4em; }
.entry-content img { border-radius: 6px; }
.entry-content blockquote {
	margin: 1.6em 0; padding: 0 0 0 22px; border-left: 3px solid var(--sunset);
	font-family: var(--serif); font-size: 1.4rem; font-style: italic;
}

/* ---------- Page header ---------- */
.page-banner {
	background-size: cover; background-position: center; position: relative;
	padding: clamp(80px, 12vw, 140px) 0 clamp(40px, 6vw, 64px);
}
.page-banner::after { content: ""; position: absolute; inset: 0;
	background: linear-gradient(180deg, rgba(31,59,87,.05), rgba(31,59,87,.55)); }
.page-banner .wrap { position: relative; z-index: 1; }
.page-banner h1 { color: #fff; margin: 0; text-shadow: 0 2px 16px rgba(20,30,50,.4); }
.page-banner .eyebrow { color: #fff; opacity: .9; }

.page-head { padding: clamp(48px, 7vw, 80px) 0 10px; text-align: center; }

/* ---------- Books ---------- */
.book-row {
	display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px;
	align-items: start; margin-top: 36px;
}
.book-row a { text-decoration: none; color: var(--ink); display: block; }
.book-row .cover { border-radius: 4px; box-shadow: 0 10px 24px rgba(31,59,87,.18); transition: transform .25s ease, box-shadow .25s ease; }
.book-row a:hover .cover { transform: translateY(-4px); box-shadow: 0 16px 30px rgba(31,59,87,.24); }
.book-row .num { display: block; margin-top: 14px; font-size: .72rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--rose); }
.book-row .title { display: block; font-family: var(--serif); font-size: 1.25rem; font-weight: 600; color: var(--navy); line-height: 1.2; }
@media (max-width: 900px) { .book-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .book-row { grid-template-columns: repeat(2, 1fr); gap: 18px; } }

.book {
	display: grid; grid-template-columns: 260px 1fr; gap: clamp(28px, 5vw, 56px);
	align-items: center; padding: clamp(40px, 6vw, 64px) 0; border-bottom: 1px solid var(--line);
	scroll-margin-top: 100px;
}
.book:last-child { border-bottom: 0; }
.book .cover { border-radius: 4px; box-shadow: 0 14px 34px rgba(31,59,87,.2); }
.book h2 { font-size: clamp(2rem, 3.6vw, 2.6rem); }
.book .tagline { font-family: var(--serif); font-style: italic; font-size: 1.4rem; color: var(--rose); line-height: 1.4; }
.book .blurb p:last-child { margin-bottom: 0; }
.book .actions { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.badge {
	display: inline-block; background: var(--shell); color: var(--navy); border-radius: 999px;
	padding: 8px 18px; font-size: .85rem; font-weight: 700; letter-spacing: .04em;
}
@media (max-width: 680px) {
	.book { grid-template-columns: 1fr; text-align: center; }
	.book .cover { max-width: 240px; margin-inline: auto; }
	.book .actions { justify-content: center; }
}

/* ---------- Newsletter ---------- */
.newsletter-band { text-align: center; }
.newsletter-band p { color: var(--muted); }
.signup { display: flex; gap: 10px; max-width: 520px; margin: 24px auto 0; }
.signup input[type="email"] {
	flex: 1; min-width: 0; padding: 13px 20px; border: 1.5px solid var(--line); border-radius: 999px;
	font: 1rem var(--sans); background: #fff; color: var(--ink);
}
.signup input[type="email"]:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 3px rgba(163,50,78,.15); }
.signup-note { font-size: .82rem; color: var(--muted); margin-top: 14px; }
.hp-field { position: absolute; left: -5000px; }
@media (max-width: 480px) { .signup { flex-direction: column; } .signup .button { width: 100%; } }

.coming-soon {
	margin-top: 36px; padding: 26px 30px; background: var(--paper); border: 1px dashed var(--sunset);
	border-radius: 10px; text-align: center; font-family: var(--serif); font-size: 1.3rem; font-style: italic; color: var(--navy);
}

/* ---------- About teaser ---------- */
.about-teaser { display: grid; grid-template-columns: 1fr; text-align: center; }

/* ---------- Blog ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 32px; }
@media (max-width: 900px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .post-grid { grid-template-columns: 1fr; } }
.post-card { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.post-card img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.post-card .inner { padding: 22px 24px 26px; }
.post-card h3 { font-size: 1.5rem; margin-bottom: .3em; }
.post-card h3 a { color: var(--navy); text-decoration: none; }
.post-card h3 a:hover { color: var(--rose); }
.post-card .excerpt { font-size: .95rem; color: var(--muted); }
.meta { font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--rose); }
.empty-note { text-align: center; color: var(--muted); font-style: italic; }

.single-head { text-align: center; padding: clamp(48px, 7vw, 80px) 0 24px; }
.single-thumb { margin: 0 auto 36px; border-radius: 8px; overflow: hidden; }
.post-nav { display: flex; justify-content: space-between; gap: 20px; margin: 48px 0 0; padding-top: 24px; border-top: 1px solid var(--line); font-size: .95rem; }

.pagination { margin-top: 40px; text-align: center; }
.pagination .page-numbers { display: inline-block; padding: 6px 12px; margin: 0 2px; border-radius: 6px; text-decoration: none; }
.pagination .current { background: var(--rose); color: #fff; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #dfe6ee; padding: 48px 0 36px; font-size: .92rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; align-items: center; }
.footer-brand { font-family: var(--serif); font-size: 1.6rem; color: #fff; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.copyright { margin-top: 26px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.15); opacity: .75; font-size: .82rem; }

/* WordPress core classes */
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { margin-inline: auto; }
.wp-caption-text, figcaption { font-size: .85rem; color: var(--muted); text-align: center; }
