/* "Notte Italiana" header — centered two-tier masthead. A slim 18+ strip
   sits on top, the branding is centered beneath it, and on desktop the nav
   menu forms its own centered tier under the branding with a gold underline
   hover. Deliberately NOT sticky: the page scrolls past it for a calmer,
   editorial feel. Mobile keeps the burger toggle + slide-down panel driven
   by assets/js/nav.js (ids/classes unchanged). */

.ci-header {
	/* Positioning context for the mobile nav panel (top: 100%). */
	position: relative;
	z-index: 100;
	background: var(--ci-bg-dark);
	border-bottom: 1px solid var(--ci-border);
}

/* Tier 1: centered branding (tier 2, the nav, lives in the same container
   as a second flex row — see .ci-primary-nav desktop rules below). */
.ci-header__main-inner {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 16px 0;
	min-height: 72px;
}

.ci-site-branding { display: flex; align-items: center; justify-content: center; }
.ci-site-branding .custom-logo-link { display: block; }
.ci-site-branding img.custom-logo { max-height: 60px; width: auto; display: block; }

.ci-site-title {
	font-family: var(--ci-font-heading);
	font-weight: 700;
	font-size: 26px;
	letter-spacing: var(--ci-letter-tight);
	color: var(--ci-text-primary);
}
.ci-site-title:hover { color: var(--ci-accent-gold-light); }

.ci-mobile-toggle {
	position: absolute;
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 40px;
	height: 40px;
	background: transparent;
	border: 1px solid var(--ci-border-strong);
	border-radius: var(--ci-radius-sm);
	cursor: pointer;
	padding: 0 8px;
}

.ci-mobile-toggle__bar {
	display: block;
	height: 2px;
	background: var(--ci-text-primary);
	border-radius: 2px;
}

@media (min-width: 768px) {
	.ci-mobile-toggle { right: 24px; }
}

/* Mobile: slide-down panel anchored under the whole header. */
.ci-primary-nav {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: var(--ci-bg-darker);
	border-bottom: 1px solid var(--ci-border);
	box-shadow: var(--ci-shadow-card);
	display: none;
	max-height: 80vh;
	overflow-y: auto;
	z-index: 90;
}

.ci-primary-nav.ci-nav-open { display: block; }

.ci-menu {
	list-style: none;
	display: flex;
	flex-direction: column;
	padding: 8px 16px 16px;
}

.ci-menu-item { position: relative; }

.ci-menu-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 12px 0;
	color: var(--ci-text-primary);
	font-weight: 500;
	font-size: 15px;
	position: relative;
}
.ci-menu-link:hover { color: var(--ci-accent-gold-light); text-decoration: none; }

.ci-dropdown-caret {
	display: inline-block;
	width: 7px;
	height: 7px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	margin-left: 4px;
	opacity: 0.7;
}

.ci-submenu {
	list-style: none;
	padding: 0 0 8px 16px;
	display: none;
}
.ci-submenu--open,
.ci-has-dropdown.is-open > .ci-submenu { display: block; }
.ci-submenu li a {
	display: block;
	padding: 8px 0;
	color: var(--ci-text-secondary);
	font-size: 14px;
}
.ci-submenu li a:hover { color: var(--ci-accent-gold-light); text-decoration: none; }

.ci-header__cta { display: none; flex-shrink: 0; }

@media (min-width: 1100px) {

	.ci-mobile-toggle { display: none; }

	.ci-header__main-inner { padding: 24px 0 0; min-height: 0; }

	/* Tier 2: the nav becomes a centered row under the branding, separated
	   by a hairline rule. */
	.ci-primary-nav {
		position: static;
		background: transparent;
		border: none;
		box-shadow: none;
		display: block;
		max-height: none;
		overflow: visible;
		width: 100%;
		margin-top: 14px;
		border-top: 1px solid var(--ci-border);
	}

	.ci-menu {
		flex-direction: row;
		align-items: center;
		justify-content: center;
		flex-wrap: wrap;
		gap: 2px;
		padding: 4px 0;
	}

	.ci-menu-link { padding: 12px 14px; font-size: 14.5px; }

	.ci-menu-link::after {
		content: "";
		position: absolute;
		left: 14px;
		right: 14px;
		bottom: 5px;
		height: 2px;
		background: var(--ci-accent-gold);
		border-radius: 2px;
		opacity: 0;
		transform: scaleX(0);
		transition: opacity 0.2s ease, transform 0.2s ease;
	}
	.ci-menu-link:hover::after { opacity: 1; transform: scaleX(1); }

	.ci-submenu {
		position: absolute;
		top: 100%;
		left: 50%;
		transform: translate(-50%, -6px);
		min-width: 230px;
		background: var(--ci-bg-card);
		border: 1px solid var(--ci-border);
		border-top: 2px solid var(--ci-accent-gold);
		border-radius: 0 0 var(--ci-radius-md) var(--ci-radius-md);
		box-shadow: var(--ci-shadow-card-lg);
		padding: 10px;
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
		z-index: 60;
	}

	.ci-has-dropdown:hover > .ci-submenu,
	.ci-has-dropdown:focus-within > .ci-submenu,
	.ci-has-dropdown.is-open > .ci-submenu {
		display: block;
		opacity: 1;
		visibility: visible;
		transform: translate(-50%, 0);
	}

	.ci-submenu li a { padding: 10px 12px; border-radius: var(--ci-radius-sm); }
	.ci-submenu li a:hover { background: var(--ci-bg-card-hover); }

	.ci-header__cta { display: none; }
}
