/*
Theme Name: YoursBible
Description: Lightweight storefront theme for YoursBible PDF guidebooks. Niche landing pages, book pages and Lemon Squeezy checkout.
Version: 1.0.0
Requires PHP: 8.1
Text Domain: yoursbible
*/

:root {
	--bg: #fbf8f3;
	--bg-alt: #f3ede3;
	--card: #ffffff;
	--ink: #1f2a24;
	--muted: #525e56;
	--line: #e6dfd3;
	--brand: #2f5d46;
	--brand-ink: #fbf8f3;
	--buy: #c2562c;
	--buy-hover: #a8471f;
	--niche: #2f5d46;
	--niche-soft: #e7efe9;
	--radius: 14px;
	--shadow: 0 1px 2px rgba(31, 42, 36, .06), 0 8px 24px rgba(31, 42, 36, .08);
	--serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
	--sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.niche-macrame, .niche-macrame-pt { --niche: #9a6a44; --niche-soft: #f4ebe1; }
.niche-crochet { --niche: #b24a6c; --niche-soft: #f8e9ee; }
.niche-herbalism { --niche: #4a7536; --niche-soft: #eaf1e4; }
.niche-homesteading { --niche: #9b5b25; --niche-soft: #f5eadd; }
.niche-survival { --niche: #395669; --niche-soft: #e5ecf0; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.65 var(--sans); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--buy); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.18; letter-spacing: -.01em; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 1.15rem + 1.4vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.icon { flex: none; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .container { padding: 0 28px; } }
.narrow { max-width: 820px; }
.center { text-align: center; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 12px; top: 12px; z-index: 100; background: #fff; padding: 8px 12px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(251, 248, 243, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.35rem; color: var(--ink); text-decoration: none; }
.brand strong { color: var(--brand); }
.nav-toggle > summary { list-style: none; cursor: pointer; width: 44px; height: 44px; display: grid; place-content: center; gap: 5px; }
.nav-toggle > summary::-webkit-details-marker { display: none; }
.nav-toggle > summary span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; }
.primary-nav ul { list-style: none; margin: 0; padding: 0; }
.primary-nav a { display: block; padding: 10px 4px; color: var(--ink); text-decoration: none; font-weight: 500; }
.primary-nav a:hover, .primary-nav .current-menu-item > a, .primary-nav .current-page-ancestor > a { color: var(--buy); }
.nav-desktop { display: none; }
@media (max-width: 959px) {
	.nav-toggle[open] .primary-nav { position: absolute; left: 0; right: 0; top: 64px; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; box-shadow: var(--shadow); }
	.nav-toggle:not([open]) .primary-nav { display: none; }
}
@media (min-width: 960px) {
	.nav-toggle { display: none; }
	.nav-desktop { display: block; }
	.primary-nav ul { display: flex; gap: 22px; }
	.primary-nav a { padding: 6px 0; font-size: .96rem; }
}

.breadcrumbs { padding-top: 16px; font-size: .88rem; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs .separator { margin: 0 6px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 999px; font-weight: 650; text-decoration: none; border: 2px solid transparent; cursor: pointer; transition: background .15s, transform .15s; font-size: 1rem; line-height: 1.2; }
.btn-lg { padding: 16px 28px; font-size: 1.08rem; }
.btn-buy { background: var(--buy); color: #fff; box-shadow: 0 6px 18px rgba(194, 86, 44, .28); }
.btn-buy:hover { background: var(--buy-hover); color: #fff; transform: translateY(-1px); }
.btn-buy.is-disabled { background: #b9b2a7; box-shadow: none; cursor: default; transform: none; }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--card); }
.btn-ghost:hover { border-color: var(--niche); color: var(--niche); }

/* Hero */
.hero { padding: 28px 0 48px; background: radial-gradient(1200px 500px at 80% 0, var(--niche-soft), transparent 70%); }
.hero-grid { display: grid; gap: 36px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.1fr .9fr; gap: 56px; } .hero { padding: 48px 0 72px; } }
.eyebrow { text-transform: uppercase; letter-spacing: .09em; font-size: .78rem; font-weight: 700; color: var(--niche); margin-bottom: .8em; }
.eyebrow a { color: inherit; text-decoration: none; }
.lede { font-size: 1.16rem; color: var(--muted); max-width: 44em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.buy-box { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 22px 0 8px; }
.buy-box .fine { flex-basis: 100%; margin: 0; font-size: .88rem; color: var(--muted); }
.price-tag { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.price-now { font-family: var(--serif); font-size: 2.1rem; font-weight: 700; color: var(--ink); }
.price-was { color: var(--muted); font-size: 1.1rem; }
.price-save { background: var(--niche-soft); color: var(--ink); font-weight: 700; font-size: .82rem; padding: 3px 10px; border-radius: 999px; }
.trust-row { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: .9rem; color: var(--muted); }
.trust-row li { display: flex; align-items: center; gap: 7px; }
.trust-row .icon { color: var(--niche); }

/* Cover stack */
.cover-stack { position: relative; height: clamp(250px, 58vw, 400px); max-width: 520px; margin: 0 auto; width: 100%; }
.cover-stack .cover-img { position: absolute; top: 50%; left: 50%; width: clamp(130px, 34vw, 230px); aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; box-shadow: 0 14px 34px rgba(31, 42, 36, .22); transform: translate(calc(-50% + (var(--i) - (var(--n) - 1) / 2) * 22%), -50%) rotate(calc((var(--i) - (var(--n) - 1) / 2) * 5deg)); z-index: calc(10 - var(--i)); background: #eee; }
.cover-stack .cover-img:nth-child(1) { z-index: 12; }
.cover-fallback { display: grid; place-items: center; text-align: center; padding: 12px; background: var(--niche); color: #fff; font-family: var(--serif); aspect-ratio: 3 / 4; border-radius: 6px; }

.mosaic { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 480px; margin: 0 auto; }
.mosaic .cover-img { border-radius: 6px; box-shadow: var(--shadow); aspect-ratio: 3 / 4; object-fit: cover; width: 100%; }
.mosaic .cover-img:nth-child(3n+2) { transform: translateY(18px); }

/* Sections */
.section { padding: 56px 0; }
.section-alt { background: var(--bg-alt); }
.section-title { text-align: center; margin-bottom: 1.2em; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 1.4em; }
.section-head .section-title { margin: 0; text-align: left; }
.sub-title { margin: 40px 0 18px; text-align: center; }

.benefit-grid { display: grid; gap: 18px; }
@media (min-width: 640px) { .benefit-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .benefit-grid { grid-template-columns: repeat(3, 1fr); } }
.benefit { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; border-top: 4px solid var(--niche); }
.benefit p { margin: 0; color: var(--muted); }

.book-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (min-width: 760px) { .book-grid { grid-template-columns: repeat(3, 1fr); gap: 22px; } }
@media (min-width: 1060px) { .book-grid { grid-template-columns: repeat(4, 1fr); } }
.book-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.book-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.book-card-cover { display: block; background: var(--niche-soft); padding: 16px 16px 0; }
.book-card-cover .cover-img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 4px 4px 0 0; box-shadow: 0 6px 16px rgba(0, 0, 0, .12); }
.book-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.book-card h3 { font-size: 1.02rem; margin-bottom: .35em; }
.book-card h3 a { color: var(--ink); text-decoration: none; }
.book-card h3 a:hover { color: var(--buy); }
.book-card p { font-size: .9rem; color: var(--muted); margin-bottom: .8em; }
.book-card-meta { margin-top: auto; display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); }
.book-card-price { font-weight: 700; color: var(--ink); }
.badge { align-self: flex-start; background: var(--niche); color: #fff; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 3px 9px; border-radius: 999px; margin-bottom: 8px; }
@media (max-width: 520px) { .book-card p { display: none; } }

.split { display: grid; gap: 32px; }
@media (min-width: 960px) { .split { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 56px; align-items: start; } .side-stack, .split > .side-card { position: sticky; top: 88px; } }
.side-stack { display: grid; gap: 18px; }
.side-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.side-card-soft { background: var(--niche-soft); border-color: transparent; }
.side-card h2 { font-size: 1.3rem; }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; }
.check-list .icon { color: var(--niche); margin-top: 3px; }

/* Prose */
.prose { font-size: 1.05rem; }
.prose h2 { margin-top: 1.4em; }
.prose h3 { margin-top: 1.3em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.prose li { margin-bottom: .35em; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.2em; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose blockquote { margin: 0 0 1em; padding: 12px 18px; border-left: 4px solid var(--niche); background: var(--niche-soft); border-radius: 0 8px 8px 0; }
.prose > :first-child { margin-top: 0; }
.prose-wrap { max-width: 800px; padding-top: 24px; padding-bottom: 64px; }
.page-title { margin-top: .3em; }
.post-meta { color: var(--muted); font-size: .9rem; }

/* CTA band */
.cta-band { display: grid; gap: 20px; align-items: center; background: var(--ink); color: #f3efe7; border-radius: 22px; padding: 32px 24px; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #cfd6d1; margin: 0; }
.cta-band .eyebrow { color: #e9b99f; }
.cta-band .price-now { color: #fff; }
.cta-band .price-was { color: #aab4ad; }
.cta-band-buy { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
@media (min-width: 860px) { .cta-band { grid-template-columns: 1.3fr 1fr; padding: 44px 48px; } .cta-band-buy { justify-content: flex-end; } }

/* FAQ */
.faq { display: grid; gap: 10px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 20px; }
.faq summary { cursor: pointer; font-weight: 650; padding: 16px 28px 16px 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 12px; font-size: 1.4rem; color: var(--niche); }
.faq details[open] summary::after { content: "–"; }
.faq-a p { color: var(--muted); }

.closing { text-align: center; }

/* Book page */
.hero-book { padding-bottom: 40px; }
.book-hero-grid { display: grid; gap: 28px; align-items: start; }
@media (min-width: 820px) { .book-hero-grid { grid-template-columns: 360px 1fr; gap: 56px; } }
.book-cover-large { max-width: 320px; margin: 0 auto; width: 70%; }
@media (min-width: 820px) { .book-cover-large { width: 100%; max-width: 360px; } }
.book-cover-large .cover-img { width: 100%; border-radius: 8px; box-shadow: 0 20px 44px rgba(31, 42, 36, .25); }
.upsell { display: flex; align-items: center; gap: 12px; background: var(--niche-soft); border-radius: 12px; padding: 12px 16px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; margin: 10px 0 4px; }
.upsell .icon { color: var(--niche); }
.upsell span { flex: 1; }
.upsell:hover { color: var(--niche); }

/* Sticky mobile buy bar */
.sticky-buy { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0, 0, 0, .08); font-size: .9rem; }
.sticky-buy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sticky-buy .btn { padding: 10px 16px; font-size: .92rem; flex: none; }
@media (min-width: 900px) { .sticky-buy { display: none; } }
@media (max-width: 899px) { .yb-hub .site-footer, .yb-book .site-footer, .yb-library .site-footer { padding-bottom: 90px; } }

/* Home */
.hub-grid { display: grid; gap: 20px; }
@media (min-width: 700px) { .hub-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1060px) { .hub-grid { grid-template-columns: repeat(3, 1fr); } }
.hub-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; color: var(--ink); text-decoration: none; transition: box-shadow .2s, transform .2s; }
.hub-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); color: var(--ink); }
.hub-card .cover-stack { height: 230px; background: var(--niche-soft); max-width: none; }
.hub-card .cover-stack .cover-img { width: 128px; }
.hub-card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.hub-card-body h3 { font-size: 1.35rem; color: var(--niche); }
.hub-card-body p { color: var(--muted); font-size: .95rem; }
.hub-card-meta { margin-top: auto; margin-bottom: 0 !important; display: flex; justify-content: space-between; align-items: baseline; }
.hub-card-meta .price-now { font-size: 1.5rem; }

.post-grid { display: grid; gap: 18px; }
@media (min-width: 700px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .post-grid { grid-template-columns: repeat(3, 1fr); } }
.post-card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; color: var(--ink); text-decoration: none; }
.post-card:hover { box-shadow: var(--shadow); color: var(--ink); }
.post-card h2, .post-card h3 { font-size: 1.2rem; }
.post-card p { color: var(--muted); font-size: .95rem; margin: 0; }
.post-card-cat { display: inline-block; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--brand); margin-bottom: 8px; }

.post-cta { margin-top: 48px; display: grid; gap: 20px; align-items: center; background: var(--niche-soft); border-radius: 18px; padding: 24px; }
.post-cta .cover-stack { height: 220px; }
.post-cta .cover-stack .cover-img { width: 120px; }
@media (min-width: 700px) { .post-cta { grid-template-columns: 260px 1fr; } }

.hub-links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.pagination { margin-top: 32px; text-align: center; }
.pagination .page-numbers { padding: 6px 12px; }

/* Footer */
.site-footer { background: #1b2520; color: #c9d1cb; padding: 56px 0 24px; font-size: .95rem; }
.site-footer a { color: #e7ece8; text-decoration: none; }
.site-footer a:hover { color: #f0b596; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-grid { display: grid; gap: 32px; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-h { font-family: var(--sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: #8fa197; margin-bottom: 14px; }
.brand-footer { font-size: 1.5rem; color: #fff !important; }
.brand-footer strong { color: #9fd0b2; }
.footer-bottom { border-top: 1px solid #33413a; margin-top: 40px; padding-top: 20px; font-size: .82rem; color: #8fa197; }
