/**
 * Miglior CRM - Kadence overrides.
 *
 * Aligns Kadence's header builder, navigation, mobile drawer and content
 * wrappers with the design. Layout choices (which items go in which row,
 * sticky on/off) stay in the Customizer; this file only handles the look.
 */

/* ==========================================================================
   Header
   ========================================================================== */

#masthead .site-main-header-wrap .site-header-row-container-inner {
	border-bottom: 1px solid var(--mc-border);
	background: rgba(255, 255, 255, 0.96);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
}

#masthead .site-main-header-inner-wrap {
	min-height: var(--mc-header-h);
}

/* Logo */
#masthead .site-branding a.brand img {
	width: auto;
	max-height: 42px;
}

@media (max-width: 1024px) {
	#masthead .site-branding a.brand img {
		max-height: 34px;
	}
}

/* Desktop navigation */
#masthead .header-navigation .header-menu-container > ul > li.menu-item > a {
	color: var(--mc-ink);
	font-family: var(--mc-font-nav);
	font-size: 0.9375rem; /* 15 */
	font-weight: 700;
	letter-spacing: 0;
	text-transform: none;
}

#masthead .header-navigation .header-menu-container > ul > li.menu-item > a:hover,
#masthead .header-navigation .header-menu-container > ul > li.menu-item.current-menu-item > a,
#masthead .header-navigation .header-menu-container > ul > li.menu-item.current-menu-ancestor > a {
	color: var(--mc-brand-dark);
}

/* Dropdowns */
/* No overflow: hidden here: it would clip the 3rd-level flyouts.
   Corners are rounded on the first/last links instead. */
#masthead .header-navigation ul ul.sub-menu {
	border: 1px solid var(--mc-border);
	border-radius: var(--mc-radius-md);
	background: var(--mc-white);
	box-shadow: var(--mc-shadow-md);
}

#masthead .header-navigation ul ul.sub-menu li.menu-item > a {
	padding-block: 0.625rem;
	border-bottom: 0;
	color: var(--mc-ink);
	font-size: var(--mc-fs-sm);
	font-weight: 600;
	text-transform: none;
	letter-spacing: 0;
}

#masthead .header-navigation ul ul.sub-menu > li.menu-item:first-child > a {
	border-top-left-radius: calc(var(--mc-radius-md) - 1px);
	border-top-right-radius: calc(var(--mc-radius-md) - 1px);
}

#masthead .header-navigation ul ul.sub-menu > li.menu-item:last-child > a {
	border-bottom-left-radius: calc(var(--mc-radius-md) - 1px);
	border-bottom-right-radius: calc(var(--mc-radius-md) - 1px);
}

/* 3rd level: flyout aligned with the hovered item. No gap on the left,
   or the pointer would leave the hover area on its way to the flyout. */
#masthead .header-navigation ul ul.sub-menu ul.sub-menu {
	top: -1px;
}

#masthead .header-navigation ul ul.sub-menu li.menu-item > a:hover {
	background: var(--mc-gray-100);
	color: var(--mc-brand-dark);
}

/* Current page in a dropdown: black background, white text (overrides
   Kadence's grey-on-grey current item) */
#masthead .header-navigation ul ul.sub-menu li.menu-item.current-menu-item > a,
#masthead .header-navigation ul ul.sub-menu li.menu-item.current-menu-item > a:hover {
	background: var(--mc-ink);
	color: var(--mc-white);
}

/* --------------------------------------------------------------------------
   Mega menu (inc/mega-menu.php). The panel is the item's own ul.sub-menu,
   stretched across the header row and aligned with the content container.
   ----------------------------------------------------------------------- */

#masthead .site-main-header-wrap .site-header-row-container-inner {
	position: relative;
}

#masthead .header-navigation li.mc-mega {
	position: static;
}

#masthead .header-navigation li.mc-mega > ul.mc-mega__panel {
	display: grid;
	grid-template-columns: repeat(var(--mc-mega-cols, 3), minmax(170px, 230px));
	gap: var(--mc-space-8) var(--mc-space-12);
	align-items: start;
	top: 100%;
	right: 0;
	left: 0;
	padding: var(--mc-space-8) max(var(--mc-gutter), calc((100% - var(--mc-container)) / 2));
	border: 0;
	/* The panel covers the header row's bottom border (absolute offsets start
	   inside it), so it draws its own divider plus a faint inner shade. */
	border-top: 1px solid var(--mc-border);
	border-bottom: 1px solid var(--mc-border);
	border-radius: 0;
	background: var(--mc-white) linear-gradient(to bottom, rgba(11, 26, 46, 0.035), rgba(11, 26, 46, 0) 10px) no-repeat;
	box-shadow: 0 28px 40px -28px rgba(11, 26, 46, 0.28);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.15s ease, visibility 0s linear 0.15s;
}

#masthead .header-navigation li.mc-mega > ul.mc-mega__panel.has-intro {
	grid-template-columns: minmax(240px, 290px) repeat(var(--mc-mega-cols, 3), minmax(170px, 230px));
}

/* Same open states as Kadence's dropdowns (hover, keyboard toggle, focus) */
#masthead .header-navigation li.mc-mega:hover > ul.mc-mega__panel,
#masthead .header-navigation li.mc-mega.menu-item--toggled-on > ul.mc-mega__panel,
#masthead .header-navigation li.mc-mega:not(.menu-item--has-toggle):focus-within > ul.mc-mega__panel {
	opacity: 1;
	visibility: visible;
	transition-delay: 0s;
}

/* Hover bridge over the gap between the menu link and the panel */
#masthead .header-navigation li.mc-mega > ul.mc-mega__panel::before {
	content: "";
	position: absolute;
	right: 0;
	bottom: 100%;
	left: 0;
	height: 18px;
}

/* No dropdown arrows or keyboard toggles inside the panel */
#masthead .header-navigation .mc-mega__panel .dropdown-nav-toggle,
#masthead .header-navigation .mc-mega__panel .dropdown-nav-special-toggle {
	display: none;
}

#masthead .header-navigation .mc-mega__panel .nav-drop-title-wrap {
	padding-right: 0;
}

/* Intro card */
#masthead .header-navigation .mc-mega__intro {
	display: flex;
	flex-direction: column;
	gap: var(--mc-space-2);
	align-self: stretch;
	padding: var(--mc-space-6);
	border-radius: var(--mc-radius-md);
	background: var(--mc-ink);
	color: var(--mc-on-dark-2);
}

#masthead .header-navigation .mc-mega__title {
	margin: 0;
	color: var(--mc-white);
	font-family: var(--mc-font-display);
	font-size: 1.25rem;
	font-weight: 800;
	line-height: 1.1;
	text-transform: none;
}

#masthead .header-navigation .mc-mega__text {
	margin: 0;
	font-size: var(--mc-fs-sm);
	line-height: 1.5;
}

#masthead .header-navigation .mc-mega__cta {
	margin-top: auto;
	padding-top: var(--mc-space-4);
	color: var(--mc-brand-light);
	font-size: var(--mc-fs-xs);
	font-weight: 800;
	letter-spacing: 0.04em;
	text-decoration: none;
	text-transform: uppercase;
}

#masthead .header-navigation .mc-mega__cta:hover {
	color: var(--mc-white);
}

/* Column heading (beats the dropdown link rule: ul ul.sub-menu li.menu-item > a) */
#masthead .header-navigation ul.mc-mega__panel > li.mc-mega__col.menu-item > a {
	width: auto;
	margin-bottom: var(--mc-space-2);
	padding: 0 0 var(--mc-space-3);
	border-bottom: 1px solid var(--mc-border);
	border-radius: 0;
	background: none;
	color: var(--mc-ink);
	font-family: var(--mc-font-display);
	font-size: var(--mc-fs-xs);
	font-weight: 800;
	letter-spacing: 0;
	text-transform: none;
}

#masthead .header-navigation ul.mc-mega__panel > li.mc-mega__col.menu-item > a[href]:hover,
#masthead .header-navigation ul.mc-mega__panel > li.mc-mega__col.menu-item.current-menu-item > a {
	background: none;
	color: var(--mc-brand-dark);
}

#masthead .header-navigation ul.mc-mega__panel > li.mc-mega__col.menu-item > a:not([href]) {
	color: var(--mc-text-muted);
	cursor: default;
}

/* Column links: always visible, no flyout */
#masthead .header-navigation .mc-mega__col > ul.sub-menu {
	position: static;
	display: block;
	min-height: 0;
	height: auto;
	padding: 0;
	overflow: visible;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	clip: auto;
	opacity: 1;
	visibility: inherit;
	transform: none;
}

#masthead .header-navigation .mc-mega__col > ul.sub-menu > li.menu-item > a {
	width: auto;
	margin-inline: calc(var(--mc-space-3) * -1);
	padding: var(--mc-space-2) var(--mc-space-3);
	border-radius: var(--mc-radius-sm);
	line-height: 1.35;
}

#masthead .header-navigation .mc-mega__col > ul.sub-menu > li.menu-item.current-menu-item > a,
#masthead .header-navigation .mc-mega__col > ul.sub-menu > li.menu-item.current-menu-item > a:hover {
	background: var(--mc-brand-tint);
	color: var(--mc-brand-dark);
}

#masthead .header-navigation .mc-mega__desc {
	display: block;
	margin-top: 2px;
	color: var(--mc-text-muted);
	font-size: var(--mc-fs-2xs);
	font-weight: 500;
}

/* Header button = primary .mc-btn */
#masthead .header-button-wrap .header-button {
	display: inline-flex;
	align-items: center;
	gap: var(--mc-space-2);
	padding: 0.75rem 1.375rem;
	border: 0;
	border-radius: var(--mc-radius-sm);
	background: var(--mc-brand);
	color: var(--mc-white);
	font-family: var(--mc-font-display);
	font-size: var(--mc-fs-xs);
	font-weight: 800;
	letter-spacing: 0;
	text-transform: none;
	box-shadow: none;
}

#masthead .header-button-wrap .header-button:hover,
#masthead .header-button-wrap .header-button:focus-visible {
	background: var(--mc-brand-dark);
	color: var(--mc-white);
}

/* Mobile toggle */
#masthead .menu-toggle-open {
	color: var(--mc-ink);
}

/* ==========================================================================
   Mobile drawer
   ========================================================================== */

#mobile-drawer .drawer-inner {
	background: var(--mc-ink);
	color: var(--mc-white);
}

#mobile-drawer .mobile-navigation ul li > a,
#mobile-drawer .mobile-navigation ul li .drawer-nav-drop-wrap {
	color: var(--mc-white);
	font-family: var(--mc-font-display);
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	text-transform: none;
}

#mobile-drawer .mobile-navigation ul ul li > a {
	font-family: var(--mc-font-body);
	font-size: var(--mc-fs-body);
	font-weight: 600;
	text-transform: none;
}

#mobile-drawer .mobile-navigation ul li:not(.menu-item-has-children) a,
#mobile-drawer .mobile-navigation ul li .drawer-nav-drop-wrap {
	border-bottom-color: var(--mc-on-dark-border);
}

#mobile-drawer .mobile-navigation ul li.current-menu-item > a,
#mobile-drawer .mobile-navigation ul li > a:hover {
	color: var(--mc-brand-light);
}

#mobile-drawer .drawer-toggle {
	color: var(--mc-white);
}

/* "#" headings (inc/mega-menu.php): a small label, links always open */
#mobile-drawer .mobile-navigation li.mc-menu-heading > .drawer-nav-drop-wrap {
	border-bottom: 0;
}

#mobile-drawer .mobile-navigation li.mc-menu-heading > .drawer-nav-drop-wrap > a,
#mobile-drawer .mobile-navigation li.mc-menu-heading > a {
	padding-top: 1.1em;
	padding-bottom: 0.3em;
	color: var(--mc-on-dark-3);
	font-family: var(--mc-font-body);
	font-size: var(--mc-fs-2xs);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: none;
}

#mobile-drawer .mobile-navigation li.mc-menu-heading > .drawer-nav-drop-wrap .drawer-sub-toggle {
	display: none;
}

#mobile-drawer .mobile-navigation ul.has-collapse-sub-nav li.mc-menu-heading > ul.sub-menu {
	display: block;
	padding-left: 0;
}

/* ==========================================================================
   Content wrappers
   ========================================================================== */

/* Full-width templates (home, landing pages built with our sections) */
.content-width-fullwidth .content-area {
	margin-block: 0;
}

/* Default single/page title hero */
.entry-hero .entry-header h1,
.entry-header .entry-title {
	font-size: var(--mc-fs-h1);
}

.entry-meta {
	color: var(--mc-text-muted);
	font-size: var(--mc-fs-2xs);
	font-weight: 600;
}

/* Kadence breadcrumbs */
.kadence-breadcrumbs {
	color: var(--mc-text-muted);
	font-size: var(--mc-fs-2xs);
	font-weight: 600;
}

.kadence-breadcrumbs a {
	color: inherit;
	text-decoration: none;
}

.kadence-breadcrumbs a:hover {
	color: var(--mc-brand-dark);
}

/* Archive pagination */
.pagination .nav-links .page-numbers {
	border-radius: var(--mc-radius-sm);
	font-family: var(--mc-font-display);
	font-weight: 800;
}

.pagination .nav-links .page-numbers.current {
	border-color: var(--mc-ink);
	background: var(--mc-ink);
	color: var(--mc-white);
}

/* Sidebar widgets */
.widget-area .widget-title {
	font-size: var(--mc-fs-sm);
	letter-spacing: 0.08em;
}

/* Scroll-to-top */
#kt-scroll-up.scroll-up-style-filled,
#kt-scroll-up-reader.scroll-up-style-filled {
	border-radius: var(--mc-radius-sm);
	background: var(--mc-ink);
	color: var(--mc-white);
}

/* ==========================================================================
   Landing pages (front page + "Landing" template): sections are full-width
   Kadence rows, so remove the theme's content spacing around them.
   ========================================================================== */

.mc-landing .content-area {
	margin-block: 0;
}

.mc-landing .entry-content-wrap {
	padding: 0;
}

.mc-landing .entry-content > .wp-block-kadence-rowlayout {
	margin-block: 0;
}

.mc-landing .entry-content > .wp-block-kadence-rowlayout:last-child {
	margin-bottom: 0;
}

/* ==========================================================================
   Footer
   Kadence footer builder rows (inc/footer.php sets which widget area goes
   where). The widget content itself is styled in components.css.
   ========================================================================== */

#colophon.site-footer {
	background: var(--mc-ink);
	color: var(--mc-on-dark-2);
	font-size: var(--mc-fs-xs);
}

#colophon .site-footer-row-container-inner {
	background: transparent;
}

#colophon .footer-widget-area-inner > .widget {
	margin: 0;
}

/* Links: plain, white on hover */
#colophon a {
	color: inherit;
	text-decoration: none;
}

#colophon a:hover,
#colophon a:focus-visible {
	color: var(--mc-white);
}

/* Row spacing and separators. Overrides the Customizer spacing on purpose:
   the three rows are one block, not three independent bands. */
#colophon .site-top-footer-wrap .site-footer-row-container-inner {
	padding-block: 52px 34px;
}

#colophon .site-middle-footer-wrap .site-footer-row-container-inner {
	padding-block: var(--mc-space-6);
	border-top: 1px solid var(--mc-on-dark-border);
}

#colophon .site-bottom-footer-wrap .site-footer-row-container-inner {
	padding-block: var(--mc-space-5);
	border-top: 1px solid var(--mc-on-dark-border);
	font-size: var(--mc-fs-2xs);
}

/* Column gaps of the top row */
#colophon .site-top-footer-inner-wrap {
	gap: var(--mc-space-8) var(--mc-space-6);
}

@media (min-width: 1025px) {
	#colophon .site-top-footer-inner-wrap {
		gap: var(--mc-space-10);
	}
}

@media (max-width: 767px) {
	#colophon .site-top-footer-wrap .site-footer-row-container-inner {
		padding-block: var(--mc-space-10) var(--mc-space-6);
	}
}

/* Footer link columns: "Navigation Menu" widgets (inc/footer.php) */
#colophon .widget-title {
	margin: 0 0 14px;
	color: var(--mc-white);
	font-family: var(--mc-font-display);
	font-size: var(--mc-fs-2xs);
	font-weight: 800;
	letter-spacing: 0.1em;
	line-height: 1.3;
	text-transform: uppercase;
}

#colophon .widget_nav_menu ul.menu {
	display: grid;
	gap: 9px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-weight: 600;
}

#colophon .widget_nav_menu ul.menu li {
	margin: 0;
	padding: 0;
}

/* Footer widget areas read left-aligned (Kadence centers the 1-column rows). */
#colophon .footer-widget-area,
#colophon .footer-widget-area-inner {
	text-align: left;
}

#colophon .site-middle-footer-inner-wrap .footer-widget-area,
#colophon .site-bottom-footer-inner-wrap .footer-widget-area {
	width: 100%;
}
