/*
Theme Name: Adopted
Theme URI: https://adoptedbook.au
Author: Ken Wootton / TPDG Publishing
Author URI: https://tpdg.au
Description: Block theme for Adopted: Taking Your Place in the Family of God. White space, charcoal type, one warm accent. Built around a buy first, claim bonuses second launch sequence and designed to pair with the Adopted Book Toolkit plugin.
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 7.4
Version: 2.3.8
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: adopted
*/

/* ---------- Base ---------- */
:root {
	--ad-ink: #161616;
	--ad-stone: #4a4a4a;
	--ad-mist: #555555;
	--ad-line: #e4e1dc;
	--ad-paper: #ffffff;
	--ad-cream: #f6f3ee;
	--ad-accent: #866120;
}

html { scroll-behavior: smooth; }
img, svg, video { max-width: 100%; height: auto; }
.wp-block-column, .wp-block-group { min-width: 0; }
body { -webkit-font-smoothing: antialiased; }

h1, h2, h3, h4 { letter-spacing: -0.015em; text-wrap: balance; }
p { text-wrap: pretty; }

.wp-site-blocks a { text-underline-offset: 3px; }

/* ---------- Buttons ---------- */
.wp-block-button__link {
	border-radius: 2px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	font-size: 0.8rem;
	font-weight: 600;
	padding: 1em 1.9em;
	transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.wp-block-button__link:hover { transform: translateY(-1px); }
.is-style-outline .wp-block-button__link { border: 2px solid currentColor; }
.is-style-accent .wp-block-button__link { background: var(--ad-accent); color: #fff; border-color: var(--ad-accent); }

/* ---------- Toolkit components ---------- */
.bk-buy-buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.25rem 0; }
.bk-buy-buttons a {
	display: inline-block; text-decoration: none; border: 2px solid var(--ad-ink);
	color: var(--ad-ink); background: var(--ad-paper); padding: 0.75em 1.3em;
	border-radius: 2px; font-weight: 600; font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase;
}
.bk-buy-buttons a:hover { background: var(--ad-ink); color: #fff; }
.bk-buy-buttons a.bk-buy-direct { background: var(--ad-ink); color: #fff; }
.bk-buy-buttons a.bk-buy-direct:hover { background: var(--ad-accent); border-color: var(--ad-accent); }

.bk-cta { display: inline-block; text-decoration: none; background: var(--ad-ink); color: #fff;
	padding: 1em 2em; border-radius: 2px; font-weight: 600; font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; }
.bk-cta:hover { background: var(--ad-accent); color: #fff; }
.bk-cta--accent { background: var(--ad-accent); }
.bk-cta--ghost { background: transparent; color: var(--ad-ink); border: 2px solid var(--ad-ink); padding: calc(1em - 2px) calc(2em - 2px); }
.bk-cta--ghost:hover { background: var(--ad-ink); color: #fff; }
.bk-buy-price { font-family: var(--wp--preset--font-family--heading); font-size: 1.6rem; margin: 0 0 0.5rem; }
.bk-buy-price span { font-family: var(--wp--preset--font-family--body); font-size: 0.85rem; color: var(--ad-mist); margin-left: 0.5rem; }
.bk-buy-note { font-size: 0.85rem; color: var(--ad-mist); }
.bk-filelist { list-style: none; padding: 0; } .bk-filelist li { border-top: 1px solid var(--ad-line); padding: 0.7rem 0; } .bk-filelist li:last-child { border-bottom: 1px solid var(--ad-line); }
.bk-social a, .bk-share a { display: inline-block; margin-right: 1rem; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none; border-bottom: 2px solid var(--ad-line); }
.bk-social a:hover, .bk-share a:hover { border-color: var(--ad-accent); }
.bk-share span { font-size: 0.85rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ad-mist); margin-right: 1rem; }
.bk-form__row { display: flex; gap: 0.5rem; flex-wrap: wrap; } .bk-form__row input[type=email] { flex: 1 1 220px; } .bk-form__row button { margin-top: 0; }
.bk-sticky { display: none; }
@media (max-width: 781px) {
	.bk-sticky { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom, 0px)); background: rgba(255,255,255,0.96); border-top: 1px solid var(--ad-line); backdrop-filter: blur(6px); }
	.bk-sticky__text { font-weight: 600; font-size: 0.9rem; }
	.bk-sticky .bk-cta { padding: 0.9em 1.3em; font-size: 0.8rem; min-height: 44px; display: inline-flex; align-items: center; }
	body { padding-bottom: 4.5rem; }
}
.bk-cta--accent:hover { background: var(--ad-ink); }

.bk-step { display: flex; gap: 1.25rem; align-items: flex-start; }
.bk-step__num { flex: 0 0 auto; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--ad-ink); color: #fff;
	display: flex; align-items: center; justify-content: center; font-weight: 700; font-family: var(--wp--preset--font-family--heading); font-size: 1.2rem; }

.bk-form { max-width: 560px; }
.bk-form label { display: block; font-size: 0.85rem; font-weight: 600; margin: 0.9rem 0 0.3rem; letter-spacing: 0.02em; }
.bk-form input[type=text], .bk-form input[type=email], .bk-form textarea, .bk-form select {
	width: 100%; padding: 0.8em 0.9em; border: 1px solid var(--ad-line); border-radius: 2px;
	font: inherit; font-size: 1rem; background: #fff; color: var(--ad-ink);
}
.bk-form input:focus, .bk-form textarea:focus { outline: 2px solid var(--ad-accent); outline-offset: 1px; border-color: var(--ad-accent); }
.bk-form button { margin-top: 1.1rem; cursor: pointer; border: 0; }
.bk-form .bk-form__note { font-size: 0.875rem; color: var(--ad-mist); margin-top: 0.75rem; }
.bk-form .bk-hp { position: absolute; left: -9999px; }
.bk-notice { border-left: 4px solid var(--ad-accent); background: var(--ad-cream); padding: 1rem 1.25rem; margin: 1rem 0; }
.bk-notice--error { border-left-color: #a33; }

.bk-endorsements { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.bk-endorsement { background: var(--ad-paper); border: 1px solid var(--ad-line); padding: 1.75rem; border-radius: 2px; }
.bk-endorsement__quote { font-family: var(--wp--preset--font-family--heading); font-size: 1.15rem; line-height: 1.5; margin: 0 0 1.25rem; }
.bk-endorsement__who { display: flex; align-items: center; gap: 0.9rem; }
.bk-endorsement__who img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.bk-endorsement__name { font-weight: 700; font-size: 0.95rem; }
.bk-endorsement__role { color: var(--ad-ink); font-weight: 700; font-size: 0.85rem; line-height: 1.4; }

.bk-countdown { font-family: var(--wp--preset--font-family--heading); font-size: 1.1rem; }
.bk-countdown strong { color: var(--ad-accent); }

.bk-badge { display: inline-block; font-size: 0.85rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ad-accent); font-weight: 700; }

.bk-chapters { counter-reset: ch; list-style: none; padding: 0; margin: 0; }
.bk-chapters li { counter-increment: ch; border-top: 1px solid var(--ad-line); padding: 1rem 0; display: flex; gap: 1.25rem; align-items: baseline; }
.bk-chapters li:last-child { border-bottom: 1px solid var(--ad-line); }
.bk-chapters li::before { content: counter(ch, decimal-leading-zero); font-family: var(--wp--preset--font-family--heading); color: var(--ad-accent); font-weight: 700; min-width: 2.2rem; }

.bk-pullquote { font-family: var(--wp--preset--font-family--heading); font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.3; font-weight: 500; }
.bk-pullquote::before { content: ""; display: block; width: 3rem; height: 3px; background: var(--ad-accent); margin-bottom: 1.25rem; }

.bk-questions p { font-family: var(--wp--preset--font-family--heading); font-style: italic; font-size: 1.25rem; margin: 0.35rem 0; }

.bk-cover { display: block; max-width: min(100%, 420px); height: auto; margin: 0 auto; box-shadow: 0 30px 60px -20px rgba(0,0,0,0.35); }
.bk-cover--3d { box-shadow: none; max-width: min(100%, 520px); }
@media (min-width: 1100px) { .bk-cover--3d { max-width: 560px; } }
/* 2.3.3: the hero cover never grows past its column, so the first screen keeps the title and the buy button together */
.bk-hero .bk-cover--3d { max-width: min(100%, 420px); }
.bk-hero .wp-block-column { min-width: 0; }
.bk-hero .wp-block-column img { max-width: 100%; height: auto; }

/* ---------- Launch and consent ---------- */
.bk-cta--small { font-size: 0.8rem; padding: 0.7em 1.3em; }
.bk-offer { display: block; margin-top: 0.6rem; font-size: 0.9rem; color: var(--ad-accent); font-weight: 600; }
.bk-strip { font-size: 0.85rem; color: var(--ad-stone); text-align: center; margin: 0 auto 2rem; }
.bk-strip span { font-size: 0.85rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ad-mist); margin-right: 0.5rem; }
.bk-tiers { background: var(--ad-cream); padding: 1rem 1.25rem; }
.bk-consent { position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 60; max-width: 560px; margin: 0 auto; background: #fff; border: 1px solid var(--ad-line); box-shadow: 0 20px 50px -20px rgba(0,0,0,0.35); padding: 1.1rem 1.25rem; font-size: 0.9rem; }
.bk-consent p { margin: 0 0 0.8rem; }
.bk-consent div { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.bk-consent .bk-cta { padding: 0.7em 1.3em; font-size: 0.75rem; cursor: pointer; border: 0; }
.bk-consent .bk-cta--ghost { border: 2px solid var(--ad-ink); }
@media (max-width: 781px) { .bk-consent { bottom: 4.6rem; } }

/* ---------- Photos ---------- */
.bk-photo { display: block; width: 100%; height: auto; border-radius: 2px; }
.bk-photo--hero { aspect-ratio: 16 / 9; object-fit: cover; object-position: center 30%; margin-bottom: 2rem; }
.bk-gallery { display: grid; gap: 0.75rem; grid-template-columns: repeat(3, 1fr); margin: 1rem 0 2rem; }
.bk-gallery__item { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 2px; background: var(--ad-cream); }
.bk-gallery__item img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; transition: transform 0.3s ease; }
.bk-gallery__item:hover img { transform: scale(1.03); }
@media (max-width: 600px) { .bk-gallery { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Downloads ---------- */
.bk-downloads { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 1rem 0 2rem; }
.bk-download { border: 1px solid var(--ad-line); padding: 1.5rem; border-radius: 2px; background: var(--ad-paper); display: flex; flex-direction: column; }
.bk-download h3 { margin: 0 0 0.5rem; font-size: 1.15rem; }
.bk-download p { flex: 1; font-size: 0.95rem; color: var(--ad-stone); }
.bk-download .bk-cta { align-self: flex-start; }

/* ---------- Header ---------- */
.bk-header { border-bottom: 1px solid var(--ad-line); }
.bk-header .wp-block-site-title a { text-decoration: none; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 700; font-size: 0.95rem; }
.wp-block-navigation a { font-size: 0.85rem; letter-spacing: 0.02em; }

/* ---------- Footer ---------- */
.bk-footer { border-top: 1px solid var(--ad-line); font-size: 0.85rem; color: var(--ad-mist); }
.bk-footer a { color: inherit; }

@media (max-width: 781px) {
	.bk-step { gap: 0.9rem; }
	.wp-block-columns.bk-hero { gap: 1.5rem; }
}

/* Blog */
.bk-eyebrow { font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ad-accent); font-weight: 600; margin-bottom: 0.5rem; }
.bk-post-date { color: var(--ad-mist); letter-spacing: 0.04em; }
.bk-post-list { margin-top: 2.5rem; }
.bk-post-card { padding: 2rem 0; border-top: 1px solid var(--ad-line); }
.bk-post-card:last-of-type { border-bottom: 1px solid var(--ad-line); }
.bk-post-card h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0.25rem 0 0.5rem; }
.bk-post-card h2 a { text-decoration: none; }
.bk-post-card h2 a:hover { color: var(--ad-accent); }
.bk-post-card .wp-block-post-excerpt__more-link { font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--ad-line); }
.bk-post-card .wp-block-post-excerpt__more-link:hover { border-color: var(--ad-accent); }
.wp-block-query-pagination { margin-top: 2rem; }
.wp-block-query-pagination a { text-decoration: none; font-weight: 600; border-bottom: 2px solid var(--ad-line); }
.bk-post-head { text-align: center; margin-bottom: 2rem; }
.bk-post-head h1 { font-size: clamp(2rem, 5vw, 3.25rem); margin-bottom: 0.5rem; }
.bk-post-image img { width: 100%; height: auto; margin: 0 0 2rem; }
.bk-post .entry-content > p, .bk-post .wp-block-post-content > p { font-size: 1.1rem; line-height: 1.7; }
.bk-post .wp-block-quote { border-left: 3px solid var(--ad-accent); padding: 0.5rem 0 0.5rem 1.5rem; margin: 2rem 0; font-family: var(--wp--preset--font-family--heading); font-style: italic; }
.bk-post .wp-block-quote cite { display: block; margin-top: 0.5rem; font-style: normal; font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ad-mist); }
.bk-post .wp-block-pullquote { border: 0; border-top: 1px solid var(--ad-line); border-bottom: 1px solid var(--ad-line); padding: 2rem 0; margin: 2.5rem 0; }
.bk-post .wp-block-pullquote p { font-family: var(--wp--preset--font-family--heading); font-size: clamp(1.4rem, 3vw, 1.9rem); line-height: 1.3; font-style: normal; }
.bk-post-after { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--ad-line); }
.bk-post-book { background: var(--ad-cream); padding: 2rem; margin: 1.5rem 0 2rem; gap: 2rem; }
.bk-post-book > .wp-block-group { flex: 1 1 280px; }
.bk-cover--post { max-width: 160px; flex: 0 0 160px; margin: 0; }
.bk-post-book h3 { margin-top: 0; }
.post-navigation-link-previous, .post-navigation-link-next { margin-top: 1rem; }
.post-navigation-link-previous a, .post-navigation-link-next a { text-decoration: none; font-weight: 600; }

/* 2.11: review ask box */
.bk-review-ask { margin: 1.5rem 0; padding: 1.25rem 1.5rem; border: 1px solid var(--ad-line); border-left: 4px solid var(--ad-ink, #111); background: #fafafa; }
.bk-review-ask p { margin: 0 0 0.75rem; }
.bk-review-ask p:last-child { margin: 0; }

/* Phones: headline and chapter button on the first screen, cover below as proof */
@media (max-width: 781px) {
	.bk-hero .bk-questions { display: none; }
	.bk-hero h1 { font-size: clamp(1.75rem, 7.6vw, 2.2rem); line-height: 1.15; margin-top: 0.75rem !important; }
	.bk-hero .has-large-font-size { font-size: 1rem !important; line-height: 1.5; }
	.bk-hero .bk-cta { display: flex; justify-content: center; box-sizing: border-box; width: 100%; min-height: 48px; align-items: center; margin-bottom: 0.6rem; }
	.bk-hero .bk-cta--small { width: auto; display: inline-flex; min-height: 44px; }
	.bk-hero .wp-block-column img { max-width: 200px; margin-top: 0.5rem; }
	.bk-hero > .wp-block-column:last-child { text-align: center; }
}
/* Tap targets of at least 44px on every link that is not body copy */
.bk-badge a, .bk-badge { display: inline-flex; align-items: center; min-height: 44px; }
.bk-cta--small { min-height: 44px; display: inline-flex; align-items: center; }
.wp-block-site-title a { display: inline-flex; align-items: center; min-height: 44px; }
.wp-block-navigation .wp-block-navigation-item__content { display: inline-flex; align-items: center; min-height: 44px; }
.bk-hero-note { font-size: 0.85rem; color: var(--ad-mist); margin-top: -0.25rem; }
