/*
Theme Name: Adventist Baobab
Theme URI: https://adventistbaobab.org
Author: Adventist Baobab working group
Description: Block theme for Adventist Baobab, an independent Pan-African forum for Adventist thought. A parallel front page (lead essay beside a news rail, four streams, Sabbath School, Point / Counterpoint), essay pages with a listen button and share links, and section archives with stream and month filters. Indigo and gold, set in Bricolage Grotesque and Gentium Book Plus, with a dark version that follows the reader's device setting.
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: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: adventist-baobab
Tags: blog, news, block-patterns, full-site-editing, wide-blocks, translation-ready
*/

/* Dark version: follows the reader's device setting. */
@media (prefers-color-scheme: dark) {
	:root:root {
		--wp--preset--color--bg: #0D102C;
		--wp--preset--color--surface: #161A44;
		--wp--preset--color--ink: #ECEEFF;
		--wp--preset--color--muted: #A7ACD2;
		--wp--preset--color--line: #2D3268;
		--wp--preset--color--brand: #AEB5FF;
		--wp--preset--color--deep: #1F2468;
		--wp--preset--color--gold: #F3B234;
		--wp--preset--color--theology: #AEB5FF;
		--wp--preset--color--history: #F3B234;
		--wp--preset--color--issues: #5FD0C5;
		--wp--preset--color--society: #F29A88;
		--wp--preset--color--sabbath: #DBA8EC;
		color-scheme: dark;
	}
}

:focus-visible { outline: 3px solid var(--wp--preset--color--gold-bright); outline-offset: 2px; }
h1, h2, h3, h4 { text-wrap: balance; }
.wp-site-blocks { overflow-x: clip; }

/* Section colours: cards and columns pick up --sc from their stream. */
:where(.wp-block-post, .bb-stream, .bb-card-area) { --sc: var(--wp--preset--color--brand); }
.category-african-theology, .bb-stream.is-theology { --sc: var(--wp--preset--color--theology); }
.category-church-history, .bb-stream.is-history { --sc: var(--wp--preset--color--history); }
.category-current-issues, .bb-stream.is-issues { --sc: var(--wp--preset--color--issues); }
.category-church-and-society, .bb-stream.is-society, .category-point-counterpoint { --sc: var(--wp--preset--color--society); }
.category-sabbath-school { --sc: var(--wp--preset--color--sabbath); }
.category-news, .category-from-the-archive { --sc: var(--wp--preset--color--gold); }

.bb-eyebrow {
	font-family: var(--wp--preset--font-family--display);
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	margin: 0;
}

/* Header */
.bb-mast { background: var(--wp--preset--color--surface); border-bottom: 1px solid var(--wp--preset--color--line); }
.bb-mast .bb-logo { display: block; width: 46px; height: 46px; color: var(--wp--preset--color--brand); flex: none; }
.bb-mast .bb-logo svg { width: 100%; height: 100%; display: block; }
.bb-brand { min-width: 0; }
.bb-brand .wp-block-site-tagline { margin-top: 4px; }
.bb-mast .wp-block-navigation .wp-block-navigation-item__content { padding: 6px 0 5px; border-bottom: 3px solid transparent; }
.bb-mast .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content,
.bb-mast .wp-block-navigation .wp-block-navigation-item__content[aria-current="page"] { border-bottom-color: var(--wp--preset--color--gold-bright); }
.bb-mast .wp-block-navigation__responsive-container.is-menu-open { background: var(--wp--preset--color--surface); color: var(--wp--preset--color--ink); }

/* Header search: a quiet icon button */
.bb-mast .wp-block-search__button { background: none; color: var(--wp--preset--color--ink); border: 1px solid var(--wp--preset--color--line); border-radius: 999px; padding: 8px; }
.bb-mast .wp-block-search__button svg { fill: currentColor; }
.bb-mast .wp-block-search__input { background: var(--wp--preset--color--surface); color: var(--wp--preset--color--ink); border: 1px solid var(--wp--preset--color--line); border-radius: 4px; }
/* Phones: menu button sits on the top row beside search */
.bb-mast { position: relative; }
@media (max-width: 599px) {
	.bb-mast .bb-toprow { padding-right: 52px; }
	.bb-mast .bb-navrow { position: absolute; top: 22px; right: 20px; padding: 0 !important; width: auto; }
	.bb-mast .wp-block-navigation__responsive-container-open { border: 1px solid var(--wp--preset--color--line); border-radius: 999px; padding: 8px; color: var(--wp--preset--color--ink); }
}
.bb-mast .wp-block-navigation__responsive-container.is-menu-open { padding: 24px; font-size: 1.15rem; }
/* "Read both sides" and similar links inside panels look like quiet buttons */
.bb-panel .wp-block-read-more {
	display: inline-block;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 600;
	font-size: 0.88rem;
	color: var(--wp--preset--color--ink);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 4px;
	padding: 7px 12px;
	text-decoration: none;
}

/* Lead essay panel */
.bb-lead {
	position: relative;
	overflow: hidden;
	background-color: var(--wp--preset--color--deep);
	color: var(--wp--preset--color--deep-fg);
	border-radius: 6px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cg fill='%23EEF0FF' fill-opacity='.11'%3E%3Cpath d='M18 45c1.4-8 .2-13-1.6-20h15.2c-1.8 7-3 12-1.6 20z'/%3E%3Ccircle cx='5' cy='14' r='2.2'/%3E%3Ccircle cx='9' cy='8' r='2.2'/%3E%3Ccircle cx='14' cy='5' r='2.2'/%3E%3Ccircle cx='21' cy='3' r='2.2'/%3E%3Ccircle cx='27' cy='3' r='2.2'/%3E%3Ccircle cx='34' cy='5' r='2.2'/%3E%3Ccircle cx='39' cy='7' r='2.2'/%3E%3Ccircle cx='43' cy='14' r='2.2'/%3E%3C/g%3E%3Cg fill='none' stroke='%23EEF0FF' stroke-opacity='.11' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M19 26 11 15M22 26 18 10M24 26V7M26 26l4-16M29 26l8-11'/%3E%3Cpath stroke-width='2' d='M11 15 5 14M11 15 9 8M18 10l-4-5M24 7l-3-4M24 7l3-4M30 10l4-5M37 15l6-1M37 15l2-7'/%3E%3C/g%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-size: min(46%, 300px) auto;
	background-position: right -30px bottom -26px;
}
.bb-lead :where(h1, h2, h3, p, a), .bb-lead .wp-block-post-title a { color: var(--wp--preset--color--deep-fg); }
.bb-lead .bb-eyebrow, .bb-lead .wp-block-post-terms a { color: var(--wp--preset--color--gold-bright); }
.bb-lead .wp-block-post-title { max-width: 14ch; letter-spacing: -0.035em; }
.bb-lead .wp-block-post-excerpt { color: var(--wp--preset--color--deep-fg); max-width: 34ch; }
.bb-lead .wp-block-post-excerpt__excerpt { font-size: var(--wp--preset--font-size--large); line-height: 1.45; }
.bb-lead :where(.wp-block-post-date, .wp-block-post-author-name) { color: var(--wp--preset--color--deep-muted); }
.bb-lead .wp-block-read-more {
	display: inline-block;
	background: var(--wp--preset--color--gold-bright);
	color: var(--wp--preset--color--on-gold);
	font-family: var(--wp--preset--font-family--display);
	font-weight: 800;
	font-size: 0.95rem;
	text-decoration: none;
	border-radius: 4px;
	padding: 10px 18px;
}

/* News rail and other headline lists */
.bb-list .wp-block-post { border-top: 1px solid var(--wp--preset--color--line); padding-block: 11px; }
.bb-list .wp-block-post-title { font-family: var(--wp--preset--font-family--display); font-weight: 600; font-size: 1rem; line-height: 1.25; letter-spacing: 0; margin: 3px 0 0; }
.bb-list .wp-block-post-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.bb-list .wp-block-post-date { font-size: 0.78rem; margin: 2px 0 0; }
.bb-list .wp-block-post-terms { color: var(--wp--preset--color--muted); }

/* Four streams */
.bb-stream { border-top: 5px solid var(--sc); padding-top: 12px; min-width: 0; }
.bb-stream > .wp-block-heading, .bb-stream > .wp-block-heading a { color: var(--sc); text-decoration: none; }
.bb-stream > p { color: var(--wp--preset--color--muted); font-size: 0.95rem; line-height: 1.4; }
.bb-stream .wp-block-post { border-top: 0; padding-block: 6px; }

/* Panels */
.bb-panel { background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--line); border-radius: 6px; }
.bb-ssband { border-top: 5px solid var(--wp--preset--color--sabbath); }
.bb-ssband .bb-eyebrow { color: var(--wp--preset--color--sabbath); }
.bb-ssband .wp-block-post:first-child { border-top: 0; padding-top: 0; }
.bb-pc .bb-eyebrow { color: var(--wp--preset--color--society); }
.bb-archive .bb-eyebrow { color: var(--wp--preset--color--gold); }
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--ink);
	border: 1px solid var(--wp--preset--color--line);
	font-weight: 600;
	padding: 7px 12px;
}

/* Conversation band */
.bb-talk { background: var(--wp--preset--color--deep); color: var(--wp--preset--color--deep-fg); border-radius: 6px; }
.bb-talk :where(h2, h3, p) { color: var(--wp--preset--color--deep-fg); }
.bb-talk strong { color: var(--wp--preset--color--gold-bright); font-family: var(--wp--preset--font-family--display); }
.bb-talk .bb-quiet { color: var(--wp--preset--color--deep-muted); font-family: var(--wp--preset--font-family--display); font-size: 0.8rem; }
.bb-talk .wp-block-button.is-style-outline > .wp-block-button__link { color: var(--wp--preset--color--deep-fg); border-color: var(--wp--preset--color--deep-muted); }

/* Essay cards (Essays page, sections, search) */
.bb-cards .wp-block-post {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-top: 5px solid var(--sc);
	border-radius: 4px;
	padding: 16px 18px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.bb-cards .wp-block-post > * { margin: 0; }
.bb-cards .wp-block-post-terms a { color: var(--sc); }
.bb-cards .wp-block-post-title { font-size: 1.2rem; }
.bb-cards .wp-block-post-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.bb-cards .wp-block-post-excerpt__more-text { display: none; }
.bb-meta { font-family: var(--wp--preset--font-family--display); font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); }
.bb-meta > * { margin: 0; }

/* Filters on the Essays page and section pages */
.bb-filters { font-family: var(--wp--preset--font-family--display); font-size: 0.9rem; }
.bb-filters select, .bb-filters .wp-block-search__input {
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--ink);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 4px;
	padding: 7px 9px;
	font: inherit;
	max-width: 100%;
}
.bb-filters .wp-block-archives-dropdown label, .bb-filters .wp-block-categories label { font-weight: 600; margin-right: 6px; }
.bb-filters .wp-block-archives-dropdown, .bb-filters .wp-block-categories-dropdown { display: flex; gap: 8px; align-items: center; margin: 0; }
.bb-filters .wp-block-search__button { background: var(--wp--preset--color--deep); color: var(--wp--preset--color--deep-fg); border: 0; border-radius: 4px; font-weight: 600; }

/* Essay page */
.bb-standfirst .wp-block-post-excerpt__excerpt { font-size: var(--wp--preset--font-size--large); line-height: 1.45; color: var(--wp--preset--color--muted); }
.bb-standfirst .wp-block-post-excerpt__more-text { display: none; }
.bb-tools { border-block: 1px solid var(--wp--preset--color--line); padding-block: 12px; }
.bb-tools button {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 600;
	font-size: 0.88rem;
	background: none;
	color: var(--wp--preset--color--ink);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 4px;
	padding: 7px 12px;
	cursor: pointer;
}
.bb-tools .bb-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bb-tools .bb-actions[hidden] { display: none; }
.bb-discuss { background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--line); border-radius: 6px; }
.wp-block-post-content > p + p { margin-top: 0.9em; }
.wp-block-post-content :where(h2) { margin-top: 1.8em; font-size: 1.3rem; }

/* Comments */
.wp-block-comments .wp-block-comment-template li { border-top: 1px solid var(--wp--preset--color--line); padding-top: 12px; }
.wp-block-comments :where(input[type=text], input[type=email], input[type=url], textarea) {
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--ink);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 4px;
	padding: 9px 10px;
	font: inherit;
	width: 100%;
}
.wp-block-comments .comment-reply-title { font-size: 1.15rem; }

/* Footer */
.bb-footer { background: var(--wp--preset--color--surface); border-top: 1px solid var(--wp--preset--color--line); font-family: var(--wp--preset--font-family--display); font-size: 0.85rem; color: var(--wp--preset--color--muted); }
.bb-footer p { margin: 0; }
.bb-footer .wp-block-site-title { font-size: 0.95rem; }

/* Page content helpers (About, Write for us, Conversations) */
.bb-kv > .wp-block-group { border-left: 4px solid var(--wp--preset--color--gold-bright); padding-left: 12px; }
.bb-kv p { margin: 0; }
.bb-parts > .wp-block-column { border-left: 4px solid var(--wp--preset--color--sabbath); padding-left: 12px; }
.bb-side-yes { border-left: 4px solid var(--wp--preset--color--issues); padding-left: 12px; }
.bb-side-no { border-left: 4px solid var(--wp--preset--color--society); padding-left: 12px; }

@media (max-width: 781px) {
	.bb-lead { background-size: 160px auto; }
}
@media (prefers-reduced-motion: reduce) {
	* { scroll-behavior: auto !important; }
}
