/*
Theme Name: ENRFO
Theme URI: https://enrfo.com/
Author: ENRFO
Author URI: https://enrfo.com/
Description: The public-facing theme for the ENRFO platform. Built around the ENRFO palette — Deep Navy Blue, Power Blue, Electric Cyan, Deep Teal, Teal Green and Energy Green — and designed to hand members straight over to the ENRFO dashboard. Works on its own, and lights up extra sections when the ENRFO plugins are active.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.6
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: enrfo-theme
Tags: custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, block-styles, wide-blocks, education
*/

/* ---------------------------------------------------------------- tokens */

:root {
	--enrfo-primary: #042b5c;    /* Deep Navy Blue  */
	--enrfo-secondary: #0a5898;  /* Power Blue      */
	--enrfo-accent: #0d9de1;     /* Electric Cyan   */
	--enrfo-teal: #165a74;       /* Deep Teal       */
	--enrfo-grid: #009b8c;       /* Teal Green      */
	--enrfo-success: #28b463;    /* Energy Green    */
	--enrfo-background: #ffffff; /* White           */

	--enrfo-ink: #12253d;
	--enrfo-muted: #56677e;
	--enrfo-line: #e1e8f0;
	--enrfo-line-strong: #c9d5e3;
	--enrfo-soft: #f3f6fa;

	--enrfo-radius: 14px;
	--enrfo-radius-sm: 9px;
	--enrfo-shadow: 0 1px 2px rgba(16, 32, 55, .06), 0 10px 30px rgba(16, 32, 55, .08);
	--enrfo-shadow-sm: 0 1px 2px rgba(16, 32, 55, .07);
	--enrfo-wrap: 1180px;
	--enrfo-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ------------------------------------------------------------------ base */

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

body {
	margin: 0;
	background: var(--enrfo-background);
	color: var(--enrfo-ink);
	font-family: var(--enrfo-font);
	font-size: 16px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.22; color: var(--enrfo-primary); font-weight: 700; }
h1 { font-size: clamp(28px, 4vw, 44px); }
h2 { font-size: clamp(23px, 3vw, 32px); }
h3 { font-size: clamp(18px, 2vw, 22px); }
p { margin: 0 0 1.1em; }

a { color: var(--enrfo-secondary); text-decoration: none; }
a:hover { color: var(--enrfo-primary); text-decoration: underline; }
img { max-width: 100%; height: auto; }
hr { border: 0; border-top: 1px solid var(--enrfo-line); margin: 40px 0; }

blockquote {
	margin: 24px 0; padding: 14px 22px;
	border-left: 4px solid var(--enrfo-accent);
	background: var(--enrfo-soft); border-radius: 0 var(--enrfo-radius-sm) var(--enrfo-radius-sm) 0;
	color: var(--enrfo-muted); font-style: italic;
}

code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
pre { padding: 16px; background: var(--enrfo-primary); color: #e8f1fa; border-radius: var(--enrfo-radius-sm); overflow-x: auto; }
code { padding: 2px 6px; background: var(--enrfo-soft); border-radius: 5px; }
pre code { padding: 0; background: none; color: inherit; }

table { width: 100%; border-collapse: collapse; margin: 0 0 24px; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--enrfo-line); text-align: left; }
th { background: var(--enrfo-soft); color: var(--enrfo-primary); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}

.skip-link {
	position: absolute; left: -9999px; top: 0; z-index: 100;
	padding: 12px 18px; background: var(--enrfo-primary); color: #fff; border-radius: 0 0 var(--enrfo-radius-sm) 0;
}
.skip-link:focus { left: 0; color: #fff; }

.enrfo-wrap { width: 100%; max-width: var(--enrfo-wrap); margin: 0 auto; padding: 0 20px; }

/* ---------------------------------------------------------------- header */

.site-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(255, 255, 255, .94);
	backdrop-filter: saturate(180%) blur(10px);
	border-bottom: 1px solid var(--enrfo-line);
}

.site-header__inner { display: flex; align-items: center; gap: 20px; min-height: 72px; }

.site-brand { display: flex; align-items: center; gap: 11px; }
.site-brand a { color: var(--enrfo-primary); text-decoration: none; }
.site-brand__mark {
	display: inline-flex; align-items: center; justify-content: center;
	width: 38px; height: 38px; border-radius: 11px;
	background: linear-gradient(135deg, var(--enrfo-accent), var(--enrfo-grid));
	color: #fff;
}
.site-brand__name { font-size: 20px; font-weight: 800; letter-spacing: .3px; line-height: 1.1; }
.site-brand__tag { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--enrfo-muted); }
.site-brand img { max-height: 44px; width: auto; }

.site-nav { margin-left: auto; }
.site-nav ul { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav li { position: relative; }
.site-nav a {
	display: block; padding: 9px 13px; border-radius: 9px;
	color: var(--enrfo-ink); font-size: 15px; font-weight: 600;
}
.site-nav a:hover { background: var(--enrfo-soft); color: var(--enrfo-primary); text-decoration: none; }
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a { color: var(--enrfo-secondary); background: var(--enrfo-soft); }

.site-nav ul ul {
	position: absolute; left: 0; top: calc(100% + 6px);
	display: none; flex-direction: column; gap: 0;
	min-width: 208px; padding: 6px;
	background: #fff; border: 1px solid var(--enrfo-line);
	border-radius: var(--enrfo-radius-sm); box-shadow: var(--enrfo-shadow);
}
.site-nav li:hover > ul, .site-nav li:focus-within > ul { display: flex; }

.site-actions { display: flex; align-items: center; gap: 10px; }
.site-header__toggle {
	display: none; align-items: center; justify-content: center;
	width: 42px; height: 42px; margin-left: auto;
	border: 1px solid var(--enrfo-line-strong); border-radius: 10px;
	background: #fff; color: var(--enrfo-primary); cursor: pointer;
}

/* --------------------------------------------------------------- buttons */

.enrfo-button {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 0 20px;
	border: 1px solid transparent; border-radius: 11px;
	font-size: 15px; font-weight: 700; cursor: pointer;
	transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.enrfo-button:hover { text-decoration: none; transform: translateY(-1px); }
.enrfo-button--primary { background: var(--enrfo-secondary); color: #fff; }
.enrfo-button--primary:hover { background: var(--enrfo-primary); color: #fff; }
.enrfo-button--accent { background: var(--enrfo-accent); color: #fff; }
.enrfo-button--accent:hover { background: var(--enrfo-secondary); color: #fff; }
.enrfo-button--ghost { border-color: var(--enrfo-line-strong); color: var(--enrfo-primary); background: #fff; }
.enrfo-button--ghost:hover { background: var(--enrfo-soft); color: var(--enrfo-primary); }
.enrfo-button--light { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .4); }
.enrfo-button--light:hover { background: rgba(255, 255, 255, .26); color: #fff; }
.enrfo-button--sm { min-height: 38px; padding: 0 15px; font-size: 14px; }

/* ------------------------------------------------------------------ hero */

.enrfo-hero {
	position: relative; overflow: hidden;
	padding: clamp(56px, 9vw, 104px) 0;
	background: linear-gradient(125deg, var(--enrfo-primary) 0%, var(--enrfo-teal) 58%, var(--enrfo-secondary) 100%);
	color: #fff;
}
.enrfo-hero h1 { color: #fff; max-width: 16ch; }
.enrfo-hero__lede { max-width: 58ch; font-size: clamp(16px, 1.6vw, 19px); color: rgba(255, 255, 255, .88); }
.enrfo-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.enrfo-hero__inner { position: relative; z-index: 2; }

.enrfo-hero__grid {
	position: absolute; right: -40px; bottom: -20px; z-index: 1;
	width: min(560px, 60%); color: #fff; opacity: .35;
}

.enrfo-hero__stats {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 14px; margin-top: 40px;
}
.enrfo-hero__stat {
	padding: 16px 18px; border-radius: var(--enrfo-radius);
	background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18);
}
.enrfo-hero__stat strong { display: block; font-size: 22px; line-height: 1.2; }
.enrfo-hero__stat span { font-size: 12.5px; text-transform: uppercase; letter-spacing: .07em; opacity: .8; }

/* -------------------------------------------------------------- sections */

.enrfo-section { padding: clamp(44px, 6vw, 78px) 0; }
.enrfo-section--soft { background: var(--enrfo-soft); }
.enrfo-section__head { max-width: 62ch; margin-bottom: 34px; }
.enrfo-section__eyebrow {
	display: inline-block; margin-bottom: 10px; padding: 4px 12px; border-radius: 999px;
	background: var(--enrfo-soft); color: var(--enrfo-secondary);
	font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.enrfo-section--soft .enrfo-section__eyebrow { background: #fff; }
.enrfo-section__head p { color: var(--enrfo-muted); margin-bottom: 0; }

.enrfo-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 20px; }

.enrfo-card {
	display: flex; flex-direction: column; gap: 10px;
	padding: 26px; border-radius: var(--enrfo-radius);
	background: #fff; border: 1px solid var(--enrfo-line);
	box-shadow: var(--enrfo-shadow-sm);
	transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.enrfo-card:hover { border-color: var(--enrfo-accent); box-shadow: var(--enrfo-shadow); transform: translateY(-2px); }
.enrfo-card h3 { margin: 0; }
.enrfo-card p { margin: 0; color: var(--enrfo-muted); font-size: 15px; }
.enrfo-card__icon {
	display: inline-flex; align-items: center; justify-content: center;
	width: 46px; height: 46px; margin-bottom: 4px; border-radius: 13px;
	background: rgba(4, 43, 92, .07); color: var(--enrfo-primary);
}
.enrfo-card:nth-child(3n+2) .enrfo-card__icon { background: rgba(22, 90, 116, .1); color: var(--enrfo-teal); }
.enrfo-card:nth-child(3n+3) .enrfo-card__icon { background: rgba(0, 155, 140, .1); color: var(--enrfo-grid); }
.enrfo-card__link { margin-top: auto; font-weight: 700; font-size: 14.5px; }

.enrfo-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 34px; align-items: center; }
.enrfo-checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.enrfo-checklist li { display: flex; gap: 11px; align-items: flex-start; color: var(--enrfo-muted); }
.enrfo-checklist svg { flex: 0 0 auto; margin-top: 3px; color: var(--enrfo-success); }

/* ------------------------------------------------------------------- cta */

.enrfo-cta {
	padding: clamp(34px, 5vw, 54px);
	border-radius: 20px;
	background: linear-gradient(120deg, var(--enrfo-primary), var(--enrfo-grid));
	color: #fff; text-align: center;
}
.enrfo-cta h2 { color: #fff; }
.enrfo-cta p { max-width: 56ch; margin: 0 auto 22px; color: rgba(255, 255, 255, .88); }
.enrfo-cta__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* --------------------------------------------------------------- content */

.site-main { padding: clamp(34px, 5vw, 60px) 0; }
.page-header { margin-bottom: 30px; }
.page-header p { color: var(--enrfo-muted); margin: 0; }

.entry {
	padding: clamp(22px, 3vw, 38px);
	background: #fff; border: 1px solid var(--enrfo-line);
	border-radius: var(--enrfo-radius); box-shadow: var(--enrfo-shadow-sm);
	margin-bottom: 26px;
}
.entry__meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--enrfo-muted); font-size: 13.5px; margin-bottom: 14px; }
.entry__thumb { margin: 0 0 20px; border-radius: var(--enrfo-radius-sm); overflow: hidden; }
.entry__more { font-weight: 700; }
.entry__content > *:last-child { margin-bottom: 0; }

.content-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }

.widget {
	padding: 22px; margin-bottom: 20px;
	background: #fff; border: 1px solid var(--enrfo-line);
	border-radius: var(--enrfo-radius);
}
.widget-title { font-size: 15px; text-transform: uppercase; letter-spacing: .05em; color: var(--enrfo-muted); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 7px 0; border-bottom: 1px dashed var(--enrfo-line); }
.widget li:last-child { border-bottom: 0; }

.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] {
	flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 14px;
	border: 1px solid var(--enrfo-line-strong); border-radius: 10px;
	font: inherit; font-size: 15px; color: var(--enrfo-ink); background: #fff;
}
.search-form input[type="search"]:focus { outline: 2px solid var(--enrfo-accent); outline-offset: 1px; }

.pagination { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0 30px; }
.pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 40px; height: 40px; padding: 0 12px;
	border: 1px solid var(--enrfo-line); border-radius: 10px;
	background: #fff; color: var(--enrfo-ink); font-weight: 600;
}
.pagination .page-numbers:hover { border-color: var(--enrfo-accent); text-decoration: none; }
.pagination .current { background: var(--enrfo-secondary); border-color: var(--enrfo-secondary); color: #fff; }

.enrfo-404 { text-align: center; padding: 60px 0; }
.enrfo-404__code { font-size: clamp(64px, 12vw, 120px); font-weight: 800; line-height: 1; color: var(--enrfo-accent); }

/* ---------------------------------------------------------------- footer */

.site-footer {
	margin-top: 40px; padding: clamp(40px, 5vw, 64px) 0 26px;
	background: var(--enrfo-primary); color: rgba(232, 241, 250, .85);
}
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--enrfo-accent); text-decoration: none; }
.site-footer h2, .site-footer h3, .site-footer .widget-title { color: #fff; }
.site-footer__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px; }
.site-footer .widget { padding: 0; margin: 0; background: none; border: 0; }
.site-footer li { border-bottom-color: rgba(255, 255, 255, .12); }
.site-footer__bottom {
	display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
	margin-top: 34px; padding-top: 20px;
	border-top: 1px solid rgba(255, 255, 255, .14);
	font-size: 13.5px;
}
.site-footer__brand { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; color: #fff; font-weight: 800; font-size: 19px; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 900px) {
	.content-sidebar { grid-template-columns: minmax(0, 1fr); }
	.site-header__toggle { display: inline-flex; }
	.site-nav {
		display: none; position: absolute; left: 0; right: 0; top: 100%;
		padding: 12px 20px 18px; background: #fff; border-bottom: 1px solid var(--enrfo-line);
		box-shadow: var(--enrfo-shadow);
	}
	.site-header.is-open .site-nav { display: block; }
	.site-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
	.site-nav ul ul { position: static; display: flex; box-shadow: none; border: 0; padding-left: 12px; }
	.site-actions { display: none; }
	.site-header.is-open .site-actions { display: flex; padding: 0 20px 16px; }
	.site-header__inner { flex-wrap: wrap; position: relative; }
}

@media (max-width: 600px) {
	.enrfo-hero__grid { display: none; }
	.enrfo-hero__actions .enrfo-button { width: 100%; }
	.enrfo-cta { border-radius: var(--enrfo-radius); }
}

@media (prefers-reduced-motion: reduce) {
	.enrfo-card, .enrfo-button { transition: none; }
}

/* ------------------------------------------------------- dark appearance */

/*
 * One set of tokens, redefined. Nothing below re-states a colour, so every
 * component that already uses the tokens changes with them.
 */
[data-enrfo-theme="dark"] {
	--enrfo-primary: #6ea9e8;
	--enrfo-secondary: #4f9ede;
	--enrfo-accent: #35b4ef;
	--enrfo-teal: #3d8fae;
	--enrfo-grid: #1fbcab;
	--enrfo-success: #46c97b;
	--enrfo-background: #0b1521;

	--enrfo-ink: #e8f1fa;
	--enrfo-muted: #9fb6ce;
	--enrfo-line: #22334a;
	--enrfo-line-strong: #2e4159;
	--enrfo-soft: #111c2b;

	--enrfo-shadow: 0 12px 34px rgba(0, 0, 0, .45);
	--enrfo-shadow-sm: 0 1px 3px rgba(0, 0, 0, .4);

	color-scheme: dark;
}

body { color-scheme: light dark; }

/* Images and illustrations are toned down a little so they do not glare. */
[data-enrfo-theme="dark"] img:not(.site-footer__logo):not(.enrfo-brand__logo) { filter: brightness(.92); }

/* --------------------------------------------------------- appearance UI */

.site-header__appearance {
	display: inline-flex; align-items: center; justify-content: center;
	width: 38px; height: 38px; padding: 0;
	border: 1px solid var(--enrfo-line);
	border-radius: 50%;
	background: transparent;
	color: var(--enrfo-ink);
	cursor: pointer;
	transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.site-header__appearance:hover { background: var(--enrfo-soft); border-color: var(--enrfo-line-strong); }
.site-header__appearance svg { display: block; }

[data-enrfo-theme="light"] .enrfo-theme-toggle__moon,
[data-enrfo-theme="dark"] .enrfo-theme-toggle__sun { display: none; }

[data-enrfo-theme="light"] .enrfo-brand__logo--dark,
[data-enrfo-theme="dark"] .enrfo-brand__logo--light { display: none; }

.enrfo-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.enrfo-brand__logo { max-height: 40px; width: auto; }
.enrfo-brand__text { font-weight: 700; font-size: 18px; color: var(--enrfo-primary); }

/* ------------------------------------------------------------ social row */

.enrfo-social { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }

.enrfo-social__link {
	display: inline-flex; align-items: center; justify-content: center;
	width: 34px; height: 34px;
	border: 1px solid var(--enrfo-line);
	border-radius: 50%;
	color: var(--enrfo-muted);
	transition: color .18s ease, background .18s ease, border-color .18s ease;
}

.enrfo-social__link:hover { color: #fff; background: var(--enrfo-secondary); border-color: transparent; }

.site-footer__logo { max-height: 40px; width: auto; }

/* ---------------------------------------------------------- back to top */

.enrfo-to-top {
	position: fixed; right: 20px; bottom: 20px; z-index: 60;
	display: inline-flex; align-items: center; justify-content: center;
	width: 44px; height: 44px; padding: 0;
	border: 1px solid var(--enrfo-line);
	border-radius: 50%;
	background: var(--enrfo-background);
	color: var(--enrfo-ink);
	box-shadow: var(--enrfo-shadow-sm);
	cursor: pointer;
	opacity: 0; visibility: hidden; transform: translateY(10px);
	transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
}

.enrfo-to-top.is-visible {
	opacity: 1; visibility: visible; transform: none;
	transition: opacity .2s ease, transform .2s ease, visibility 0s;
}

.enrfo-to-top:hover { background: var(--enrfo-secondary); color: #fff; border-color: transparent; }

@media (prefers-reduced-motion: reduce) {
	.enrfo-to-top, .site-header__appearance, .enrfo-social__link { transition: none; }
}
