/**
 * BBMRI-ERIC UI layer. Printed after Global Styles and Additional CSS
 * (includes/ui.php), so plain selectors here override the database styles.
 * Third-party widgets (Max Mega Menu, Smart Slider 3) use ID selectors, so
 * their sections match that specificity; !important only beats inline styles.
 *
 * Sections:
 *   1. Base: type, links, buttons, focus
 *   2. Header and Max Mega Menu
 *   3. Homepage hero (Smart Slider 3, slider #3)
 *   4. Homepage content: intro, impact stats
 *   5. News cards: Latest Posts block and Query Loop archives
 *   6. Footer
 *   7. Plugin skins: The Events Calendar, BetterDocs
 *   8. Motion preferences
 */

/* ------------------------------------------------------------------ */
/* 1. Base                                                            */
/* ------------------------------------------------------------------ */

html,
body {
	overflow-x: clip;
}

body {
	font-family: var(--bb-font-text);
	font-size: var(--bb-text-base);
	font-weight: 400;
	line-height: var(--bb-leading);
	color: var(--bb-text);
	background: var(--bb-surface);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--bb-font-display);
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: -0.01em;
	color: var(--bb-navy);
	text-wrap: balance;
}

h1 { font-size: var(--bb-h1); }
h2 { font-size: var(--bb-h2); }
h3 { font-size: var(--bb-h3); }

p {
	text-wrap: pretty;
}

:root :where(h1, h2, h3, h4, h5, h6) a:where(:not(.wp-element-button)) {
	color: inherit;
	text-decoration: none;
}

:root :where(h1, h2, h3, h4, h5, h6) a:where(:not(.wp-element-button)):hover {
	color: var(--bb-green-800);
}

/* Post dates/meta use the light orange from the palette, which is unreadable on white. */
.wp-block-post-date,
.wp-block-post-date a {
	color: var(--bb-muted);
	font-size: 0.875rem;
}

strong, b {
	font-weight: 700;
}

/* Same selector as Global Styles' link element, printed later so it wins. */
:root :where(a:where(:not(.wp-element-button))) {
	color: var(--bb-navy);
	font-weight: inherit;
	text-decoration: underline;
	text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	transition: color var(--bb-dur) var(--bb-ease), text-decoration-color var(--bb-dur) var(--bb-ease);
}

:root :where(a:where(:not(.wp-element-button)):hover) {
	color: var(--bb-green-800);
	text-decoration-color: currentColor;
}

:root :where(.wp-element-button, .wp-block-button__link) {
	font-family: var(--bb-font-display);
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.2;
	padding: 0.85em 1.6em;
	border-radius: var(--bb-radius-pill);
	background-color: var(--bb-navy);
	color: #fff;
	text-decoration: none;
	transition: background-color var(--bb-dur) var(--bb-ease), transform var(--bb-dur) var(--bb-ease), box-shadow var(--bb-dur) var(--bb-ease);
}

:root :where(.wp-element-button:hover, .wp-block-button__link:hover) {
	background-color: var(--bb-navy-700);
	color: #fff;
	box-shadow: var(--bb-shadow);
	transform: translateY(-1px);
}

:root :where(.is-style-outline > .wp-block-button__link) {
	background: transparent;
	color: var(--bb-navy);
	border: 2px solid currentColor;
}

:focus-visible {
	outline: 3px solid var(--bb-orange);
	outline-offset: 3px;
	border-radius: 4px;
}

::selection {
	background: var(--bb-green);
	color: var(--bb-navy-900);
}

/* ------------------------------------------------------------------ */
/* 2. Header and Max Mega Menu                                        */
/* ------------------------------------------------------------------ */

body > .wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(255, 255, 255, 0.94);
	-webkit-backdrop-filter: saturate(160%) blur(10px);
	backdrop-filter: saturate(160%) blur(10px);
	border-bottom: 1px solid var(--bb-line);
}

body.admin-bar > .wp-site-blocks > header.wp-block-template-part {
	top: var(--wp-admin--admin-bar--height, 32px);
}

@media (max-width: 600px) {
	/* The admin bar is not fixed at this width. */
	body.admin-bar > .wp-site-blocks > header.wp-block-template-part {
		top: 0;
	}
}

header.wp-block-template-part .wp-block-site-logo img {
	width: clamp(180px, 16vw, 230px);
	height: auto;
}

@media (min-width: 769px) {
	#mega-menu-wrap-max_mega_menu_1 #mega-menu-max_mega_menu_1 {
		display: flex;
		align-items: center;
		gap: 0.25rem;
	}

	#mega-menu-wrap-max_mega_menu_1 #mega-menu-max_mega_menu_1 > li.mega-menu-item > a.mega-menu-link {
		font-family: var(--bb-font-text);
		font-size: 15px;
		font-weight: 500;
		color: var(--bb-ink);
		padding: 0 0.75rem;
		line-height: 44px;
		height: 44px;
		border-radius: var(--bb-radius-sm);
		transition: color var(--bb-dur) var(--bb-ease), background-color var(--bb-dur) var(--bb-ease);
	}

	/* Shorthand `background` also clears the menu theme's grey hover gradient.
	   Weight is restated: the theme drops it to normal on hover, which narrows
	   the label and shifts the whole menu sideways. */
	#mega-menu-wrap-max_mega_menu_1 #mega-menu-max_mega_menu_1 > li.mega-menu-item > a.mega-menu-link:hover,
	#mega-menu-wrap-max_mega_menu_1 #mega-menu-max_mega_menu_1 > li.mega-menu-item > a.mega-menu-link:focus,
	#mega-menu-wrap-max_mega_menu_1 #mega-menu-max_mega_menu_1 > li.mega-menu-item.mega-toggle-on > a.mega-menu-link {
		color: var(--bb-navy);
		font-weight: 500;
		background: var(--bb-navy-tint);
	}

	/* "Log in" as an outlined pill, set apart from the navigation. */
	#mega-menu-wrap-max_mega_menu_1 #mega-menu-max_mega_menu_1 > li.mega-menu-item > a.mega-menu-link[href*="bbmri_login"] {
		margin-left: 0.75rem;
		padding: 0 1.25rem;
		height: 40px;
		line-height: 36px;
		border: 2px solid var(--bb-navy);
		border-radius: var(--bb-radius-pill);
		color: var(--bb-navy);
		transition: color var(--bb-dur) var(--bb-ease), background-color var(--bb-dur) var(--bb-ease), box-shadow var(--bb-dur) var(--bb-ease);
	}

	#mega-menu-wrap-max_mega_menu_1 #mega-menu-max_mega_menu_1 > li.mega-menu-item > a.mega-menu-link[href*="bbmri_login"]:hover,
	#mega-menu-wrap-max_mega_menu_1 #mega-menu-max_mega_menu_1 > li.mega-menu-item > a.mega-menu-link[href*="bbmri_login"]:focus {
		background: var(--bb-navy);
		border-color: var(--bb-navy);
		color: #fff;
		box-shadow: var(--bb-shadow-sm);
	}

	/* Dropdown panels */
	#mega-menu-wrap-max_mega_menu_1 #mega-menu-max_mega_menu_1 > li.mega-menu-item > ul.mega-sub-menu {
		border-top: 1px solid var(--bb-line);
		box-shadow: var(--bb-shadow-lg);
	}

	#mega-menu-wrap-max_mega_menu_1 #mega-menu-max_mega_menu_1 > li.mega-menu-flyout > ul.mega-sub-menu {
		border: 1px solid var(--bb-line);
		border-radius: var(--bb-radius);
		padding: 0.5rem;
		min-width: 240px;
		overflow: hidden;
	}

	/* Mega panel: full-width band, white instead of the theme's grey gradient. */
	#mega-menu-wrap-max_mega_menu_1 #mega-menu-max_mega_menu_1 > li.mega-menu-megamenu > ul.mega-sub-menu {
		background: var(--bb-surface);
		padding-top: var(--bb-space-2);
		padding-bottom: var(--bb-space-3);
	}

	/* Mega column headers: small uppercase labels, like the footer headings. */
	#mega-menu-wrap-max_mega_menu_1 #mega-menu-max_mega_menu_1 > li.mega-menu-megamenu > ul.mega-sub-menu li.mega-menu-column-standard > a.mega-menu-link,
	#mega-menu-wrap-max_mega_menu_1 #mega-menu-max_mega_menu_1 > li.mega-menu-megamenu > ul.mega-sub-menu li.mega-menu-column > ul.mega-sub-menu > li.mega-menu-item > a.mega-menu-link,
	#mega-menu-wrap-max_mega_menu_1 #mega-menu-max_mega_menu_1 > li.mega-menu-megamenu > ul.mega-sub-menu li.mega-menu-column-standard > a.mega-menu-link:hover,
	#mega-menu-wrap-max_mega_menu_1 #mega-menu-max_mega_menu_1 > li.mega-menu-megamenu > ul.mega-sub-menu li.mega-menu-column > ul.mega-sub-menu > li.mega-menu-item > a.mega-menu-link:hover {
		padding: 0 0.85rem 0.5rem;
		background: transparent;
		font-family: var(--bb-font-text);
		font-size: 0.75rem;
		font-weight: 700;
		letter-spacing: 0.1em;
		text-transform: uppercase;
		text-decoration: none;
		color: var(--bb-muted);
	}

	/* Mega items sit flush so their hover pills line up with the header text. */
	#mega-menu-wrap-max_mega_menu_1 #mega-menu-max_mega_menu_1 > li.mega-menu-megamenu > ul.mega-sub-menu li.mega-menu-column > ul.mega-sub-menu > li.mega-menu-item li.mega-menu-item,
	#mega-menu-wrap-max_mega_menu_1 #mega-menu-max_mega_menu_1 > li.mega-menu-megamenu > ul.mega-sub-menu li.mega-menu-column-standard li.mega-menu-item {
		padding: 0;
	}

	/* Submenu items, flyout and mega alike. Weight is restated on hover because
	   the theme sets it there too, and any change would shift the text. */
	#mega-menu-wrap-max_mega_menu_1 #mega-menu-max_mega_menu_1 li.mega-menu-flyout ul.mega-sub-menu li.mega-menu-item a.mega-menu-link,
	#mega-menu-wrap-max_mega_menu_1 #mega-menu-max_mega_menu_1 > li.mega-menu-megamenu > ul.mega-sub-menu li.mega-menu-column-standard li.mega-menu-item > a.mega-menu-link,
	#mega-menu-wrap-max_mega_menu_1 #mega-menu-max_mega_menu_1 > li.mega-menu-megamenu > ul.mega-sub-menu li.mega-menu-column > ul.mega-sub-menu > li.mega-menu-item li.mega-menu-item > a.mega-menu-link,
	#mega-menu-wrap-max_mega_menu_1 #mega-menu-max_mega_menu_1 > li.mega-menu-megamenu.mega-no-headers > ul.mega-sub-menu > li.mega-menu-item > a.mega-menu-link {
		border-radius: var(--bb-radius-sm);
		padding: 0.5rem 0.85rem;
		background: transparent;
		font-family: var(--bb-font-text);
		font-size: 15px;
		font-weight: 400;
		line-height: 1.4;
		text-decoration: none;
		color: var(--bb-ink);
		transition: color var(--bb-dur) var(--bb-ease), background-color var(--bb-dur) var(--bb-ease);
	}

	#mega-menu-wrap-max_mega_menu_1 #mega-menu-max_mega_menu_1 li.mega-menu-flyout ul.mega-sub-menu li.mega-menu-item a.mega-menu-link:hover,
	#mega-menu-wrap-max_mega_menu_1 #mega-menu-max_mega_menu_1 li.mega-menu-flyout ul.mega-sub-menu li.mega-menu-item a.mega-menu-link:focus,
	#mega-menu-wrap-max_mega_menu_1 #mega-menu-max_mega_menu_1 > li.mega-menu-megamenu > ul.mega-sub-menu li.mega-menu-column-standard li.mega-menu-item > a.mega-menu-link:hover,
	#mega-menu-wrap-max_mega_menu_1 #mega-menu-max_mega_menu_1 > li.mega-menu-megamenu > ul.mega-sub-menu li.mega-menu-column-standard li.mega-menu-item > a.mega-menu-link:focus,
	#mega-menu-wrap-max_mega_menu_1 #mega-menu-max_mega_menu_1 > li.mega-menu-megamenu > ul.mega-sub-menu li.mega-menu-column > ul.mega-sub-menu > li.mega-menu-item li.mega-menu-item > a.mega-menu-link:hover,
	#mega-menu-wrap-max_mega_menu_1 #mega-menu-max_mega_menu_1 > li.mega-menu-megamenu > ul.mega-sub-menu li.mega-menu-column > ul.mega-sub-menu > li.mega-menu-item li.mega-menu-item > a.mega-menu-link:focus,
	#mega-menu-wrap-max_mega_menu_1 #mega-menu-max_mega_menu_1 > li.mega-menu-megamenu.mega-no-headers > ul.mega-sub-menu > li.mega-menu-item > a.mega-menu-link:hover,
	#mega-menu-wrap-max_mega_menu_1 #mega-menu-max_mega_menu_1 > li.mega-menu-megamenu.mega-no-headers > ul.mega-sub-menu > li.mega-menu-item > a.mega-menu-link:focus {
		background: var(--bb-navy-tint);
		font-weight: 400;
		text-decoration: none;
		color: var(--bb-navy);
	}
}

/* ------------------------------------------------------------------ */
/* 3. Homepage hero (Smart Slider 3, slider #3)                       */
/* ------------------------------------------------------------------ */

/* One type family inside the slider instead of the per-layer Rubik. */
#n2-ss-3 [class*="n2-font-"],
#n2-ss-3 [class*="n2-font-"] a,
#n2-ss-3 .n2-ss-text {
	font-family: var(--bb-font-display) !important;
	letter-spacing: -0.005em;
}

/* Audience tabs: the thumbnails are PNG labels; show their text as a segmented control. */
#n2-ss-3 .nextend-thumbnail-inner {
	display: flex;
	justify-content: center;
	overflow: visible;
}

div#n2-ss-3 .nextend-thumbnail-horizontal .nextend-thumbnail-scroller {
	display: inline-flex !important;
	min-width: 0;
	width: auto;
	gap: 4px;
	padding: 4px;
	margin: 0 auto 1.5rem;
	background: var(--bb-navy-tint);
	border-radius: var(--bb-radius-pill);
	transform: none !important;
}

#n2-ss-3 .nextend-thumbnail-scroller .n2-thumbnail-dot {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 !important;
	padding: 0.55rem 1.4rem;
	border: 0 !important;
	border-radius: var(--bb-radius-pill);
	background: transparent;
	box-shadow: none;
	opacity: 1 !important;
	color: var(--bb-navy);
	font-family: var(--bb-font-display);
	font-size: 1rem;
	line-height: 1.2;
	white-space: nowrap;
	transition: background-color var(--bb-dur) var(--bb-ease), color var(--bb-dur) var(--bb-ease), box-shadow var(--bb-dur) var(--bb-ease);
}

#n2-ss-3 .nextend-thumbnail-scroller .n2-thumbnail-dot picture,
#n2-ss-3 .nextend-thumbnail-scroller .n2-thumbnail-dot img {
	display: none !important;
}

/* Smart Slider hides every ::after inside .n2-ow-all; bring this one back. */
#n2-ss-3 .nextend-thumbnail-scroller .n2-thumbnail-dot::after {
	content: attr(aria-label);
	display: block;
}

#n2-ss-3 .nextend-thumbnail-scroller .n2-thumbnail-dot:hover {
	background: rgba(255, 255, 255, 0.7);
}

#n2-ss-3 .nextend-thumbnail-scroller .n2-thumbnail-dot.n2-active {
	background: var(--bb-navy);
	color: #fff;
	box-shadow: var(--bb-shadow-sm);
}

#n2-ss-3 .nextend-thumbnail-button {
	display: none !important;
}

@media (max-width: 600px) {
	#n2-ss-3 .nextend-thumbnail-scroller .n2-thumbnail-dot {
		padding: 0.5rem 0.9rem;
		font-size: 0.9375rem;
	}
}

/* Kicker button ("For researchers") */
#n2-ss-3 .n2-ss-button-container a {
	background: var(--bb-navy) !important;
	color: #fff !important;
	border-radius: var(--bb-radius-pill) !important;
	box-shadow: var(--bb-shadow-sm);
	letter-spacing: 0.02em !important;
	transition: background-color var(--bb-dur) var(--bb-ease);
}

#n2-ss-3 .n2-ss-button-container a:hover {
	background: #fff !important;
	color: var(--bb-navy-900) !important;
}

/* Hero headline card */
#n2-ss-3 .n2-ss-text[id$="item2"] {
	background: rgba(255, 255, 255, 0.92) !important;
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	border-radius: var(--bb-radius);
	box-shadow: var(--bb-shadow);
	color: var(--bb-navy) !important;
}

/* Service cards (Find, Knowledge Base, Helpdesk, Learn) */
#n2-ss-3 .n2-ss-layer-col:has(.n2-ss-item-image-content) {
	background: var(--bb-surface) !important;
	border: 1px solid var(--bb-line);
	border-radius: var(--bb-radius) !important;
	box-shadow: var(--bb-shadow);
	transition: transform var(--bb-dur) var(--bb-ease), box-shadow var(--bb-dur) var(--bb-ease), border-color var(--bb-dur) var(--bb-ease);
}

#n2-ss-3 .n2-ss-layer-col:has(.n2-ss-item-image-content):hover {
	transform: translateY(-4px);
	box-shadow: var(--bb-shadow-lg);
	border-color: var(--bb-green);
}

#n2-ss-3 .n2-ss-layer-col:has(.n2-ss-item-image-content) .n2-ss-item-image-content img {
	transition: transform var(--bb-dur) var(--bb-ease);
}

#n2-ss-3 .n2-ss-layer-col:has(.n2-ss-item-image-content):hover .n2-ss-item-image-content img {
	transform: scale(1.05);
}

#n2-ss-3 .n2-ss-layer-col:has(.n2-ss-item-image-content) .n2-ss-text a {
	color: var(--bb-navy) !important;
	text-decoration: none;
}

#n2-ss-3 .n2-ss-layer-col:has(.n2-ss-item-image-content) .n2-ss-text:not(:has(a)) {
	color: var(--bb-muted) !important;
}

/* Previous/next arrows as round buttons */
#n2-ss-3-arrow-previous,
#n2-ss-3-arrow-next {
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: var(--bb-surface);
	border: 1px solid var(--bb-line);
	box-shadow: var(--bb-shadow);
	transition: background-color var(--bb-dur) var(--bb-ease), box-shadow var(--bb-dur) var(--bb-ease);
}

#n2-ss-3-arrow-previous img,
#n2-ss-3-arrow-next img {
	width: 22px !important;
	height: 22px !important;
}

#n2-ss-3-arrow-previous:hover,
#n2-ss-3-arrow-next:hover {
	background: var(--bb-navy-tint);
	box-shadow: var(--bb-shadow-lg);
}

/* ------------------------------------------------------------------ */
/* 4. Homepage content                                                */
/* ------------------------------------------------------------------ */

.home .entry-content > p {
	font-size: 1.125rem;
	line-height: 1.7;
}

.home .entry-content > h2.wp-block-heading {
	margin-top: var(--bb-space-6);
	margin-bottom: var(--bb-space-3);
}

/* Roadmap link as a call-to-action button */
.home .entry-content > p > a[href*="Roadmap"] {
	display: inline-flex;
	align-items: center;
	gap: 0.6em;
	padding: 0.85em 1.6em;
	border-radius: var(--bb-radius-pill);
	background: var(--bb-navy);
	color: #fff;
	font-family: var(--bb-font-display);
	text-decoration: none;
	transition: background-color var(--bb-dur) var(--bb-ease), transform var(--bb-dur) var(--bb-ease), box-shadow var(--bb-dur) var(--bb-ease);
}

.home .entry-content > p > a[href*="Roadmap"]::after {
	content: "\2192";
	transition: transform var(--bb-dur) var(--bb-ease);
}

.home .entry-content > p > a[href*="Roadmap"]:hover {
	background: var(--bb-navy-700);
	color: #fff;
	box-shadow: var(--bb-shadow);
	transform: translateY(-1px);
}

.home .entry-content > p > a[href*="Roadmap"]:hover::after {
	transform: translateX(3px);
}

/* Impact stats: navy panel, one tile per figure */
.home .entry-content .wp-block-group.has-background.is-layout-grid:has(.wp-block-column > h3 + p) {
	background: linear-gradient(135deg, var(--bb-navy) 0%, var(--bb-navy-900) 100%) !important;
	border-radius: var(--bb-radius-lg) !important;
	padding: clamp(1.25rem, 3vw, 2.5rem) !important;
	gap: clamp(1rem, 2vw, 1.5rem);
	box-shadow: var(--bb-shadow-lg);
}

.home .entry-content .wp-block-group.has-background.is-layout-grid:has(.wp-block-column > h3 + p) > .wp-block-columns {
	margin: 0;
	padding: 1.25rem 1.5rem;
	border-left: 3px solid var(--bb-green);
	background: rgba(255, 255, 255, 0.06);
	border-radius: 0 var(--bb-radius) var(--bb-radius) 0;
}

.home .entry-content .wp-block-group.has-background.is-layout-grid:has(.wp-block-column > h3 + p) h3 {
	margin: 0 0 0.35rem;
	font-size: var(--bb-stat);
	line-height: 1.05;
	color: #fff;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.02em;
}

.home .entry-content .wp-block-group.has-background.is-layout-grid:has(.wp-block-column > h3 + p) p {
	margin: 0;
	color: rgba(255, 255, 255, 0.82);
	font-size: var(--bb-text-sm);
	line-height: 1.5;
}

@media (max-width: 781px) {
	.home .entry-content .wp-block-group.has-background.is-layout-grid:has(.wp-block-column > h3 + p) {
		grid-template-columns: 1fr !important;
	}
}

@media (max-width: 600px) {
	.home .entry-content > p > a[href*="Roadmap"] {
		display: flex;
		justify-content: space-between;
		border-radius: var(--bb-radius);
	}
}

/* ------------------------------------------------------------------ */
/* 5. Latest Posts news cards (image size set in includes/ui.php)      */
/* ------------------------------------------------------------------ */

.wp-block-latest-posts.is-grid {
	gap: clamp(1rem, 2vw, 1.75rem);
	padding: 0;
}

.wp-block-latest-posts.is-grid > li {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0 0 1.25rem;
	background: var(--bb-surface);
	border: 1px solid var(--bb-line);
	border-radius: var(--bb-radius);
	box-shadow: var(--bb-shadow-sm);
	overflow: hidden;
	transition: transform var(--bb-dur) var(--bb-ease), box-shadow var(--bb-dur) var(--bb-ease);
}

.wp-block-latest-posts.is-grid > li:hover {
	transform: translateY(-3px);
	box-shadow: var(--bb-shadow-lg);
}

.wp-block-latest-posts.is-grid .wp-block-latest-posts__featured-image {
	float: none;
	margin: 0 0 1rem;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--bb-surface-alt);
}

.wp-block-latest-posts.is-grid .wp-block-latest-posts__featured-image a,
.wp-block-latest-posts.is-grid .wp-block-latest-posts__featured-image img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none !important;
	max-height: none !important;
}

.wp-block-latest-posts.is-grid .wp-block-latest-posts__featured-image img {
	object-fit: cover;
	transition: transform 400ms var(--bb-ease);
}

.wp-block-latest-posts.is-grid > li:hover .wp-block-latest-posts__featured-image img {
	transform: scale(1.04);
}

.wp-block-latest-posts.is-grid .wp-block-latest-posts__post-title {
	display: block;
	padding: 0 1.25rem;
	font-family: var(--bb-font-display);
	font-size: 1.2rem;
	line-height: 1.3;
	color: var(--bb-navy);
	text-decoration: none;
}

.wp-block-latest-posts.is-grid .wp-block-latest-posts__post-title:hover {
	color: var(--bb-green-800);
}

.wp-block-latest-posts.is-grid .wp-block-latest-posts__post-date,
.wp-block-latest-posts.is-grid .wp-block-latest-posts__post-author {
	padding: 0 1.25rem;
	color: var(--bb-muted);
	font-size: 0.875rem;
}

.wp-block-latest-posts.is-grid .wp-block-latest-posts__post-excerpt {
	display: flex;
	flex-direction: column;
	flex: 1;
	margin: 0.6rem 0 0;
	padding: 0 1.25rem;
	color: var(--bb-muted);
	font-size: var(--bb-text-sm);
	line-height: 1.6;
}

.wp-block-latest-posts.is-grid .wp-block-latest-posts__read-more {
	margin-top: auto;
	padding-top: 0.9rem;
	align-self: flex-start;
	font-weight: 600;
	color: var(--bb-navy);
	text-decoration: none;
}

.wp-block-latest-posts.is-grid .wp-block-latest-posts__read-more::after {
	content: " \2192";
}

@media (max-width: 781px) {
	.wp-block-latest-posts.is-grid {
		grid-template-columns: 1fr;
	}
}

/* Query Loop grids (news archive, category pages): same card look. */
.wp-block-post-template.is-layout-grid {
	gap: clamp(1rem, 2vw, 1.75rem);
}

.wp-block-post-template.is-layout-grid > li.wp-block-post {
	display: flex;
	flex-direction: column;
	background: var(--bb-surface);
	border: 1px solid var(--bb-line);
	border-radius: var(--bb-radius);
	box-shadow: var(--bb-shadow-sm);
	overflow: hidden;
	transition: transform var(--bb-dur) var(--bb-ease), box-shadow var(--bb-dur) var(--bb-ease);
}

.wp-block-post-template.is-layout-grid > li.wp-block-post:hover {
	transform: translateY(-3px);
	box-shadow: var(--bb-shadow-lg);
}

.wp-block-post-template.is-layout-grid > li.wp-block-post > .wp-block-group {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 0 0 1.25rem !important;
}

.wp-block-post-template.is-layout-grid > li.wp-block-post > .wp-block-group > * {
	margin-block: 0;
	padding-inline: 1.25rem;
}

.wp-block-post-template.is-layout-grid > li.wp-block-post > .wp-block-group > * + * {
	margin-top: 0.6rem;
}

.wp-block-post-template.is-layout-grid > li.wp-block-post > .wp-block-group > .wp-block-post-featured-image {
	padding-inline: 0;
	margin-bottom: 0.4rem;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--bb-surface-alt);
}

.wp-block-post-template.is-layout-grid .wp-block-post-featured-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 400ms var(--bb-ease);
}

.wp-block-post-template.is-layout-grid > li.wp-block-post:hover .wp-block-post-featured-image img {
	transform: scale(1.04);
}

.wp-block-post-template.is-layout-grid .wp-block-post-title {
	font-size: 1.3rem !important;
	line-height: 1.3;
}

.wp-block-post-template.is-layout-grid .wp-block-post-excerpt {
	color: var(--bb-muted);
	font-size: var(--bb-text-sm);
	line-height: 1.6;
}

.wp-block-post-template.is-layout-grid .wp-block-post-excerpt__excerpt {
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.wp-block-post-template.is-layout-grid .wp-block-post-date {
	margin-top: auto;
	padding-top: 0.6rem;
}

/* ------------------------------------------------------------------ */
/* 6. Footer                                                          */
/* ------------------------------------------------------------------ */

body > .wp-site-blocks > footer.wp-block-template-part {
	margin-top: var(--bb-space-6);
	background: var(--bb-surface-alt-gray);
	border-top: 1px solid var(--bb-line);
	font-size: var(--bb-text-sm);
}

footer.wp-block-template-part h3.wp-block-heading,
footer.wp-block-template-part .wp-block-search__label {
	margin-bottom: 0.75rem;
	font-family: var(--bb-font-display);
	font-size: 0.8125rem !important;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--bb-navy);
}

footer.wp-block-template-part h3.wp-block-heading strong,
footer.wp-block-template-part .wp-block-search__label strong {
	font-weight: inherit;
}

footer.wp-block-template-part .wp-block-site-tagline {
	margin-top: 0.5rem;
	color: var(--bb-muted);
}

footer.wp-block-template-part .wp-block-search__inside-wrapper {
	border: 0;
	padding: 0;
}

footer.wp-block-template-part .wp-block-search__input {
	min-width: 220px;
	padding: 0.65rem 1rem 0.65rem 2.5rem;
	border: 1px solid var(--bb-line);
	border-radius: var(--bb-radius-pill);
	background: var(--bb-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235f6b7a' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 0.95rem center;
	font-size: var(--bb-text-sm) !important;
	transition: border-color var(--bb-dur) var(--bb-ease), box-shadow var(--bb-dur) var(--bb-ease);
}

footer.wp-block-template-part .wp-block-search__input:focus {
	outline: none;
	border-color: var(--bb-navy);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--bb-navy) 18%, transparent);
}

/* Social icons: one consistent navy set instead of five brand colours. */
footer.wp-block-template-part .wp-block-social-links {
	gap: 0.5rem;
}

footer.wp-block-template-part .wp-block-social-links .wp-social-link {
	background-color: var(--bb-navy);
	color: #fff;
	transition: background-color var(--bb-dur) var(--bb-ease), transform var(--bb-dur) var(--bb-ease);
}

footer.wp-block-template-part .wp-block-social-links .wp-social-link:hover {
	background-color: var(--bb-green-800);
	transform: translateY(-2px);
}

footer.wp-block-template-part .wp-block-social-links .wp-social-link svg {
	fill: currentColor;
}

/* Bottom bar: legal links and copyright */
footer.wp-block-template-part .wp-block-group.alignfull.is-content-justification-space-between:last-child {
	margin-top: var(--bb-space-4);
	padding-top: var(--bb-space-3);
	border-top: 1px solid var(--bb-line);
	color: var(--bb-muted);
}

footer.wp-block-template-part a {
	color: var(--bb-ink);
}

/* ------------------------------------------------------------------ */
/* 7. Plugin skins                                                    */
/* ------------------------------------------------------------------ */

/* The Events Calendar reads these from :root; html:root outranks it
   wherever its stylesheet ends up in the page. */
html:root {
	--tec-color-accent-primary: var(--bb-navy);
	--tec-color-accent-primary-hover: var(--bb-navy-700);
	--tec-color-accent-primary-active: var(--bb-navy-900);
	--tec-color-accent-primary-background: var(--bb-navy-tint);
	--tec-color-button-primary: var(--bb-navy);
	--tec-color-button-primary-hover: var(--bb-navy-700);
	--tec-color-button-primary-active: var(--bb-navy-900);
	--tec-color-button-primary-background: var(--bb-navy-tint);
	--tec-color-link-accent: var(--bb-navy);
	--tec-color-link-accent-hover: var(--bb-green-800);
	--tec-font-family-sans-serif: var(--bb-font-text);
}

.tribe-common .tribe-common-h1,
.tribe-common .tribe-common-h2,
.tribe-common .tribe-common-h3,
.tribe-common .tribe-common-h4,
.tribe-common .tribe-common-h5,
.tribe-common .tribe-common-h6 {
	font-family: var(--bb-font-display);
	font-weight: 400;
	color: var(--bb-navy);
}

.tribe-common .tribe-common-c-btn,
.tribe-common a.tribe-common-c-btn {
	border-radius: var(--bb-radius-pill);
	font-family: var(--bb-font-display);
	font-weight: 400;
}

/* BetterDocs category grid (Knowledge Base) */
.betterdocs-category-grid-wrapper .betterdocs-single-category-wrapper {
	border: 1px solid var(--bb-line);
	border-radius: var(--bb-radius) !important;
	box-shadow: var(--bb-shadow-sm) !important;
	overflow: hidden;
	transition: transform var(--bb-dur) var(--bb-ease), box-shadow var(--bb-dur) var(--bb-ease);
}

.betterdocs-category-grid-wrapper .betterdocs-single-category-wrapper:hover {
	transform: translateY(-3px);
	box-shadow: var(--bb-shadow-lg) !important;
}

.betterdocs-category-grid-wrapper .betterdocs-category-title,
.betterdocs-category-grid-wrapper .betterdocs-category-title a {
	font-family: var(--bb-font-display) !important;
	color: var(--bb-navy) !important;
}

.betterdocs-category-grid-wrapper .betterdocs-category-items-counts,
.betterdocs-category-grid-wrapper .betterdocs-category-items-counts span {
	background-color: var(--bb-navy-tint) !important;
	color: var(--bb-navy) !important;
}

.betterdocs-category-grid-wrapper .betterdocs-category-header {
	border-bottom-color: var(--bb-green) !important;
}

.betterdocs-category-grid-wrapper .betterdocs-articles-list a {
	color: var(--bb-text) !important;
	text-decoration: none;
}

.betterdocs-category-grid-wrapper .betterdocs-articles-list a:hover {
	color: var(--bb-navy) !important;
	text-decoration: underline;
}

.betterdocs-search-form-wrapper {
	border-radius: var(--bb-radius-lg);
}

.betterdocs-search-form-wrapper .betterdocs-searchform {
	border-radius: var(--bb-radius-pill) !important;
	border: 1px solid var(--bb-line);
	box-shadow: var(--bb-shadow) !important;
}

/* ------------------------------------------------------------------ */
/* 8. Account page (ag-rcp-profile module, page "account")            */
/* ------------------------------------------------------------------ */

/* Tinted band, full bleed: cancel the post content's root padding. */
.entry-content > .bbmri-profile-page {
	width: auto;
	max-width: none;
	margin: var(--bb-space-3) calc(var(--wp--style--root--padding-right, 0px) * -1) 0 calc(var(--wp--style--root--padding-left, 0px) * -1) !important;
	padding: var(--bb-space-5) 0 var(--bb-space-6);
	background: var(--bb-surface-alt);
	border-top: 1px solid var(--bb-line);
	font-family: inherit;
	color: var(--bb-text);
}

/* Band runs straight into the footer. */
body:has(.bbmri-profile-page) main#wp--skip-link--target,
body:has(.bbmri-profile-page) main#wp--skip-link--target > .wp-block-group:has(.bbmri-profile-page) {
	margin-bottom: 0;
	padding-bottom: 0 !important;
}

body:has(.bbmri-profile-page) > .wp-site-blocks > footer.wp-block-template-part {
	margin-top: 0;
}

.bbmri-profile-page .bbmri-profile-page-inner {
	max-width: 960px;
	padding-inline: var(--wp--style--root--padding-left, 1.5rem);
}

.bbmri-profile-page .bbmri-page-header p {
	margin: 0;
	color: var(--bb-muted);
	font-size: 1.0625rem;
}

.bbmri-profile-page .bbmri-text-muted {
	color: var(--bb-muted);
	font-size: var(--bb-text-sm);
}

.bbmri-profile-page .bbmri-card {
	padding: clamp(1.25rem, 1rem + 1.5vw, 2.25rem);
	background: var(--bb-surface);
	border: 1px solid var(--bb-line);
	border-radius: var(--bb-radius);
	box-shadow: var(--bb-shadow-sm);
}

.bbmri-profile-page .bbmri-card-title,
.bbmri-profile-page .bbmri-profile-form > h2.wp-block-post-title {
	margin: 0 0 var(--bb-space-2);
	font-family: var(--bb-font-display);
	font-size: clamp(1.35rem, 1.2rem + 0.5vw, 1.6rem);
	font-weight: 500;
	line-height: 1.25;
	color: var(--bb-navy);
}

/* The form prints its own heading, so drop the card's duplicate. */
.bbmri-profile-page .bbmri-card:has(.bbmri-profile-form > h2) > .bbmri-card-title {
	display: none;
}

.bbmri-profile-page .ag-rcp-profile-intro {
	margin: 0 0 var(--bb-space-3);
	color: var(--bb-muted);
	font-size: 1rem;
}

.bbmri-profile-page .ag-rcp-profile-intro strong {
	font-weight: 400;
}

/* Form fields */
.bbmri-profile-page .ag-rcp-profile-form {
	max-width: 640px;
}

.bbmri-profile-page .ag-rcp-profile-form .ag-rcp-field {
	gap: 0.4rem;
	margin: 0 0 1.1rem;
}

.bbmri-profile-page .ag-rcp-profile-form .ag-rcp-label {
	padding-top: 0;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--bb-ink);
}

.bbmri-profile-page .ag-rcp-profile-form .required {
	color: var(--bb-orange);
}

.bbmri-profile-page .ag-rcp-profile-form .ag-rcp-control input[type="text"],
.bbmri-profile-page .ag-rcp-profile-form .ag-rcp-control input[type="email"],
.bbmri-profile-page .ag-rcp-profile-form .ag-rcp-control select,
.bbmri-profile-page .ag-rcp-profile-form .select2-container .select2-selection--single {
	max-width: none;
	height: 46px;
	border: 1px solid #cdd5df;
	border-radius: var(--bb-radius-sm);
	background-color: var(--bb-surface);
	font-family: inherit;
	font-size: 1rem;
	color: var(--bb-ink);
	transition: border-color var(--bb-dur) var(--bb-ease), box-shadow var(--bb-dur) var(--bb-ease);
}

.bbmri-profile-page .ag-rcp-profile-form .select2-container {
	max-width: none;
}

.bbmri-profile-page .ag-rcp-profile-form .select2-container .select2-selection--single .select2-selection__rendered {
	line-height: 44px;
	color: var(--bb-ink);
}

.bbmri-profile-page .ag-rcp-profile-form .ag-rcp-control input:focus,
.bbmri-profile-page .ag-rcp-profile-form .ag-rcp-control select:focus,
.bbmri-profile-page .ag-rcp-profile-form .select2-container--focus .select2-selection--single,
.bbmri-profile-page .ag-rcp-profile-form .select2-container--open .select2-selection--single {
	outline: none;
	border-color: var(--bb-navy);
	box-shadow: 0 0 0 3px rgba(0, 54, 116, 0.15);
}

.bbmri-profile-page .ag-rcp-profile-form .ag-rcp-control input[readonly] {
	background-color: var(--bb-surface-alt);
	border-style: dashed;
	color: var(--bb-muted);
}

.bbmri-profile-page .ag-rcp-profile-form p:last-of-type {
	display: block;
	max-width: none;
	text-align: left;
	margin-top: var(--bb-space-3);
	padding-top: var(--bb-space-3);
	border-top: 1px solid var(--bb-line);
}

/* Buttons: primary submit, outlined secondary and logout. */
.bbmri-profile-page .ag-rcp-profile-form p:last-of-type button,
.bbmri-profile-page .ag-rcp-profile-form button[type="submit"] {
	height: 46px;
	padding: 0 1.6rem;
	border: 0;
	border-radius: var(--bb-radius-pill);
	background: var(--bb-navy);
	box-shadow: none;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 600;
	color: #fff;
	transition: background-color var(--bb-dur) var(--bb-ease);
}

.bbmri-profile-page .ag-rcp-profile-form p:last-of-type button:hover,
.bbmri-profile-page .ag-rcp-profile-form button[type="submit"]:hover {
	background: var(--bb-navy-700);
	filter: none;
}

.bbmri-profile-page a.ag-btn,
.bbmri-profile-page .rcp_sub_details_change_membership button {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	height: 42px;
	padding: 0 1.25rem;
	border: 1.5px solid var(--bb-navy);
	border-radius: var(--bb-radius-pill);
	background: transparent;
	box-shadow: none;
	font-family: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--bb-navy);
	text-decoration: none;
	cursor: pointer;
	transition: color var(--bb-dur) var(--bb-ease), background-color var(--bb-dur) var(--bb-ease);
}

.bbmri-profile-page a.ag-btn:hover,
.bbmri-profile-page a.ag-btn:focus-visible,
.bbmri-profile-page .rcp_sub_details_change_membership:hover button {
	background: var(--bb-navy);
	color: #fff;
	filter: none;
}

.bbmri-profile-page a.ag-btn.ag-btn-ghost {
	border-color: var(--bb-line);
	background: var(--bb-surface);
}

.bbmri-profile-page a.ag-btn.ag-btn-ghost:hover {
	border-color: var(--bb-navy);
}

.bbmri-profile-page .rcp_sub_details_change_membership {
	text-decoration: none;
}

.bbmri-profile-page .rcp_sub_details_change_membership button {
	height: 34px;
	padding: 0 0.9rem;
	font-size: 0.8125rem;
	white-space: nowrap;
}

/* Account details tables */
.bbmri-profile-page .bbmri-account-details h3 {
	margin: var(--bb-space-3) 0 var(--bb-space-1);
	font-family: var(--bb-font-text);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--bb-muted);
}

.bbmri-profile-page .bbmri-account-details h3:first-child {
	margin-top: 0;
}

.bbmri-profile-page .bbmri-account-details table {
	margin: 0;
	border: 1px solid var(--bb-line);
	border-radius: var(--bb-radius-sm);
	border-collapse: separate;
	border-spacing: 0;
	overflow: hidden;
	font-size: var(--bb-text-sm);
}

.bbmri-profile-page .bbmri-account-details th,
.bbmri-profile-page .bbmri-account-details td {
	padding: 0.75rem 1rem;
	border: 0;
	border-bottom: 1px solid var(--bb-line);
}

.bbmri-profile-page .bbmri-account-details tr:last-child td {
	border-bottom: 0;
}

.bbmri-profile-page .bbmri-account-details th {
	background: var(--bb-surface-alt);
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--bb-muted);
}

.bbmri-profile-page .bbmri-account-details td[colspan] {
	color: var(--bb-muted);
	text-align: center;
}

.bbmri-profile-page .bbmri-footer {
	margin-top: var(--bb-space-1);
}

/* ------------------------------------------------------------------ */
/* 9. Motion preferences                                              */
/* ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
