/*
Theme Name: Chad Reisig
Theme URI: https://chadreisig.org
Author: Chad Reisig
Description: Custom theme for chadreisig.org: books, podcast, The Daily Dose devotionals, and Next Pasture Leadership coaching.
Version: 1.0.0
Requires at least: 5.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: chadreisig
*/

/* ==========================================================================
   Design tokens (palette A: pasture green)
   ========================================================================== */
:root {
	--bg: #FAF7F2;
	--bg-alt: #F1ECE2;
	--ink: #2C2C2A;
	--muted: #6B6A64;
	--accent: #0F6E56;
	--accent-ink: #FFFFFF;
	--gold: #C8963E;
	--dark: #12261F;
	--dark-ink: #F4EFE6;
	--line: #DDD6C8;
	--serif: 'Fraunces', Georgia, 'Times New Roman', serif;
	--sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); background: var(--bg); color: var(--ink); line-height: 1.6; font-size: 17px; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.15; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.wrap { width: min(1120px, 100% - 48px); margin-inline: auto; }
.wrap-narrow { width: min(740px, 100% - 48px); 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 { position: fixed !important; top: 8px; left: 8px; width: auto; height: auto; clip: auto; background: #fff; color: #000; padding: 10px 16px; z-index: 100; border-radius: 4px; }

section { padding: 84px 0; }
.alt { background: var(--bg-alt); }
.dark { background: var(--dark); color: var(--dark-ink); }

.eyebrow { font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.eyebrow a:hover { text-decoration: underline; }
.dark .eyebrow { color: var(--gold); }
.sec-head { max-width: 640px; margin-bottom: 44px; }
.sec-head h2, .sec-title { font-size: clamp(28px, 3.4vw, 40px); }
.sec-title { margin-bottom: 16px; }
.soft { opacity: .82; max-width: 32em; margin-bottom: 26px; }
.more { margin-top: 36px; }
.empty { color: var(--muted); }

.textlink { color: var(--accent); font-weight: 600; border-bottom: 2px solid currentColor; padding-bottom: 1px; display: inline-block; }
.dark .textlink { color: var(--gold); }

/* Buttons */
.btn { display: inline-block; padding: 14px 26px; border-radius: 6px; font: 600 15.5px/1.2 var(--sans); border: 2px solid transparent; transition: transform .15s, background .2s, opacity .2s; cursor: pointer; text-align: center; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #0b5945; }
.btn-gold { background: var(--gold); color: #1a1a18; }
.btn-gold:hover { background: #d6a54d; }
.btn-ghost { border-color: currentColor; background: transparent; }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(250, 247, 242, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
body.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .site-header { top: 46px; } }
.nav { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 24px; }
.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand b { font-family: var(--serif); font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.brand span { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.brand-logo img { max-height: 48px; width: auto; }
.primary-nav { display: flex; align-items: center; gap: 30px; }
.primary-nav .menu { display: flex; gap: 30px; list-style: none; font-size: 15px; font-weight: 500; }
.primary-nav .menu a:hover, .primary-nav .menu .current-menu-item > a, .primary-nav .menu .current_page_item > a { color: var(--accent); }
.nav-cta { padding: 10px 18px; font-size: 14px; }
.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle .bars, .nav-toggle .bars::before, .nav-toggle .bars::after { display: block; width: 24px; height: 2px; background: var(--ink); position: relative; content: ''; transition: transform .2s; }
.nav-toggle .bars::before { position: absolute; top: -7px; }
.nav-toggle .bars::after { position: absolute; top: 7px; }

/* ==========================================================================
   Home: hero
   ========================================================================== */
.hero { padding: 88px 0 96px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 64px; align-items: center; }
.hero h1 { font-size: clamp(38px, 5.2vw, 62px); margin-bottom: 22px; }
.hero h1 em { font-style: italic; color: var(--gold); font-weight: 500; }
.hero .lead { font-size: 19px; opacity: .88; max-width: 34em; margin-bottom: 32px; }
.badge { display: inline-block; border: 1px solid rgba(200, 150, 62, .7); color: var(--gold); padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; letter-spacing: .06em; margin-bottom: 22px; }

/* Book covers: real image, or a placeholder until the cover is uploaded */
.hero-cover { display: flex; justify-content: center; }
.cover-link { display: block; width: min(340px, 80%); }
.hero-cover img, .cover-link img { width: 100%; border-radius: 4px 10px 10px 4px; box-shadow: 0 30px 60px rgba(0, 0, 0, .45), 0 0 0 1px rgba(244, 239, 230, .16); }
.cover-ph { width: 100%; aspect-ratio: 2 / 3; border-radius: 4px 10px 10px 4px; background: linear-gradient(160deg, #0a4a3a 0%, var(--accent) 60%, #4d9a86 100%); box-shadow: 0 30px 60px rgba(0, 0, 0, .35), inset 6px 0 0 rgba(0, 0, 0, .18); color: #fff; display: flex; align-items: center; justify-content: center; text-align: center; padding: 28px; }
.cover-ph { container-type: inline-size; }
.cover-ph { padding: 20px; }
.cover-ph span { font-family: var(--serif); font-weight: 700; font-size: clamp(14px, 10.5cqw, 34px); line-height: 1.1; overflow-wrap: break-word; }

/* Home: intro */
.intro-grid { display: grid; grid-template-columns: 340px 1fr; gap: 64px; align-items: center; }
.headshot { aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; background: repeating-linear-gradient(45deg, var(--bg-alt), var(--bg-alt) 12px, var(--line) 12px, var(--line) 13px); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.headshot img { width: 100%; height: 100%; object-fit: cover; }
/* The bundled photo is a transparent cutout, so it sits on a brand-green panel. */
.headshot.is-cutout { background: linear-gradient(165deg, #0a4a3a 0%, var(--accent) 55%, #2f8a72 100%); align-items: flex-end; box-shadow: 0 24px 50px rgba(15, 110, 86, .25); }
.headshot.is-cutout img { object-fit: cover; object-position: center top; } /* trims the ragged bottom edge of the cutout */
.intro h2 { font-size: clamp(30px, 3.6vw, 42px); margin-bottom: 20px; }
.intro p { color: var(--muted); max-width: 34em; }

/* Home: three paths */
.paths { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card { display: block; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 32px 28px; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0, 0, 0, .08); }
.card .num { font-family: var(--serif); font-size: 15px; color: var(--accent); font-weight: 600; margin-bottom: 14px; }
.card h3 { font-size: 24px; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 15.5px; margin-bottom: 18px; }

/* Devotional cards */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px 24px; }
.post-card { border-top: 3px solid var(--accent); padding-top: 18px; }
.post-card .date { font-size: 13px; color: var(--muted); letter-spacing: .04em; margin-bottom: 8px; }
.post-card h3 { font-size: 22px; margin-bottom: 8px; }
.post-card h3 a:hover { color: var(--accent); }
.post-card p { font-size: 15px; color: var(--muted); margin: 0; }

/* Podcast */
.pod-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 56px; align-items: center; }
.pod-art { aspect-ratio: 1; max-width: 340px; width: 100%; border-radius: 14px; background: linear-gradient(135deg, var(--gold), #7f8a4d); display: flex; align-items: center; justify-content: center; text-align: center; padding: 30px; color: #1a1a18; font-family: var(--serif); font-size: 34px; font-weight: 700; line-height: 1.05; box-shadow: 0 20px 40px rgba(0, 0, 0, .35); }
.pod-art small { display: block; font-family: var(--sans); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; margin-top: 12px; opacity: .7; }

.episodes { list-style: none; }
.ep { display: flex; align-items: flex-start; gap: 16px; padding: 16px 0; border-bottom: 1px solid rgba(244, 239, 230, .18); }
.ep-body { flex: 1; min-width: 0; }
.ep-body b { display: block; font-weight: 600; }
.ep-body b a:hover { text-decoration: underline; }
.ep-body span { font-size: 13.5px; opacity: .65; }
.ep-audio audio { width: 100%; margin-top: 10px; }
.play { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--gold); color: #1a1a18; cursor: pointer; position: relative; }
.play::before { content: ''; position: absolute; left: 16px; top: 12px; border-style: solid; border-width: 8px 0 8px 13px; border-color: transparent transparent transparent currentColor; }
.ep.is-playing .play::before { left: 13px; top: 13px; width: 14px; height: 14px; border: 0; background: linear-gradient(90deg, currentColor 0 35%, transparent 35% 65%, currentColor 65% 100%); }
.episodes-light .ep { border-bottom-color: var(--line); }
.episodes-light .play { background: var(--accent); color: #fff; }

/* Books */
.books { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
/* Covers sit on a shared baseline, like books on a shelf, so different cover shapes line up. */
.book .bc { display: flex; align-items: flex-end; aspect-ratio: 2 / 3; margin-bottom: 18px; }
.book .bc img { width: 100%; height: auto; border-radius: 3px 8px 8px 3px; box-shadow: 0 14px 28px rgba(0, 0, 0, .18), 0 0 0 1px rgba(0, 0, 0, .08); }
.book .cover-ph { box-shadow: 0 14px 28px rgba(0, 0, 0, .18), inset 5px 0 0 rgba(0, 0, 0, .15); }
.book h3 { font-size: 22px; margin-bottom: 4px; }
.book h3 a:hover { color: var(--accent); }
.subtitle { color: var(--muted); font-style: italic; margin: 0 0 10px; font-size: 15.5px; }
.book p { font-size: 15px; color: var(--muted); }
.tag { display: inline-block; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 4px; margin-bottom: 10px; }

/* Books page rows and single book */
.book-list { display: grid; gap: 64px; }
.book-row { display: grid; grid-template-columns: 220px 1fr; gap: 40px; align-items: center; }
.book-row-cover img { width: 100%; border-radius: 3px 8px 8px 3px; box-shadow: 0 14px 28px rgba(0, 0, 0, .18), 0 0 0 1px rgba(0, 0, 0, .08); }
.book-row h2 { font-size: clamp(26px, 3vw, 34px); margin-bottom: 6px; }
.book-row h2 a:hover { color: var(--accent); }
.book-row p { color: var(--muted); }
.book-row .btn-row { margin-top: 18px; }
.book-detail-grid { display: grid; grid-template-columns: 340px 1fr; gap: 64px; align-items: start; }
.book-detail-cover img { width: 100%; border-radius: 4px 10px 10px 4px; box-shadow: 0 24px 50px rgba(0, 0, 0, .3), 0 0 0 1px rgba(0, 0, 0, .08); }
@media (min-width: 901px) {
	.book-detail-cover { position: sticky; top: 110px; } /* cover stays in view beside a long description */
}
.book-detail h1 { font-size: clamp(34px, 4.4vw, 52px); margin-bottom: 8px; }
.book-detail .entry-content { margin: 24px 0 32px; }

/* Coaching */
.np-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.np-logo { background: #fff; border-radius: 10px; padding: 26px 30px; margin-bottom: 26px; width: fit-content; max-width: 100%; }
.np-logo img { height: 52px; width: auto; }
.services { display: grid; gap: 14px; }
.svc { display: flex; gap: 18px; align-items: center; background: rgba(244, 239, 230, .08); border: 1px solid rgba(244, 239, 230, .16); border-radius: 10px; padding: 16px 20px; }
.svc img { width: 52px; height: 52px; border-radius: 8px; background: #fff; padding: 6px; flex: none; }
.svc b { display: block; }
.svc span { font-size: 14px; opacity: .7; }
.coaching-hero h1 { font-size: clamp(30px, 3.8vw, 44px); }

/* ==========================================================================
   Inner pages
   ========================================================================== */
.page-hero { background: var(--bg-alt); padding: 64px 0 48px; border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(34px, 4.6vw, 54px); }
.page-hero .lead { margin-top: 16px; max-width: 40em; color: var(--muted); font-size: 18px; }
.page-hero .lead p:last-child { margin-bottom: 0; }
.page-hero .byline { margin-top: 14px; color: var(--muted); font-size: 15px; }
.page-hero + section { padding-top: 56px; }

.archive-tools { display: grid; gap: 22px; margin-bottom: 44px; }
.search-form { display: flex; gap: 10px; max-width: 520px; }
.search-form input[type="search"] { flex: 1; min-width: 0; padding: 13px 16px; border: 1.5px solid var(--line); border-radius: 6px; background: #fff; font: inherit; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chips a { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font-size: 14px; font-weight: 500; }
.chips a small { color: var(--muted); }
.chips a:hover { border-color: var(--accent); color: var(--accent); }

.pagination { margin-top: 56px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pagination .page-numbers { min-width: 42px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-weight: 500; text-align: center; }
.pagination .page-numbers.current { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination a.page-numbers:hover { border-color: var(--accent); color: var(--accent); }

/* Reading text (devotionals and pages) */
.entry-content { font-size: 18.5px; line-height: 1.75; }
.entry-content > * + * { margin-top: 1.2em; }
.entry-content h2 { font-size: 30px; margin-top: 1.8em; }
.entry-content h3 { font-size: 24px; margin-top: 1.6em; }
.entry-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.entry-content blockquote { border-left: 4px solid var(--gold); margin: 1.6em 0; padding: 4px 0 4px 22px; font-family: var(--serif); font-size: 1.1em; color: #444; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li + li { margin-top: .4em; }
.entry-content img { border-radius: 6px; margin-inline: auto; }
.entry-content figure { margin-inline: 0; }
.entry-content figcaption, .wp-caption-text { font-size: 14px; color: var(--muted); text-align: center; margin-top: 8px; }
.entry-content .alignleft { float: left; margin: 0 24px 12px 0; }
.entry-content .alignright { float: right; margin: 0 0 12px 24px; }
.entry-content .aligncenter { margin-inline: auto; }
.entry-content iframe { max-width: 100%; }
.single-thumb { margin-bottom: 32px; }
.single-thumb img { border-radius: 8px; width: 100%; }
.pod-links { margin-bottom: 36px; }

/* About page: text beside a photo */
.about-grid { display: grid; grid-template-columns: 1fr 340px; gap: 64px; align-items: start; }
.about-photo { position: sticky; top: 110px; }

.post-navigation { margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--line); }
.post-navigation .nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.post-navigation a { display: block; font-family: var(--serif); font-weight: 600; font-size: 18px; }
.post-navigation a:hover { color: var(--accent); }
.post-navigation a span { display: block; font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.post-navigation .nav-next { text-align: right; }

/* Comments */
.comments { margin-top: 64px; }
.comments-title { font-size: 26px; margin-bottom: 20px; }
.comment-list { list-style: none; }
.comment-list .children { list-style: none; margin-left: 28px; }
.comment-body { padding: 18px 0; border-top: 1px solid var(--line); font-size: 16px; }
.comment-author .avatar { float: left; margin-right: 12px; border-radius: 50%; }
.comment-metadata { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.comment-form label { display: block; font-weight: 500; margin-bottom: 4px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 6px; font: inherit; background: #fff; }
.comment-form .submit { background: var(--accent); color: #fff; border: 0; padding: 14px 26px; border-radius: 6px; font: 600 15.5px var(--sans); cursor: pointer; }

/* ==========================================================================
   Newsletter (styles MailPoet's form to match)
   ========================================================================== */
.news { text-align: center; }
.news h2 { font-size: clamp(28px, 3.4vw, 40px); margin-bottom: 14px; }
.news > .wrap > p { color: var(--muted); max-width: 32em; margin: 0 auto 28px; }
.news-form { max-width: 560px; margin: 0 auto; }
.news-form .mailpoet_form { margin: 0; }
.news-form .mailpoet_form form, .news-form .mailpoet_paragraph { margin: 0 0 12px; }
.news-form .mailpoet_text, .news-form input[type="email"], .news-form input[type="text"] { width: 100%; padding: 14px 18px; border: 1.5px solid var(--line); border-radius: 6px; background: #fff; font: inherit; }
.news-form .mailpoet_submit { background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: 14px 26px; font: 600 15.5px var(--sans); cursor: pointer; width: 100%; }
.news-form .mailpoet_submit:hover { background: #0b5945; }
/* MailPoet's ready-made templates put their own colors, fonts, icon and headings directly on the
   form, so these rules use !important to keep the form on-brand. The section above the form
   already carries the heading and text, so the template's own headings and icon are hidden. */
.news-form .mailpoet_form_image,
.news-form .mailpoet-heading { display: none !important; }
.news-form .mailpoet_text,
.news-form input[type="email"] { background: #fff !important; border: 1.5px solid var(--line) !important; border-radius: 6px !important; font-family: var(--sans) !important; font-size: 16px !important; padding: 14px 18px !important; }
.news-form .mailpoet_submit { background: var(--accent) !important; color: var(--accent-ink) !important; border-radius: 6px !important; font-family: var(--sans) !important; font-size: 15.5px !important; font-weight: 600 !important; padding: 14px 26px !important; cursor: pointer; }
.news-form .mailpoet_submit:hover { background: #0b5945 !important; }
.news-form .mailpoet_form_paragraph { font-family: var(--sans) !important; font-size: 13px !important; color: var(--muted); text-align: center; margin: 4px 0 0; }
.news-form .mailpoet_form_paragraph a { color: var(--accent); text-decoration: underline; }
.news-form .mailpoet_validate_success { color: var(--accent); font-weight: 600; }
.news-form .mailpoet_validate_error { color: #b3261e; }
.admin-note { border: 2px dashed var(--line); border-radius: 8px; padding: 14px 18px; color: var(--muted); font-size: 15px; text-align: left; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--dark); color: var(--dark-ink); padding: 56px 0 32px; font-size: 14.5px; }
.foot { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; align-items: flex-start; }
.site-footer .brand span { color: rgba(244, 239, 230, .6); }
.foot-email { margin: 14px 0 0; opacity: .8; }
.foot-email a:hover, .foot-menu a:hover, .social a:hover { color: var(--gold); }
.foot-menu, .social { list-style: none; display: flex; gap: 22px; flex-wrap: wrap; opacity: .85; }
.foot-legal { margin-top: 40px; padding-top: 24px; border-top: 1px solid rgba(244, 239, 230, .14); opacity: .6; font-size: 13.5px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
	.nav-toggle { display: block; }
	.primary-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 24px 24px; box-shadow: 0 16px 24px rgba(0, 0, 0, .08); }
	.primary-nav.open { display: flex; }
	.primary-nav .menu { flex-direction: column; gap: 0; }
	.primary-nav .menu a { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); }
	.nav-cta { margin-top: 18px; }
	.site-header .wrap { position: static; }
	.site-header { position: sticky; }

	.hero-grid, .intro-grid, .pod-grid, .np-grid, .book-detail-grid, .about-grid { grid-template-columns: 1fr; gap: 40px; }
	.about-photo { order: -1; position: static; max-width: 300px; }
	.paths, .post-grid, .books { grid-template-columns: 1fr; }
	.book-row { grid-template-columns: 140px 1fr; gap: 24px; }
	.headshot { max-width: 300px; }
	section { padding: 64px 0; }
	.hero { padding: 56px 0 64px; }
	.page-hero { padding: 44px 0 36px; }
	.book-detail-cover { max-width: 280px; }
}

@media (max-width: 520px) {
	.book-row { grid-template-columns: 1fr; }
	.book-row-cover { max-width: 180px; }
	.post-navigation .nav-links { grid-template-columns: 1fr; }
	.post-navigation .nav-next { text-align: left; }
	.search-form { flex-direction: column; }
	.entry-content { font-size: 17.5px; }
}

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