/* Elevate page: the alumni link in the white Elevate bar and in the phone menu.
 *
 * Loaded only on the Elevate page, and only while the feature is switched on
 * (see CFV_Alumni_Menu). Nothing here touches the portal itself.
 *
 * The bar's own colours, type and hover come from Elementor's nav menu through
 * the .elementor-item class, so the link matches its neighbours without
 * restating them. */

/* ---- The white Elevate bar (desktop) ---------------------------------- */

/* The link sits against Apply Now with a faint divider between them, the way the
 * approved mockup (option B) drew it.
 *
 * It lives in the menu list, so keyboard order is the visual order: the section
 * links, then this, then Apply Now. But Apply Now is not in that list; it is in
 * a separate column at the right, so the link cannot simply follow the last
 * item. It is taken out of the flow and anchored to the right-hand end of the
 * list, then pushed across by the exact distance to Apply Now.
 *
 * That distance comes from the page's own layout, measured on the live page at
 * widths from 1101px to 2560px: the column holding Apply Now is always 20% of
 * the screen and the button inside it is 164px wide, so the gap between the end
 * of the list and the button is 20vw minus 164px. The three numbers below are
 * that layout. If Apply Now's text or size is ever changed, update
 * --cfv-apply-w; the link is placed relative to the button's left edge, so a
 * wider button means a larger value here.
 *
 * The list is also stretched to fill its row, so that its right-hand end is a
 * fixed reference. */
.elementor-widget-nav-menu:has(li.cfv-alumni-menu-item) {
	align-self: stretch;
}
.elementor-nav-menu--main:has(li.cfv-alumni-menu-item) > ul.elementor-nav-menu {
	position: relative;
	flex: 1 1 auto;
	flex-wrap: nowrap;
}

/* The column holding Apply Now has its own stacking order (z-index 9) and is
 * painted over the part of the link that reaches into it, which makes that part
 * unclickable even though the column is transparent. Raise the link's own
 * container, and only that one, above it. */
.e-con:has(> .elementor-widget-nav-menu li.cfv-alumni-menu-item) {
	z-index: 10;
}

.elementor-nav-menu--main li.cfv-alumni-menu-item {
	--cfv-apply-w: 164px;   /* Apply Now's width */
	--cfv-apply-col: 20vw;  /* the column that holds it */
	--cfv-link-gap: 26px;   /* link to divider, and divider to Apply Now */
	position: absolute;
	top: 0;
	bottom: 0;
	right: calc(var(--cfv-apply-w) + var(--cfv-link-gap) - var(--cfv-apply-col));
	display: flex;
	align-items: center;
	margin: 0;
	padding-right: 12px;
}

/* The divider: faint, shorter than the bar, centred. */
.elementor-nav-menu--main li.cfv-alumni-menu-item::after {
	content: "";
	position: absolute;
	right: 0;
	top: 50%;
	width: 1px;
	height: 26px;
	transform: translateY(-50%);
	background: rgba(9, 43, 67, 0.18);
}

.elementor-nav-menu--main li.cfv-alumni-menu-item > a.elementor-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding-left: 14px;
	padding-right: 14px;
	font-weight: 500;
	white-space: nowrap;
}

/* The disc is 28px tall; trimmed padding keeps the bar the same 46px as the
 * links beside it, so signing in does not nudge the layout. */
.elementor-nav-menu--main li.cfv-member > a.elementor-item {
	padding-top: 9px;
	padding-bottom: 9px;
}

.cfv-menu-icon {
	flex: none;
	width: 18px;
	height: 18px;
}

/* Signed in: the member's photo, or initials, the same disc the portal uses. */
.cfv-menu-chip {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	overflow: hidden;
	border-radius: 50%;
	background: #1A365D;
	color: #fff;
	font: 700 11.5px/1 'Inter', sans-serif;
	letter-spacing: 0.02em;
}
.cfv-menu-chip.has-img {
	background: none;
}
.cfv-menu-chip img {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
}

/* The bar has about 190px spare at 1280px and 90px at 1180px, so below 1340px
 * only the icon or initials show. The label stays in the page for screen
 * readers, and the link keeps its full aria-label and title. */
@media (max-width: 1339px) {
	.cfv-alumni-menu-item .cfv-menu-label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}
}

/* The bar first appears at 1101px, where the links already run to within 8px of
 * Apply Now, so there is no room for anything. Below 1180px the links give up
 * 8px of padding each side, which frees about 100px. */
@media (max-width: 1179px) {
	.elementor-widget-nav-menu:has(li.cfv-alumni-menu-item) .elementor-nav-menu--main li:not(.cfv-alumni-menu-item) > a.elementor-item {
		padding-left: 12px;
		padding-right: 12px;
	}
}

/* ---- The phone menu --------------------------------------------------- */

/* The main menu is rendered for the desktop header and again for the hamburger,
 * so the entry exists in both. The desktop list carries dt-nav-menu-horizontal
 * and has the white bar to itself; the hamburger's list does not. */
ul.dt-nav-menu-horizontal > li.cfv-alumni-mobile-item {
	display: none;
}

.cfv-alumni-mobile-item {
	margin-top: 8px;
	padding-top: 6px;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.cfv-alumni-mobile-item .menu-text {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}
