/**
 * Cities / chapters megamenu (header + offcanvas).
 */

@media (min-width: 992px) {
	#nav-main.navbar .offcanvas,
	#nav-main.navbar .offcanvas-body {
		overflow: visible !important;
	}

	/*
	 * The panel is absolutely positioned, so it spans whichever ancestor is
	 * positioned. This used to be the .container (max-width 1140px), which capped
	 * the megamenu at container width. Left static, the panel resolves against
	 * .navbar — which Bootstrap positions and which spans the full viewport — so
	 * the panel goes edge to edge.
	 */
	#nav-main.navbar > .container {
		position: static;
	}

	#fld-navbar > .fld-cities-nav-item.dropdown {
		position: static;
	}

	/*
	 * Out of flow: Cities <li> stays narrow; full-width bar under header.
	 * Scoped to lg+ so the mobile drawer can keep in-flow static positioning.
	 */
	#fld-navbar > .fld-cities-nav-item > .fld-chapters-megamenu__panel.dropdown-menu {
		position: absolute !important;
		top: 100% !important;
		right: 0 !important;
		width: 100% !important;
		max-width: none !important;
		transform: none !important;
		inset: auto !important;
		margin: 0 !important;
		z-index: 1080;
		max-height: min(82vh, 760px);
		left: 0 !important;
		border-left: 0;
		border-right: 0;
	}

	.fld-chapters-megamenu__grid {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: flex-start;
		gap: 2.5rem;
	}

	.fld-chapters-megamenu__live {
		flex: 1 1 100%;
		width: 100%;
		min-width: 0;
	}

	/* Only the live chapter grid uses four columns (not coming-soon multi-column) */
	#fld-navbar .fld-chapters-megamenu__live > .fld-chapters-megamenu__columns {
		grid-template-columns: repeat(4, minmax(7.5rem, 1fr)) !important;
		gap: 0.35rem 1.5rem;
	}

	/* Coming soon: four columns to align with chapters row */
	#fld-navbar .fld-chapters-megamenu__soon-grid {
		grid-template-columns: repeat(4, minmax(7.5rem, 1fr)) !important;
		gap: 0.35rem 1.5rem;
	}

	.fld-chapters-megamenu__soon {
		flex: 1 1 100%;
		width: 100%;
		max-width: none;
		padding-bottom: 2rem;
	}
}

.fld-chapters-megamenu__panel {
	background: #000;
	color: #fff;
	padding: 0;
	margin-top: 0;
	border-radius: 0;
	border: 1px solid rgba(255, 255, 255, 0.08);
	box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
	max-height: min(82vh, 760px);
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.22) rgba(255, 255, 255, 0.04);
}

.fld-chapters-megamenu__panel::-webkit-scrollbar {
	width: 8px;
}

.fld-chapters-megamenu__panel::-webkit-scrollbar-track {
	background: rgba(255, 255, 255, 0.04);
}

.fld-chapters-megamenu__panel::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.22);
	border-radius: 6px;
}

.fld-chapters-megamenu__panel::-webkit-scrollbar-thumb:hover {
	background: rgba(255, 255, 255, 0.32);
}

.fld-chapters-megamenu__inner {
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
	padding: 10px;
}

@media (min-width: 992px) {

	.fld-chapters-megamenu__inner {
		padding-top: 50px;
	}	

}

.fld-chapters-megamenu__all-link {
	display: inline-block;
	margin-bottom: 25px;
	color: #fff;
	font-size: 0.95rem;
	font-weight: 600;
	text-decoration: none;
	text-transform: uppercase;
	transition: color 0.15s ease, opacity 0.15s ease;
}

.fld-chapters-megamenu__all-link:hover,
.fld-chapters-megamenu__all-link:focus {
	color: #fff;
	opacity: 0.75;
}

.fld-chapters-megamenu__heading {
	font-size: 0.7rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.55);
	margin-bottom: 0.75rem;
	font-weight: 600;
}

.fld-chapters-megamenu__heading--muted {
	color: rgba(255, 255, 255, 0.38);
}

.fld-chapters-megamenu__grid {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.fld-chapters-megamenu__columns {
	display: grid;
	grid-template-columns: repeat(2, minmax(8.5rem, 1fr));
	gap: 0.35rem 1.75rem;
}

/* Coming soon: multi-column list (row flow) */
.fld-chapters-megamenu__soon-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 1.75rem;
	row-gap: 0.35rem;
}

@media (min-width: 576px) {
	.fld-chapters-megamenu__soon-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.fld-chapters-megamenu__list li {
	margin-bottom: 0.35rem;
}

.fld-chapters-megamenu__link {
	display: block;
	padding: 0.2rem 0;
	color: #fff;
	text-decoration: none;
	font-size: 0.95rem;
	transition: color 0.15s ease, opacity 0.15s ease;
}

.fld-chapters-megamenu__link:hover,
.fld-chapters-megamenu__link:focus {
	color: #fff;
	opacity: 0.75;
}

.fld-chapters-megamenu__soon {
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	padding-top: 1.25rem;
}

.fld-chapters-megamenu__soon-btn {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.15rem;
	width: 100%;
	text-align: left;
	background: transparent;
	border: 0;
	padding: 0.35rem 0;
	color: rgba(255, 255, 255, 0.55);
	cursor: pointer;
	transition: color 0.15s ease;
}

.fld-chapters-megamenu__soon-btn:hover,
.fld-chapters-megamenu__soon-btn:focus {
	color: rgba(255, 255, 255, 0.85);
}

.fld-chapters-megamenu__soon-name {
	font-size: 0.95rem;
	color: #fff;
}

.fld-chapters-megamenu__soon-region {
	font-size: 0.7rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.38);
}

.fld-chapters-megamenu__empty {
	color: rgba(255, 255, 255, 0.45);
	font-size: 0.9rem;
}

.fld-chapters-megamenu__empty--muted {
	color: rgba(255, 255, 255, 0.35);
}

/* Modal waitlist form */
.fld-chapter-interest-modal .modal-content {
	background: #111;
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.12);
}

.fld-chapter-interest-modal .modal-header {
	border-color: rgba(255, 255, 255, 0.12) !important;
}

/*
 * Mobile drawer only: the nav lives inside .offcanvas at every breakpoint, so these rules
 * MUST be scoped to <992px — otherwise they override desktop absolute + chapter grid.
 */
@media (max-width: 991.98px) {
	.offcanvas .fld-cities-nav-item > .fld-chapters-megamenu__panel.dropdown-menu {
		position: static !important;
		top: auto !important;
		left: auto !important;
		right: auto !important;
		width: 100% !important;
		max-width: 100% !important;
		transform: none !important;
		margin-top: 0.5rem;
		margin-bottom: 0.5rem;
		box-shadow: none;
		border: 1px solid rgba(255, 255, 255, 0.1);
		border-radius: 0.35rem;
		max-height: none;
	}

	.offcanvas .fld-chapters-megamenu__soon {
		border-top: 1px solid rgba(255, 255, 255, 0.12);
		padding-top: 1rem;
		border-left: 0;
		padding-left: 0;
	}

	.offcanvas .fld-chapters-megamenu__columns {
		grid-template-columns: 1fr !important;
	}

	.offcanvas .fld-chapters-megamenu__soon-grid {
		grid-template-columns: 1fr !important;
	}
}
