/* WordPress additions. Maps block-editor output and new states (errors, payment status,
   pagination, consent) onto the approved design. Loaded last. */

/* Admin toolbar: keep the fixed portrait panel below it for signed-in editors. */
.admin-bar .david-edge {
	top: 32px;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

/* Block styles registered by the Foundation plugin. */
.is-style-lead {
	font-size: 1.35rem;
	line-height: 1.6;
}

.is-style-small {
	font-size: .85rem;
}

.is-style-notice {
	padding: 20px 24px;
	background: #edf1ff;
	border-left: 3px solid var(--blue);
	margin: 24px 0;
}

.wp-block-image.is-style-dsf-photo {
	margin: 0 0 28px;
}

.wp-block-image.is-style-dsf-photo img {
	display: block;
	width: 100%;
	height: 320px;
	object-fit: cover;
}

.wp-block-image.is-style-dsf-photo img[src*="david_shelton"] {
	height: 420px;
	object-position: center 20%;
}

.wp-block-image.is-style-dsf-photo figcaption,
.blog-article .wp-element-caption {
	font-size: .8rem;
	margin: 9px 0 0;
	line-height: 1.5;
	opacity: .8;
	text-align: left;
	color: inherit;
}

.blog-article .wp-element-caption {
	font-size: .85rem;
	color: #46536d;
	line-height: 1.6;
	margin-top: 12px;
	opacity: 1;
}

.blog-article .wp-block-image.is-style-dsf-photo figcaption {
	font-size: .8rem;
	color: inherit;
	opacity: .8;
	margin-top: 9px;
}

/* Paragraph used as a row of links, as in the approved ".actions" rows. */
p.actions:last-child {
	margin-bottom: 0;
}

/* Core buttons block with the Foundation button styles. */
.wp-block-buttons {
	display: flex;
	gap: 28px;
	align-items: center;
	flex-wrap: wrap;
	margin: 30px 0 0;
}

.wp-block-button .wp-block-button__link {
	display: inline-flex;
	justify-content: space-between;
	gap: 28px;
	align-items: center;
	padding: 15px 23px;
	line-height: 1.4;
	font-size: .95rem;
	font-weight: 600;
	border: 1px solid transparent;
	border-radius: 0;
	background: var(--blue);
	color: white;
	text-decoration: none;
	transition: background .2s, transform .2s;
}

.wp-block-button .wp-block-button__link:hover {
	transform: translateY(-3px);
}

.wp-block-button.is-style-dsf-gold .wp-block-button__link {
	background: var(--gold);
	color: var(--ink);
}

.wp-block-button.is-style-dsf-outline .wp-block-button__link {
	background: transparent;
	color: inherit;
	border-color: currentColor;
}

.wp-block-button.is-style-dsf-underlink .wp-block-button__link {
	background: transparent;
	color: inherit;
	padding: 8px 0;
	border: 0;
	border-bottom: 1px solid;
	transform: none;
}

.text-section .wp-block-list {
	padding-left: 20px;
}

/* Foundation card grid inside a text section. */
.text-section .cards .card > :last-child {
	margin-bottom: 0;
}

.figure-value {
	font: 3.2rem/1 var(--serif);
	color: var(--blue);
	margin-bottom: .6rem;
}

/* Blog article details. */
.article-meta {
	color: #46536d;
	margin-bottom: 2rem;
}

.article-meta a {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.blog-article .wp-block-video video {
	display: block;
	width: 100%;
}

.blog-article .wp-block-gallery {
	margin: 35px 0;
}

.blog-article .dsf-embed {
	margin: 35px 0;
}

.blog-article blockquote,
.blog-article .wp-block-quote {
	font: italic 1.45rem/1.5 var(--serif);
	margin: 30px 0;
	padding-left: 22px;
	border-left: 3px solid var(--gold);
}

.blog-article a:not(.button):not(.underlink):not(.wp-block-button__link) {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.editorial-cover__empty {
	display: block;
	aspect-ratio: 16 / 10;
	background: radial-gradient(ellipse at 90% 0%, #3155e5, transparent 65%), var(--navy);
}

.empty-state {
	font-size: 1.2rem;
	padding: 20px 0;
}

.result-list {
	padding-left: 20px;
}

/* Pagination. The approved stylesheet styles every <nav> as the main menu, so reset it here. */
nav.pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	position: static;
	padding: 0;
	margin-top: 45px;
	background: none;
	box-shadow: none;
	font-size: 1rem;
}

nav.pagination .page-numbers {
	display: inline-block;
	min-width: 44px;
	padding: 10px 14px;
	text-align: center;
	border: 1px solid #a7b2d0;
}

nav.pagination .page-numbers.current {
	background: var(--blue);
	border-color: var(--blue);
	color: white;
}

/* Forms: honeypot, errors and confirmations. */
.hp {
	position: absolute !important;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.field-error {
	color: #b3261e;
	font-weight: 600;
	margin: 0 0 6px;
	font-size: .9rem;
}

[aria-invalid="true"],
fieldset[aria-invalid="true"] .choice {
	border-color: #b3261e;
	border-width: 2px;
}

fieldset[aria-invalid="true"] {
	border: 0;
}

.error-summary {
	border: 3px solid #b3261e;
	padding: 18px 22px;
	margin: 0 0 20px;
	background: white;
}

.error-summary h3 {
	margin-bottom: .6rem;
}

.error-summary ul {
	margin: 0;
	padding-left: 20px;
}

.error-summary a {
	text-decoration: underline;
	color: #b3261e;
	font-weight: 600;
}

.result--success {
	background: #e3f4e6;
	border-left: 3px solid #1d7a35;
	margin: 0 0 20px;
}

/* Mobile Money network choices are real radio buttons styled as the approved choice buttons. */
label.choice {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	font-weight: 400;
	cursor: pointer;
	position: relative;
}

label.choice input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
}

label.choice:has(input:checked) {
	background: var(--blue);
	color: white;
	border-color: var(--blue);
}

label.choice:has(input:focus-visible) {
	outline: 3px solid #de591c;
	outline-offset: 5px;
}

.donation-submit {
	width: 100%;
	margin-top: 20px;
}

.donation-submit[disabled] {
	opacity: .7;
	cursor: progress;
}

.donation-footnote {
	margin-top: 15px;
}

.notice--sandbox {
	background: #fff3cc;
	border-left-color: #de591c;
}

.result--status {
	margin: 0 0 20px;
	background: white;
	border-left: 3px solid var(--blue);
}

.result--status p {
	margin: 6px 0 0;
}

/* Analytics consent banner (only present when analytics is configured). */
.consent {
	position: fixed;
	z-index: 50;
	left: calc(var(--david-edge-width) + 16px);
	right: 16px;
	bottom: 16px;
	max-width: 720px;
	padding: 20px 24px;
	background: var(--paper);
	color: var(--ink);
	box-shadow: 0 10px 40px #111f4440;
	border-top: 4px solid var(--gold);
}

.consent[hidden] {
	display: none;
}

.consent p {
	margin-bottom: 12px;
}

.consent__actions {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.consent .button {
	padding: 11px 18px;
}

@media (max-width: 760px) {
	.is-style-lead {
		font-size: 1.2rem;
	}

	.wp-block-image.is-style-dsf-photo img {
		height: 240px;
	}

	.wp-block-image.is-style-dsf-photo img[src*="david_shelton"] {
		height: 360px;
	}
}

@media (max-width: 782px) {
	.admin-bar .david-edge {
		top: 46px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-button .wp-block-button__link:hover {
		transform: none;
	}
}

/* A paragraph holding only an underlined link (class added by the importer) behaves like the
   approved bare link: no gap below. */
p.link-row {
	margin-bottom: 0;
}

/* Policy contents list: the core list block's indent would otherwise override the approved zero padding. */
.text-section .wp-block-list.policy-contents {
	padding-left: 0;
}

/* Client portraits in text sections (same crop as .content-photo in the static reference). */
.wp-block-image.is-style-dsf-photo img[src*="-portrait"] {
	height: 460px;
	object-position: center 22%;
}

/* People grid: classic themes wrap group content in an inner container, so the grid moves onto it;
   the group's flow spacing and the core caption defaults are neutralised. */
.people-grid.wp-block-group {
	display: block;
}
.people-grid > .wp-block-group__inner-container {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}
.people-grid > .wp-block-group__inner-container > * {
	margin-block: 0;
}
.people-grid .wp-block-image {
	margin: 0;
}
.people-grid .wp-element-caption {
	margin: 12px 0 0;
	text-align: left;
	font-size: inherit;
	color: inherit;
}

@media (max-width: 760px) {
	.wp-block-image.is-style-dsf-photo img[src*="-portrait"] {
		height: 400px;
	}
	.people-grid > .wp-block-group__inner-container {
		grid-template-columns: 1fr 1fr;
		gap: 20px;
	}
}
