/*
Theme Name: NFEM
Theme URI: https://nfem.org
Author: MOS Creative
Author URI: https://moscreative.com
Description: Custom theme for the National Foundation of Emergency Medicine, built from the V2 homepage design.
Version: 1.0.5
Requires at least: 6.4
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: nfem
*/

/* ---------- Tokens ---------- */
:root {
	--nfem-blue: #1766d5;
	--nfem-blue-dark: #1052af;
	--nfem-ink: #000;
	--nfem-ink-2: #202020;
	--nfem-ink-3: #121726;
	--nfem-body: #333845;
	--nfem-muted: #6b7380;
	--nfem-border: #e0e5f2;
	--nfem-tint: #f7fafe;
	--nfem-card-blue: #eff1fe;
	--nfem-card-peach: #fef4eb;
	--nfem-card-pink: #faeefa;
	--nfem-line: #d9dde5;
	--nfem-white: #fff;
	--nfem-container: 1312px;
	--nfem-gutter: 32px;
	--font-open: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-roboto: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-inter: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
	margin: 0;
	background: var(--nfem-white);
	color: var(--nfem-ink);
	font-family: var(--font-roboto);
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
p, h1, h2, h3, h4 { margin: 0; }
h1, h2, h3, h4 { overflow-wrap: break-word; }
:focus-visible { outline: 3px solid #ffbf47; outline-offset: 3px; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}
.skip-link:focus {
	position: fixed !important; top: 12px; left: 12px; z-index: 1000; width: auto; height: auto; clip: auto; clip-path: none;
	background: #fff; color: #000; padding: 10px 16px; border-radius: 8px; white-space: normal;
}

.nfem-container {
	width: 100%;
	max-width: calc(var(--nfem-container) + var(--nfem-gutter) * 2);
	margin: 0 auto;
	padding: 0 var(--nfem-gutter);
}

/* ---------- Pill buttons ---------- */
.nfem-btn {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	font-family: var(--font-open);
	font-size: 16px;
	line-height: 1.5;
	white-space: nowrap;
}
.nfem-btn__label,
.nfem-btn__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--nfem-blue);
	color: #fff;
	border-radius: 24px;
	transition: background-color .2s ease, transform .2s ease;
}
.nfem-btn__label { padding: 12px 24px; }
.nfem-btn__icon { width: 48px; height: 48px; flex: 0 0 48px; }
.nfem-btn__icon svg { width: 10.5px; height: 10.5px; }
.nfem-btn--upper .nfem-btn__label { text-transform: uppercase; }
.nfem-btn:hover .nfem-btn__label,
.nfem-btn:hover .nfem-btn__icon { background: var(--nfem-blue-dark); }
.nfem-btn:hover .nfem-btn__icon { transform: translateX(2px); }
.nfem-btn--light .nfem-btn__label,
.nfem-btn--light .nfem-btn__icon { background: #fff; color: #000; }
.nfem-btn--light:hover .nfem-btn__label,
.nfem-btn--light:hover .nfem-btn__icon { background: #e8effb; }

.nfem-deadline {
	display: block;
	margin-top: 10px;
	font-family: var(--font-open);
	font-size: 14px;
	line-height: normal;
}

/* ---------- Hero + header ---------- */
.nfem-hero {
	position: relative;
	min-height: 763px;
	color: #fff;
	background-color: #1d2a3d;
	background-size: cover;
	background-position: center;
	isolation: isolate;
	padding-bottom: 96px;
}
.nfem-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .5);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	z-index: -1;
}
.nfem-header__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding-top: 39px;
	padding-bottom: 39px;
	border-bottom: 1px solid rgba(255, 255, 255, .25);
}
.nfem-header__logo { display: block; flex: 0 0 auto; }
.nfem-header__logo img { width: 191px; height: 50px; object-fit: contain; object-position: left center; }
.nfem-header__nav { display: flex; align-items: center; gap: 32px; }

.nfem-hero__content {
	max-width: 1005px;
	margin: 0 auto;
	padding-top: 86px;
	text-align: center;
}
.nfem-hero__title {
	font-family: var(--font-open);
	font-weight: 700;
	font-size: clamp(34px, 4.2vw + 8px, 55px);
	line-height: 1.2;
}
.nfem-hero__tagline {
	margin-top: 16px;
	font-family: var(--font-open);
	font-weight: 600;
	font-size: clamp(19px, 1.4vw + 8px, 26px);
	line-height: normal;
}
.nfem-hero__sub {
	max-width: 692px;
	margin: 16px auto 0;
	font-family: var(--font-open);
	font-size: 16px;
	line-height: 1.5;
}
.nfem-hero__cta { margin-top: 32px; }
.nfem-hero__cta .nfem-deadline { margin-top: 10px; }

/* ---------- Intro + service cards ---------- */
.nfem-intro {
	position: relative;
	margin-top: -46px;
	background: #fff;
	border-radius: 50px 50px 0 0;
	padding: 80px 0 80px;
}
.nfem-intro__head {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 576px;
	gap: 80px;
	align-items: start;
}
.nfem-intro__title {
	font-family: var(--font-open);
	font-weight: 700;
	font-size: clamp(28px, 1.6vw + 14px, 36px);
	line-height: 1.2;
	max-width: 620px;
}
.nfem-intro__text {
	font-family: var(--font-open);
	font-size: 14px;
	line-height: 1.5;
}
.nfem-cards {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 24px;
	margin-top: 50px;
	min-height: 590px;
}
.nfem-cards__stack {
	display: grid;
	grid-template-rows: 1fr 1fr;
	gap: 24px;
}
.nfem-card {
	border-radius: 20px;
	font-family: var(--font-open);
}
.nfem-card--blue { background: var(--nfem-card-blue); padding: 50px; }
.nfem-card--peach { background: var(--nfem-card-peach); padding: 30px; }
.nfem-card--pink { background: var(--nfem-card-pink); padding: 30px; }
.nfem-card__icon { width: 50px; height: 50px; margin-bottom: 20px; }
.nfem-card--blue .nfem-card__icon { width: 80px; height: 80px; margin-bottom: 40px; }
.nfem-card__title {
	font-family: var(--font-open);
	font-weight: 700;
	font-size: 24px;
	line-height: 1.4;
}
.nfem-card__text { margin-top: 20px; font-size: 16px; line-height: 1.5; }
.nfem-card--blue .nfem-card__text { margin-top: 40px; }

/* ---------- Program section ---------- */
.nfem-program {
	background: var(--nfem-tint);
	padding: 84px 0 24px;
}
.nfem-program__main { padding-top: 6px; padding-bottom: 12px; }
.nfem-program__grid {
	display: grid;
	grid-template-columns: 270px minmax(0, 909px);
	justify-content: space-between;
	gap: 64px;
}
.nfem-stats {
	position: relative;
	padding-right: 24px;
}
.nfem-stats::after {
	content: "";
	position: absolute;
	top: 6px;
	right: -46px;
	height: 546px;
	width: 1px;
	background: var(--nfem-line);
}
.nfem-stat + .nfem-stat { margin-top: 83px; }
.nfem-stat__num {
	font-family: var(--font-inter);
	font-weight: 800;
	font-size: 48px;
	line-height: 1.4;
	color: var(--nfem-blue);
}
.nfem-stat__label {
	margin-top: 13px;
	font-family: var(--font-inter);
	font-weight: 500;
	font-size: 16px;
	line-height: 1.6;
	color: var(--nfem-ink-2);
	max-width: 259px;
}
.nfem-stats__cta { margin-top: 28px; }
.nfem-stats__cta .nfem-deadline { color: var(--nfem-body); }

.nfem-program__head { display: flex; align-items: center; gap: 40px; }
.nfem-program__mark { flex: 0 0 auto; width: 79px; height: 79px; }
.nfem-program__title {
	font-family: var(--font-roboto);
	font-weight: 700;
	font-size: clamp(28px, 1.6vw + 12px, 40px);
	line-height: 1.2;
}
.nfem-program__intro { margin-top: 24px; font-size: 18px; line-height: 1.5; }
.nfem-program__items { display: grid; gap: 40px; margin-top: 58px; }
.nfem-item {
	background: #fff;
	border-radius: 16px;
	padding: 24px;
}
.nfem-item__head { display: flex; align-items: center; gap: 16px; }
.nfem-item__icon { width: 40px; height: 40px; flex: 0 0 40px; }
.nfem-item__title { font-weight: 700; font-size: 20px; line-height: 1.4; }
.nfem-item__text { margin-top: 20px; font-size: 16px; line-height: 1.5; }

/* ---------- Recent achievements ---------- */
.nfem-achievements { padding: 80px 0 74px; }
.nfem-achievements__head {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 620px;
	gap: 40px;
	align-items: start;
}
.nfem-achievements__title {
	font-family: var(--font-roboto);
	font-weight: 700;
	font-size: clamp(28px, 1.6vw + 12px, 40px);
	line-height: 1.2;
}
.nfem-achievements__intro { font-size: 18px; line-height: 1.5; }
.nfem-achievements__grid {
	display: grid;
	grid-template-columns: 300px minmax(0, 1fr);
	gap: 24px;
	margin-top: 36px;
	align-items: start;
}
.nfem-featured { margin: 0; }
.nfem-featured img {
	width: 300px;
	height: 272px;
	border-radius: 16px;
	object-fit: cover;
	object-position: center;
}
.nfem-featured__name {
	margin-top: 10px;
	font-weight: 600;
	font-size: 18px;
	line-height: normal;
	color: var(--nfem-ink-3);
}
.nfem-featured__caption {
	margin-top: 10px;
	font-size: 14px;
	line-height: normal;
	color: var(--nfem-muted);
}
.nfem-ach-cards {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 24px;
}
.nfem-ach {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	background: #fff;
	border: 1px solid var(--nfem-border);
	border-radius: 16px;
	padding: 24px;
}
.nfem-ach__photo {
	flex: 0 0 64px;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	object-fit: cover;
	object-position: center 15%;
	background: var(--nfem-border);
}
.nfem-ach__body { min-width: 0; display: grid; gap: 4px; }
.nfem-ach__name { font-weight: 600; font-size: 18px; line-height: normal; color: var(--nfem-ink-3); }
.nfem-ach__meta { font-size: 14px; line-height: normal; color: var(--nfem-muted); }
.nfem-ach__text { font-size: 15px; line-height: 22px; color: var(--nfem-body); }
.nfem-ach__text p { margin: 0; }
.nfem-ach__text a { color: var(--nfem-blue); font-style: italic; }

/* ---------- Banner ---------- */
.nfem-banner__box {
	background: linear-gradient(90deg, var(--nfem-blue), var(--nfem-blue-dark));
	border-radius: 20px;
	color: #fff;
	min-height: 294px;
	padding: 53px 93px;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 44px;
	align-items: center;
}
.nfem-banner__title {
	font-family: var(--font-roboto);
	font-weight: 700;
	font-size: clamp(28px, 1.6vw + 12px, 40px);
	line-height: 1.2;
	max-width: 496px;
}
.nfem-banner__stats { display: flex; flex-wrap: wrap; gap: 24px 56px; }
.nfem-banner__num { font-family: var(--font-inter); font-weight: 800; font-size: 48px; line-height: normal; }
.nfem-banner__label { margin-top: 4px; font-family: var(--font-inter); font-weight: 500; font-size: 16px; line-height: normal; }
.nfem-banner__cta { margin-top: 32px; }
.nfem-banner__cta .nfem-deadline { font-family: var(--font-roboto); }

/* ---------- Footer ---------- */
.nfem-footer { padding-top: 60px; }
.nfem-footer__grid {
	position: relative;
	display: flex;
	justify-content: space-between;
	gap: 48px;
}
.nfem-footer__brand { width: 401px; max-width: 100%; }
.nfem-footer__logo { display: block; width: 193px; height: 50px; overflow: hidden; }
.nfem-footer__logo img { width: 193px; height: 50px; object-fit: cover; object-position: left center; }
.nfem-footer__desc { margin-top: 41px; font-size: 14px; line-height: 1.5; }
.nfem-footer__contacts { width: 252px; }
.nfem-footer__heading { font-weight: 600; font-size: 20px; line-height: 1.5; }
.nfem-footer__block { margin-top: 16px; font-size: 14px; line-height: 1.5; }
.nfem-footer__block + .nfem-footer__block { margin-top: 24px; }
.nfem-footer__label { font-weight: 600; margin-bottom: 4px; }
.nfem-footer__rule {
	margin-top: 16px;
	border: 0;
	border-top: 1px solid var(--nfem-line);
}
.nfem-footer__brand .nfem-footer__rule { margin-top: 87px; }

.nfem-email-reveal {
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	color: inherit;
	text-decoration: underline;
	cursor: pointer;
}
.nfem-email-check { margin-top: 8px; }
.nfem-email-check[hidden] { display: none; }
.nfem-email-check__human {
	display: inline-flex; align-items: center; gap: 8px; font-size: 14px;
	border: 1px solid var(--nfem-border); border-radius: 8px; padding: 8px 12px; background: #fff; cursor: pointer;
}
.nfem-email-check__msg { margin-top: 6px; font-size: 13px; color: var(--nfem-muted); }
.nfem-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.nfem-totop {
	position: absolute;
	right: -91px;
	top: 119px;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	border: 0;
	background: var(--nfem-blue);
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background-color .2s ease, transform .2s ease;
}
.nfem-totop:hover { background: var(--nfem-blue-dark); transform: translateY(-2px); }
.nfem-totop svg { width: 19px; height: 14px; transform: rotate(90deg); }

.nfem-bottom {
	margin-top: 38px;
	background: var(--nfem-blue);
	color: #fff;
	font-size: 14px;
	line-height: 1.5;
}
.nfem-bottom__row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px 24px;
	flex-wrap: wrap;
	padding-top: 5px;
	padding-bottom: 4px;
}
.nfem-bottom__links { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.nfem-bottom a { color: #fff; }
.nfem-bottom__credit a { font-weight: 600; }

/* ---------- Legal pages ---------- */
.nfem-page .entry-content { font-size: 16px; line-height: 1.6; color: var(--nfem-body); }
.nfem-page .entry-content p,
.nfem-page .entry-content ul { margin: 0 0 16px; }
.nfem-page .entry-content ul { padding-left: 24px; }
.nfem-page .entry-content a { color: var(--nfem-blue); }
.nfem-page .entry-content [id] { scroll-margin-top: 24px; }

/* ---------- Generic pages (index.php / page.php) ---------- */
.nfem-page { padding: 80px 0; }
.nfem-page .nfem-container { max-width: 880px; }
.nfem-page h1 { font-family: var(--font-open); font-size: 40px; line-height: 1.2; margin-bottom: 24px; }
.nfem-page-header { background: var(--nfem-blue); color: #fff; }
.nfem-page-header .nfem-header__bar { border-bottom: 0; padding-top: 24px; padding-bottom: 24px; }
.nfem-page-header .nfem-btn__label,
.nfem-page-header .nfem-btn__icon { background: #fff; color: var(--nfem-blue); }
.nfem-page-header .nfem-btn:hover .nfem-btn__label,
.nfem-page-header .nfem-btn:hover .nfem-btn__icon { background: #e8effb; }

/* ---------- Responsive ---------- */
@media (max-width: 1500px) {
	.nfem-totop {
		position: fixed; right: 20px; bottom: 20px; top: auto; z-index: 50;
		box-shadow: 0 6px 18px rgba(16, 82, 175, .3);
		opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s ease, background-color .2s ease;
	}
	.nfem-totop.is-visible { opacity: 1; visibility: visible; }
}
@media (max-width: 1200px) {
	.nfem-intro__head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; }
	.nfem-program__grid { grid-template-columns: 240px minmax(0, 1fr); gap: 48px; }
	.nfem-stats::after { right: -24px; }
	.nfem-achievements__head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
	.nfem-achievements__grid { grid-template-columns: 1fr; }
	.nfem-featured { display: grid; grid-template-columns: 300px 1fr; column-gap: 24px; align-items: end; }
	.nfem-banner__box { padding: 48px; }
}
@media (max-width: 992px) {
	:root { --nfem-gutter: 24px; }
	.nfem-hero { min-height: 0; padding-bottom: 110px; }
	.nfem-hero__content { padding-top: 72px; }
	.nfem-intro__head { grid-template-columns: 1fr; gap: 20px; }
	.nfem-intro__text { font-size: 16px; }
	.nfem-cards { grid-template-columns: 1fr; min-height: 0; }
	.nfem-cards__stack { grid-template-rows: auto; }
	.nfem-program__grid { grid-template-columns: 1fr; gap: 56px; }
	.nfem-program { padding-bottom: 72px; }
	.nfem-program__main { order: -1; padding: 0; }
	.nfem-stats { padding-right: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
	.nfem-stats::after { display: none; }
	.nfem-stat + .nfem-stat { margin-top: 0; }
	.nfem-stats__cta { grid-column: 1 / -1; margin-top: 8px; }
	.nfem-achievements__head { grid-template-columns: 1fr; gap: 16px; }
	.nfem-banner__box { grid-template-columns: 1fr; padding: 40px; gap: 32px; }
	.nfem-footer__grid { flex-direction: column; }
	.nfem-footer__grid { gap: 32px; }
	.nfem-footer__brand { width: 100%; }
	.nfem-footer__brand .nfem-footer__rule { display: none; }
	.nfem-footer__desc { margin-top: 24px; max-width: 520px; }
	.nfem-footer__contacts { width: 100%; }
}
@media (max-width: 768px) {
	.nfem-header__bar { padding-top: 20px; padding-bottom: 20px; }
	.nfem-header__logo img { width: 160px; height: 42px; }
	.nfem-intro { border-radius: 32px 32px 0 0; padding: 56px 0; }
	.nfem-card--blue { padding: 32px; }
	.nfem-card--blue .nfem-card__icon { width: 64px; height: 64px; margin-bottom: 24px; }
	.nfem-card--blue .nfem-card__text { margin-top: 20px; }
	.nfem-card__title { font-size: 22px; }
	.nfem-program { padding: 56px 0; }
	.nfem-program__main { padding: 0; }
	.nfem-program__head { gap: 20px; }
	.nfem-program__mark { width: 56px; height: 56px; }
	.nfem-program__intro { font-size: 16px; }
	.nfem-program__items { gap: 24px; margin-top: 32px; }
	.nfem-stats { grid-template-columns: 1fr; gap: 28px; }
	.nfem-stat__num { font-size: 40px; }
	.nfem-stat__label { margin-top: 4px; }
	.nfem-achievements { padding: 56px 0; }
	.nfem-achievements__intro { font-size: 16px; }
	.nfem-ach-cards { grid-template-columns: 1fr; }
	.nfem-featured { grid-template-columns: 1fr; }
	.nfem-featured img { width: 100%; height: auto; aspect-ratio: 300 / 272; }
	.nfem-banner__box { padding: 32px 24px; }
	.nfem-banner__num { font-size: 40px; }
	.nfem-footer { padding-top: 48px; }
	.nfem-bottom__row { justify-content: center; text-align: center; padding-top: 10px; padding-bottom: 10px; }
	.nfem-bottom__links { justify-content: center; }
}
@media (max-width: 480px) {
	:root { --nfem-gutter: 20px; }
	.nfem-header__logo img { width: 140px; height: 37px; }
	.nfem-header .nfem-btn__label { padding: 10px 18px; font-size: 15px; }
	.nfem-header .nfem-btn__icon { width: 44px; height: 44px; flex-basis: 44px; }
	.nfem-hero__content { padding-top: 56px; }
	.nfem-btn__label { padding: 12px 20px; }
	.nfem-card--peach, .nfem-card--pink { padding: 24px; }
	.nfem-ach { padding: 20px; }
	.nfem-ach__photo { flex-basis: 56px; width: 56px; height: 56px; }
}
