/*
Theme Name: MHF Foundation
Theme URI: https://medexhealthfoundation.com
Author: MedEx Health Foundation
Description: Custom block theme for MedEx Health Foundation. Elegant, accessible (WCAG 2.1 AA / AODA) and fully editable: every heading, paragraph, button and photo can be changed directly in the WordPress editor. Includes the MHF pages, forms with saved entries, a floating Donate button and the Image Manager (Appearance → Image Manager).
Version: 4.3.0
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mhf-foundation
*/

/* ==========================================================================
   Base
   ========================================================================== */
html { scroll-behavior: smooth; scroll-padding-top: 140px; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
:where(.wp-site-blocks) > * { margin-block-start: 0; }
img { height: auto; }
::selection { background: #B8DDE6; color: #2A2333; }
:focus-visible { outline: 2px solid #1F96AE; outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Small uppercase label above headings */
.mhf-eyebrow {
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.8125rem !important;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--teal-deep);
	margin-bottom: 0.25rem !important;
}
.has-plum-background-color .mhf-eyebrow,
.has-purple-background-color .mhf-eyebrow,
.has-background-gradient .mhf-eyebrow,
.has-brand-gradient-background .mhf-eyebrow,
.wp-block-cover .mhf-eyebrow { color: #DCEFF4; }

.mhf-lead { font-size: 1.0625rem; color: var(--wp--preset--color--muted); }
.has-brand-gradient-background .mhf-lead,
.wp-block-cover .mhf-lead { color: #F1ECF5; }
.mhf-note { font-size: 0.875rem !important; font-style: italic; color: var(--wp--preset--color--muted); }
.has-brand-gradient-background .mhf-note { color: #E7DDF0; }

/* ==========================================================================
   Header
   ========================================================================== */
.mhf-header-wrap { position: sticky; top: 0; z-index: 50; }
.admin-bar .mhf-header-wrap { top: 32px; }
@media (max-width: 782px) { .admin-bar .mhf-header-wrap { top: 46px; } }
@media (max-width: 600px) { .admin-bar .mhf-header-wrap { top: 0; } }
.mhf-header {
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: saturate(160%) blur(8px);
	-webkit-backdrop-filter: saturate(160%) blur(8px);
	border-bottom: 1px solid transparent;
	transition: box-shadow .25s ease, border-color .25s ease;
}
.mhf-header.is-scrolled { box-shadow: 0 6px 24px rgba(62, 36, 101, 0.08); border-bottom-color: var(--wp--preset--color--line); }
.mhf-header .wp-block-site-logo img { max-height: 54px; width: auto; }
.mhf-header .wp-block-navigation .wp-block-navigation-item__content { color: var(--wp--preset--color--plum); text-decoration: none; padding: 0.35rem 0; position: relative; }
.mhf-header .wp-block-navigation .wp-block-navigation-item__content::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; border-radius: 2px;
	background: var(--wp--preset--color--teal); transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.mhf-header .wp-block-navigation .wp-block-navigation-item__content:hover::after,
.mhf-header .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content::after { transform: scaleX(1); }
.mhf-header .wp-block-search__button { border: 0; background: transparent; color: var(--wp--preset--color--plum); padding: 0.4rem; }
.mhf-header .wp-block-search__button svg { width: 22px; height: 22px; }
.mhf-header .wp-block-search__input { border-radius: 999px; border: 1px solid var(--wp--preset--color--line); padding: 0.45rem 0.9rem; font-size: 0.9375rem; }
.mhf-header .wp-block-search.wp-block-search__button-behavior-expand.wp-block-search__searchfield-hidden .wp-block-search__inside-wrapper { border: 0; }
@media (max-width: 600px) {
	.mhf-header .wp-block-site-logo img { max-height: 44px; }
	.mhf-header .wp-block-button.is-style-donate .wp-block-button__link { padding: 0.55em 1em; font-size: 0.875rem; }
	.mhf-header .wp-block-search { display: none; }
}
.wp-block-navigation__responsive-container.is-menu-open { background: #fff; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { font-size: 1.125rem; }

/* ==========================================================================
   Buttons — only Donate has a filled background
   ========================================================================== */
.wp-block-button__link { transition: color .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease, background-color .2s ease; }
.wp-block-button__link:hover { transform: translateY(-1px); }

/* Donate (gold) */
.wp-block-button.is-style-donate .wp-block-button__link,
.mhf-donate-link {
	background: #F2B544 !important;
	color: #3E2465 !important;
	border-color: #F2B544 !important;
	box-shadow: 0 6px 18px rgba(242, 181, 68, 0.35);
	display: inline-flex; align-items: center; gap: 0.5em;
}
.wp-block-button.is-style-donate .wp-block-button__link::before,
.mhf-donate-link::before {
	content: ""; width: 1em; height: 1em; flex: none; background: currentColor;
	-webkit-mask: var(--mhf-i-heart) center / contain no-repeat; mask: var(--mhf-i-heart) center / contain no-repeat;
}
.wp-block-button.is-style-donate .wp-block-button__link:hover,
.mhf-donate-link:hover { background: #F6C566 !important; border-color: #F6C566 !important; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(242, 181, 68, 0.45); }

/* Light outline — for dark and gradient backgrounds */
.wp-block-button.is-style-light .wp-block-button__link { color: #fff; border-color: rgba(255, 255, 255, 0.85); background: transparent; }
.wp-block-button.is-style-light .wp-block-button__link:hover { color: #fff; border-color: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.15); }

/* Text link with arrow */
.wp-block-button.is-style-text .wp-block-button__link { border: 0; padding: 0.25em 0; border-radius: 0; color: var(--wp--preset--color--teal-deep); background: transparent; }
.wp-block-button.is-style-text .wp-block-button__link::after { content: " →"; transition: margin .2s ease; }
.wp-block-button.is-style-text .wp-block-button__link:hover { transform: none; text-decoration: underline; text-underline-offset: 4px; }
.wp-block-button.is-style-text .wp-block-button__link:hover::after { margin-left: 4px; }

/* Plain text links with an arrow (inside paragraphs) */
.mhf-arrow-link a { font-weight: 600; text-decoration: none; }
.mhf-arrow-link a::after { content: " →"; }
.mhf-arrow-link a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Floating Donate button */
.mhf-float-donate {
	position: fixed; right: 20px; bottom: 20px; z-index: 60; margin: 0 !important;
}
.mhf-float-donate .wp-block-button__link { font-size: 1rem; padding: 0.85em 1.5em; box-shadow: 0 10px 30px rgba(62, 36, 101, 0.28), 0 4px 12px rgba(242, 181, 68, 0.4); }
.mhf-float-donate.is-pulsing .wp-block-button__link { animation: mhf-pulse 1.4s ease-out 1; }
@keyframes mhf-pulse {
	0% { box-shadow: 0 0 0 0 rgba(242, 181, 68, 0.7), 0 10px 30px rgba(62, 36, 101, 0.28); }
	70% { box-shadow: 0 0 0 16px rgba(242, 181, 68, 0), 0 10px 30px rgba(62, 36, 101, 0.28); }
	100% { box-shadow: 0 0 0 0 rgba(242, 181, 68, 0), 0 10px 30px rgba(62, 36, 101, 0.28); }
}
@media (max-width: 600px) { .mhf-float-donate { right: 14px; bottom: 14px; } .mhf-float-donate .wp-block-button__link { font-size: 0.9375rem; } }
.mhf-on-donate-section .mhf-float-donate { opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .25s, transform .25s; }

/* Back to top */
.mhf-top {
	position: fixed; left: 20px; bottom: 20px; z-index: 59; width: 44px; height: 44px; border-radius: 50%;
	border: 1.5px solid var(--wp--preset--color--purple); background: rgba(255,255,255,0.95); color: var(--wp--preset--color--purple);
	display: grid; place-items: center; cursor: pointer; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .25s, transform .25s, color .2s, border-color .2s;
}
.mhf-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.mhf-top:hover { color: var(--wp--preset--color--teal-deep); border-color: var(--wp--preset--color--teal-deep); }
.mhf-top::before { content: ""; width: 18px; height: 18px; background: currentColor; -webkit-mask: var(--mhf-i-up) center / contain no-repeat; mask: var(--mhf-i-up) center / contain no-repeat; }
@media (max-width: 600px) { .mhf-top { left: 14px; bottom: 14px; width: 40px; height: 40px; } }

/* ==========================================================================
   Sections, cards and layout helpers
   ========================================================================== */
.mhf-card {
	background: #fff; border-radius: 12px; border: 1px solid var(--wp--preset--color--line);
	box-shadow: 0 8px 28px rgba(62, 36, 101, 0.06); transition: transform .25s ease, box-shadow .25s ease;
	height: 100%;
}
.mhf-card:hover { transform: translateY(-3px); box-shadow: 0 14px 40px rgba(62, 36, 101, 0.12); }
.mhf-card > *:first-child { margin-top: 0; }
.wp-block-column > .mhf-card { height: 100%; }

.mhf-num { font-family: var(--wp--preset--font-family--heading); font-size: 0.9375rem !important; font-weight: 600; color: var(--wp--preset--color--teal) !important; letter-spacing: 0.08em; margin-bottom: 0 !important; }

/* Rounded photos with consistent shapes */
.mhf-photo img, .wp-block-media-text.mhf-photo .wp-block-media-text__media img { border-radius: 12px; }
.mhf-ratio-43 img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.mhf-ratio-square img { aspect-ratio: 1 / 1; object-fit: cover; width: 100%; }
.mhf-ratio-portrait img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
.wp-block-media-text.mhf-photo .wp-block-media-text__media img { aspect-ratio: 4 / 3; object-fit: cover; }

/* "How can we help?" photo tiles */
.mhf-tile { position: relative; background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid var(--wp--preset--color--line); box-shadow: 0 8px 28px rgba(62,36,101,0.06); transition: transform .25s ease, box-shadow .25s ease; height: 100%; }
.mhf-tile:hover { transform: translateY(-3px); box-shadow: 0 14px 40px rgba(62,36,101,0.14); }
.mhf-tile .wp-block-image { margin: 0; overflow: hidden; }
.mhf-tile .wp-block-image img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; border-radius: 0; transition: transform .5s ease; }
.mhf-tile:hover .wp-block-image img { transform: scale(1.04); }
.mhf-tile .mhf-tile-label { padding: 0.9rem 1.1rem 1.1rem; margin: 0 !important; font-weight: 600; font-size: 1rem; line-height: 1.35; }
.mhf-tile .mhf-tile-label a { color: var(--wp--preset--color--plum); text-decoration: none; }
.mhf-tile .mhf-tile-label a::after { content: ""; position: absolute; inset: 0; } /* whole tile clickable */
.mhf-tile .mhf-tile-label a::before { content: "→"; float: right; color: var(--wp--preset--color--teal); transition: transform .2s; }
.mhf-tile:hover .mhf-tile-label a::before { transform: translateX(3px); }
.mhf-tile:focus-within { outline: 2px solid #1F96AE; outline-offset: 3px; }

/* Grids that reflow as items are added (board, tiles) */
.mhf-grid.is-layout-grid { align-items: stretch; }

/* Pathway steps */
.mhf-steps { counter-reset: mhfstep; }
.mhf-step { position: relative; padding-top: 3.25rem !important; }
.mhf-step::before {
	counter-increment: mhfstep; content: counter(mhfstep);
	position: absolute; top: 0; left: 0; width: 2.4rem; height: 2.4rem; border-radius: 50%;
	display: grid; place-items: center; font-family: var(--wp--preset--font-family--heading); font-weight: 600;
	color: #fff; background: linear-gradient(135deg, #582D6B, #17788C);
}
@media (min-width: 782px) {
	.mhf-step:not(:last-child)::after { content: ""; position: absolute; top: 1.2rem; left: 3rem; right: -1rem; height: 1px; background: linear-gradient(90deg, #1F96AE, rgba(31,150,174,0.15)); }
}
.mhf-step h3 { font-size: 1.125rem !important; margin-bottom: 0.25rem; }
.mhf-step p { font-size: 0.9375rem; color: var(--wp--preset--color--muted); margin-top: 0.25rem; }

/* Pill tags (Who we serve) */
.mhf-pills { display: flex; flex-wrap: wrap; gap: 0.6rem; list-style: none; padding: 0 !important; margin: 0; justify-content: center; }
.mhf-pills li { background: #fff; border: 1px solid var(--wp--preset--color--line); border-radius: 999px; padding: 0.45rem 1rem; font-size: 0.9375rem; color: var(--wp--preset--color--plum); }

/* Plain lists */
.mhf-plain-list { list-style: none; padding-left: 0 !important; }
.mhf-plain-list li { margin-bottom: 0.45rem; }
.mhf-check-list { list-style: none; padding-left: 0 !important; }
.mhf-check-list li { position: relative; padding-left: 1.9rem; margin-bottom: 0.7rem; }
.mhf-check-list li::before { content: ""; position: absolute; left: 0; top: 0.3em; width: 1.1rem; height: 1.1rem; background: var(--wp--preset--color--teal); -webkit-mask: var(--mhf-i-check) center / contain no-repeat; mask: var(--mhf-i-check) center / contain no-repeat; }

/* Jump-link bar */
.mhf-jumpbar { position: sticky; top: 76px; z-index: 40; background: rgba(246,246,248,0.96); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-bottom: 1px solid var(--wp--preset--color--line); }
.admin-bar .mhf-jumpbar { top: 108px; }
.mhf-jumpbar .wp-block-button__link { font-size: 0.875rem; padding: 0.45em 1.05em; }
@media (max-width: 782px) {
	.mhf-jumpbar { position: static; }
	.mhf-jumpbar .wp-block-buttons { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start !important; padding-bottom: 4px; }
	.mhf-jumpbar .wp-block-button { flex: none; }
}

/* Featured panel (SALP etc.) */
.mhf-feature { border-left: 4px solid var(--wp--preset--color--teal); }

/* Reserved MedEx Academy space */
.mhf-academy { border: 1px solid var(--wp--preset--color--sky); border-radius: 12px; background: #fff; min-height: 160px; }

/* Board and founder */
.mhf-person .wp-block-image { margin-bottom: 0.75rem; }
.mhf-person .wp-block-image img { border-radius: 12px; aspect-ratio: 1 / 1; object-fit: cover; width: 100%; }
.mhf-person h3 { font-size: 1.25rem !important; margin: 0.25rem 0 0; }
.mhf-person .mhf-role { color: var(--wp--preset--color--teal-deep); font-size: 0.875rem; font-weight: 600; letter-spacing: 0.04em; margin-top: 0.15rem !important; }
.mhf-founder .wp-block-image img { aspect-ratio: 4 / 5; object-fit: cover; border-radius: 12px; }
.mhf-founder blockquote { border-left: 3px solid var(--wp--preset--color--teal); padding-left: 1.2rem; margin-left: 0; font-family: var(--wp--preset--font-family--heading); font-style: italic; font-size: 1.125rem; color: var(--wp--preset--color--plum); }

/* Expand-in-place bios and FAQs */
.wp-block-details { border-top: 1px solid var(--wp--preset--color--line); padding-top: 0.6rem; }
.wp-block-details summary { cursor: pointer; font-weight: 600; color: var(--wp--preset--color--teal-deep); list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary::after { content: "+"; font-size: 1.2em; line-height: 1; transition: transform .2s; }
.wp-block-details[open] summary::after { transform: rotate(45deg); }
.wp-block-details > :not(summary) { margin-top: 0.6rem; color: var(--wp--preset--color--muted); }
.mhf-faq .wp-block-details { padding: 0.9rem 0; }
.mhf-faq .wp-block-details summary { font-size: 1.0625rem; color: var(--wp--preset--color--plum); }

/* Impact numbers */
.mhf-stat { font-family: var(--wp--preset--font-family--heading); font-size: clamp(2rem, 1.7rem + 1.2vw, 2.5rem) !important; line-height: 1; color: var(--wp--preset--color--purple); margin-bottom: 0.25rem !important; }

/* Icons (CSS masks — choose with Advanced → Additional CSS class) */
:root {
	--mhf-i-heart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-9.6-9.2C.9 8.5 3 5 6.4 5c2 0 3.3 1 4.1 2.2h3C14.3 6 15.6 5 17.6 5 21 5 23.1 8.5 21.6 11.8 19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E");
	--mhf-i-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5M5 12l7-7 7 7'/%3E%3C/svg%3E");
	--mhf-i-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10' stroke-width='1.6'/%3E%3Cpath d='M7.5 12.5l3 3 6-6.5'/%3E%3C/svg%3E");
	--mhf-i-pin: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s7-6.2 7-11.5A7 7 0 0 0 5 9.5C5 14.8 12 21 12 21z'/%3E%3Ccircle cx='12' cy='9.5' r='2.5'/%3E%3C/svg%3E");
	--mhf-i-phone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1.9.4 1.8.7 2.7a2 2 0 0 1-.5 2.1L8 9.8a16 16 0 0 0 6 6l1.3-1.3a2 2 0 0 1 2.1-.4c.9.3 1.8.6 2.7.7a2 2 0 0 1 1.7 2z'/%3E%3C/svg%3E");
	--mhf-i-mail: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3 7l9 6 9-6'/%3E%3C/svg%3E");
	--mhf-i-map: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 4L3 6v14l6-2 6 2 6-2V4l-6 2-6-2zM9 4v14M15 6v14'/%3E%3C/svg%3E");
	--mhf-i-community: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3'/%3E%3Ccircle cx='17' cy='9' r='2.4'/%3E%3Cpath d='M3 19c0-3.3 2.7-5.5 6-5.5s6 2.2 6 5.5M14.5 14.2c.8-.4 1.6-.6 2.5-.6 2.5 0 4 1.7 4 4.4'/%3E%3C/svg%3E");
	--mhf-i-mind: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20s-6.5-3.9-8.3-7.9C2.4 9.3 4.2 6.2 7.2 6.2c1.9 0 3.2 1 3.9 2.1h1.8c.7-1.1 2-2.1 3.9-2.1 3 0 4.8 3.1 3.5 5.9C18.5 16.1 12 20 12 20z'/%3E%3Cpath d='M8 12h2l1.2-2 1.6 4 1.2-2h2'/%3E%3C/svg%3E");
	--mhf-i-family: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='7' cy='6' r='2.4'/%3E%3Ccircle cx='17' cy='6' r='2.4'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3Cpath d='M3 20v-4.5A3.5 3.5 0 0 1 6.5 12h1M21 20v-4.5a3.5 3.5 0 0 0-3.5-3.5h-1M8.5 20v-2a3.5 3.5 0 0 1 7 0v2'/%3E%3C/svg%3E");
	--mhf-i-compass: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M15.5 8.5l-2 5-5 2 2-5z'/%3E%3C/svg%3E");
	--mhf-i-briefcase: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='7' width='18' height='13' rx='2'/%3E%3Cpath d='M9 7V5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2M3 12.5h18M11 12.5v2h2v-2'/%3E%3C/svg%3E");
	--mhf-i-handshake: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m11 17 2 2a1 1 0 1 0 3-3'/%3E%3Cpath d='m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4'/%3E%3Cpath d='m21 3 1 11h-2'/%3E%3Cpath d='M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3'/%3E%3Cpath d='M3 4h8'/%3E%3C/svg%3E");
	--mhf-i-shield: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l8 3v6c0 4.5-3.4 8.2-8 9-4.6-.8-8-4.5-8-9V6z'/%3E%3Cpath d='M8.5 12l2.5 2.5 4.5-5'/%3E%3C/svg%3E");
	--mhf-i-chart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='M7 15l4-4 3 3 5-6'/%3E%3C/svg%3E");
	--mhf-i-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9z'/%3E%3C/svg%3E");
	--mhf-i-leaf: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 19c0-8 5-13 15-14-1 10-6 15-14 15'/%3E%3Cpath d='M5 19l7-7'/%3E%3C/svg%3E");
}
.mhf-icon { position: relative; padding-left: 2.1em; }
.mhf-icon::before {
	content: ""; position: absolute; left: 0; top: 0.12em; width: 1.35em; height: 1.35em;
	background: var(--wp--preset--color--teal);
	-webkit-mask: var(--mhf-ic) center / contain no-repeat; mask: var(--mhf-ic) center / contain no-repeat;
}
/* Icon tile above a heading: add "mhf-icon-lg icon-…" to the heading */
.mhf-icon-lg { position: relative; padding-top: 60px; }
.mhf-icon-lg::before { content: ""; position: absolute; top: 0; left: 0; width: 46px; height: 46px; border-radius: 12px; background: var(--wp--preset--color--mist); }
.mhf-icon-lg::after { content: ""; position: absolute; top: 11px; left: 11px; width: 24px; height: 24px; background: var(--wp--preset--color--teal-deep); -webkit-mask: var(--mhf-ic) center / contain no-repeat; mask: var(--mhf-ic) center / contain no-repeat; }
.has-text-align-center.mhf-icon-lg::before { left: calc(50% - 23px); }
.has-text-align-center.mhf-icon-lg::after { left: calc(50% - 12px); }
.has-brand-gradient-background .mhf-icon::before { background: #B8DDE6; }
.icon-pin { --mhf-ic: var(--mhf-i-pin); } .icon-phone { --mhf-ic: var(--mhf-i-phone); } .icon-mail { --mhf-ic: var(--mhf-i-mail); }
.icon-map { --mhf-ic: var(--mhf-i-map); } .icon-community { --mhf-ic: var(--mhf-i-community); } .icon-mind { --mhf-ic: var(--mhf-i-mind); }
.icon-family { --mhf-ic: var(--mhf-i-family); } .icon-compass { --mhf-ic: var(--mhf-i-compass); } .icon-briefcase { --mhf-ic: var(--mhf-i-briefcase); }
.icon-handshake { --mhf-ic: var(--mhf-i-handshake); } .icon-shield { --mhf-ic: var(--mhf-i-shield); } .icon-chart { --mhf-ic: var(--mhf-i-chart); }
.icon-star { --mhf-ic: var(--mhf-i-star); } .icon-leaf { --mhf-ic: var(--mhf-i-leaf); } .icon-heart { --mhf-ic: var(--mhf-i-heart); } .icon-check { --mhf-ic: var(--mhf-i-check); }

/* ==========================================================================
   Hero and page headers
   ========================================================================== */
.mhf-hero.wp-block-cover { min-height: min(78vh, 680px); }
.mhf-hero h1 { color: #fff; max-width: 18ch; margin-left: 0 !important; }
.mhf-hero .wp-block-cover__inner-container { width: 100%; max-width: 1200px; margin-inline: auto !important; }
.mhf-hero .wp-block-cover__inner-container > * { margin-left: 0 !important; }
.mhf-hero .mhf-lead { max-width: 52ch; }
.mhf-pagehead h1 { color: #fff; }
.mhf-pagehead p:not(.mhf-eyebrow) { color: #F1ECF5; max-width: 62ch; margin-left: max(0px, calc((100% - 1200px) / 2)) !important; }
.has-brand-gradient-background h1, .has-brand-gradient-background h2, .has-brand-gradient-background h3,
.has-plum-background-color h2, .has-plum-background-color h3 { color: #fff; }
.has-brand-gradient-background { color: #F4F0F7; }
.has-brand-gradient-background a:not(.wp-block-button__link) { color: #fff; }

/* Subtle moving gradient sheen on dark bands */
.mhf-sheen { position: relative; overflow: hidden; isolation: isolate; }
.mhf-sheen::before {
	content: ""; position: absolute; inset: -50%; z-index: -1; pointer-events: none;
	background: radial-gradient(circle at 30% 30%, rgba(31,150,174,0.35), transparent 40%), radial-gradient(circle at 75% 70%, rgba(88,45,107,0.45), transparent 45%);
	animation: mhf-drift 22s ease-in-out infinite alternate;
}
@keyframes mhf-drift { from { transform: translate3d(-4%, -2%, 0) rotate(0deg); } to { transform: translate3d(4%, 3%, 0) rotate(8deg); } }

/* ==========================================================================
   Footer
   ========================================================================== */
.mhf-footer { color: #EDE6F2; font-size: 0.9375rem; }
.mhf-footer h2, .mhf-footer h3, .mhf-footer h4 { color: #fff; }
.mhf-footer h4, .mhf-footer .mhf-footer-heading { font-family: var(--wp--preset--font-family--body) !important; font-weight: 600 !important; font-size: 0.8125rem !important; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 0.9rem; }
.mhf-footer a { color: #fff; text-decoration: none; }
.mhf-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.mhf-footer .mhf-plain-list li { margin-bottom: 0.5rem; }
.mhf-footer .mhf-icon::before { background: #B8DDE6; }
.mhf-footer .wp-block-separator { border-color: rgba(255,255,255,0.18) !important; opacity: 1; }
.mhf-footer .mhf-legal, .mhf-footer .mhf-legal a { font-size: 0.8125rem; color: #D9CFE3; }
.mhf-footer .mhf-ack { font-size: 0.875rem; max-width: 900px; }
.mhf-footer .icon-mail { font-size: 0.875rem; overflow-wrap: anywhere; }
.mhf-footer .mhf-crisis { font-size: 0.875rem; color: #fff; }
.mhf-footer .wp-block-social-links .wp-social-link { background: rgba(255,255,255,0.12) !important; color: #fff !important; }
.mhf-footer .wp-block-social-links .wp-social-link:hover { background: rgba(255,255,255,0.22) !important; }
.mhf-footer .wp-block-image img { max-width: min(250px, 100%); height: auto; }

/* ==========================================================================
   Forms
   ========================================================================== */
.mhf-form { display: grid; gap: 1rem; }
.mhf-form .mhf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .mhf-form .mhf-row { grid-template-columns: 1fr; } }
.mhf-form label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--wp--preset--color--plum); margin-bottom: 0.35rem; }
.mhf-form .mhf-req { color: #A3324A; }
.mhf-form input[type=text], .mhf-form input[type=email], .mhf-form input[type=tel], .mhf-form select, .mhf-form textarea {
	width: 100%; box-sizing: border-box; font: inherit; font-size: 1rem; color: var(--wp--preset--color--ink);
	background: #fff; border: 1px solid #CFCAD8; border-radius: 10px; padding: 0.7rem 0.9rem; transition: border-color .2s, box-shadow .2s;
}
.mhf-form textarea { min-height: 140px; resize: vertical; }
.mhf-form input:focus, .mhf-form select:focus, .mhf-form textarea:focus { outline: none; border-color: #1F96AE; box-shadow: 0 0 0 3px rgba(31,150,174,0.2); }
.mhf-form .mhf-consent { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.875rem; color: var(--wp--preset--color--muted); }
.mhf-form .mhf-consent input { margin-top: 0.25rem; width: 1.1rem; height: 1.1rem; flex: none; accent-color: #582D6B; }
.mhf-form .mhf-consent label { font-weight: 400; color: inherit; margin: 0; font-size: inherit; }
.mhf-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.mhf-form button[type=submit] {
	justify-self: start; font: inherit; font-size: 0.9375rem; font-weight: 600; cursor: pointer; color: var(--wp--preset--color--purple);
	background: transparent; border: 1.5px solid var(--wp--preset--color--purple); border-radius: 999px; padding: 0.75em 1.7em; transition: color .2s, border-color .2s, transform .2s;
}
.mhf-form button[type=submit]:hover { color: var(--wp--preset--color--teal-deep); border-color: var(--wp--preset--color--teal-deep); transform: translateY(-1px); }
.mhf-form-msg { border-radius: 10px; padding: 0.9rem 1.1rem; font-size: 0.9375rem; margin-bottom: 1rem; }
.mhf-form-msg.is-success { background: #E7F5EE; color: #1D5A3C; border: 1px solid #BFE3CF; }
.mhf-form-msg.is-error { background: #FBEAEE; color: #7A2236; border: 1px solid #F1C6D0; }
.mhf-form-note { font-size: 0.8125rem; color: var(--wp--preset--color--muted); margin: 0; }

/* Newsletter (footer) */
.mhf-newsletter { display: grid; gap: 0.6rem; }
.mhf-newsletter .mhf-nl-row { display: flex; gap: 0.5rem; }
.mhf-newsletter input[type=email] { flex: 1; min-width: 0; font: inherit; font-size: 0.9375rem; border-radius: 999px; border: 1px solid rgba(255,255,255,0.4); background: rgba(255,255,255,0.1); color: #fff; padding: 0.6rem 1rem; }
.mhf-newsletter input[type=email]::placeholder { color: #E3DAEA; }
.mhf-newsletter input[type=email]:focus { outline: none; border-color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,0.2); }
.mhf-newsletter button { font: inherit; font-size: 0.875rem; font-weight: 600; color: #fff; background: transparent; border: 1.5px solid rgba(255,255,255,0.85); border-radius: 999px; padding: 0.55rem 1.1rem; cursor: pointer; }
.mhf-newsletter button:hover { border-color: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,0.15); }
.mhf-newsletter .mhf-nl-consent { font-size: 0.75rem; color: #D9CFE3; margin: 0; }
.mhf-newsletter .mhf-form-msg { margin: 0; }

/* Map */
.mhf-map iframe { width: 100%; height: 300px; border: 0; border-radius: 12px; display: block; }

/* Stories / news cards (query loop) */
.mhf-stories .wp-block-post { background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid var(--wp--preset--color--line); box-shadow: 0 8px 28px rgba(62,36,101,0.06); }
.mhf-stories .wp-block-post-featured-image { margin: 0; }
.mhf-stories .wp-block-post-featured-image img { aspect-ratio: 16 / 9; object-fit: cover; }
.mhf-stories .mhf-story-body { padding: 1.1rem 1.25rem 1.3rem; }
.mhf-stories .wp-block-post-title a { color: var(--wp--preset--color--plum); text-decoration: none; }
.mhf-stories .wp-block-post-title a:hover { color: var(--wp--preset--color--teal-deep); }
.mhf-stories .wp-block-post-terms a { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; color: var(--wp--preset--color--teal-deep); }

/* Legal / long-form pages */
.mhf-prose h2 { font-size: 1.5rem; margin-top: 2.2rem; }
.mhf-prose h3 { font-size: 1.2rem; margin-top: 1.6rem; }

/* Search results & posts */
.wp-block-post-title a { text-decoration: none; }

/* ==========================================================================
   Reveal on scroll (only when JavaScript runs and motion is allowed)
   ========================================================================== */
.mhf-js .mhf-reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.mhf-js .mhf-reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .mhf-js .mhf-reveal { opacity: 1; transform: none; } }

/* ==========================================================================
   Mobile tidy-up
   ========================================================================== */
@media (max-width: 781px) {
	.mhf-hero.wp-block-cover { min-height: 560px; }
	.wp-block-columns.mhf-stack-gap { gap: 1.25rem; }
	.mhf-center-mobile { text-align: center; }
}
@media print {
	.mhf-header-wrap, .mhf-float-donate, .mhf-top, .mhf-jumpbar { display: none !important; }
}

/* Helpers added for page sections */
.mhf-space-top { margin-top: var(--wp--preset--spacing--50) !important; }
.mhf-feature-purple { border-left-color: var(--wp--preset--color--purple); }
.mhf-highlights h3 { font-family: var(--wp--preset--font-family--body); font-size: 1rem !important; font-weight: 600; color: var(--wp--preset--color--plum); }
.mhf-partner-logo img { max-height: 70px; width: auto; margin: 0 auto; filter: grayscale(1); opacity: .8; transition: filter .2s, opacity .2s; }
.mhf-partner-logo img:hover { filter: none; opacity: 1; }
.mhf-academy h2 { margin: 0; }
.mhf-board .mhf-card, .mhf-grid > .mhf-card { height: 100%; }
@media (max-width: 600px) {
	.mhf-grid:has(> .mhf-tile) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 0.75rem !important; }
	.mhf-tile .mhf-tile-label { font-size: 0.875rem; padding: 0.7rem 0.75rem 0.85rem; }
	.mhf-tile .mhf-tile-label a::before { display: none; }
}

/* ==========================================================================
   Readability guard for dark / gradient areas.
   Hosts and site builders (e.g. GoDaddy / Airo) can add their own text colours
   site-wide. These rules use the footer and main-area IDs so they always win.
   ========================================================================== */
#mhf-footer, #mhf-footer p, #mhf-footer li, #mhf-footer span, #mhf-footer strong, #mhf-footer em, #mhf-footer label,
#mhf-footer h1, #mhf-footer h2, #mhf-footer h3, #mhf-footer h4, #mhf-footer h5, #mhf-footer h6 {
	color: #FFFFFF !important; -webkit-text-fill-color: currentColor !important; opacity: 1 !important; text-shadow: none !important;
}
#mhf-footer p, #mhf-footer li { color: #F4EFF8 !important; }
#mhf-footer a, #mhf-footer a:visited { color: #FFFFFF !important; -webkit-text-fill-color: currentColor !important; text-decoration: none !important; opacity: 1 !important; }
#mhf-footer a:hover, #mhf-footer a:focus { text-decoration: underline !important; text-underline-offset: 3px; }
#mhf-footer .mhf-legal, #mhf-footer .mhf-legal a, #mhf-footer .mhf-nl-consent, #mhf-footer .mhf-nl-consent a { color: #E9E2F0 !important; }
#mhf-footer .mhf-ack { color: #EFE9F4 !important; }
#mhf-footer > .mhf-ack, #mhf-footer > .mhf-crisis, #mhf-footer > p { margin-left: auto !important; margin-right: auto !important; max-width: 1200px !important; width: 100%; }
#mhf-footer .mhf-newsletter input[type=email] {
	background: rgba(255,255,255,0.12) !important; color: #FFFFFF !important; -webkit-text-fill-color: #FFFFFF !important;
	border: 1px solid rgba(255,255,255,0.6) !important; border-radius: 999px !important; padding: 0.6rem 1rem !important; box-shadow: none !important;
}
#mhf-footer .mhf-newsletter input[type=email]::placeholder { color: #E9E2F0 !important; -webkit-text-fill-color: #E9E2F0 !important; opacity: 1; }
#mhf-footer .mhf-newsletter button {
	background: transparent !important; color: #FFFFFF !important; -webkit-text-fill-color: #FFFFFF !important; border: 1.5px solid rgba(255,255,255,0.9) !important;
	border-radius: 999px !important; padding: 0.55rem 1.1rem !important; font-size: 0.875rem !important; font-weight: 600 !important;
}
#mhf-footer .wp-block-button.is-style-donate .wp-block-button__link, .mhf-float-donate .wp-block-button__link { color: #3E2465 !important; -webkit-text-fill-color: #3E2465 !important; }

/* Dark bands inside pages (page headers, call-to-action bands) */
#mhf-main .has-brand-gradient-background h1, #mhf-main .has-brand-gradient-background h2, #mhf-main .has-brand-gradient-background h3 { color: #FFFFFF !important; -webkit-text-fill-color: currentColor !important; }
#mhf-main .has-brand-gradient-background p:not(.mhf-eyebrow), #mhf-main .has-brand-gradient-background li { color: #F4EFF8 !important; -webkit-text-fill-color: currentColor !important; opacity: 1 !important; }
#mhf-main .has-brand-gradient-background .mhf-eyebrow { color: #DCEFF4 !important; }
#mhf-main .wp-block-button.is-style-light .wp-block-button__link { color: #FFFFFF !important; -webkit-text-fill-color: currentColor !important; border-color: rgba(255,255,255,0.85) !important; background: transparent !important; }
#mhf-main .wp-block-button.is-style-donate .wp-block-button__link { color: #3E2465 !important; -webkit-text-fill-color: currentColor !important; }

/* Home hero: text + rectangular image/video frame (stationary, no effects) */
.mhf-hero-split h1 { color: var(--wp--preset--color--plum); max-width: 18ch; }
.mhf-hero-split .mhf-lead { max-width: 50ch; }
.mhf-media-frame.wp-block-cover { border-radius: 16px; overflow: hidden; min-height: clamp(240px, 30vw, 440px) !important; padding: 0 !important; width: 100%; }
.mhf-media-frame.wp-block-cover img, .mhf-media-frame.wp-block-cover video { border-radius: 0; }
.mhf-media-frame, .mhf-media-frame * { transform: none !important; animation: none !important; }
@media (max-width: 781px) { .mhf-hero-split .wp-block-columns { gap: 2rem !important; } }

/* Back-to-top button stays visible whatever the host styles buttons as */
.mhf-top { background: rgba(255,255,255,0.95) !important; border: 1.5px solid #582D6B !important; color: #582D6B !important; }

/* ==========================================================================
   Version 4 — LOFT-style structure
   ========================================================================== */
/* Utility bar */
.mhf-utility { background: #3E2465; color: #F4EFF8; font-size: 0.8125rem; }
.mhf-utility p { margin: 0; color: #F4EFF8 !important; }
.mhf-utility a { color: #FFFFFF !important; text-decoration: none; }
.mhf-utility a:hover { text-decoration: underline; text-underline-offset: 3px; }
.mhf-utility .mhf-util-links a { margin-left: 1.1rem; }
@media (max-width: 781px) { .mhf-utility .mhf-util-links { display: none; } .mhf-utility { text-align: center; } }

/* Dropdown menus */
.mhf-header .wp-block-navigation .wp-block-navigation__submenu-container {
	border: 1px solid var(--wp--preset--color--line) !important; border-radius: 12px; padding: 0.5rem !important;
	box-shadow: 0 16px 40px rgba(62, 36, 101, 0.14); min-width: 250px !important; background: #fff !important;
}
.mhf-header .wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 0.55rem 0.8rem !important; border-radius: 8px; font-weight: 400; color: var(--wp--preset--color--ink);
}
.mhf-header .wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover { background: var(--wp--preset--color--mist); color: var(--wp--preset--color--plum); }
.mhf-header .wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content::after { display: none; }
.mhf-header .wp-block-navigation .wp-block-navigation-submenu__toggle { color: var(--wp--preset--color--plum); }
.mhf-header .mhf-getsupport .wp-block-button__link { padding: 0.6em 1.15em; }
@media (max-width: 1279px) { .mhf-header .mhf-getsupport { display: none; } }

/* Program directory filter */
.mhf-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-bottom: 1.75rem; }
.mhf-filter button { font: inherit; font-size: 0.875rem; font-weight: 600; cursor: pointer; border-radius: 999px; padding: 0.5rem 1rem;
	background: #fff; color: var(--wp--preset--color--purple); border: 1.5px solid var(--wp--preset--color--line); transition: border-color .2s, color .2s; }
.mhf-filter button:hover { border-color: var(--wp--preset--color--purple); }
.mhf-filter button[aria-pressed="true"] { border-color: var(--wp--preset--color--purple); color: var(--wp--preset--color--plum); box-shadow: inset 0 0 0 1px var(--wp--preset--color--purple); }
.mhf-hidden { display: none !important; }
.mhf-tagline { font-size: 0.75rem !important; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--wp--preset--color--muted); }

/* Events and jobs */
.mhf-event-list, .mhf-job-list { display: grid; gap: 1rem; }
.mhf-event { display: flex; gap: 1.1rem; align-items: flex-start; background: #fff; border: 1px solid var(--wp--preset--color--line); border-radius: 12px; padding: 1.1rem 1.25rem; }
.mhf-event-date { flex: none; width: 64px; text-align: center; border-radius: 10px; background: var(--wp--preset--color--mist); padding: 0.5rem 0; }
.mhf-event-date span { display: block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--wp--preset--color--teal-deep); }
.mhf-event-date strong { display: block; font-family: var(--wp--preset--font-family--heading); font-size: 1.6rem; line-height: 1.1; color: var(--wp--preset--color--plum); }
.mhf-event h3, .mhf-job h3 { font-size: 1.125rem !important; margin: 0 0 0.25rem; }
.mhf-event h3 a, .mhf-job h3 a { color: var(--wp--preset--color--plum); text-decoration: none; }
.mhf-event h3 a:hover, .mhf-job h3 a:hover { color: var(--wp--preset--color--teal-deep); text-decoration: underline; }
.mhf-event p { margin: 0.25rem 0 0; font-size: 0.9375rem; }
.mhf-event-meta { font-size: 0.875rem !important; color: var(--wp--preset--color--muted); margin: 0 !important; }
.mhf-job { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; background: #fff; border: 1px solid var(--wp--preset--color--line); border-radius: 12px; padding: 1.1rem 1.25rem; }
.mhf-outline-link { display: inline-block; border: 1.5px solid var(--wp--preset--color--purple); color: var(--wp--preset--color--purple) !important; border-radius: 999px; padding: 0.55em 1.25em; font-weight: 600; font-size: 0.9375rem; text-decoration: none !important; }
.mhf-outline-link:hover { border-color: var(--wp--preset--color--teal-deep); color: var(--wp--preset--color--teal-deep) !important; }
.mhf-empty { color: var(--wp--preset--color--muted); background: #fff; border: 1px dashed var(--wp--preset--color--line); border-radius: 12px; padding: 1.2rem 1.4rem; }
.mhf-details-box { background: #fff; border: 1px solid var(--wp--preset--color--line); border-radius: 12px; padding: 1.25rem 1.4rem; margin-bottom: 1.5rem; }
.mhf-details-box dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.25rem; margin: 0 0 1rem; }
.mhf-details-box dt { font-weight: 600; color: var(--wp--preset--color--plum); }
.mhf-details-box dd { margin: 0; }

/* Referral form choices */
.mhf-choice { border: 1px solid var(--wp--preset--color--line); border-radius: 10px; padding: 0.8rem 1rem; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; }
.mhf-choice legend { font-size: 0.875rem; font-weight: 600; color: var(--wp--preset--color--plum); padding: 0 0.3rem; }
.mhf-choice label { display: inline-flex !important; align-items: center; gap: 0.45rem; font-weight: 400 !important; color: var(--wp--preset--color--ink) !important; margin: 0 !important; font-size: 0.9375rem !important; }
.mhf-choice input { accent-color: #582D6B; width: 1.05rem; height: 1.05rem; }

/* Crisis panel */
.mhf-crisis-panel { border-left: 4px solid #F2B544 !important; }

/* Sub-page navigation chips (e.g. About → Leadership) */
.mhf-subnav .wp-block-button__link { font-size: 0.875rem; padding: 0.45em 1.05em; }

/* News category chips */
.mhf-cat-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0 !important; margin: 0 0 1.5rem; justify-content: center; }
.mhf-cat-chips li a { display: inline-block; border: 1.5px solid var(--wp--preset--color--line); border-radius: 999px; padding: 0.35rem 0.9rem; text-decoration: none; font-size: 0.875rem; font-weight: 600; color: var(--wp--preset--color--purple); }
.mhf-cat-chips li a:hover { border-color: var(--wp--preset--color--purple); }

/* v4 header fixes */
.mhf-header-wrap > * { margin-block-start: 0 !important; margin-top: 0 !important; }
@media (min-width: 1280px) { .mhf-header .mhf-nav-support { display: none !important; } }
/* The blur effect would trap the full-screen mobile menu inside the header */
@media (max-width: 781px) {
	.mhf-header { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: #FFFFFF !important; }
}
.mhf-header:has(.wp-block-navigation__responsive-container.is-menu-open) { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
.wp-block-navigation__responsive-container.is-menu-open { padding: 1.25rem 1.5rem 2rem !important; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container { border: 0 !important; box-shadow: none !important; padding: 0.25rem 0 0.5rem 1rem !important; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { color: var(--wp--preset--color--plum) !important; }

/* Card titles that are links */
.mhf-card h3 a { color: var(--wp--preset--color--plum); text-decoration: none; }
.mhf-card h3 a:hover { color: var(--wp--preset--color--teal-deep); text-decoration: underline; text-underline-offset: 4px; }
.wp-block-navigation__responsive-container.is-menu-open { --navigation-layout-justification-setting: flex-start; --navigation-layout-justify: flex-start; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item { align-items: flex-start !important; text-align: left !important; }

/* ==========================================================================
   4.0.1 — Media frame: any photo, video or embed placed INSIDE the hero
   rectangle fills it edge to edge (as well as the frame's own background).
   ========================================================================== */
.mhf-media-frame.wp-block-cover .wp-block-cover__inner-container {
	position: absolute !important; inset: 0 !important; z-index: 2;
	width: 100% !important; max-width: none !important; height: 100% !important; margin: 0 !important; padding: 0 !important;
}
.mhf-media-frame .wp-block-cover__inner-container > * {
	margin: 0 !important; max-width: none !important; width: 100% !important; height: 100% !important;
}
.mhf-media-frame .wp-block-cover__inner-container figure,
.mhf-media-frame .wp-block-cover__inner-container .wp-block-embed__wrapper { height: 100% !important; margin: 0 !important; }
.mhf-media-frame .wp-block-cover__inner-container img,
.mhf-media-frame .wp-block-cover__inner-container video,
.mhf-media-frame .wp-block-cover__inner-container iframe {
	display: block; width: 100% !important; height: 100% !important; max-width: none !important;
	object-fit: cover; border-radius: 0 !important; aspect-ratio: auto !important;
}
.mhf-media-frame .wp-block-cover__inner-container figcaption { display: none; }
/* When something is placed inside, hide the frame's own background picture underneath */
.mhf-media-frame:has(.wp-block-cover__inner-container img, .wp-block-cover__inner-container video, .wp-block-cover__inner-container iframe) > .wp-block-cover__image-background,
.mhf-media-frame:has(.wp-block-cover__inner-container img, .wp-block-cover__inner-container video, .wp-block-cover__inner-container iframe) > .wp-block-cover__video-background { opacity: 0; }

/* Other photo spots: images always fill their shape, whatever size is uploaded */
.mhf-tile .wp-block-image img, .mhf-person .wp-block-image img, .mhf-ratio-43 img, .mhf-ratio-square img, .mhf-ratio-portrait img,
.wp-block-media-text.mhf-photo .wp-block-media-text__media img { object-fit: cover !important; width: 100% !important; height: auto; }
.mhf-tile .wp-block-image, .mhf-person .wp-block-image, .mhf-ratio-43, .mhf-ratio-square, .mhf-ratio-portrait { width: 100%; }
.mhf-tile .wp-block-image img { aspect-ratio: 4 / 3 !important; }
.mhf-person .wp-block-image img, .mhf-ratio-square img { aspect-ratio: 1 / 1 !important; }
.mhf-ratio-43 img, .wp-block-media-text.mhf-photo .wp-block-media-text__media img { aspect-ratio: 4 / 3 !important; }
.mhf-ratio-portrait img { aspect-ratio: 4 / 5 !important; }

/* ==========================================================================
   4.0.2 — quality pass fixes
   ========================================================================== */
/* Program numbers: deeper teal for readable contrast */
.mhf-num { color: var(--wp--preset--color--teal-deep) !important; }
/* Links inside sentences are underlined so they stand out (crisis lines, legal line) */
.mhf-utility p a, #mhf-footer .mhf-crisis a, #mhf-footer .mhf-legal a, #mhf-footer .mhf-ack a,
#mhf-footer .mhf-nl-consent a { text-decoration: underline !important; text-underline-offset: 3px; }
.mhf-utility .mhf-util-links a { text-decoration: none !important; }
.mhf-utility .mhf-util-links a:hover { text-decoration: underline !important; }
/* Floating Donate wrapper (landmark for screen readers) takes no space */
.mhf-float-wrap { margin: 0 !important; padding: 0 !important; }
/* Search box on dark page headers (search results page) */
.mhf-pagehead .wp-block-search__inside-wrapper { gap: 0.5rem; border: 0 !important; padding: 0 !important; }
.mhf-pagehead .wp-block-search__input { border-radius: 999px !important; border: 1px solid rgba(255,255,255,0.6) !important; background: #FFFFFF !important; color: #2A2333 !important; padding: 0.6rem 1rem !important; }
.mhf-pagehead .wp-block-search__button, #mhf-main .mhf-pagehead .wp-block-search__button {
	background: transparent !important; color: #FFFFFF !important; -webkit-text-fill-color: #FFFFFF !important; border: 1.5px solid rgba(255,255,255,0.9) !important;
	border-radius: 999px !important; padding: 0.55rem 1.3rem !important; font-weight: 600; margin-left: 0 !important;
}
.mhf-pagehead .wp-block-search__button:hover { box-shadow: 0 0 0 4px rgba(255,255,255,0.18); }
/* Search box on light pages (404) */
#mhf-main > .wp-block-search .wp-block-search__input { border-radius: 999px; border: 1px solid #CFCAD8; padding: 0.6rem 1rem; }
#mhf-main > .wp-block-search .wp-block-search__button { border-radius: 999px; border: 1.5px solid var(--wp--preset--color--purple); background: transparent; color: var(--wp--preset--color--purple); padding: 0.55rem 1.3rem; font-weight: 600; }
/* List titles (News, search) are now level-2 headings: keep their size modest */
.mhf-stories .wp-block-post-title { font-size: 1.1875rem !important; }
/* MedEx Academy space (when the portal link is set) */
.mhf-academy .mhf-academy-text { color: var(--wp--preset--color--muted); max-width: 56ch; margin: 0.75rem auto 1rem !important; }
.mhf-academy .mhf-academy-buttons { justify-content: center; gap: 1rem; display: flex; flex-wrap: wrap; }

/* Board and advisory cards: opening one bio grows only that card */
.mhf-board.is-layout-grid, .mhf-grid.mhf-board { align-items: start !important; }
.mhf-board > .mhf-card { height: auto !important; }
.mhf-role { color: var(--wp--preset--color--teal-deep); font-size: 0.875rem; font-weight: 600; letter-spacing: 0.04em; }

/* ==========================================================================
   4.2 — Home hero: on wider screens the image/video rectangle runs the full
   height of the text beside it (tall portrait), whatever the text length.
   On tablets and phones it keeps a normal-height rectangle.
   ========================================================================== */
@media (min-width: 1024px) {
	.mhf-hero-split .wp-block-columns:has(.mhf-media-frame) { align-items: stretch !important; }
	.mhf-hero-split .wp-block-columns:has(.mhf-media-frame) > .wp-block-column { align-self: stretch !important; }
	.mhf-hero-split .wp-block-column:has(.mhf-media-frame) { display: flex !important; flex-direction: column; }
	.mhf-hero-split .wp-block-column:has(.mhf-media-frame) > * { flex: 1 1 auto; margin-block: 0 !important; }
	.mhf-hero-split .wp-block-column:has(.mhf-media-frame) > :not(.mhf-media-frame) { display: flex; flex-direction: column; }
	.mhf-hero-split .wp-block-column:has(.mhf-media-frame) .mhf-media-frame { flex: 1 1 auto; height: auto !important; min-height: 420px !important; }
	/* the text column keeps its natural top-to-bottom flow */
	.mhf-hero-split .wp-block-column:not(:has(.mhf-media-frame)) { display: flex; flex-direction: column; justify-content: center; }
}

/* News page: category chips only appear once there are real categories */
.mhf-cat-chips:has(.cat-item-none) { display: none !important; }

/* 4.2.1 — Header logo: sized by height so the wording stays readable (any logo shape works). */
.mhf-header .wp-block-site-logo, .mhf-header .wp-block-site-logo a { width: auto !important; max-width: none !important; flex-shrink: 0; }
.mhf-header .wp-block-site-logo img { height: 46px !important; max-height: none !important; width: auto !important; max-width: min(52vw, 360px) !important; object-fit: contain; }
@media (max-width: 600px) { .mhf-header .wp-block-site-logo img { height: 30px !important; } }
/* Header buttons never wrap onto two lines */
.mhf-header .wp-block-button__link { white-space: nowrap; }
/* Menu: the ☰ button is used below 1280px so the menu never wraps onto several rows */
@media (max-width: 1279px) {
	.mhf-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex !important; }
	.mhf-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none !important; }
	.mhf-header { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: #FFFFFF !important; }
}
@media (max-width: 380px) {
	.mhf-header .wp-block-site-logo img { height: 26px !important; }
	.mhf-header .wp-block-button.is-style-donate .wp-block-button__link { padding: 0.5em 0.85em; }
}
/* Room under the footer so the floating Donate and back-to-top buttons never cover the legal links */
#mhf-footer { padding-bottom: 5.5rem !important; }

/* ==========================================================================
   4.3 — MedEx Academy
   Stands out without a coloured button: the only menu item with an icon,
   a gold portal link in the top bar, and a deep-purple feature band on Home.
   ========================================================================== */
:root {
	--mhf-i-cap: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z'/%3E%3Cpath d='M22 10v6'/%3E%3Cpath d='M6 12.5V16a6 3 0 0 0 12 0v-3.5'/%3E%3C/svg%3E");
}
.icon-cap { --mhf-ic: var(--mhf-i-cap); }

/* Main menu item */
.mhf-header .wp-block-navigation .mhf-nav-academy > .wp-block-navigation-item__content { color: var(--wp--preset--color--teal-deep) !important; font-weight: 600; display: inline-flex; align-items: center; gap: 0.4em; }
.mhf-header .wp-block-navigation .mhf-nav-academy > .wp-block-navigation-item__content::before {
	content: ""; width: 1.25em; height: 1.25em; flex: none; background: currentColor;
	-webkit-mask: var(--mhf-i-cap) center / contain no-repeat; mask: var(--mhf-i-cap) center / contain no-repeat;
}

/* Top bar portal link */
.mhf-utility .mhf-util-links a.mhf-util-academy { color: var(--wp--preset--color--gold) !important; font-weight: 700; display: inline-flex; align-items: center; gap: 0.35em; margin-left: 0; }
.mhf-utility .mhf-util-links a.mhf-util-academy::before {
	content: ""; width: 1.2em; height: 1.2em; background: currentColor;
	-webkit-mask: var(--mhf-i-cap) center / contain no-repeat; mask: var(--mhf-i-cap) center / contain no-repeat;
}

/* Cap badge above “MedEx Academy” headings */
.mhf-cap-title::before {
	content: ""; display: block; width: 64px; height: 64px; margin: 0 auto 0.9rem; border-radius: 18px;
	background: var(--wp--preset--color--mist);
	box-shadow: inset 0 0 0 1.5px var(--wp--preset--color--sky);
}
.mhf-cap-title::after {
	content: ""; position: absolute; left: calc(50% - 17px); top: 15px; width: 34px; height: 34px; background: var(--wp--preset--color--teal-deep);
	-webkit-mask: var(--mhf-i-cap) center / contain no-repeat; mask: var(--mhf-i-cap) center / contain no-repeat;
}
.mhf-cap-title { position: relative; }
.mhf-cap-left::before { margin-left: 0; }
.mhf-cap-left::after { left: 15px; }
.has-brand-gradient-background .mhf-cap-title::before { background-color: rgba(255,255,255,0.12); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.35); }
.has-brand-gradient-background .mhf-cap-title::after { background: var(--wp--preset--color--gold); }

/* Home feature band */
.mhf-academy-band { text-align: center; }
.mhf-academy-band .mhf-cap-title { font-size: var(--wp--preset--font-size--xx-large); }

/* MedEx Academy page: “Launching soon” panel and portal buttons on the dark header */
.mhf-academy-portal { max-width: 560px; margin-top: 1.75rem !important; margin-left: max(0px, calc((100% - 1200px) / 2)) !important; margin-right: auto !important; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.28); border-radius: 14px; padding: 1.25rem 1.4rem; }
.mhf-academy-portal .mhf-academy-soon { margin: 0 0 0.85rem; }
#mhf-main .has-brand-gradient-background .mhf-academy-portal .mhf-academy-soon strong { color: var(--wp--preset--color--gold) !important; }
.mhf-academy-portal:has(.mhf-academy-buttons) { background: transparent; border: 0; padding: 0; }
.mhf-academy-buttons { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; }
.mhf-academy-buttons.is-content-justification-left { justify-content: flex-start; }
.mhf-academy-buttons.is-content-justification-center { justify-content: center; }
.mhf-academy .mhf-academy-intro { color: var(--wp--preset--color--muted); max-width: 56ch; margin: 0.6rem auto 0.4rem !important; }
.mhf-academy .mhf-academy-buttons { margin-top: 0.75rem; }
/* Header fit with the Academy item */
.mhf-header .wp-block-navigation .wp-block-navigation__container { gap: 1rem !important; }
.mhf-header .wp-block-buttons { flex-wrap: nowrap !important; }
.mhf-header .mhf-nav-academy > .wp-block-navigation-item__content { white-space: nowrap; }
@media (max-width: 1023px) {
	.mhf-utility .mhf-util-links a:not(.mhf-util-academy):not([href^="tel:"]) { display: none; }
}
/* ☰ menu: Get Support first, then Academy */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container > .mhf-nav-support { order: -2; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container > .mhf-nav-academy { order: -1; }
#mhf-main .has-brand-gradient-background .mhf-academy-buttons .is-style-text .wp-block-button__link { color: #FFFFFF !important; -webkit-text-fill-color: #FFFFFF !important; }
.mhf-academy .mhf-academy-buttons { margin-bottom: 0.25rem; }
