/*
 * MBM Theme - Main Styles
*/

/* ==========================================================================
   1. Design Tokens
   ========================================================================== */

:root {
	/* Colors */
	/* Light theme palette */
	--light-color-blue: #03799B;
	--light-color-dark-blue: #033449;
	--light-color-light-beige: #F4F2ED;
	--light-color-black: #141414;
	--light-color-white: #FFFFFF;
	--light-color-text: var(--light-color-dark-blue);
	--light-color-bg: #fffefc;
	--light-color-link: var(--light-color-dark-blue);
	--light-color-link-hover: var(--light-color-blue);
	--light-color-primary: var(--light-color-blue);
	--light-color-menu-bg: var(--light-color-dark-blue);
	--light-color-header-bg: #ffffff;

	/* Dark theme palette */
	--dark-color-blue: #5fc4e3;
	--dark-color-dark-blue: #dbe8ee;
	--dark-color-light-beige: #122331;
	--dark-color-black: #050b10;
	--dark-color-white: #e8f1f5;
	--dark-color-text: var(--dark-color-dark-blue);
	--dark-color-bg: #0a1a24;
	--dark-color-link: var(--dark-color-dark-blue);
	--dark-color-link-hover: var(--dark-color-blue);
	--dark-color-primary: var(--dark-color-blue);
	--dark-color-menu-bg: #061520;
	--dark-color-header-bg: #0a1a24;

	/* Active theme tokens (default: light) */
	--color-blue: var(--light-color-blue);
	--color-dark-blue: var(--light-color-dark-blue);
	--color-light-beige: var(--light-color-light-beige);
	--color-black: var(--light-color-black);
	--color-white: var(--light-color-white);
	--color-text: var(--light-color-text);
	--color-bg: var(--light-color-bg);
	--color-link: var(--light-color-link);
	--color-link-hover: var(--light-color-link-hover);
	--color-primary: var(--light-color-primary);
	--color-menu-bg: var(--light-color-menu-bg);
	--color-header-bg: var(--light-color-header-bg);

	/* Typography */
	--font-family: "google-sans", sans-serif;
	--font-family-heading: "playfair-display", serif;
	--font-size-base: 16px;
	--font-weight-normal: 400;
	--font-weight-semibold: 600;
	--line-height-base: 1.5;

	/* Breakpoints (for reference; use in media queries) */
	--bp-mobile: 767px;
	--bp-tablet: 991px;
	--bp-desktop: 992px;

	/* Transitions */
	--transition-color: color 0.4s;
	--transition-link-underline: all 0.3s;
}

html.dark {
	--color-blue: var(--dark-color-blue);
	--color-dark-blue: var(--dark-color-dark-blue);
	--color-light-beige: var(--dark-color-light-beige);
	--color-black: var(--dark-color-black);
	--color-white: var(--dark-color-white);
	--color-text: var(--dark-color-text);
	--color-bg: var(--dark-color-bg);
	--color-link: var(--dark-color-link);
	--color-link-hover: var(--dark-color-link-hover);
	--color-primary: var(--dark-color-primary);
	--color-menu-bg: var(--dark-color-menu-bg);
	--color-header-bg: var(--dark-color-header-bg);
}

/* ==========================================================================
   2. Fonts
   ========================================================================== */

@font-face {
	font-family: "playfair-display";
	src: url("../fonts/playfair/PlayfairDisplay-VariableFont_wght.woff2") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "playfair-display";
	src: url("../fonts/playfair/PlayfairDisplay-Italic-VariableFont_wght.woff2") format("woff2");
	font-weight: 100 900;
	font-style: italic;
	font-display: swap;
}
@font-face {
	font-family: "google-sans";
	src: url("../fonts/google-sans/GoogleSans-VariableFont_GRAD,opsz,wght.woff2") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "google-sans";
	src: url("../fonts/google-sans/GoogleSans-Italic-VariableFont_GRAD,opsz,wght.woff2") format("woff2");
	font-weight: 100 900;
	font-style: italic;
	font-display: swap;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--font-family-heading);
}

/* ==========================================================================
   3. Base
   ========================================================================== */

html {
	width: 100%;
	overflow-x: hidden !important;
}

body {
	font-family: var(--font-family);
	font-size: var(--font-size-base);
	font-weight: var(--font-weight-normal);
	color: var(--color-text);
	background-color: var(--color-bg);
	width: 100%;
}

/* Admin bar: hidden when theme option is on and user has no override (body.mbm-hide-admin-bar) */
body.mbm-hide-admin-bar #wpadminbar {
	display: none !important;
}

#main {
	overflow-x: hidden;
}

@media (max-width: 767px) {
	.container {
		padding-left: 1rem;
		padding-right: 1rem;
	}
}
/* ==========================================================================
   4. Typography
   ========================================================================== */

strong {
	font-weight: var(--font-weight-semibold);
}

ul,
ol {
	padding-left: 1rem;
}

ul li {
	line-height: var(--line-height-base);
}

ul li.menu-item {
	line-height: 1em;
	display: flex;
}

/* ==========================================================================
   5. Links
   ========================================================================== */

a,
a:link,
a:visited,
a:active {
	text-decoration: none;
	color: var(--color-link);
	transition: var(--transition-color);
}

a:hover {
	color: var(--color-link-hover);
}

/* ==========================================================================
   6. Utilities
   ========================================================================== */

/* [hide_on_mobile] shortcode */
@media (max-width: 767px) {
	.hide-on-mobile {
		display: none !important;
	}
}

/* ==========================================================================
   7. Buttons
   ========================================================================== */

.button-cta {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 46px;
	padding: 0.72rem 1.4rem;
	border-radius: 999px;
	border: 1px solid transparent;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1;
	overflow: hidden;
	isolation: isolate;
	transition: transform 0.25s ease, filter 0.25s ease;
}

.button-cta::before {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--button-hover-overlay, rgba(255, 255, 255, 0.18));
	transform: translateX(-101%);
	transition: transform 0.4s ease;
	z-index: 0;
}

.button-cta > span,
.button-cta > i {
	position: relative;
	z-index: 1;
}

.button-cta:hover::before {
	transform: translateX(0);
}

.button-cta--text-white {
	color: var(--color-white) !important;
}

.button-cta--text-blue {
	color: var(--color-blue) !important;
}

.button-cta--text-dark-blue {
	color: var(--color-dark-blue) !important;
}

.button-cta--text-black {
	color: var(--color-black) !important;
}

.button-cta--bg-white {
	background: var(--color-white);
	border-color: rgba(3, 52, 73, 0.2);
	--button-hover-overlay: rgba(3, 52, 73, 0.1);
}

.button-cta--bg-blue {
	background: var(--color-blue);
}

.button-cta--bg-dark-blue {
	background: var(--color-dark-blue);
}

.button-cta--bg-black {
	background: var(--color-black);
}

/* ==========================================================================
   8. Header
   ========================================================================== */

header#main-header {
	position: sticky;
	top: 0;
	z-index: 1100;
	padding: 1.125rem 3rem;
	background-color: var(--color-header-bg);
	transition: background-color 0.28s ease, box-shadow 0.28s ease;
}

header#main-header.is-scrolled {
	background-color: var(--color-header-bg);
	box-shadow: 0 1px 0 rgba(3, 52, 73, 0.08);
}

body.menu-open header#main-header {
	background-color: var(--color-header-bg);
}

.header-shell {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 2rem;
	width: 100%;
	min-width: 0;
}

.header-logo {
	flex: 0 0 auto;
}

.header-logo img {
	width: auto;
	height: 34px;
}

.header-logo .theme-logo,
.site-footer__logo .theme-logo {
	display: block;
}

.header-logo .theme-logo--dark,
.site-footer__logo .theme-logo--dark {
	display: none !important;
}

html.dark .header-logo .theme-logo--light,
html.dark .site-footer__logo .theme-logo--light {
	display: none !important;
}

html.dark .header-logo .theme-logo--dark,
html.dark .site-footer__logo .theme-logo--dark {
	display: block !important;
}

.header-menu {
	flex: 1 1 auto;
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 2rem;
	min-width: 0;
}

.header-nav .primary-menu-container {
	display: flex;
	justify-content: center;
}

.header-actions {
	display: inline-flex;
	align-items: center;
	gap: 1rem;
	white-space: nowrap;
}

.theme-toggle {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	cursor: pointer;
}

.theme-toggle input {
	display: none;
}

.theme-toggle input + div {
	border-radius: 50%;
	width: 100%;
	height: 100%;
	position: relative;
	box-shadow: inset 8px -3px 0 1px #0a2f43;
	transform: scale(1) rotate(-8deg);
	transition: box-shadow 0.5s ease 0s, transform 0.4s ease 0.1s;
}

.theme-toggle input + div::before {
	content: "";
	width: inherit;
	height: inherit;
	border-radius: inherit;
	position: absolute;
	left: 0;
	top: 0;
	background: transparent;
	transition: background 0.3s ease;
}

.theme-toggle input + div::after {
	content: "";
	width: 5px;
	height: 5px;
	border-radius: 50%;
	margin: -2.5px 0 0 -2.5px;
	position: absolute;
	top: 50%;
	left: 50%;
	box-shadow: 0 -15px 0 #0a2f43,
		0 15px 0 #0a2f43,
		15px 0 0 #0a2f43,
		-15px 0 0 #0a2f43,
		10px 10px 0 #0a2f43,
		-10px 10px 0 #0a2f43,
		10px -10px 0 #0a2f43,
		-10px -10px 0 #0a2f43;
	transform: scale(0);
	transition: all 0.3s ease;
}

.theme-toggle input:checked + div {
	box-shadow: inset 22px -22px 0 0 var(--color-bg);
	transform: scale(0.5) rotate(0deg);
	transition: transform 0.3s ease 0.1s, box-shadow 0.2s ease 0s;
}

.theme-toggle input:checked + div::before {
	background: #c7d5df;
	transition: background 0.3s ease 0.1s;
}

.theme-toggle input:checked + div::after {
	box-shadow: 0 -15px 0 #7fbfd8,
		0 15px 0 #7fbfd8,
		15px 0 0 #7fbfd8,
		-15px 0 0 #7fbfd8,
		10px 10px 0 #7fbfd8,
		-10px 10px 0 #7fbfd8,
		10px -10px 0 #7fbfd8,
		-10px -10px 0 #7fbfd8;
	transform: scale(1.5);
	transition: transform 0.5s ease 0.15s;
}

.request-access-link,
.header-user-greeting {
	color: var(--color-link) !important;
	font-size: 0.875rem;
	font-weight: 500;
}

.header-user-greeting {
	white-space: nowrap;
	max-width: min(220px, 42vw);
	overflow: hidden;
	text-overflow: ellipsis;
}

.btn-sign-in {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	padding: 0.625rem 1.25rem;
	border-radius: 999px;
	background: #0a2f43;
	color: #ffffff !important;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1;
}

@media screen and (max-width: 991px) {
	header#main-header {
		padding: 1.125rem 1.25rem 0.75rem;
	}
}

/* ==========================================================================
   8. Navigation (Desktop)
   ========================================================================== */

#top-menu.nav {
	display: flex;
	gap: 25px;
	margin: 0;
	padding: 0;
	list-style: none;
	justify-content: center;
}

#top-menu.nav li a {
	font-size: 0.875rem;
	font-family: var(--font-family);
	font-weight: 500;
	display: block;
	line-height: 1;
	color: var(--color-link);
}

#top-menu.nav li a::after {
	display: block;
	height: 2px;
	width: 100%;
	background-color: var(--color-link);
	content: " ";
	margin-top: 12px;
	position: absolute;
	opacity: 0;
	transition: var(--transition-link-underline);
}

#top-menu.nav li a:hover::after,
#top-menu.nav li a:active::after {
	opacity: 1;
	margin-top: 8px;
}

@media (min-width: 992px) {
	.mobile-menu-toggle {
		display: none;
	}

	.header-menu {
		position: static;
		opacity: 1 !important;
		transform: none !important;
	}
}

/* ==========================================================================
   9. Mobile Menu
   ========================================================================== */

@media (max-width: 991px) {
	.header-shell {
		justify-content: space-between;
		gap: 1rem;
	}

	.header-menu {
		flex: 0 0 0;
		min-width: 0;
		position: fixed;
		inset: 0;
		width: 100vw;
		min-height: 100vh;
		min-height: 100dvh;
		height: 100dvh;
		background: var(--color-bg);
		opacity: 1 !important;
		transform: translateX(100%) !important;
		visibility: hidden;
		transition: transform 0.45s ease, visibility 0s linear 0.45s;
		z-index: 1000;
		padding: 6.25rem 2rem 2rem;
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		gap: 2rem;
		overflow-y: auto;
	}

	.header-menu.show {
		transform: translateX(0) !important;
		visibility: visible;
		transition: transform 0.45s ease;
	}

	.header-nav .primary-menu-container {
		width: 100%;
		justify-content: flex-start;
	}

	.header-nav,
	.header-nav .primary-menu-container #top-menu {
		padding: 0;
		flex-direction: column;
		align-items: flex-start;
		gap: 2rem;
		width: 100%;
	}

	.header-nav .primary-menu-container ul li.menu-item {
		line-height: 1;
	}

	#top-menu.nav li a {
		font-size: 1.5rem;
		font-weight: 500;
		opacity: 0;
		transform: translateX(28px);
		transition: transform 0.35s ease, opacity 0.35s ease;
	}

	.header-menu.show #top-menu.nav li a {
		opacity: 1;
		transform: translateX(0);
	}

	.header-menu.show #top-menu.nav li:nth-child(1) a { transition-delay: 0.22s; }
	.header-menu.show #top-menu.nav li:nth-child(2) a { transition-delay: 0.32s; }
	.header-menu.show #top-menu.nav li:nth-child(3) a { transition-delay: 0.42s; }
	.header-menu.show #top-menu.nav li:nth-child(4) a { transition-delay: 0.52s; }
	.header-menu.show #top-menu.nav li:nth-child(5) a { transition-delay: 0.62s; }
	.header-menu.show #top-menu.nav li:nth-child(6) a { transition-delay: 0.72s; }
	.header-menu.show #top-menu.nav li:nth-child(7) a { transition-delay: 0.82s; }
	.header-menu.show #top-menu.nav li:nth-child(8) a { transition-delay: 0.92s; }

	.header-actions > * {
		opacity: 0;
		transform: translateY(24px);
		transition: none;
	}

	.header-menu.show .header-actions > * {
		animation: mobile-actions-fade-up 0.45s ease forwards;
	}

	.header-menu.show .header-actions > *:nth-child(1) { animation-delay: 0.32s; }
	.header-menu.show .header-actions > *:nth-child(2) { animation-delay: 0.44s; }
	.header-menu.show .header-actions > *:nth-child(3) { animation-delay: 0.56s; }

	html.menu-open {
		overflow: hidden !important;
		overscroll-behavior: none;
	}

	body.menu-open {
		overflow: hidden;
		position: fixed;
		left: 0;
		right: 0;
		width: 100%;
		overscroll-behavior: none;
		touch-action: none;
		/* top set in JS to preserve scroll position while fixed */
	}

	#top-menu.nav li a::after {
		opacity: 0;
		margin-top: 3px;
	}

	#top-menu.nav li a:hover::after {
		width: 100%;
		opacity: 1;
	}

	.header-actions {
		flex-direction: column;
		align-items: flex-start;
		width: 100%;
		margin-top: auto;
		padding-bottom: 1.5rem;
	}

	.request-access-link,
	.header-user-greeting {
		font-size: 1.25rem;
		font-weight: 500;
	}

	.header-user-greeting {
		max-width: min(280px, 85vw);
	}

	.btn-sign-in {
		min-height: 48px;
		padding: 0.75rem 1.5rem;
		font-size: 1rem;
	}

	.theme-toggle {
		transform: scale(1);
		transform-origin: left center;
	}

	.mobile-menu-toggle {
		position: relative;
		z-index: 1200;
		flex: 0 0 auto;
	}

	/* Stay in header flow (same spot as hamburger); body is already fixed while menu is open. */
	body.menu-open .mobile-menu-toggle {
		z-index: 10050;
	}
}


@keyframes mobile-actions-fade-up {
	from {
		opacity: 0;
		transform: translateY(24px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

#mobileMenuToggle {
	border: 0;
	background: transparent;
	color: #0a2f43;
	line-height: 0;
	padding: 0;
	width: 42px;
	height: 42px;
}

.mobile-menu-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 6px;
}

.mobile-menu-toggle__line {
	display: block;
	width: 24px;
	height: 2px;
	background: #fff;
	border-radius: 999px;
	transition: transform 0.3s ease, opacity 0.3s ease;
}

body.menu-open .mobile-menu-toggle__line:nth-child(1) {
	transform: translateY(8px) rotate(45deg);
}

body.menu-open .mobile-menu-toggle__line:nth-child(2) {
	opacity: 0;
}

body.menu-open .mobile-menu-toggle__line:nth-child(3) {
	transform: translateY(-8px) rotate(-45deg);
}

#mobileMenuToggle:hover,
#mobileMenuToggle:active {
	color: #0a2f43;
}

@media (max-width: 991px) {
	.mobile-menu-toggle {
		display: inline-flex;
	}
}

/* ==========================================================================
   9b. Site footer
   ========================================================================== */

.site-footer {
	padding: clamp(2.25rem, 5vw, 3.5rem) 0 clamp(1.5rem, 3vw, 2rem);
	background: var(--color-light-beige);
	color: var(--color-dark-blue);
}

.site-footer__inner {
	max-width: 1220px;
}

.site-footer__top {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: clamp(1.5rem, 4vw, 3rem);
	margin-bottom: clamp(1.75rem, 4vw, 4.5rem);
}

.site-footer__brand {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	text-align: left;
}

.site-footer__logo a {
	display: block;
	line-height: 0;
}

.site-footer__logo img {
	display: block;
	width: auto;
	height: 34px;
}

.site-footer__columns {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: flex-start;
	justify-content: flex-end;
	gap: clamp(2rem, 6vw, 4.5rem);
	text-align: left;
	min-width: 0;
}

.site-footer__column {
	flex: 0 1 auto;
	min-width: 0;
}

.site-footer__heading {
	margin: 0 0 0.65rem;
	font-family: var(--font-family);
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--color-dark-blue);
}

.site-footer__menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .8rem;
    margin-top: 2rem;
}

.site-footer__menu a {
	color: var(--color-dark-blue);
	text-decoration: none;
	font-size: 0.92rem;
	opacity: 0.92;
	transition: color 0.2s ease, opacity 0.2s ease;
}

.site-footer__menu a:hover {
	color: var(--color-blue);
	opacity: 1;
}

.site-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem 2rem;
	padding-top: clamp(1.25rem, 3vw, 1.75rem);
	border-top: 1px solid rgba(3, 52, 73, 0.12);
}

.site-footer__copyright {
	margin: 0;
	font-size: 0.8rem;
	color: rgba(3, 52, 73, 0.78);
}

.site-footer__credit {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.35rem 0.45rem;
	font-size: 0.8rem;
	color: rgba(3, 52, 73, 0.78);
}

.site-footer__credit-link {
	color: var(--color-dark-blue);
	font-weight: 500;
	text-decoration: none;
}

.site-footer__credit-link:hover {
	color: var(--color-blue);
	text-decoration: underline;
}

.site-footer__credit-by {
	text-transform: lowercase;
}

.site-footer__credit-logo {
	display: inline-flex;
	line-height: 0;
}

.site-footer__credit-logo img {
	display: block;
	height: 16px;
	width: auto;
}

@media (max-width: 767px) {
	.site-footer__top {
		flex-direction: column;
		align-items: flex-start;
	}

	.site-footer__columns {
		justify-content: flex-start;
		width: 100%;
		flex-wrap: nowrap;
		gap: clamp(1.5rem, 5vw, 2.5rem);
	}

	.site-footer__bottom {
		flex-direction: column;
		align-items: flex-start;
	}
}

/* ==========================================================================
   10. WordPress required (alignments, captions, sticky)
   ========================================================================== */

.aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.alignleft {
	float: left;
}

.alignright {
	float: right;
}

.wp-caption {
	border: 1px solid #ddd;
	text-align: center;
	background-color: #f3f3f3;
	padding-top: 4px;
	margin: 10px;
	border-radius: 3px;
}

.wp-caption img {
	margin: 0;
	padding: 0;
	border: 0 none;
}

.wp-caption-dd {
	font-size: 11px;
	line-height: 17px;
	padding: 0 4px 5px;
	margin: 0;
}

.sticky {
	background: #f7f7f7;
	padding: 0 10px 10px;
}

.sticky h2 {
	padding-top: 10px;
}
