/*
Theme Name: Patrick Moore
Theme URI: https://example.com/
Author: Patrick Moore
Description: A dark, atmospheric author theme for Patrick Moore, author of the Cold Iron Trilogy. Built for selling books and growing an author brand.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: patrick-moore
*/

/* ---------- Base polish ---------- */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
::selection { background: var(--wp--preset--color--ember); color: var(--wp--preset--color--ink); }
:where(a, button, input, textarea, summary):focus-visible { outline: 2px solid var(--wp--preset--color--ember); outline-offset: 3px; }

/* Grain overlay for atmosphere */
body::before {
	content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 9999; opacity: .045;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Header ---------- */
.pm-header { border-bottom: 1px solid var(--wp--preset--color--rule); backdrop-filter: blur(8px); }
.pm-header .wp-block-site-title a { text-decoration: none; }
.pm-header .wp-block-navigation a:hover { color: var(--wp--preset--color--ember); }
.pm-header .wp-block-navigation .current-menu-item > a,
.pm-header .wp-block-navigation a[aria-current="page"] { color: var(--wp--preset--color--ember); }
.wp-block-navigation__responsive-container.is-menu-open { background: var(--wp--preset--color--ink) !important; color: var(--wp--preset--color--bone) !important; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item { font-size: 1.5rem; }

/* ---------- Eyebrow / kicker text ---------- */
.pm-eyebrow { font-family: var(--wp--preset--font-family--display); text-transform: uppercase; letter-spacing: .32em; font-weight: 600; font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--ember); margin: 0; }
.pm-eyebrow.is-summer { color: var(--wp--preset--color--blood-light); }
.pm-eyebrow.is-winter { color: var(--wp--preset--color--ice); }

/* ---------- Rule with a diamond ---------- */
.pm-ornament { display: flex; align-items: center; gap: 1rem; color: var(--wp--preset--color--ember); max-width: 14rem; margin-inline: auto !important; }
.pm-ornament::before, .pm-ornament::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: .55; }
.pm-ornament span { width: .5rem; height: .5rem; transform: rotate(45deg); border: 1px solid currentColor; display: block; }

/* ---------- Book covers ---------- */
.pm-cover img { border-radius: 2px; box-shadow: 0 2px 4px rgba(0,0,0,.5), 0 30px 60px -20px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.04); transition: transform .5s cubic-bezier(.2,.7,.2,1), box-shadow .5s; }
.pm-cover.is-summer img { box-shadow: 0 2px 4px rgba(0,0,0,.5), 0 30px 80px -20px rgba(179,36,42,.45), 0 0 0 1px rgba(255,255,255,.04); }
.pm-cover.is-winter img { box-shadow: 0 2px 4px rgba(0,0,0,.5), 0 30px 80px -20px rgba(156,195,216,.35), 0 0 0 1px rgba(255,255,255,.04); }
a:hover .pm-cover img, .pm-cover a:hover img { transform: translateY(-6px); }

/* ---------- Hero ---------- */
.pm-hero { position: relative; }
.pm-hero .wp-block-cover__image-background { filter: saturate(.9); }
.pm-hero-title { text-wrap: balance; }
.pm-hook { font-style: italic; }

/* ---------- Sections ---------- */
.pm-section-rule { border-top: 1px solid var(--wp--preset--color--rule); }
.pm-card { border: 1px solid var(--wp--preset--color--rule); transition: border-color .3s; }
.pm-card:hover { border-color: rgba(208,137,79,.5); }

/* Pull quote / hook line */
.pm-hookline { font-family: var(--wp--preset--font-family--display); font-style: italic; font-weight: 500; line-height: 1.25; text-wrap: balance; }

/* Blurb drop cap */
.pm-blurb > p:first-child::first-letter { font-family: var(--wp--preset--font-family--display); float: left; font-size: 4.2em; line-height: .8; padding: .08em .12em 0 0; color: var(--wp--preset--color--ember); font-weight: 600; }

/* Book details list */
.pm-details { list-style: none; padding: 0 !important; margin: 0; }
.pm-details li { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--wp--preset--color--rule); font-size: var(--wp--preset--font-size--small); }
.pm-details li strong { font-family: var(--wp--preset--font-family--display); text-transform: uppercase; letter-spacing: .18em; font-weight: 600; color: var(--wp--preset--color--steel); }

/* Placeholder cover for book three */
.pm-cover-tba { aspect-ratio: 2 / 3; display: grid; place-items: center; border: 1px dashed rgba(230,220,207,.25); background: repeating-linear-gradient(135deg, rgba(255,255,255,.015) 0 12px, transparent 12px 24px); text-align: center; }

/* Post cards */
.pm-post-card .wp-block-post-title a { text-decoration: none; }
.pm-post-card .wp-block-post-title a:hover { color: var(--wp--preset--color--ember); }

/* ---------- Contact form ---------- */
.pm-form { display: grid; gap: 1.25rem; }
.pm-form label { display: block; font-family: var(--wp--preset--font-family--display); text-transform: uppercase; letter-spacing: .2em; font-weight: 600; font-size: .85rem; color: var(--wp--preset--color--steel); margin-bottom: .4rem; }
.pm-form input[type=text], .pm-form input[type=email], .pm-form textarea {
	width: 100%; box-sizing: border-box; background: var(--wp--preset--color--coal); color: var(--wp--preset--color--parchment);
	border: 1px solid var(--wp--preset--color--rule); border-radius: 2px; padding: .85rem 1rem; font: inherit; font-size: 1rem;
	transition: border-color .2s, background .2s;
}
.pm-form input:focus, .pm-form textarea:focus { border-color: var(--wp--preset--color--ember); background: var(--wp--preset--color--smoke); outline: none; }
.pm-form textarea { min-height: 11rem; resize: vertical; }
.pm-form .pm-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.pm-form button {
	justify-self: start; cursor: pointer; border: 0; border-radius: 2px; background: var(--wp--preset--color--ember); color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--display); font-weight: 700; text-transform: uppercase; letter-spacing: .22em; font-size: .95rem; padding: 1rem 2rem;
	transition: background .2s, transform .2s;
}
.pm-form button:hover { background: var(--wp--preset--color--bone); }
.pm-notice { padding: 1rem 1.25rem; border-left: 3px solid var(--wp--preset--color--ember); background: var(--wp--preset--color--coal); }
.pm-notice.is-error { border-color: var(--wp--preset--color--blood-light); }

/* ---------- Footer ---------- */
.pm-footer a { text-decoration: none; }
.pm-footer a:hover { color: var(--wp--preset--color--ember); }

/* ---------- Buttons: outline style ---------- */
.wp-block-button.is-style-outline > .wp-block-button__link { border: 1px solid currentColor; background: transparent; color: var(--wp--preset--color--bone); }
.wp-block-button.is-style-outline > .wp-block-button__link:hover { color: var(--wp--preset--color--ember); background: transparent; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
	.pm-rise { animation: pm-rise .9s cubic-bezier(.2,.7,.2,1) both; }
	.pm-rise-2 { animation: pm-rise .9s .15s cubic-bezier(.2,.7,.2,1) both; }
	@keyframes pm-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
}

/* ---------- Small screens ---------- */
@media (max-width: 781px) {
	.pm-hero .wp-block-columns { flex-direction: column-reverse; }
	.pm-hero .pm-cover { max-width: 260px; margin-inline: auto; }
	.pm-center-mobile { text-align: center; }
	.pm-center-mobile .wp-block-buttons { justify-content: center; }
	.pm-details li { flex-direction: column; gap: .2rem; }
}

/* ---------- Full-width sections sit flush ---------- */
.wp-block-post-content > .alignfull { margin-block: 0 !important; }
main > .wp-block-post-content { margin-block: 0; }
.wp-block-template-part + main, main + .wp-block-template-part { margin-block-start: 0; }
:where(h1, h2, h3, h4) a { text-decoration: none; }
:where(h1, h2, h3, h4) a:hover { color: var(--wp--preset--color--ember); }

@media (max-width: 600px) {
	.pm-header-cta { display: none !important; }
	.pm-header .wp-block-site-title { letter-spacing: .26em; font-size: 1.05rem; white-space: nowrap; }
}
.wp-block-list.is-style-none { list-style: none; }
