/* Page structure: containers, header, navigation, drawer, footer. */

.container {
	max-width: var(--max);
	margin-inline: auto;
	padding-inline: var(--g);
}

.site-main:focus { outline: none; }

/* Vertical rhythm between sections */
.section { padding-block: var(--sp); }
.section--flush-top { padding-top: 0; }
.section--flush-bottom { padding-bottom: 0; }

/* Starter templates (page, single, archive) until each is restyled */
.page-header {
	padding-block: clamp(40px, 6vw, 96px) var(--space-5);
}

.page-header__meta {
	color: var(--slate);
	font-size: var(--text-sm);
}

/* ============================================================
   Inner page introduction (template-parts/page-intro.php)
   ============================================================ */
.page-intro {
	padding-block: clamp(40px, 6vw, 96px) clamp(44px, 5vw, 80px);
}

.page-intro h1 {
	max-width: 17ch;
	font-size: clamp(2.6rem, 5.4vw, 5.2rem);
}

.page-intro .intro { margin: clamp(20px, 2.4vw, 30px) 0 0; max-width: 56ch; }

.page-intro--leaves .container {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 0.38fr);
	gap: clamp(30px, 5vw, 90px);
	align-items: center;
}

/* Two of the homepage's leaf frames, smaller */
.page-intro__leaves {
	position: relative;
	justify-self: end;
	width: 100%;
	max-width: 300px;
	aspect-ratio: 1;
}

.page-intro__leaves .leaf--a { top: 0; left: 0; width: 68%; }
.page-intro__leaves .leaf--b { top: auto; right: 0; bottom: 0; width: 50%; }

@media (max-width: 820px) {
	.page-intro--leaves .container { grid-template-columns: 1fr; }
	.page-intro__leaves { display: none; }
}

/* ============================================================
   Main text of pages and posts
   ============================================================ */
.prose {
	max-width: var(--container-narrow);
	padding-bottom: var(--sp);
}

.prose h2 {
	margin: 1.7em 0 0.5em;
	font-size: clamp(1.7rem, 2.6vw, 2.3rem);
}

.prose h3 {
	margin: 1.6em 0 0.4em;
	font-size: 1.35rem;
}

.prose > :first-child { margin-top: 0; }

.prose a {
	color: var(--forest);
	font-weight: 500;
	text-decoration-color: var(--moss);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}

.prose a:hover { color: var(--leaf); }

.prose strong { color: var(--forest); font-weight: 600; }

.prose ul,
.prose ol { padding-left: 1.25em; }

.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--leaf); }

.prose blockquote {
	margin: 1.6em 0;
	padding-left: 22px;
	border-left: 3px solid var(--coral);
	color: var(--forest);
	font-family: var(--serif);
	font-size: 1.35rem;
	line-height: 1.4;
}

.prose blockquote p:last-child { margin-bottom: 0; }

.prose img { border-radius: 14px; }

.prose figcaption,
.prose .wp-caption-text {
	margin-top: 8px;
	color: var(--slate);
	font-size: var(--text-sm);
}

/* ============================================================
   Notice bar (Site settings → Notice bar)
   ============================================================ */
.notice-bar {
	background: var(--forest);
	color: #fff;
	font-size: var(--text-sm);
}

.notice-bar a { color: var(--sprout); font-weight: 600; }

.notice-bar__inner p {
	margin: 0;
	padding-block: var(--space-2);
	text-align: center;
}

/* ============================================================
   Header: a white strip for the logo, which is a JPEG on white
   and is only ever scaled.
   ============================================================ */
.site-header {
	position: sticky;
	top: 0;
	z-index: 90;
	background: #fff;
	border-bottom: 1px solid var(--rule);
	transition: box-shadow 0.3s;
}

.admin-bar .site-header { top: var(--wp-admin--admin-bar--height, 32px); }

@media (max-width: 600px) {
	.admin-bar .site-header { top: 0; }
}

.site-header.is-scrolled { box-shadow: 0 6px 24px -14px rgb(29 42 34 / 0.35); }

.site-header__bar {
	display: flex;
	align-items: center;
	gap: 26px;
	min-height: var(--header-height);
	padding-inline: clamp(16px, 2.6vw, 44px);
}

.site-header__brand {
	flex: none;
	color: var(--forest);
	font-family: var(--serif);
	font-size: 1.4rem;
	text-decoration: none;
}

.site-header__brand img {
	width: auto;
	height: clamp(40px, 3.8vw, 52px);
}

/* Main menu */
.site-nav {
	display: flex;
	align-items: center;
	gap: 4px;
	margin-left: auto;
}

.site-nav__menu {
	display: flex;
	align-items: center;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-nav__menu a {
	display: block;
	padding: 9px 14px;
	border-radius: 999px;
	color: var(--forest);
	font-size: 15px;
	font-weight: 500;
	text-decoration: none;
	transition: background 0.2s;
}

.site-nav__menu a:hover,
.site-nav__menu [aria-current="page"] { background: var(--paper); }

.site-nav__menu .sub-menu { display: none; }

/*
 * The menu's Donate is leaf green: always visible, calmer than the red used
 * for the donate section itself. White on leaf is 4.75:1 (WCAG AA).
 */
.site-nav .btn-give,
.site-drawer .btn-give { background: var(--leaf); color: #fff; }

.site-nav .btn-give:hover,
.site-drawer .btn-give:hover { background: var(--forest); }

.site-nav .btn-give {
	margin-left: 8px;
	padding: 11px 20px;
	font-size: 15px;
}

/* Text size control */
.text-size {
	display: flex;
	align-items: center;
	gap: 2px;
	padding: 4px;
	background: var(--paper);
	border-radius: 999px;
}

.text-size button {
	width: 30px;
	height: 30px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: var(--slate);
	font-family: var(--serif);
	line-height: 1;
	cursor: pointer;
}

.text-size button:nth-child(1) { font-size: 13px; }
.text-size button:nth-child(2) { font-size: 16px; }
.text-size button:nth-child(3) { font-size: 19px; }

.text-size button[aria-pressed="true"] {
	background: #fff;
	color: var(--forest);
	box-shadow: 0 1px 3px rgb(0 0 0 / 0.12);
}

/* Text size needs JavaScript, so it is only shown when that has run. */
html:not(.js) .text-size { display: none; }

.menu-toggle {
	display: none;
	margin-left: auto;
	padding: 10px 18px;
	border: 1.5px solid var(--rule-mid);
	border-radius: 999px;
	background: #fff;
	color: var(--forest);
	font: 600 14px var(--sans);
	cursor: pointer;
}

/* ============================================================
   Drawer: the menu on smaller screens
   ============================================================ */
.site-drawer {
	display: none;
	max-height: calc(100svh - var(--header-height));
	overflow: auto;
	padding: 10px clamp(16px, 2.6vw, 44px) 24px;
	border-top: 1px solid var(--rule);
	background: #fff;
}

.site-drawer__menu {
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-drawer__menu a {
	display: block;
	padding: 12px 0;
	border-bottom: 1px solid var(--rule);
	color: var(--forest);
	font-family: var(--serif);
	font-size: 1.5rem;
	text-decoration: none;
}

.site-drawer__row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	margin-top: 20px;
}

.site-drawer__row .btn {
	flex: 1;
	justify-content: center;
}

@media (max-width: 1180px) {
	.site-nav,
	.site-header__bar .text-size { display: none; }

	.js .menu-toggle { display: inline-flex; }

	/* Without JavaScript the drawer simply stays open. */
	.site-drawer { display: block; }
	.js .site-drawer:not(.is-open) { display: none; }
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
	margin-top: var(--sp);
	background: var(--ink);
	color: #a9b7ad;
	font-size: 0.94rem;
}

.site-footer .container { padding-block: clamp(60px, 7vw, 100px) 36px; }

.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--sprout); }

.site-footer__top {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) repeat(var(--cols, 3), minmax(0, 0.6fr));
	gap: clamp(28px, 4vw, 60px);
}

.site-footer__say {
	max-width: 22ch;
	margin: 0;
	color: #fff;
	font-family: var(--serif);
	font-size: clamp(1.4rem, 2.2vw, 2rem);
	line-height: 1.25;
}

.site-footer__say em { color: var(--sprout); }

.site-footer__heading {
	margin: 0 0 14px;
	color: #fff;
	font-family: var(--sans);
	font-size: var(--t5);
	font-weight: 600;
	font-variation-settings: normal;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.site-footer__links {
	display: grid;
	gap: 9px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: clamp(40px, 5vw, 64px) 0 0;
	padding: 0;
	list-style: none;
}

.site-footer__badges li {
	padding: 8px 14px;
	border: 1px solid rgb(255 255 255 / 0.18);
	border-radius: 999px;
	font-size: 0.8rem;
}

.site-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 16px;
	margin-top: 36px;
	padding-top: 22px;
	border-top: 1px solid rgb(255 255 255 / 0.12);
	font-size: 0.8rem;
}

.site-footer__bottom p { margin: 0; }

.site-footer__legal {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (max-width: 980px) {
	.site-footer__top { grid-template-columns: 1fr 1fr; }
	.site-footer__top > :first-child { grid-column: 1 / -1; }
}

/* ============================================================
   Donate bar: rises on phones once past the top of the page
   ============================================================ */
.donate-bar {
	position: fixed;
	left: 12px;
	right: 12px;
	bottom: calc(12px + env(safe-area-inset-bottom));
	z-index: 95;
	display: none;
	visibility: hidden; /* out of the tab order while lowered */
	transform: translateY(160%);
	transition: transform 0.4s var(--ease), visibility 0s 0.4s;
}

.donate-bar.is-up {
	visibility: visible;
	transform: none;
	transition: transform 0.4s var(--ease);
}

.donate-bar .btn {
	width: 100%;
	justify-content: center;
	box-shadow: 0 14px 30px -12px rgb(162 50 19 / 0.6);
}

@media (max-width: 1180px) {
	.js .donate-bar { display: block; }
}
