/*
 * HHCI Within Reach blocks
 * px units on purpose: the theme resets the root font-size, so rem renders too small.
 */

.wr-section {
	--wr-teal: #24989e;
	--wr-teal-deep: #1b7a7f;
	--wr-navy: #12436b;
	--wr-light: #eaf5f5;
	--wr-white: #ffffff;
	--wr-ink: #1d2b36;
	--wr-muted: #52646f;
	--wr-ph: #c9d6df;
	--wr-ph-ink: #52646f;

	/* per-background tokens (light defaults) */
	--wr-bg: var(--wr-white);
	--wr-fg: var(--wr-ink);
	--wr-heading: var(--wr-navy);
	--wr-accent: var(--wr-teal-deep);
	--wr-sub: var(--wr-muted);
	--wr-rule-color: rgba(18, 67, 107, 0.18);
	--wr-btn-bg: var(--wr-teal-deep);
	--wr-btn-fg: #ffffff;
	--wr-btn-bg-hover: var(--wr-navy);
	--wr-btn-fg-hover: #ffffff;

	position: relative;
	box-sizing: border-box;
	width: 100vw;
	max-width: 100vw;
	margin: 0 calc(50% - 50vw);
	padding: 80px 24px;
	background: var(--wr-bg);
	color: var(--wr-fg);
	font-size: 18px;
	line-height: 1.6;
}

.wr-section *,
.wr-section *::before,
.wr-section *::after {
	box-sizing: border-box;
}

.wr-bg--white { --wr-bg: var(--wr-white); }
.wr-bg--light { --wr-bg: var(--wr-light); }
.wr-bg--teal { --wr-bg: var(--wr-teal); }
.wr-bg--teal-deep { --wr-bg: var(--wr-teal-deep); }
.wr-bg--navy { --wr-bg: var(--wr-navy); }

.wr-section.wr-is-dark {
	--wr-fg: #ffffff;
	--wr-heading: #ffffff;
	--wr-accent: #ffffff;
	--wr-sub: rgba(255, 255, 255, 0.85);
	--wr-rule-color: rgba(255, 255, 255, 0.4);
	--wr-btn-bg: #ffffff;
	--wr-btn-fg: var(--wr-navy);
	--wr-btn-bg-hover: var(--wr-navy);
	--wr-btn-fg-hover: #ffffff;
	--wr-ph: rgba(255, 255, 255, 0.22);
	--wr-ph-ink: #ffffff;
}

body.has-within-reach {
	overflow-x: clip;
}

html:has(body.has-within-reach) {
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html:has(body.has-within-reach) {
		scroll-behavior: auto;
	}
}

.wr-section[id] {
	scroll-margin-top: 120px;
}

/* Consecutive bands with the same background read as one section */
.wr-bg--white + .wr-bg--white,
.wr-bg--light + .wr-bg--light {
	padding-top: 0;
}

/* ---------- Layout ---------- */

.wr-inner {
	max-width: 1140px;
	margin: 0 auto;
}

.wr-inner--wide { max-width: 1240px; }
.wr-inner--narrow { max-width: 960px; }

.wr-center { text-align: center; }

/* ---------- Type ---------- */

.wr-section .wr-h2,
.wr-section .wr-h3 {
	margin: 0 0 16px;
	padding: 0;
	color: var(--wr-heading);
	font-family: inherit;
	font-weight: 700;
	letter-spacing: normal;
	text-transform: none;
}

.wr-section .wr-h2 {
	font-size: 44px;
	line-height: 1.15;
}

.wr-section .wr-h3 {
	font-size: 34px;
	line-height: 1.2;
}

.wr-section p,
.wr-section .wr-prose,
.wr-section .wr-prose li {
	color: var(--wr-fg);
	font-size: 18px;
	line-height: 1.6;
}

.wr-section p {
	margin: 0 0 16px;
}

.wr-section .wr-prose > :last-child,
.wr-section p:last-child {
	margin-bottom: 0;
}

.wr-section .wr-prose a {
	color: var(--wr-accent);
	text-decoration: underline;
}

.wr-section .wr-intro {
	margin-bottom: 32px;
	color: var(--wr-sub);
}

.wr-section .wr-rule {
	height: 0;
	margin: 24px 0 48px;
	border: 0;
	border-top: 1px solid var(--wr-rule-color);
	background: none;
	opacity: 1;
}

.wr-section .wr-rule--end {
	margin: 56px 0 0;
}

/* ---------- Story ---------- */

.wr-story {
	display: grid;
	grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
	gap: 56px;
	align-items: start;
}

.wr-story--photo-left {
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
}

.wr-story--photo-left .wr-story__media {
	order: -1;
}

.wr-story__photo,
.wr-section img.wr-story__photo {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 16px;
}

.wr-quote {
	margin: 20px 0 0;
	padding: 0;
}

.wr-section .wr-quote blockquote {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
}

.wr-section .wr-quote blockquote p {
	color: var(--wr-heading);
	font-size: 20px;
	font-style: italic;
	line-height: 1.5;
}

.wr-section .wr-quote figcaption {
	margin-top: 8px;
	color: var(--wr-sub);
	font-size: 15px;
}

.wr-section .wr-bridge {
	max-width: 820px;
	margin: 64px auto 0;
	color: var(--wr-heading);
	font-size: 22px;
	line-height: 1.45;
	text-align: center;
}

.wr-section .wr-lead {
	max-width: 720px;
	margin: 20px auto 0;
	text-align: center;
}

.wr-video-wrap {
	max-width: 960px;
	margin: 32px auto 0;
}

.wr-cta-section .wr-video-wrap {
	margin-top: 0;
}

/* ---------- Video ---------- */

.wr-video {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 16px;
	background: #0d2233;
}

.wr-video iframe,
.wr-video video,
.wr-video__play,
.wr-video__poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.wr-video video {
	object-fit: cover;
	background: #000;
}

.wr-section .wr-video__play {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	background: transparent;
	cursor: pointer;
}

.wr-video__poster {
	object-fit: cover;
}

.wr-video__icon {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 84px;
	height: 84px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease;
}

.wr-video__icon::after {
	content: "";
	margin-left: 6px;
	border-top: 16px solid transparent;
	border-bottom: 16px solid transparent;
	border-left: 26px solid var(--wr-navy);
}

.wr-video__play:hover .wr-video__icon,
.wr-video__play:focus-visible .wr-video__icon {
	transform: scale(1.08);
}

.wr-video__play:focus-visible {
	outline: 3px solid #f2b705;
	outline-offset: -3px;
}

.wr-video--ph {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	background: var(--wr-ph);
}

.wr-video__ph-label {
	color: var(--wr-ph-ink);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* ---------- Placeholders (editor + logged-in editors only) ---------- */

.wr-ph {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	border-radius: 16px;
	background: var(--wr-ph);
	color: var(--wr-ph-ink);
	font-size: 14px;
	font-weight: 600;
	text-align: center;
}

.wr-ph--img {
	width: 100%;
	aspect-ratio: 4 / 3;
}

.wr-ph--text {
	min-height: 160px;
}

.wr-ph--form {
	min-height: 320px;
	background: #ffffff;
	border: 2px dashed var(--wr-ph);
	color: var(--wr-muted);
}

.wr-section .wr-ph.wr-ph--img {
	display: flex;
}

/* ---------- Stats ---------- */

.wr-section .wr-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 40px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wr-section .wr-stat {
	margin: 0;
	padding: 0;
	text-align: center;
}

.wr-section .wr-stat::before {
	content: none;
}

.wr-stat__graphic,
.wr-section img.wr-stat__graphic {
	display: block;
	width: 160px;
	max-width: 100%;
	height: 120px;
	margin: 0 auto 20px;
	object-fit: contain;
	border-radius: 16px;
}

.wr-stat .wr-ph--img {
	aspect-ratio: auto;
}

.wr-section .wr-stat__number {
	margin: 0 0 6px;
	color: var(--wr-accent);
	font-size: 44px;
	font-weight: 700;
	line-height: 1.15;
}

.wr-section .wr-stat__desc {
	margin: 0;
	color: var(--wr-fg);
	font-size: 16px;
	line-height: 1.5;
}

/* ---------- Donation ---------- */

.wr-section .wr-donate__heading {
	max-width: 900px;
	margin-right: auto;
	margin-left: auto;
}

.wr-donate__intro {
	max-width: 760px;
	margin: 0 auto;
}

.wr-donate__form {
	margin: 40px auto 0;
	padding: 40px;
	border-radius: 16px;
	background: #ffffff;
	box-shadow: 0 10px 40px rgba(18, 67, 107, 0.08);
	color: var(--wr-ink);
	text-align: left;
}

.wr-donate__form--wide { max-width: 1240px; }
.wr-donate__form--standard { max-width: 960px; }

.wr-donate__form p,
.wr-donate__form label,
.wr-donate__form legend {
	color: var(--wr-ink);
}

/* Two-column short fields (Gravity Forms 2.5+ grid markup) */
@media (min-width: 768px) {
	.wr-donate--2col .gform_wrapper .gform_fields > .gfield:is(
		.gfield--type-text,
		.gfield--type-email,
		.gfield--type-phone,
		.gfield--type-select,
		.gfield--type-number,
		.gfield--type-website,
		.gfield--type-date
	):not(.gfield--width-quarter):not(.gfield--width-third) {
		grid-column: span 6;
	}
}

/* Gift amounts as buttons: product/option radios, or any field with CSS class "wr-pills" */
.wr-donate--pills :is(.gfield--type-product, .gfield--type-option, .gfield--type-total, .wr-pills) .gfield_radio {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.wr-donate--pills :is(.gfield--type-product, .gfield--type-option, .wr-pills) .gfield_radio .gchoice {
	position: relative;
	display: flex;
	margin: 0;
	padding: 0;
}

.wr-donate--pills :is(.gfield--type-product, .gfield--type-option, .wr-pills) .gfield_radio .gchoice input[type="radio"] {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
}

.wr-donate--pills :is(.gfield--type-product, .gfield--type-option, .wr-pills) .gfield_radio .gchoice label {
	display: inline-flex;
	align-items: center;
	min-height: 48px;
	max-width: none;
	margin: 0;
	padding: 10px 22px;
	border: 2px solid var(--wr-teal-deep);
	border-radius: 10px;
	background: #ffffff;
	color: var(--wr-navy);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.wr-donate--pills :is(.gfield--type-product, .gfield--type-option, .wr-pills) .gfield_radio .gchoice label:hover {
	background: var(--wr-light);
}

.wr-donate--pills :is(.gfield--type-product, .gfield--type-option, .wr-pills) .gfield_radio .gchoice input:checked + label {
	border-color: var(--wr-teal-deep);
	background: var(--wr-teal-deep);
	color: #ffffff;
}

.wr-donate--pills :is(.gfield--type-product, .gfield--type-option, .wr-pills) .gfield_radio .gchoice input:focus-visible + label {
	outline: 3px solid #f2b705;
	outline-offset: 2px;
}

/* "Other amount" text input that GF places inside the last choice */
.wr-donate--pills :is(.gfield--type-product, .gfield--type-option, .wr-pills) .gfield_radio .gchoice input[type="text"] {
	margin-left: 8px;
	max-width: 180px;
}

/* ---------- CTA / button ---------- */

.wr-section .wr-cta__heading {
	max-width: 820px;
	margin-right: auto;
	margin-left: auto;
}

.wr-section .wr-cta__actions {
	margin: 32px 0 0;
}

.wr-section a.wr-btn,
.wr-section a.wr-btn:visited {
	display: inline-block;
	padding: 16px 40px;
	border: 2px solid var(--wr-btn-bg);
	border-radius: 10px;
	background: var(--wr-btn-bg);
	color: var(--wr-btn-fg);
	font-size: 20px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.wr-section a.wr-btn:hover,
.wr-section a.wr-btn:focus-visible {
	border-color: var(--wr-btn-bg-hover);
	background: var(--wr-btn-bg-hover);
	color: var(--wr-btn-fg-hover);
}

.wr-section a.wr-btn:focus-visible {
	outline: 3px solid #f2b705;
	outline-offset: 3px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
	.wr-section { padding: 64px 24px; }
	.wr-section .wr-h2 { font-size: 38px; }
	.wr-section .wr-h3 { font-size: 30px; }
	.wr-story { gap: 40px; }
}

@media (max-width: 860px) {
	.wr-story,
	.wr-story--photo-left {
		grid-template-columns: minmax(0, 1fr);
	}

	.wr-story__media {
		max-width: 520px;
	}
}

@media (max-width: 640px) {
	.wr-section { padding: 48px 20px; }
	.wr-section .wr-h2 { font-size: 32px; }
	.wr-section .wr-h3 { font-size: 25px; }
	.wr-section p,
	.wr-section .wr-prose,
	.wr-section .wr-prose li { font-size: 17px; }
	.wr-section .wr-bridge { margin-top: 40px; font-size: 20px; }
	.wr-section .wr-rule { margin: 20px 0 32px; }
	.wr-section .wr-stat__number { font-size: 38px; }
	.wr-donate__form { padding: 24px 18px; }
	.wr-video__icon { width: 64px; height: 64px; }
	.wr-section a.wr-btn { display: block; padding: 16px 24px; }
}

/* ---------- Block editor ---------- */

.editor-styles-wrapper .wr-section,
.block-editor-block-preview__content .wr-section {
	width: auto;
	max-width: none;
	margin-right: 0;
	margin-left: 0;
}
