/* ==========================================================================
   Randolph Modular - site chrome: header, footer, page hero, archives, forms
   ========================================================================== */

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	font-family: var(--rmh-body);
	color: var(--rmh-text);
	background: #fff;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}

img { max-width: 100%; height: auto; }
a { color: var(--rmh-navy); }

h1, h2, h3, h4, h5, h6 { font-family: var(--rmh-display); color: var(--rmh-navy); line-height: 1.12; }

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

.skip-link:focus {
	clip: auto;
	width: auto;
	height: auto;
	margin: 0;
	background: var(--rmh-gold);
	color: var(--rmh-deep);
	padding: 12px 20px;
	z-index: 1000;
	left: 12px;
	top: 12px;
	font-weight: 700;
}

:focus-visible { outline: 3px solid var(--rmh-gold); outline-offset: 3px; }

/* ---------- Header ---------- */

.site-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 100;
	transition: background 0.35s ease, box-shadow 0.35s ease, transform 0.35s ease;
}

.admin-bar .site-header { top: 32px; }

@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

.topbar {
	background: rgba(0, 16, 34, 0.55);
	backdrop-filter: blur(8px);
	color: rgba(255, 255, 255, 0.85);
	font-size: 0.8rem;
	max-height: 42px;
	overflow: hidden;
	transition: max-height 0.35s ease, opacity 0.35s ease;
}

.topbar__inner {
	max-width: 1320px;
	margin: 0 auto;
	padding: 9px 24px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 20px;
}

.topbar a { color: inherit; text-decoration: none; }
.topbar a:hover { color: var(--rmh-gold-l); }
.topbar .rmh-i { width: 1.05em; height: 1.05em; color: var(--rmh-gold-l); }
.topbar__tag { display: inline-flex; align-items: center; gap: 8px; letter-spacing: 0.04em; font-weight: 500; }
.topbar__links { display: inline-flex; gap: 26px; }
.topbar__links a { display: inline-flex; align-items: center; gap: 8px; }

.mainbar { transition: background 0.35s ease, padding 0.35s ease; }

.mainbar__inner {
	max-width: 1320px;
	margin: 0 auto;
	padding: 16px 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 28px;
	transition: padding 0.35s ease;
}

.site-logo { display: inline-flex; flex: none; line-height: 0; }
.site-logo__img { height: 48px; width: auto; transition: height 0.35s ease; }

/* scrolled / solid */
.site-header.is-scrolled,
.no-hero .site-header {
	background: rgba(0, 20, 40, 0.97);
	backdrop-filter: blur(10px);
	box-shadow: 0 10px 40px -14px rgba(0, 0, 0, 0.55);
}

.site-header.is-scrolled .topbar { max-height: 0; opacity: 0; }
.site-header.is-scrolled .mainbar__inner { padding-top: 10px; padding-bottom: 10px; }
.site-header.is-scrolled .site-logo__img { height: 40px; }

.no-hero .site-main { padding-top: 130px; }

/* ---------- Navigation ---------- */

.primary-nav { display: flex; align-items: center; gap: 22px; margin-left: auto; }

.primary-nav .menu {
	display: flex;
	align-items: center;
	gap: 2px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.primary-nav .menu > li { position: relative; margin: 0; }

.primary-nav .menu a {
	display: block;
	padding: 12px 15px;
	color: #fff;
	text-decoration: none;
	font-size: 0.93rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	border-radius: 8px;
	transition: color 0.2s ease, background 0.2s ease;
	position: relative;
}

.primary-nav .menu > li > a::after {
	content: "";
	position: absolute;
	left: 15px;
	right: 15px;
	bottom: 6px;
	height: 2px;
	background: var(--rmh-gold);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.3s ease;
}

.primary-nav .menu > li:hover > a::after,
.primary-nav .menu > li.current-menu-item > a::after,
.primary-nav .menu > li.current-menu-ancestor > a::after { transform: scaleX(1); }

.primary-nav .menu > li:hover > a,
.primary-nav .menu > li.current-menu-item > a { color: var(--rmh-gold-l); }

.primary-nav .menu-item-has-children > a { padding-right: 28px; }

.primary-nav .menu-item-has-children > a::before {
	content: "";
	position: absolute;
	right: 11px;
	top: 50%;
	width: 7px;
	height: 7px;
	margin-top: -6px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	opacity: 0.7;
}

.primary-nav .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 230px;
	background: #fff;
	border-radius: 14px;
	padding: 10px;
	margin: 8px 0 0;
	list-style: none;
	box-shadow: 0 24px 60px -16px rgba(0, 20, 40, 0.5);
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.primary-nav .sub-menu::before {
	content: "";
	position: absolute;
	top: -8px;
	left: 0;
	right: 0;
	height: 8px;
}

.primary-nav .menu-item-has-children:hover > .sub-menu,
.primary-nav .menu-item-has-children:focus-within > .sub-menu,
.primary-nav .menu-item-has-children.is-open > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.primary-nav .sub-menu a { color: var(--rmh-navy); padding: 11px 16px; font-size: 0.92rem; }
.primary-nav .sub-menu a:hover { background: var(--rmh-cream); color: var(--rmh-navy); }

.nav-cta { padding: 12px 24px; font-size: 0.88rem; white-space: nowrap; }

.nav-toggle {
	display: none;
	background: transparent;
	border: 1.5px solid rgba(255, 255, 255, 0.4);
	border-radius: 10px;
	width: 46px;
	height: 46px;
	padding: 0;
	color: #fff;
	cursor: pointer;
	place-items: center;
}

.nav-toggle .rmh-i { width: 24px; height: 24px; }
.nav-toggle__close { display: none; }
.nav-open .nav-toggle__open { display: none; }
.nav-open .nav-toggle__close { display: inline; }

@media (max-width: 1080px) {
	.nav-toggle { display: inline-grid; }

	.primary-nav {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		padding: 110px 28px 40px;
		background: var(--rmh-deep);
		flex-direction: column;
		align-items: stretch;
		justify-content: flex-start;
		gap: 24px;
		overflow-y: auto;
		opacity: 0;
		visibility: hidden;
		transform: translateY(-14px);
		transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
		z-index: -1;
	}

	.nav-open .primary-nav { opacity: 1; visibility: visible; transform: none; z-index: 0; }
	.nav-open { overflow: hidden; }
	.nav-open .site-header { background: var(--rmh-deep); }
	.nav-toggle { position: relative; z-index: 2; }
	.site-logo { position: relative; z-index: 2; }

	.primary-nav .menu { flex-direction: column; align-items: stretch; gap: 0; }
	.primary-nav .menu > li { border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
	.primary-nav .menu a { font-size: 1.15rem; padding: 16px 4px; border-radius: 0; }
	.primary-nav .menu > li > a::after { display: none; }
	.primary-nav .menu-item-has-children > a::before { right: 6px; margin-top: -7px; }

	.primary-nav .sub-menu {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		background: transparent;
		box-shadow: none;
		padding: 0 0 12px 14px;
		margin: 0;
		display: none;
	}

	.primary-nav .menu-item-has-children.is-open > .sub-menu { display: block; }
	.primary-nav .sub-menu a { color: rgba(255, 255, 255, 0.82); font-size: 1rem; padding: 11px 4px; }
	.primary-nav .sub-menu a:hover { background: transparent; color: var(--rmh-gold-l); }
	.nav-cta { text-align: center; justify-content: center; padding: 16px; }
	.topbar__tag { display: none; }
	.topbar__inner { justify-content: center; }
}

@media (max-width: 600px) {
	.topbar { display: none; }
	.site-logo__img { height: 40px; }
	.site-header.is-scrolled .site-logo__img { height: 36px; }
}

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

.page-hero {
	position: relative;
	background: linear-gradient(150deg, #00254a 0%, var(--rmh-deep) 100%);
	color: #fff;
	padding: clamp(160px, 18vw, 230px) 24px clamp(64px, 8vw, 100px);
	overflow: hidden;
	isolation: isolate;
}

.page-hero__bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: -2;
}

.page-hero.has-image::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(100deg, rgba(0, 16, 34, 0.94) 0%, rgba(0, 37, 72, 0.78) 55%, rgba(0, 37, 72, 0.5) 100%);
}

.page-hero::before {
	content: "";
	position: absolute;
	right: -80px;
	bottom: -120px;
	width: 420px;
	height: 420px;
	z-index: -1;
	border: 1px solid rgba(230, 194, 122, 0.25);
	border-radius: 50%;
	box-shadow: 0 0 0 60px rgba(230, 194, 122, 0.04), 0 0 0 120px rgba(230, 194, 122, 0.025);
}

.page-hero__inner { max-width: 1240px; margin: 0 auto; }

.page-hero__title {
	font-family: var(--rmh-display);
	font-weight: 600;
	font-size: clamp(2.6rem, 5.6vw, 4.8rem);
	line-height: 1.04;
	color: #fff;
	margin: 0 0 0.25em;
	max-width: 900px;
}

.page-hero__sub {
	font-size: clamp(1.05rem, 1.6vw, 1.3rem);
	color: rgba(255, 255, 255, 0.86);
	max-width: 680px;
	margin: 0;
}

.page-hero__meta {
	color: var(--rmh-gold-l);
	font-weight: 600;
	letter-spacing: 0.06em;
	margin: 0;
}

/* ---------- Content ---------- */

.site-main { display: block; min-height: 40vh; }

.entry-content > *:not(.alignfull):not(.alignwide) {
	max-width: 760px;
	margin-left: auto;
	margin-right: auto;
	padding-left: 24px;
	padding-right: 24px;
	box-sizing: border-box;
}

.entry-content > .alignwide { max-width: 1240px; margin-left: auto; margin-right: auto; padding-left: 24px; padding-right: 24px; box-sizing: border-box; }
.entry-content > .alignfull { max-width: none; width: 100%; margin-left: 0; margin-right: 0; }

.entry-content > *:not(.alignfull) { margin-top: 0; margin-bottom: 1.3em; }
.entry-content > *:first-child:not(.alignfull) { margin-top: 70px; }
.entry-content > *:last-child:not(.alignfull) { margin-bottom: 90px; }
.entry-content--full > * { margin-top: 0; margin-bottom: 0; }

.entry--single .entry-content { font-size: 1.1rem; }
.entry--single .entry-content h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin-top: 1.6em; margin-bottom: 0.5em; }
.entry--single .entry-content h3 { font-size: 1.4rem; margin-top: 1.4em; }
.entry-content a:not(.wp-block-button__link):not(.rmh-btn):not(.rmh-link) { text-decoration-color: var(--rmh-gold); text-underline-offset: 3px; text-decoration-thickness: 2px; }

.wp-block-quote { border-left: 4px solid var(--rmh-gold); padding-left: 22px; font-family: var(--rmh-display); font-size: 1.5rem; color: var(--rmh-navy); }
.wp-block-image img { height: auto; }
.wp-block-image figcaption { font-size: 0.85rem; color: var(--rmh-muted); text-align: center; margin-top: 8px; }

/* ---------- Archives ---------- */

.rmh-archive { padding: clamp(56px, 7vw, 96px) 0; background: var(--rmh-cream); }
.no-hero .rmh-archive { padding-top: 160px; }
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }

.post-card {
	background: #fff;
	border-radius: var(--rmh-radius);
	overflow: hidden;
	box-shadow: var(--rmh-shadow-sm);
	display: flex;
	flex-direction: column;
	transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.post-card:hover { transform: translateY(-8px); box-shadow: var(--rmh-shadow); }

.post-card__media { display: block; aspect-ratio: 16 / 11; overflow: hidden; background: var(--rmh-sand); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s ease; }
.post-card:hover .post-card__media img { transform: scale(1.06); }
.post-card__placeholder { display: grid; place-items: center; height: 100%; color: var(--rmh-gold); }
.post-card__placeholder .rmh-i { width: 56px; height: 56px; }

.post-card__body { padding: 26px 26px 28px; display: flex; flex-direction: column; flex: 1; }
.post-card__meta { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rmh-muted); margin: 0 0 10px; }
.post-card__meta span { color: var(--rmh-gold); }
.post-card__title { font-family: var(--rmh-display); font-size: 1.7rem; font-weight: 600; margin: 0 0 10px; line-height: 1.12; }
.post-card__title a { color: var(--rmh-navy); text-decoration: none; }
.post-card__title a:hover { color: #003a70; }
.post-card__excerpt { color: var(--rmh-muted); font-size: 0.97rem; margin: 0 0 18px; }
.post-card .rmh-link { margin-top: auto; align-self: flex-start; }

.navigation.pagination { margin-top: 56px; }
.nav-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.page-numbers { padding: 10px 18px; border-radius: 999px; background: #fff; color: var(--rmh-navy); text-decoration: none; font-weight: 700; border: 1px solid var(--rmh-line); }
.page-numbers.current, .page-numbers:hover { background: var(--rmh-navy); color: #fff; border-color: var(--rmh-navy); }

.post-nav { display: flex; justify-content: space-between; gap: 20px; margin: 40px 0; padding-top: 30px; border-top: 1px solid var(--rmh-line); font-weight: 600; }
.post-nav a { color: var(--rmh-navy); text-decoration: none; }
.post-nav a:hover { color: var(--rmh-gold); }

.rmh-empty { text-align: center; padding: 60px 0; }
.rmh-empty__links { display: flex; gap: 12px; justify-content: center; margin-top: 28px; }

/* ---------- Search form ---------- */

.search-form { display: flex; max-width: 480px; margin: 22px auto; position: relative; }
.search-field { flex: 1; font: inherit; padding: 15px 56px 15px 20px; border-radius: 999px; border: 1.5px solid var(--rmh-line); background: #fff; }
.search-field:focus { outline: 0; border-color: var(--rmh-gold); box-shadow: 0 0 0 4px rgba(201, 153, 62, 0.18); }
.search-submit { position: absolute; right: 6px; top: 6px; bottom: 6px; width: 44px; border: 0; border-radius: 50%; background: var(--rmh-navy); color: #fff; cursor: pointer; display: grid; place-items: center; }

/* ---------- Comments ---------- */

.comments-area { margin: 40px 0 80px; }
.comments-title { font-size: 1.8rem; }
.comment-list { list-style: none; padding: 0; }
.comment-body { padding: 18px 0; border-bottom: 1px solid var(--rmh-line); }
.comment-respond input[type="text"], .comment-respond input[type="email"], .comment-respond input[type="url"], .comment-respond textarea { width: 100%; font: inherit; padding: 12px 14px; border: 1.5px solid var(--rmh-line); border-radius: 10px; background: var(--rmh-cream); }
.comment-respond .submit { background: var(--rmh-navy); color: #fff; border: 0; padding: 14px 30px; border-radius: 999px; font-weight: 700; cursor: pointer; }

/* ---------- Footer ---------- */

.site-footer { background: var(--rmh-deep); color: rgba(255, 255, 255, 0.72); font-size: 0.95rem; }

.site-footer__top { padding: clamp(56px, 7vw, 92px) 24px 48px; border-top: 3px solid var(--rmh-gold); }

.footer-grid {
	max-width: 1240px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: 1.35fr 0.8fr 1.1fr 1.15fr;
	gap: clamp(28px, 4vw, 60px);
}

.site-logo--footer .site-logo__img { height: 54px; }
.footer-tagline { margin: 22px 0 18px; font-family: var(--rmh-display); font-size: 1.35rem; line-height: 1.25; color: #fff; max-width: 300px; }

.footer-title {
	font-family: var(--rmh-body);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--rmh-gold-l);
	margin: 0 0 22px;
}

.footer-menu, .footer-contact { list-style: none; margin: 0; padding: 0; }
.footer-menu li { margin: 0 0 10px; }
.site-footer a { color: rgba(255, 255, 255, 0.78); text-decoration: none; transition: color 0.2s ease; }
.site-footer a:hover { color: var(--rmh-gold-l); }

.footer-contact li { display: flex; gap: 12px; margin-bottom: 16px; align-items: flex-start; }
.footer-contact .rmh-i { color: var(--rmh-gold); margin-top: 3px; width: 1.15em; height: 1.15em; }

.footer-col--cta p { margin: 0 0 20px; }
.footer-col--cta .rmh-btn { color: var(--rmh-deep) !important; }

.social-links { display: flex; gap: 10px; }
.social-links a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.25); color: #fff; }
.social-links a:hover { background: var(--rmh-gold); border-color: var(--rmh-gold); color: var(--rmh-deep); }

.site-footer__bottom { border-top: 1px solid rgba(255, 255, 255, 0.1); padding: 24px; background: #000d1c; }
.footer-bottom { max-width: 1240px; margin: 0 auto; display: flex; gap: 32px; justify-content: space-between; align-items: flex-start; font-size: 0.8rem; color: rgba(255, 255, 255, 0.55); }
.footer-bottom p { margin: 0; }
.footer-note { max-width: 780px; line-height: 1.55; }
.footer-copy { white-space: nowrap; }

/* ---------- Lightbox ---------- */

.rmh-lb {
	position: fixed;
	inset: 0;
	z-index: 1000;
	background: rgba(0, 10, 22, 0.94);
	display: none;
	align-items: center;
	justify-content: center;
	padding: 56px 70px;
	animation: rmh-fade 0.25s ease;
}

.rmh-lb.is-open { display: flex; }
.rmh-lb img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6); }

.rmh-lb button {
	position: absolute;
	background: rgba(255, 255, 255, 0.12);
	border: 0;
	color: #fff;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease;
}

.rmh-lb button:hover { background: var(--rmh-gold); color: var(--rmh-deep); }
.rmh-lb__close { top: 18px; right: 18px; }
.rmh-lb__prev { left: 14px; top: 50%; margin-top: -24px; }
.rmh-lb__next { right: 14px; top: 50%; margin-top: -24px; }
.rmh-lb__cap { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: rgba(255, 255, 255, 0.75); font-size: 0.9rem; padding: 0 70px; }

@keyframes rmh-fade { from { opacity: 0; } to { opacity: 1; } }

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

@media (max-width: 1000px) {
	.post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
	.post-grid { grid-template-columns: 1fr; }
	.footer-grid { grid-template-columns: 1fr; }
	.footer-bottom { flex-direction: column; gap: 12px; }
	.rmh-lb { padding: 56px 12px; }
	.rmh-lb__prev { left: 6px; }
	.rmh-lb__next { right: 6px; }
	.entry-content > *:not(.alignfull):not(.alignwide) { padding-left: 20px; padding-right: 20px; }
}

@media print {
	.site-header, .site-footer, .rmh-cta { display: none; }
}
