/* =====================================================================
 * Baumlinks Theme Polish — scoped Divi front-end refinements.
 * Palette: brand navy #1b2b48, accent orange #e8590c, neutral grays.
 * ===================================================================== */

:root {
	--bml-navy: #1b2b48;
	--bml-accent: #e8590c;
	--bml-lego-blue: #0b5cc4;
	--bml-ink: #111827;
	--bml-muted: #6b7280;
	--bml-line: #e5e7eb;
}

/* =====================================================================
 * 1. MAIN NAVIGATION
 * ===================================================================== */

/* Subtle header depth. */
#main-header {
	box-shadow: 0 2px 0 rgba(11, 92, 196, 0.12), 0 8px 28px rgba(15, 23, 42, 0.06) !important;
}

/* Restore the fixed-header offset that Divi zeroes out because the Theme
   Builder *footer* adds the .et-tb class to <body>. This site uses the classic
   fixed header (not a TB header), so without this the header overlaps the
   disclaimer banner injected right below it. */
body.et_fixed_nav.et_show_nav.et-tb #page-container,
body.et_fixed_nav.et_show_nav.et-tb-has-footer #page-container,
body.et_fixed_nav.et_show_nav.et-tb-has-template #page-container {
	padding-top: 80px !important;
}

/* --- Desktop header rebuilt as flexbox: [logo] .......... [menu + search].
   Scoped to >=981px so Divi's separate mobile menu is left fully intact.
   This removes the float collisions (Home overlapping the logo, search icon
   floating off). --- */
@media (min-width: 981px) {
	#main-header .et_menu_container {
		display: flex !important;
		align-items: center !important;
		justify-content: space-between !important;
		gap: 40px;
	}

	#main-header .logo_container {
		position: static !important;
		float: none !important;
		width: auto !important;
		height: auto !important;
		margin: 0 !important;
		flex: 0 0 auto;
	}
	#main-header .logo_container .logo_helper {
		position: static !important;
		height: auto !important;
	}
	#main-header #logo {
		position: static !important;
		width: auto !important;
		height: auto !important;
		max-height: 54px !important;
	}
	#main-header.et-fixed-header #logo {
		max-height: 40px !important;
	}

	#et-top-navigation {
		display: flex !important;
		align-items: center !important;
		justify-content: flex-end;
		gap: 8px;
		float: none !important;
		width: auto !important;
		padding: 0 !important;
		margin-left: auto !important;
	}
	#top-menu-nav { float: none !important; width: auto !important; }
	#top-menu {
		display: flex !important;
		align-items: center;
		gap: 6px;
	}
	#et_top_search {
		display: flex !important;
		align-items: center;
		position: static !important;
		margin: 0 0 0 4px !important;
		padding: 0 !important;
	}
	#et_search_icon {
		position: static !important;
		top: auto !important;
		right: auto !important;
		margin: 0 0 0 8px !important;
		width: 42px !important;
		height: 42px !important;
		display: inline-flex !important;
		align-items: center !important;
		justify-content: center !important;
		border: 2px solid #ffffff !important;
		border-radius: 12px !important;
		background: rgba(255, 255, 255, 0.18) !important;
		cursor: pointer;
		transition: background 0.15s ease, transform 0.12s ease;
	}
	#et_search_icon:hover {
		background: #ffffff !important;
		transform: translateY(-1px);
	}

	/* Pin the (fixed) header to its expected 79px height so the disclaimer
	   banner injected right below it is never overlapped on load. */
	#main-header:not(.et-fixed-header),
	#main-header:not(.et-fixed-header) .et_menu_container {
		height: 80px !important;
		min-height: 80px !important;
	}
}

/* --- Responsive: tighten the bar on smaller desktops / landscape tablets so
   items don't crowd the logo. (Below 981px Divi switches to its mobile menu.) --- */
@media (min-width: 981px) and (max-width: 1119px) {
	#main-header #logo { max-height: 46px !important; }
	#main-header .et_menu_container { gap: 22px; }
	#top-menu { gap: 2px !important; }
	#top-menu li a { font-size: 13.5px !important; }
	#top-menu > li > a { padding: 7px 10px !important; }
}

/* --- Fun, clean palette: vibrant LEGO blue links on the yellow bar (no black),
   white "brick" pill on hover, solid-blue pill for the current page. --- */
#top-menu li a {
	font-weight: 700 !important;
	letter-spacing: 0.2px;
	color: var(--bml-lego-blue) !important;
	border: none !important;
	box-shadow: none !important;
	transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

#top-menu li > a::before,
#top-menu li > a::after {
	display: none !important;
	content: none !important;
}

#top-menu > li { white-space: nowrap !important; }

#top-menu > li > a {
	padding: 8px 15px !important;
	border-radius: 10px !important;
}

#top-menu > li:hover > a {
	background: #ffffff !important;
	color: var(--bml-lego-blue) !important;
	box-shadow: 0 3px 10px rgba(11, 92, 196, 0.2) !important;
}

#top-menu > li.current-menu-item > a,
#top-menu > li.current-menu-ancestor > a {
	background: var(--bml-lego-blue) !important;
	color: #ffffff !important;
}

/* Search icon glyph: on-brand blue, centered in its button. */
#et_search_icon::before {
	color: var(--bml-lego-blue) !important;
	font-size: 20px !important;
	line-height: 1 !important;
	margin: 0 !important;
	top: auto !important;
	right: auto !important;
	position: static !important;
}

/* Open search field = clean white, clearly-typeable box, aligned to the right. */
#et_top_search .et-search-form {
	max-width: 440px !important;
	margin-left: auto !important;
	margin-right: 0 !important;
}

#et_top_search .et-search-field {
	border: 2px solid #ffffff !important;
	border-radius: 12px !important;
	background: #ffffff !important;
	color: var(--bml-lego-blue) !important;
	font-weight: 600 !important;
	padding: 12px 18px !important;
	height: auto !important;
	box-shadow: 0 6px 20px rgba(15, 23, 42, 0.18) !important;
}

#et_top_search .et-search-field::placeholder {
	color: rgba(11, 92, 196, 0.55) !important;
}

#et_top_search .et_close_search_field::before {
	color: var(--bml-lego-blue) !important;
}

/* Dropdowns: white, rounded card with vertically-stacked items. */
#top-menu li ul.sub-menu {
	background: #ffffff !important;
	border: none !important;
	border-radius: 14px !important;
	box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18) !important;
	padding: 8px 0 !important;
	margin-top: 12px !important;
	min-width: 240px !important;
	width: max-content !important;
	max-width: 320px !important;
}

/* Invisible hover "bridge" across the visual gap so the dropdown stays open
   while the cursor travels from the menu item down into it. */
#top-menu li ul.sub-menu::before {
	content: "";
	position: absolute;
	top: -16px;
	left: 0;
	right: 0;
	height: 16px;
	background: transparent;
}

/* Force every dropdown item to stack vertically and fill the card — this
   stops the items from floating off horizontally to the right. */
#top-menu li ul.sub-menu li {
	display: block !important;
	float: none !important;
	width: 100% !important;
	margin: 0 !important;
	white-space: normal !important;
}

#top-menu li ul.sub-menu li a {
	display: block !important;
	float: none !important;
	width: 100% !important;
	padding: 11px 20px !important;
	font-weight: 600 !important;
	line-height: 1.35 !important;
	white-space: normal !important;
	color: var(--bml-lego-blue) !important;
	background: transparent !important;
	border-radius: 0 !important;
	transition: background 0.15s ease, color 0.15s ease;
}

#top-menu li ul.sub-menu li a:hover {
	background: #eaf3fe !important;
	color: var(--bml-lego-blue) !important;
}

/* =====================================================================
 * 2. FOOTER  (.baumlinks-footer code module)
 * Only the link *color* is locked (white via inline !important) — that
 * reads well on navy, so we refine everything else: layout, type, spacing.
 * ===================================================================== */

body .baumlinks-footer {
	background: var(--bml-navy) !important;
	border-top: 3px solid var(--bml-accent);
	display: grid !important;
	grid-template-columns: repeat(3, 1fr) !important;
	gap: 36px !important;
	align-items: start;
	padding: 52px 7% !important;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif !important;
}

body .baumlinks-footer > div {
	flex: none !important;
	margin: 0 !important;
}

/* Clean links: drop the heavy underline + bold, refine size/spacing. */
body .baumlinks-footer a {
	display: block;
	text-decoration: none !important;
	font-weight: 600 !important;
	font-size: 14px !important;
	line-height: 1.4;
	margin-bottom: 11px !important;
	letter-spacing: 0.2px;
	transition: color 0.18s ease, opacity 0.18s ease;
}

body .baumlinks-footer a:hover {
	color: #ffffff !important;
	opacity: 0.85;
}

/* Muted supporting copy. */
body .baumlinks-footer p {
	color: #9fb1c9 !important;
	font-size: 13px !important;
	line-height: 1.55 !important;
}

/* Social row: left-aligned, accent icons, hover lift. */
body .baumlinks-footer .et_pb_row_5 {
	justify-content: flex-start !important;
	gap: 6px;
	margin-top: 4px;
}

body .baumlinks-footer .et_pb_icon_wrap .et-pb-icon {
	color: var(--bml-accent) !important;
	font-size: 22px !important;
	transition: transform 0.18s ease, color 0.18s ease;
}

body .baumlinks-footer .et_pb_module.et_pb_icon:hover .et-pb-icon {
	transform: translateY(-2px);
	color: #ffffff !important;
}

@media (max-width: 980px) {
	body .baumlinks-footer {
		grid-template-columns: 1fr 1fr !important;
		gap: 28px !important;
	}
}

@media (max-width: 600px) {
	body .baumlinks-footer {
		grid-template-columns: 1fr !important;
		padding: 38px 8% !important;
		gap: 22px !important;
		text-align: left;
	}
}

/* =====================================================================
 * 3. BLOG — card grid (.et_pb_blog_grid .et_pb_post)
 * ===================================================================== */

.et_pb_blog_grid .et_pb_post {
	background: #ffffff !important;
	border: 1px solid var(--bml-line) !important;
	border-radius: 16px !important;
	overflow: hidden !important;
	padding: 0 0 4px !important;
	margin-bottom: 28px !important;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 6px 18px rgba(16, 24, 40, 0.05);
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
	display: flex;
	flex-direction: column;
}

.et_pb_blog_grid .et_pb_post:hover {
	transform: translateY(-4px);
	box-shadow: 0 14px 34px rgba(16, 24, 40, 0.12);
	border-color: #d1d5db !important;
}

/* Edge-to-edge cover image with a consistent aspect ratio. */
.et_pb_blog_grid .et_pb_post .et_pb_image_container {
	margin: 0 0 4px !important;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: #f3f4f6;
}

.et_pb_blog_grid .et_pb_post .et_pb_image_container img {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.et_pb_blog_grid .et_pb_post:hover .et_pb_image_container img {
	transform: scale(1.04);
}

/* Padded content area. */
.et_pb_blog_grid .et_pb_post .entry-title {
	padding: 18px 20px 0 !important;
	margin: 0 !important;
	font-size: 1.12rem !important;
	line-height: 1.32 !important;
	font-weight: 800 !important;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.et_pb_blog_grid .et_pb_post .entry-title a {
	color: var(--bml-ink) !important;
	transition: color 0.15s ease;
}

.et_pb_blog_grid .et_pb_post:hover .entry-title a {
	color: var(--bml-accent) !important;
}

.et_pb_blog_grid .et_pb_post .post-meta {
	padding: 10px 20px 0 !important;
	margin: 0 !important;
	font-size: 0.78rem !important;
	color: var(--bml-muted) !important;
}

.et_pb_blog_grid .et_pb_post .post-meta a {
	color: var(--bml-navy) !important;
	font-weight: 600;
}

.et_pb_blog_grid .et_pb_post .post-content {
	padding: 10px 20px 18px !important;
	margin: 0 !important;
}

.et_pb_blog_grid .et_pb_post .post-content,
.et_pb_blog_grid .et_pb_post .post-content-inner p {
	font-size: 0.9rem !important;
	line-height: 1.55 !important;
	color: #4b5563 !important;
}

.et_pb_blog_grid .et_pb_post .post-content-inner {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* No-thumbnail cards still look intentional. */
.et_pb_blog_grid .et_pb_post.et_pb_no_thumb .entry-title {
	padding-top: 20px !important;
}

@media (prefers-reduced-motion: reduce) {
	#top-menu > li > a::after,
	.et_pb_blog_grid .et_pb_post,
	.et_pb_blog_grid .et_pb_post .et_pb_image_container img,
	body .baumlinks-footer .et_pb_icon_wrap .et-pb-icon {
		transition: none !important;
	}
}
