/*
Theme Name: LEV Foundation
Theme URI: https://levf.org
Author: LEV Foundation
Description: Block theme for levf.org. Hyke visual design (dark theme).
Version: 0.1.0
Requires at least: 6.0
Tested up to: 6.7
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: levf-theme
*/

/* Layout and structure are defined in theme.json and templates. */

/* ========== CSS variables (Hyke) ========== */
:root {
	--levf-color-text: #ffffff;
	--levf-color-bg: #000000;
	--levf-color-text-muted: #a0a0a0;
	--levf-color-accent: #4a90e2;
	--levf-color-accent-blue: #4a90e2;
	--levf-color-accent-green: #3dbe4a;
	--levf-color-surface: #121212;
	--levf-color-border: #333333;
	--levf-font-sans: Satoshi, sans-serif;
	--levf-font-serif: Satoshi, serif;
	--levf-radius-pill: 9999px;
	--levf-radius-card: 10px;
	--levf-space-unit: 0.25rem;
	--levf-space-s: calc(var(--levf-space-unit) * 2);
	--levf-space-m: calc(var(--levf-space-unit) * 4);
	--levf-space-l: calc(var(--levf-space-unit) * 6);
	--levf-nav-header-inset: 1rem;
	--levf-nav-pane-content-bg: #0a0a0a;
}

/* ========== Sticky footer (all pages): footer at bottom of viewport ========== */
/* WordPress wraps the block template in .wp-site-blocks; that wrapper must grow and be a flex column so main can push the footer down. */
html {
	height: 100%;
	scroll-behavior: smooth;
}

body {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
	font-family: var(--levf-font-sans);
	color: var(--levf-color-text);
	background-color: var(--levf-color-bg);
}

/* Template wrapper (WP adds .wp-site-blocks): take remaining height and become flex column so main can grow */
body > .wp-site-blocks {
	flex: 1 0 auto;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.levf-main {
	flex: 1 0 auto;
}

/* ========== Global structural rules ========== */
.levf-main {
	/* Constrained width aligns with theme.json contentSize/wideSize */
	max-width: var(--wp--style--global--wide-size, 1200px);
	margin-left: auto;
	margin-right: auto;
}

/* ========== Global aesthetic rules ========== */

a {
	color: var(--levf-color-accent-blue);
}

a:hover {
	opacity: 0.85;
}

a:focus-visible {
	outline: 2px solid var(--levf-color-accent-blue);
	outline-offset: 2px;
}

.home .levf-header-breadcrumb {
	display: none;
}

/* ========== Responsive rules ========== */
/* Mobile-first: base styles target narrow viewports; enhance/override at 1024px+ for desktop. */
@media (min-width: 1024px) {
	/* Example: hide the footer "Share" action on desktop. */
	.levf-footer-actions a.levf-footer-action-share {
		display: none;
	}
}

/* ========== Page-specific rules ========== */

/* --- Header --- */
.levf-header {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	box-sizing: border-box;
	padding: var(--levf-space-s) var(--levf-space-m);
	background: var(--levf-color-bg);
	position: relative;
	z-index: 110;
}

.levf-header-brand-col {
	justify-self: start;
	min-width: 0;
}

.levf-header-band {
	flex: 1;
	min-width: 0;
	align-items: center;
	box-sizing: border-box;
	display: flex;
	flex-wrap: nowrap;
	gap: var(--levf-space-m);
	padding-right: 0.5rem;
}

.levf-header-brand {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.25rem;
	min-width: 0;
}

.levf-header-brand-mark,
.levf-brand-logo {
	display: inline-flex;
	line-height: 0;
}

.levf-brand-logo img,
.levf-header-brand-logo {
	display: block;
	height: 32px;
	width: auto;
	max-width: 100px;
}

.levf-header-top-nav {
	display: none;
	justify-self: center;
	grid-column: 2;
}

.levf-header-actions {
	justify-self: end;
	grid-column: 3;
}

.levf-header-top-nav__list {
	display: flex;
	flex-wrap: nowrap;
	gap: 1.75rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.levf-header-top-nav__item {
	position: relative;
}

.levf-header-top-nav__item > a {
	color: #bbbbbb;
	text-decoration: none;
	font-size: 0.95rem;
	white-space: nowrap;
	display: inline-block;
	padding: 0.35rem 0;
}

.levf-header .levf-header-top-nav__item > a {
	color: #bbbbbb;
}

.levf-header-top-nav__item > a:hover,
.levf-header-top-nav__item:focus-within > a {
	color: var(--levf-color-text);
}

.levf-header-top-nav__submenu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 14rem;
	margin: 0;
	padding: 0.5rem 0;
	list-style: none;
	background: var(--levf-color-surface);
	border: 1px solid var(--levf-color-border);
	border-radius: var(--levf-radius-card);
	z-index: 120;
}

.levf-header-top-nav__item--has-children:hover > .levf-header-top-nav__submenu,
.levf-header-top-nav__item--has-children:focus-within > .levf-header-top-nav__submenu {
	display: block;
}

.levf-header-top-nav__subitem {
	position: relative;
}

.levf-header-top-nav__subitem a {
	display: block;
	padding: 0.45rem 1rem;
	color: var(--levf-color-text);
	text-decoration: none;
	font-size: 0.9rem;
	white-space: nowrap;
}

.levf-header-top-nav__subitem a:hover {
	background: rgba(255, 255, 255, 0.06);
}

.levf-header-top-nav__submenu--flyout {
	top: 0;
	left: 100%;
}

.levf-header-top-nav__subitem--has-children:hover > .levf-header-top-nav__submenu--flyout,
.levf-header-top-nav__subitem--has-children:focus-within > .levf-header-top-nav__submenu--flyout {
	display: block;
}

.levf-header-breadcrumb {
	font-size: 0.85rem;
	color: var(--levf-color-text-muted);
}

.levf-header-breadcrumb a {
	color: var(--levf-color-text-muted);
}

@media (min-width: 1024px) {
	.levf-header-top-nav {
		display: flex;
	}
}

.levf-header-inner {
	flex: 1;
	min-width: 0;
	align-items: center;
}

/*
 * Floating header: slide the band (brand + border/backdrop) off-screen.
 * Nav trigger stays a fixed sibling — never transform an ancestor of the trigger.
 */
body.levf-header-floating .levf-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 95;
	background: transparent;
	border-bottom: none;
	pointer-events: none;
	overflow: hidden;
	max-height: 0;
	transition: max-height 250ms ease;
}

body.levf-header-floating.levf-header-visible .levf-header {
	max-height: 6rem;
}

body.levf-header-floating .levf-header-brand-col {
	background: var(--levf-color-bg);
	transform: translateY(-100%);
	transition: transform 250ms ease;
	pointer-events: auto;
}

body.levf-header-floating.levf-header-visible .levf-header-brand-col {
	transform: translateY(0);
}

body.levf-header-floating .levf-header-actions {
	min-width: 0;
	width: 0;
	height: 0;
	overflow: visible;
	pointer-events: auto;
}

body.admin-bar.levf-header-floating .levf-header {
	top: var(--wp-admin--admin-bar--height, 32px);
}

@media (max-width: 782px) {
	body.admin-bar.levf-header-floating .levf-header {
		top: var(--wp-admin--admin-bar--height, 46px);
	}
}

body.levf-header-floating .levf-main {
	padding-top: 4.5rem;
}

/* --- Footer --- */
.levf-footer {
	border-top: 1px solid var(--levf-color-border);
	padding-left: var(--levf-space-m);
	padding-right: var(--levf-space-m);
}

.levf-footer-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
	align-items: center;
}

.levf-footer-actions .levf-footer-action-icon {
	width: 1em;
	height: 1em;
	vertical-align: middle;
}

.levf-footer-actions a {
	display: inline-flex;
	align-items: center;
	gap: 1em;
	padding: 0.35em 0;
}

.levf-footer-brand,
.levf-footer-brand img,
.levf-footer-brand span {
	display: block;
}

.levf-footer-brand .levf-footer-brand-logo {
	max-height: 2.5em;
	width: auto;
}

.levf-footer-social {
	/* Social icons row */
}

/* --- Nav trigger --- */
/*
 * Fixed corner position uses core's --wp-admin--admin-bar--height (0px when logged out).
 * @see https://developer.wordpress.org/reference/functions/wp_admin_bar_render/
 */

/* One-time layout measure at page top before fixed coordinates are applied */
body.levf-nav-trigger-measure .levf-header-actions .levf-nav-trigger-icon {
	position: static;
	top: auto;
	right: auto;
}

.levf-header-actions {
	align-items: center;
	min-width: 2.75rem;
	flex-shrink: 0;
}

.levf-nav-trigger-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: fixed;
	top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--levf-nav-trigger-inset, var(--levf-nav-header-inset)));
	right: var(--levf-nav-trigger-inset, var(--levf-nav-header-inset));
	z-index: 100;
	text-decoration: none;
}

.levf-nav-trigger-icon__btn {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 5px;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 50%;
	background: var(--levf-color-surface);
	border: none;
	box-sizing: border-box;
	box-shadow: none;
}

.levf-nav-trigger-icon__bar {
	display: block;
	width: 1.1rem;
	height: 2px;
	background: var(--levf-color-text);
	border-radius: 1px;
}

/* --- Home blocks --- */

.levf-main--home {
	max-width: none;
	width: 100%;
	padding-left: var(--levf-space-m);
	padding-right: var(--levf-space-m);
	box-sizing: border-box;
}

/* Above the fold: two-column layout; section fills viewport on homepage */
.levf-home-above-fold {
	align-items: stretch;
	min-height: calc(100vh - 4.5rem);
	min-height: calc(100dvh - 4.5rem);
	position: relative;
	overflow: hidden;
}

.levf-home-above-fold::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 1vh;
	background: linear-gradient(to bottom, transparent, #000);
	pointer-events: none;
	z-index: 4;
}

.levf-home-hero-col {
	position: relative;
	min-height: calc(100dvh - 4.5rem);
	overflow: hidden;
}

/* Right column: moon band + flexible gap + cards (Hyke vertical rhythm) */
.levf-home-above-fold > .wp-block-column {
	align-self: stretch;
}

.levf-home-highlights-col {
	position: relative;
	display: block !important;
	min-height: calc(100dvh - 4.5rem);
	height: 100%;
	padding: 0 0.35rem 0 0.15rem;
	box-sizing: border-box;
}

/* Hyke desktop: moon ~13% from fold top; card stack ~42% (see Desktop viable start.png) */
.levf-home-highlights-col > p:has(.levf-home-highlights__moon-wrap),
.levf-home-highlights-col > .levf-home-highlights__moon-wrap,
.levf-home-highlights-col > p:has(.levf-home-highlights__moon) {
	position: absolute;
	top: 13%;
	left: 50%;
	transform: translateX(-50%);
	margin: 0;
	width: 100%;
	text-align: center;
	z-index: 2;
}

.levf-home-highlights-col > p:has(.levf-home-highlights-stack),
.levf-home-highlights-col > .levf-home-highlights-stack {
	position: absolute;
	top: 42%;
	left: 0;
	right: 0;
	margin: 0;
	width: 100%;
	z-index: 2;
}

.levf-home-highlights__moon-wrap {
	display: block;
	text-align: center;
}

.levf-home-highlights__moon {
	display: block;
	width: 152px;
	max-width: 82%;
	height: auto;
	margin: 0 auto;
	pointer-events: none;
}

.levf-home-highlights-stack {
	position: relative;
	z-index: 2;
	width: 92%;
	max-width: 21.5rem;
	margin: 0 auto;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
}

.levf-home-highlights-col .levf-highlights {
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
	width: 100%;
}

.levf-home-highlights-col .levf-home-highlight-item {
	flex: 0 0 auto;
}

/* Hyke homepage hero stage */
.levf-home-hero-stage {
	position: relative;
	min-height: 100%;
	height: 100%;
	padding-top: var(--levf-space-m);
}

.levf-home-hero__copy {
	position: relative;
	z-index: 3;
	max-width: 36rem;
	padding-top: 2em;
	padding-left: 3em;
}

.levf-home-hero__headline {
	margin: 0 0 var(--levf-space-s);
	font-size: clamp(1.75rem, 4vw, 2.75rem);
	font-weight: 700;
	line-height: 1.2;
	color: var(--levf-color-text);
	text-transform: none;
	display: flex;
	flex-direction: column;
	gap: 0.15em;
}

.levf-home-hero__line1,
.levf-home-hero__line2 {
	display: block;
}

.levf-home-hero__line1 {
	font-style: italic;
}

.levf-home-hero__line2 {
	font-size: 0.8em;
	text-align: center;
}

.levf-home-hero__gravity {
	color: var(--levf-color-accent-blue);
	font-style: italic;
}

.levf-home-hero__subline {
	margin: 0;
	font-size: 1.6rem;
	font-weight: 700;
	font-style: italic;
	text-align: right;
	color: var(--levf-color-text);
}

.levf-home-hero__earth-wrap {
	position: absolute;
	left: 25%;
	top: 87.5%;
	width: min(130%, 58rem);
	transform: translate(-50%, -50%) scale(1.3);
	z-index: 1;
	pointer-events: none;
	mask-image: linear-gradient(to bottom, #000 0%, #000 calc(100% - 1vh), transparent 100%);
	-webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 calc(100% - 1vh), transparent 100%);
}

.levf-home-hero__earth-wrap .levf-home-hero__hotspot {
	pointer-events: auto;
}

.levf-home-hero__earth {
	display: block;
	width: 100%;
	height: auto;
}

.levf-home-hero__hotspot {
	position: absolute;
	display: flex;
	align-items: center;
	gap: 0.35rem;
	text-decoration: none;
	color: var(--levf-color-text);
	font-size: 0.7rem;
	z-index: 3;
}

.levf-home-hero__hotspot-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--levf-color-text);
	flex-shrink: 0;
}

.levf-home-hero__hotspot-label {
	border: 1px solid var(--levf-color-text);
	padding: 0.2rem 0.45rem;
	background: rgba(0, 0, 0, 0.35);
	white-space: nowrap;
}

/* Pin positions tuned on desktop (percentages relative to earth-wrap) */
.levf-home-hero__hotspot--rmr1 {
	left: 30.7%;
	top: 30.1%;
	transform: translate(0, -50%);
}

.levf-home-hero__hotspot--rmr2-es {
	left: 72%;
	top: 34.6%;
	/* Dot on the right; anchor right edge to the pin coordinates */
	transform: translate(-100%, -50%);
}

.levf-home-hero__hotspot--rmr2-it {
	left: 81%;
	top: 35%;
	transform: translate(0, -50%);
}

/* Above-fold bottom-left (hero column, not earth image) */
.levf-home-hero__program {
	position: absolute;
	left: 2em;
	bottom: 2em;
	z-index: 4;
}

.levf-home-hero__program-title {
	margin: 0 0 0.25rem;
	font-weight: 700;
	font-size: 1rem;
	color: var(--levf-color-text);
}

.levf-home-hero__program-link {
	margin: 0;
	font-size: 0.9rem;
}

.levf-home-hero__program-link a {
	color: var(--levf-color-text);
	text-decoration: underline;
}

/* Highlights sidebar */
.levf-highlights-heading {
	margin-top: 0;
	margin-bottom: var(--levf-space-m);
}

.levf-highlights {
	display: flex;
	flex-direction: column;
	gap: var(--levf-space-m);
}

/* Below the fold: Latest Posts */
.levf-latest-posts-header,
.levf-latest-posts-query,
.levf-latest-posts-see-more--footer,
.levf-main--home .levf-full-archive-link {
	max-width: var(--wp--style--global--content-size, 720px);
	width: 100%;
	margin-left: auto;
	margin-right: auto;
}

.levf-latest-posts-header {
	margin-top: var(--levf-space-l);
	margin-bottom: var(--levf-space-m);
}

.levf-latest-posts-heading {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 500;
}

.levf-latest-posts-heading__link {
	color: var(--levf-color-text);
	text-decoration: none;
}

.levf-latest-posts-heading__link:hover {
	opacity: 0.85;
}

.levf-latest-posts-see-more--footer {
	margin: 1em auto 0;
	text-align: center;
	width: 100%;
}

.levf-latest-posts-see-more__link {
	display: inline-block;
	padding: 0.5rem 1.35rem;
	background: #090909;
	color: var(--levf-color-text);
	text-decoration: none;
	border-radius: var(--levf-radius-pill);
	font-size: 1.05rem;
	border: 1px solid #1a1a1a;
}

.levf-latest-posts-see-more__link:hover {
	opacity: 0.9;
}

.levf-latest-posts-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: var(--levf-space-m);
	list-style: none;
	padding: 0;
	margin: 0;
}

.levf-latest-posts-grid > li:first-child {
	grid-column: 1 / -1;
}

.levf-latest-posts-grid > li:not(:first-child) {
	display: flex;
}

.levf-latest-posts-grid > li:not(:first-child) .levf-latest-posts-item {
	flex: 1;
	width: 100%;
}

.levf-latest-posts-item,
.levf-home-highlight-item {
	--levf-latest-posts-thumb-width: 9rem;
	--levf-latest-posts-thumb-height: calc(var(--levf-latest-posts-thumb-width) * 9 / 16);
	position: relative;
	padding: 1em;
	background: #090909;
	border: 1px solid #1a1a1a;
	border-radius: 6px;
	transition: filter 100ms ease;
}

@media (hover: hover) {
	.levf-latest-posts-item:hover,
	.levf-latest-posts-item:has(.levf-latest-posts-item__link:focus-visible),
	.levf-home-highlight-item:hover,
	.levf-home-highlight-item:has(.levf-home-highlight-item__link:focus-visible) {
		filter: brightness(1.4);
	}
}

.levf-latest-posts-grid > li:first-child .levf-latest-posts-item,
.levf-latest-posts-item--featured {
	--levf-latest-posts-thumb-width: 18rem;
}

.levf-latest-posts-item__link-wrap,
.levf-home-highlight-item__link-wrap {
	position: absolute;
	inset: 0;
	z-index: 1;
	margin: 0;
	padding: 0;
}

.levf-latest-posts-item__link,
.levf-home-highlight-item__link {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 6px;
}

.levf-latest-posts-item > p:has(.levf-latest-posts-item__link) {
	position: absolute;
	inset: 0;
	z-index: 1;
	margin: 0;
	padding: 0;
}

.levf-latest-posts-item__link:focus-visible,
.levf-home-highlight-item__link:focus-visible {
	outline: 2px solid var(--levf-color-accent-blue, #4a90e2);
	outline-offset: 2px;
}

.levf-latest-posts-item__image,
.levf-latest-posts-item__body,
.levf-home-highlight-item__image,
.levf-home-highlight-item__body {
	position: relative;
	z-index: 0;
}

.levf-latest-posts-item:not(:has(.levf-latest-posts-item__image)),
.levf-home-highlight-item:not(:has(.levf-home-highlight-item__image)) {
	display: grid;
	grid-template-columns: var(--levf-latest-posts-thumb-width) 1fr;
	align-items: center;
	column-gap: var(--levf-space-m);
}

.levf-latest-posts-item:not(:has(.levf-latest-posts-item__image))::before,
.levf-home-highlight-item:not(:has(.levf-home-highlight-item__image))::before {
	content: "";
	width: var(--levf-latest-posts-thumb-width);
	height: var(--levf-latest-posts-thumb-height);
	border-radius: 16px;
	background-color: #121212;
	grid-column: 1;
	grid-row: 1 / -1;
	align-self: center;
}

.levf-latest-posts-item:not(:has(.levf-latest-posts-item__image)) .levf-latest-posts-item__body,
.levf-home-highlight-item:not(:has(.levf-home-highlight-item__image)) .levf-home-highlight-item__body {
	grid-column: 2;
}

.levf-latest-posts-item:has(.levf-latest-posts-item__image),
.levf-home-highlight-item:has(.levf-home-highlight-item__image) {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: var(--levf-space-m);
}

.levf-latest-posts-item__image,
.levf-home-highlight-item__image {
	flex: 0 0 var(--levf-latest-posts-thumb-width);
	width: var(--levf-latest-posts-thumb-width);
	max-width: var(--levf-latest-posts-thumb-width);
	margin: 0;
	line-height: 0;
	align-self: center;
	overflow: hidden;
	border-radius: 16px;
}

.levf-latest-posts-item__image img,
.levf-home-highlight-item__image img {
	display: block;
	width: 100%;
	height: var(--levf-latest-posts-thumb-height);
	max-width: var(--levf-latest-posts-thumb-width);
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: 16px;
	border: none;
	background-color: #121212;
}

.levf-latest-posts-item__body,
.levf-home-highlight-item__body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.75em;
}

.levf-latest-posts-grid > li:first-child .levf-latest-posts-item__body,
.levf-latest-posts-item--featured .levf-latest-posts-item__body {
	gap: 1.5em;
}

.levf-latest-posts-item__title,
.levf-home-highlight-item__title {
	margin: 0;
	font-size: 0.95em;
	font-weight: 600;
	line-height: 1.3;
	color: var(--levf-color-text);
}

.levf-latest-posts-grid > li:first-child .levf-latest-posts-item__title,
.levf-latest-posts-item--featured .levf-latest-posts-item__title {
	font-size: 1.1em;
}

.levf-latest-posts-item__excerpt,
.levf-home-highlight-item__excerpt {
	margin: 0;
	font-size: 0.9em;
	color: var(--levf-color-text-muted);
	line-height: 1.45;
}

.levf-latest-posts-item__excerpt p,
.levf-latest-posts-item__excerpt span,
.levf-home-highlight-item__excerpt p,
.levf-home-highlight-item__excerpt span {
	margin: 0;
}

.levf-latest-posts-grid > li:not(:first-child) .levf-latest-posts-item__excerpt,
.levf-home-highlight-item__excerpt {
	display: none;
}

.levf-latest-posts-item__date {
	margin: 0;
	font-size: 0.82em;
	color: var(--levf-color-text-muted);
	line-height: 1.3;
}

.levf-full-archive-link {
	margin-top: var(--levf-space-m);
	margin-bottom: var(--levf-space-l);
}

.levf-full-archive-link a {
	color: var(--levf-color-text-muted);
}

/* Posts archive (/posts): thumbnail + meta list */
.levf-posts-archive-intro {
	margin-bottom: var(--levf-space-l);
}

.levf-posts-archive-intro > :first-child {
	margin-top: 0;
}

.levf-posts-archive-intro > :last-child {
	margin-bottom: 0;
}

.levf-posts-archive-header {
	margin-bottom: var(--levf-space-l);
}

.levf-posts-archive-header__title {
	margin: 0 0 0.5em;
	font-size: 1.35rem;
	font-weight: 600;
}

.levf-posts-archive-header__description {
	margin: 0 0 var(--levf-space-m);
	font-size: 0.95em;
	color: var(--levf-color-text-muted);
	line-height: 1.5;
}

.levf-posts-archive-header__description p {
	margin: 0 0 0.75em;
}

.levf-posts-archive-header__description p:last-child {
	margin-bottom: 0;
}

.levf-posts-archive-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.levf-posts-archive-item {
	--levf-posts-archive-thumb-width: 12.5rem;
	--levf-posts-archive-thumb-height: calc(var(--levf-posts-archive-thumb-width) * 9 / 16);
	display: flex;
	flex-direction: row;
	align-items: stretch;
	gap: var(--levf-space-m);
	margin-bottom: var(--levf-space-l);
}

/* Reserve thumbnail column when no featured image is present. */
.levf-posts-archive-item:not(:has(.levf-posts-archive-item__image))::before {
	content: "";
	flex: 0 0 var(--levf-posts-archive-thumb-width);
	width: var(--levf-posts-archive-thumb-width);
	height: var(--levf-posts-archive-thumb-height);
	align-self: center;
}

.levf-posts-archive-item__image {
	flex: 0 0 var(--levf-posts-archive-thumb-width);
	width: var(--levf-posts-archive-thumb-width);
	max-width: var(--levf-posts-archive-thumb-width);
	align-self: stretch;
	display: flex;
	align-items: center;
	margin: 0;
	min-height: 0;
	overflow: hidden;
	line-height: 0;
}

.levf-posts-archive-item__image a {
	display: block;
	width: 100%;
	max-height: var(--levf-posts-archive-thumb-height);
	overflow: hidden;
	line-height: 0;
}

.levf-posts-archive-item__image img {
	display: block;
	width: 100%;
	height: var(--levf-posts-archive-thumb-height);
	max-width: var(--levf-posts-archive-thumb-width);
	max-height: var(--levf-posts-archive-thumb-height);
	min-width: 0;
	min-height: 0;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	background-color: var(--levf-color-surface);
}

.levf-posts-archive-item__body {
	flex: 1;
	min-width: 0;
	align-self: stretch;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.levf-posts-archive-item__title {
	margin: 0 0 0.35em;
	font-size: 1.05em;
}

.levf-posts-archive-item__title a {
	color: var(--levf-color-text);
	text-decoration: none;
	font-weight: 600;
}

.levf-posts-archive-item__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.5em;
	margin: 0 0 0.5em;
	font-size: 0.82em;
	line-height: 1.4;
	color: var(--levf-color-text-muted);
}

.levf-posts-archive-item__date {
	margin: 0;
	line-height: inherit;
}

.levf-posts-archive-item__categories {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.35em;
	margin: 0;
	line-height: inherit;
}

.levf-posts-archive-item__categories a {
	display: inline-block;
	padding: 0 0.45em;
	margin: 0;
	border: 1px solid #ccc;
	color: var(--levf-color-text-muted);
	text-decoration: none;
	font-size: inherit;
	line-height: inherit;
	vertical-align: baseline;
	box-sizing: border-box;
}

.levf-posts-archive-item__excerpt {
	margin: 0;
	font-size: 0.95em;
	color: var(--levf-color-text-muted);
}

.levf-posts-archive-item__excerpt p {
	margin: 0;
}

.levf-posts-archive-pagination {
	margin-top: 1em;
	margin-bottom: 1em;
	justify-content: center;
	align-items: center;
	font-size: calc(1em + 2pt);
	gap: 1.6em;
}

.levf-posts-archive-pagination::before {
	content: "Page: ";
}

.levf-posts-archive-pagination .wp-block-query-pagination-numbers {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1.6em;
}

.levf-posts-archive-pagination .page-numbers {
	margin: 0;
}

/* Legacy class names (kept for any existing references) */
.levf-home-intro {
	/* Hero / mission intro - now part of .levf-home-hero */
}

.levf-home-rmr {
	/* RMR section */
}

/* ========== Navigation pane (overlay / sidebar) ========== */

/* Overlay: semi-opaque backdrop; hidden until nav opens or hover grace */
.levf-nav-overlay {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 998;
	background: rgba(0, 0, 0, 0.4);
	opacity: 0;
	pointer-events: none;
}

body.is-nav-hover-grace .levf-nav-overlay,
body.is-nav-open .levf-nav-overlay {
	display: block;
}

body.is-nav-open .levf-nav-overlay {
	pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
	body.is-nav-hover-grace .levf-nav-overlay,
	body.is-nav-open .levf-nav-overlay {
		opacity: 1;
	}
}

body.admin-bar .levf-nav-overlay {
	top: 32px;
}

@media (min-width: 782px) {
	body.admin-bar .levf-nav-overlay {
		top: 46px;
	}
}

/* Pane: hidden until open (display:none avoids visibility:inherit leaks from active panels) */
.levf-nav-pane {
	display: none;
	position: fixed;
	z-index: 999;
	background: var(--levf-color-bg);
	box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
	flex-direction: column;
	height: 100vh;
	height: 100dvh;
}

body.is-nav-open .levf-nav-pane,
body.is-nav-open .levf-nav-pane.levf-nav-pane--open {
	display: flex;
}

body.admin-bar .levf-nav-pane {
	top: 32px;
	height: calc(100vh - 32px);
	height: calc(100dvh - 32px);
}

@media (min-width: 782px) {
	body.admin-bar .levf-nav-pane {
		top: 46px;
		height: calc(100vh - 46px);
		height: calc(100dvh - 46px);
	}
}

/* Mobile: full-screen overlay and pane */
.levf-nav-pane {
	inset: 0;
	top: 0;
	right: 0;
	left: 0;
	bottom: 0;
	width: 100%;
}

body.admin-bar .levf-nav-pane {
	inset: 32px 0 0 0;
}

@media (min-width: 782px) {
	body.admin-bar .levf-nav-pane {
		inset: 46px 0 0 0;
	}
}

/* Desktop: right sidebar + overlay covers remainder */
@media (min-width: 1024px) {
	.levf-nav-pane {
		left: auto;
		width: min(35vw, 28rem);
		max-width: 100%;
	}

	body.admin-bar .levf-nav-pane {
		inset: 46px 0 0 auto;
		width: min(35vw, 28rem);
		height: calc(100dvh - 46px);
	}
}

/* Pane layout: three stacked sections */
.levf-nav-pane__top {
	flex-shrink: 0;
	padding: var(--levf-space-m);
	border-bottom: 1px solid var(--levf-color-border);
}

.levf-nav-pane__top-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
}

.levf-nav-pane__logo {
	margin: 0;
	font-size: 1.25rem;
}

.levf-nav-pane__close {
	background: var(--levf-color-surface);
	border: none;
	border-radius: 50%;
	width: 2.25rem;
	height: 2.25rem;
	font-size: 1.25rem;
	line-height: 1;
	padding: 0;
	cursor: pointer;
	color: var(--levf-color-text);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.levf-nav-pane__close:hover {
	opacity: 0.8;
}

.levf-nav-pane__search-wrap {
	margin-top: var(--levf-space-s);
}

.levf-nav-pane__search-form {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.35rem 0.75rem;
	border: 1px solid var(--levf-color-border);
	border-radius: var(--levf-radius-pill);
	background: transparent;
}

.levf-nav-pane__search-icon-btn,
.levf-nav-pane__search-chevron-btn {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: none;
	background: transparent;
	cursor: pointer;
	color: var(--levf-color-text);
	line-height: 1;
}

.levf-nav-pane__search-icon-btn img {
	display: block;
	width: 1.25rem;
	height: 1.25rem;
}

.levf-nav-pane__search-input {
	flex: 1;
	min-width: 0;
	padding: 0.35rem 2.75rem 0.35rem 0;
	border: none;
	background: transparent;
	font-size: 1rem;
	color: var(--levf-color-text);
}

.levf-nav-pane__search-input::-webkit-search-cancel-button {
	-webkit-appearance: none;
	height: 1.1rem;
	width: 1.1rem;
	margin-right: 0.15rem;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2'%3E%3Cpath d='M18 6L6 18M6 6l12 12'/%3E%3C/svg%3E") center / contain no-repeat;
	cursor: pointer;
}

.levf-nav-pane__search-input::placeholder {
	color: var(--levf-color-text-muted);
}

.levf-nav-pane__search-input:focus {
	outline: none;
}

.levf-nav-pane__search-chevron {
	color: var(--levf-color-text-muted);
	font-size: 2.2rem;
	line-height: 1;
	display: block;
}

.levf-nav-pane__search-chevron-btn {
	align-self: stretch;
	padding-right: 0.15rem;
}

.levf-nav-pane__search-submit {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
}

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

/* Variable content area: scrollable, pale grey background */
.levf-nav-pane__content-wrap {
	flex: 1;
	min-height: 0;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	background: var(--levf-nav-pane-content-bg);
}

.levf-nav-pane__content {
	flex: 1;
	min-height: 0;
	overflow: hidden;
	padding: var(--levf-space-m);
	position: relative;
}

/* Nav pane panels: stacked; one visible at a time (see assets/nav.js) */
.levf-nav-pane__content .levf-nav-panel {
	position: absolute;
	inset: 0;
	overflow-y: auto;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.levf-nav-pane__content .levf-nav-panel--active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

/* Bottom buttons: full-width vertical stack */
.levf-nav-pane__bottom {
	flex-shrink: 0;
	padding: var(--levf-space-m);
	border-top: 1px solid var(--levf-color-border);
}

.levf-nav-pane__bottom .wp-block-buttons {
	display: flex;
	flex-direction: column;
	flex-wrap: nowrap;
	gap: 0.5rem;
	width: 100%;
}

.levf-nav-pane__bottom .levf-nav-pane__btn {
	width: 100%;
	margin: 0;
}

.levf-nav-pane__bottom .levf-nav-pane__btn .wp-block-button__link {
	width: 100%;
	text-align: center;
	box-sizing: border-box;
	border-radius: var(--levf-radius-pill);
	padding: 0.75rem 1rem;
	font-size: 1rem;
}

.levf-nav-pane__btn--subscribe .wp-block-button__link,
.levf-nav-pane__btn--contact .wp-block-button__link,
.levf-nav-pane__btn--sitemap .wp-block-button__link {
	background: var(--levf-color-bg) !important;
	color: var(--levf-color-text) !important;
	border: 2px solid var(--levf-color-accent-green) !important;
}

.levf-nav-pane__btn--donate .wp-block-button__link {
	background: var(--levf-color-accent-green) !important;
	color: var(--levf-color-text) !important;
	border: 2px solid var(--levf-color-accent-green) !important;
}

.levf-nav-pane__btn--sitemap-hidden {
	display: none !important;
}

/* When a function (or search) view is active: hide function buttons, show Sitemap */
.levf-nav-pane__bottom--function-active .levf-nav-pane__btn--subscribe,
.levf-nav-pane__bottom--function-active .levf-nav-pane__btn--donate,
.levf-nav-pane__bottom--function-active .levf-nav-pane__btn--contact {
	display: none !important;
}

.levf-nav-pane__bottom--function-active .levf-nav-pane__btn--sitemap {
	display: block !important;
	width: 100%;
}

/* ========== Nav content tree (sitemap) ========== */
.levf-nav-panel--sitemap .levf-nav-tree {
	display: block;
	margin: 0.5em 0;
}

.levf-nav-panel--sitemap,
.levf-nav-panel--contact,
.levf-nav-panel--subscribe,
.levf-nav-panel--search {
	color: var(--levf-color-text);
}

.levf-nav-tree__empty {
	margin: 0;
	color: var(--levf-color-text-muted);
}

.levf-nav-tree__list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.levf-nav-tree__item {
	margin-bottom: 0.65rem;
}

.levf-nav-tree__row {
	display: flex;
	align-items: center;
	gap: 0.35rem;
}

.levf-nav-tree__toggle {
	width: 1.5rem;
	height: 1.5rem;
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: 1px solid var(--levf-color-border);
	color: var(--levf-color-text);
	cursor: pointer;
	font-size: 1rem;
	line-height: 1;
	padding: 0;
}

.levf-nav-tree__toggle--placeholder {
	border: none;
	background: transparent;
	cursor: default;
}

.levf-nav-tree__toggle-icon {
	line-height: 1;
}

.levf-nav-tree__link {
	flex: 1;
	min-width: 0;
	text-decoration: none;
	color: var(--levf-color-text);
}

/* Leaf pages: bold > in the toggle column, inside the link */
.levf-nav-tree__link--leaf {
	display: grid;
	grid-template-columns: 1.5rem 1fr;
	gap: 0.35rem;
	align-items: center;
}

.levf-nav-tree__leaf-marker {
	justify-self: center;
	font-weight: 700;
	line-height: 1;
	font-size: 1rem;
}

.levf-nav-tree__link-text {
	min-width: 0;
}

.levf-nav-tree__link:hover {
	text-decoration: underline;
}

.levf-nav-tree__link--current {
	font-weight: 600;
}

.levf-nav-tree__link--draft {
	text-decoration: line-through;
}

.levf-nav-tree__pin {
	vertical-align: middle;
}

/* Children list: indented, animated expand/collapse */
.levf-nav-tree__children {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 250ms ease;
}

.levf-nav-tree__item.is-expanded > .levf-nav-tree__children {
	grid-template-rows: 1fr;
}

.levf-nav-tree__children-inner {
	overflow: hidden;
}

.levf-nav-tree__item .levf-nav-tree__list {
	margin-left: var(--levf-space-m);
}

/* Snippets: animated reveal via wrapper */
.levf-nav-snippet-wrap {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 250ms ease;
}

.levf-nav-snippet-wrap--visible {
	grid-template-rows: 1fr;
}

.levf-nav-snippet-wrap__inner {
	overflow: hidden;
}

.levf-nav-snippet {
	margin: 0.25rem 0 0.5rem 1.5rem;
	font-size: 0.9em;
	font-style: italic;
	color: #555;
	line-height: 1.4;
}

/* Search results view (injected by JS) */
.levf-nav-search-results {
	padding: 0;
}

.levf-nav-search-results__list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.levf-nav-search-results__item {
	margin-bottom: var(--levf-space-s);
}

.levf-nav-search-results__item a {
	display: block;
	font-weight: 600;
}

.levf-nav-search-results__nav-snippet,
.levf-nav-search-results__excerpt {
	margin: 0.25rem 0 0;
	font-size: 0.9em;
	color: #555;
}

.levf-nav-search-results__excerpt {
	font-style: italic;
}

/* Search loading spinner */
.levf-nav-search-loading {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	color: #555;
}

.levf-nav-search-loading__spinner {
	width: 1.25rem;
	height: 1.25rem;
	border: 2px solid #ccc;
	border-top-color: var(--levf-color-accent, #333);
	border-radius: 50%;
	animation: levf-nav-spin 0.7s linear infinite;
}

@keyframes levf-nav-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Donate page (temporary content until nav-integrated flow) */
.levf-donate-preamble {
	margin-bottom: var(--levf-space-l, 2rem);
	text-align: center;
}

.levf-donate-preamble .wp-block-heading {
	margin-bottom: var(--levf-space-s, 1rem);
}

.levf-donate-methods-heading {
	margin: var(--levf-space-l, 2rem) 0 var(--levf-space-m, 1.5rem);
}

.levf-donate-grid {
	margin-bottom: var(--levf-space-m, 1.5rem);
	gap: var(--levf-space-m, 1.5rem);
}

.levf-donate-method {
	height: 100%;
	display: flex;
	flex-direction: column;
}

.levf-donate-method .wp-block-heading {
	margin-top: 0;
	font-size: 1.05em;
}

.levf-donate-method .wp-block-buttons {
	margin-top: auto;
	padding-top: var(--levf-space-s, 1rem);
}

.levf-donate-footer {
	margin-top: var(--levf-space-l, 2rem);
	text-align: center;
}

/* --- Singular post/page: bordered title + content --- */
.levf-singular-content {
	box-sizing: border-box;
	border: 1px solid var(--levf-color-border); /* #FFFFFF33 on #000000 ≈ #333333 */
	border-radius: 64px;
	padding: 40px;
	margin-bottom: 80px;
}

/* --- Keep Reading (related content block) --- */
.levf-related-content {
	margin-top: var(--levf-space-l, 2rem);
	margin-bottom: var(--levf-space-l, 2rem);
	max-width: var(--wp--style--global--content-size, 720px);
	margin-left: auto;
	margin-right: auto;
	width: 100%;
	box-sizing: border-box;
	border: 1px solid #ccc;
	border-radius: 10px;
	padding: var(--levf-space-m, 1.25rem);
}

.levf-related-content__heading {
	margin: 0 0 var(--levf-space-m, 1.25rem);
	font-size: 1.35rem;
}

.levf-related-content__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: var(--levf-space-m, 1.25rem);
}

.levf-related-content__item {
	margin: 0;
	padding: 0;
}

.levf-related-content__label {
	display: block;
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #555;
	margin-bottom: 0.35rem;
}

.levf-related-content__card {
	display: flex;
	flex-direction: row;
	align-items: flex-start;
	gap: 1rem;
	text-decoration: none;
	color: inherit;
	border: 1px solid #ccc;
	padding: 0.75rem 1rem;
	box-sizing: border-box;
}

.levf-related-content__card:hover,
.levf-related-content__card:focus-visible {
	border-color: var(--levf-color-accent, #0066cc);
}

.levf-related-content__card--placeholder {
	display: block;
	border-style: dashed;
	background: #f8f8f8;
	color: #666;
	cursor: default;
}

.levf-related-content__card--placeholder:hover {
	border-color: #ccc;
}

.levf-related-content__placeholder-text {
	margin: 0;
	font-style: italic;
}

.levf-related-content__thumb {
	flex: 0 0 auto;
	max-width: 120px;
}

.levf-related-content__thumb img,
.levf-related-content__thumb-img {
	display: block;
	width: 100%;
	height: auto;
}

.levf-related-content__body {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	min-width: 0;
}

.levf-related-content__title {
	font-weight: 700;
	font-size: 1.05rem;
	line-height: 1.3;
}

.levf-related-content__snippet {
	font-size: 0.9rem;
	line-height: 1.45;
	color: #444;
}

.levf-related-content-editor {
	padding: 1rem;
	border: 1px dashed #999;
	background: #fafafa;
}

@media (max-width: 600px) {
	.levf-related-content__card {
		flex-direction: column;
	}

	.levf-related-content__thumb {
		max-width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.levf-nav-tree__children,
	.levf-nav-snippet-wrap {
		transition: none;
	}

	.levf-nav-search-loading__spinner {
		animation: none;
		border-top-color: #ccc;
	}
}
