/* Custom Mega Menu — frontend */

.cmm-root {
	--cmm-bg: #1e342f;
	--cmm-text: #f4f1ea;
	--cmm-muted: #8a9b94;
	--cmm-accent: #c2a878;
	--cmm-trigger: #1e342f;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	display: flex;
	align-items: center;
}

html.cmm-lock { overflow: hidden; }

/* ---- Trigger (3-line bar) ----
   Class selectors (0,1,0) so they beat the theme's `button {}` rules; the plugin CSS loads
   before Elementor's control CSS, so equal-specificity controls still win. */
.cmm-trigger,
.cmm-close {
	display: inline-block;
	position: relative;
	width: 46px;
	height: 46px;
	background: transparent;
	border: 0;
	cursor: pointer;
	box-sizing: border-box;
	-webkit-appearance: none;
	appearance: none;
}

/* Keep the hamburger above the menu so it's always visible and clickable to toggle. */
.cmm-trigger { z-index: 9991; }

.cmm-trigger .cmm-bar { background: var(--cmm-trigger); }
.cmm-close .cmm-bar { background: var(--cmm-text); }

/* The 3 bars are centred absolutely, so spacing grows symmetrically both ways. */
.cmm-bar {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 100%;
	height: var(--cmm-bar-thickness, 2px);
	border-radius: 2px;
	transition: transform .35s cubic-bezier(.6,.05,.2,.95), opacity .25s ease;
	transform-origin: center;
}

/* Closed hamburger: top bar up, bottom bar down, by gap + thickness (symmetric about centre) */
.cmm-trigger .cmm-bar:nth-child(1) { transform: translate(-50%, calc(-50% - var(--cmm-bar-gap, 6px) - var(--cmm-bar-thickness, 2px))); }
.cmm-trigger .cmm-bar:nth-child(2) { transform: translate(-50%, -50%); }
.cmm-trigger .cmm-bar:nth-child(3) { transform: translate(-50%, calc(-50% + var(--cmm-bar-gap, 6px) + var(--cmm-bar-thickness, 2px))); }

/* Open: all bars meet at centre → exact X */
.cmm-root.is-open .cmm-trigger .cmm-bar:nth-child(1) { transform: translate(-50%, -50%) rotate(45deg); }
.cmm-root.is-open .cmm-trigger .cmm-bar:nth-child(2) { opacity: 0; }
.cmm-root.is-open .cmm-trigger .cmm-bar:nth-child(3) { transform: translate(-50%, -50%) rotate(-45deg); }

/* ---- Fullscreen menu container ----
   No z-index: position:fixed still stacks it over the page, but any header with a z-index
   stays above it — both when closed and open — so the menu never blocks the header. */
.cmm-fullscreen {
	position: fixed;
	inset: 0;
	background: var(--cmm-bg);
	color: var(--cmm-text);
	opacity: 0;
	visibility: hidden;
	transform: scale(var(--cmm-anim-scale, 0.98));   /* closed scale: 0.98 = zoom, 1 = pure fade */
	transition: opacity .4s ease, transform .4s ease, visibility 0s linear .4s;
	overflow-x: hidden;                /* never produce a horizontal scrollbar */
	overflow-y: auto;
}

.cmm-fullscreen.is-open {
	opacity: 1;
	visibility: visible;
	transform: scale(1);
	transition: opacity .4s ease, transform .4s ease, visibility 0s;
}

/* The body-level wrapper holding the portaled menu: no box, just carries vars + modifier classes. */
.cmm-portal { display: contents; }

/* Leave room for the WordPress admin bar when logged in (it sits above the overlay). */
.admin-bar .cmm-fullscreen { top: 32px; }
.admin-bar .cmm-grid { min-height: calc(100vh - 32px); }
.admin-bar .cmm-col--info { max-height: calc(100vh - 32px); }
@media screen and (max-width: 782px) {
	.admin-bar .cmm-fullscreen { top: 46px; }
	.admin-bar .cmm-grid { min-height: calc(100vh - 46px); }
	.admin-bar .cmm-col--info { max-height: calc(100vh - 46px); }
}

.cmm-close {
	position: absolute;
	top: 26px;
	right: 30px;
	z-index: 5;
}
.cmm-close .cmm-bar:nth-child(1) { transform: translate(-50%, -50%) rotate(45deg); }
.cmm-close .cmm-bar:nth-child(2) { opacity: 0; }
.cmm-close .cmm-bar:nth-child(3) { transform: translate(-50%, -50%) rotate(-45deg); }

/* ---- Layout (flexbox) ----
   The container carries NO padding, so the right side can run to the screen edge.
   Each side owns its own padding instead. */
.cmm-grid {
	display: flex;
	align-items: stretch;
	justify-content: space-between;
	min-height: 100vh;
	max-width: var(--cmm-max-width, 1600px);
	margin: 0 auto;
	box-sizing: border-box;
}

/* Left side = parents + submenu (+ optional bottom links). */
.cmm-col--nav {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;      /* main area on top, bottom links underneath */
	min-width: 0;
	padding: 7vh 4vw 7vh 6vw;
	box-sizing: border-box;
	position: relative;          /* anchor the optional background overlay */
}
/* Main area holds the parents + submenu side by side and fills the height. */
.cmm-nav-main {
	flex: 1 1 auto;
	display: flex;
	gap: 48px;
	min-width: 0;
}
/* Optional bottom links — horizontal row pinned to the bottom of the left side. */
.cmm-nav-footer {
	flex: 0 0 auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 24px;
	margin-top: 30px;
}
.cmm-nav-footer-link {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: var(--cmm-muted);
	text-decoration: none;
	font-size: 13px;
	transition: color .25s ease;
}
.cmm-nav-footer-link:hover { color: var(--cmm-text); }
.cmm-nav-footer-icon {
	display: inline-flex;
	align-items: center;
	font-size: 16px;
	line-height: 1;
}
.cmm-nav-footer-icon svg { width: 1em; height: 1em; fill: currentColor; }
.cmm-nav-footer-icon i { font-size: inherit; }

/* Optional ↗ arrow: hidden down-left, slides up the -45° diagonal into place on hover. */
.cmm-nav-footer--arrow .cmm-nav-footer-link::after {
	content: "→";
	display: inline-block;
	margin-left: 4px;
	opacity: 0;
	transform: translate(-5px, 5px) rotate(-45deg);
	transition: opacity .25s ease, transform .3s cubic-bezier(.2,.7,.3,1);
}
.cmm-nav-footer--arrow .cmm-nav-footer-link:hover::after {
	opacity: 1;
	transform: translate(0, 0) rotate(-45deg);
}
/* Optional colour/gradient overlay drawn on top of the left-panel background image */
.cmm-col--nav::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background: transparent;
}
.cmm-col--items,
.cmm-col--sub { position: relative; z-index: 1; }  /* keep menu content above the overlay */

.cmm-col--items { flex: 1 1 55%; min-width: 0; }
.cmm-col--sub { flex: 1 1 45%; min-width: 0; }

/* Right side = image / info. Fixed-ish width; sits hard against the right edge.
   Capped to the viewport height so the image can never run past the screen. */
.cmm-col--info {
	flex: 0 0 36%;
	display: flex;
	flex-direction: column;
	position: sticky;
	top: 0;
	max-height: 100vh;       /* stretches to fill, but never taller than the screen */
	padding: 7vh 6vw;
	box-sizing: border-box;
	overflow: hidden;
}

/* Full width: span the whole screen — the right side now reaches the screen edge. */
.cmm-root--full .cmm-grid { max-width: none; }

/* Right-panel background (shortcode var; the Elementor control writes this directly). */
.cmm-root--rightbg .cmm-col--info { background: var(--cmm-right-bg); }

/* Right side vertical alignment: middle (centered) instead of full height */
.cmm-root--vmiddle .cmm-col--info { justify-content: center; }
.cmm-root--vmiddle .cmm-stage { flex: 0 0 auto; }

.cmm-col { min-width: 0; }

/* ---- Left: items ---- */
.cmm-items {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 28px;                 /* spacing BETWEEN items, so the first/last have no offset */
}

.cmm-item {
	display: flex;
	align-items: baseline;
	column-gap: 22px;          /* number ↔ label spacing (controllable) */
	row-gap: 0;                /* no vertical gap when the row wraps on mobile */
	position: relative;        /* no top/bottom padding → first item aligns with the submenu */
}

.cmm-num {
	font-size: 12px;
	letter-spacing: 1px;
	color: var(--cmm-muted);
	width: 26px;
	flex: none;
	font-variant: small-caps;
}

.cmm-item-link {
	font-family: Georgia, "Times New Roman", serif;
	font-size: clamp(28px, 4vw, 50px);
	line-height: 1.05;
	color: var(--cmm-text);
	text-decoration: none;
	transition: color .25s ease, opacity .25s ease, letter-spacing .25s ease, background .25s ease, border-color .25s ease;
	opacity: .85;
}

.cmm-item.is-active .cmm-item-link,
.cmm-item-link:hover { opacity: 1; color: var(--cmm-text); }

.cmm-item-toggle {
	display: none;
	margin-left: auto;
	width: 30px;
	height: 30px;
	background: transparent;
	border: 0;
	cursor: pointer;
	position: relative;
}
/* The +/× accordion icon is mobile-only — force it off on desktop no matter what. */
@media (min-width: 901px) {
	.cmm-item-toggle { display: none !important; }
}
.cmm-item-toggle::before,
.cmm-item-toggle::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 14px;
	height: 2px;
	background: var(--cmm-text);
	transform: translate(-50%, -50%);
	transition: transform .3s ease;
}
.cmm-item-toggle::after { transform: translate(-50%, -50%) rotate(90deg); }
.cmm-item.is-expanded .cmm-item-toggle::after { transform: translate(-50%, -50%) rotate(0); }

.cmm-submobile { display: none; }

/* ---- Center: submenu panels ---- */
.cmm-col--sub { position: relative; }

.cmm-subpanel {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity .35s ease, transform .35s ease, visibility 0s linear .35s;
	pointer-events: none;
}
.cmm-subpanel.is-active {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	transition: opacity .35s ease, transform .35s ease, visibility 0s;
	pointer-events: auto;
}

.cmm-subhead {
	display: flex;
	align-items: center;
	gap: 16px;
	font-size: 17px;
	font-weight: 600;
	margin-bottom: 34px;
}
.cmm-subhead-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border: 1px solid var(--cmm-muted);
	border-radius: 50%;
	color: var(--cmm-text);
	text-decoration: none;
	font-size: 18px;
	line-height: 1;
}

.cmm-subitems {
	list-style: none;
	margin: 0;
	padding: 0;
}
.cmm-subitems li { margin: 0 0 22px; }
.cmm-subitems a {
	color: var(--cmm-muted);
	text-decoration: none;
	font-size: 15px;
	letter-spacing: .3px;
	transition: color .25s ease;
}
.cmm-subitems a:hover { color: var(--cmm-text); }

/* ---- Right: dynamic image / details ---- */
/* Stage = per-parent mega content (image OR details), swaps on hover */
.cmm-stage {
	position: relative;
	flex: 1 1 auto;
	min-height: 240px;
}

.cmm-stage-image {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	border-radius: 4px;
	opacity: 0;
	visibility: hidden;
	transition: opacity .5s ease, visibility 0s linear .5s;
}
.cmm-stage-image.is-active {
	opacity: 1;
	visibility: visible;
	transition: opacity .5s ease, visibility 0s;
}

.cmm-stage-detail {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;   /* vertical alignment (controllable) */
	align-items: flex-start;       /* horizontal alignment (controllable) */
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: opacity .45s ease, transform .45s ease, visibility 0s linear .45s;
}
.cmm-stage-detail.is-active {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	transition: opacity .45s ease, transform .45s ease, visibility 0s;
}
.cmm-detail-title {
	font-family: Georgia, "Times New Roman", serif;
	font-size: clamp(22px, 2.6vw, 32px);
	line-height: 1.2;
	margin: 0 0 16px;
	color: var(--cmm-text);
	font-weight: 500;
}
.cmm-detail-desc {
	font-size: 15px;
	line-height: 1.7;
	color: var(--cmm-muted);
	margin: 0 0 24px;
}
.cmm-detail-btn {
	display: inline-block;
	padding: 12px 26px;
	border: 1px solid var(--cmm-accent);
	border-radius: 40px;
	color: var(--cmm-text);
	text-decoration: none;
	font-size: 13px;
	letter-spacing: .5px;
	text-transform: uppercase;
	transition: background .25s ease, color .25s ease;
}
.cmm-detail-btn:hover { background: var(--cmm-accent); color: var(--cmm-bg); }

.cmm-info-body {
	position: relative;
	z-index: 1;
	margin-top: auto;
	text-align: right;
	margin-left: auto;
}

.cmm-notice {
	padding: 14px 18px;
	background: #fff3cd;
	border: 1px solid #ffe69c;
	border-radius: 4px;
	color: #664d03;
	font-size: 13px;
}

.cmm-info-logo { width: 54px; height: auto; margin: 0 0 26px auto; display: block; }

.cmm-info-title {
	font-family: Georgia, "Times New Roman", serif;
	font-size: 22px;
	line-height: 1.3;
	margin: 0 0 14px;
	color: var(--cmm-text);
	font-weight: 500;
}
.cmm-info-address {
	font-size: 13px;
	line-height: 1.7;
	color: var(--cmm-muted);
	margin: 0 0 22px;
}
.cmm-info-contact { display: flex; flex-direction: column; gap: 6px; margin-bottom: 26px; }
.cmm-info-contact a {
	color: var(--cmm-text);
	text-decoration: none;
	font-size: 14px;
}
.cmm-info-contact a:hover { color: var(--cmm-accent); }
.cmm-info-contact-link { color: var(--cmm-muted) !important; margin-top: 4px; }

.cmm-info-socials {
	list-style: none;
	display: flex;
	gap: 22px;
	justify-content: flex-end;
	margin: 0;
	padding: 0;
}
.cmm-info-socials a {
	color: var(--cmm-muted);
	text-decoration: none;
	font-size: 13px;
	transition: color .25s ease;
}
.cmm-info-socials a:hover { color: var(--cmm-text); }

/* ---- Tablet + Mobile (stacked) ---- */
@media (max-width: 1100px) {
	/* Pin the menu to the full device height and let the grid flex-fill it, so flex-basis
	   becomes HEIGHT — the Left/Right Width/height controls then set each part's height. */
	.cmm-fullscreen { display: flex; flex-direction: column; height: 100vh; height: 100lvh; }
	.cmm-grid { flex: 1 1 auto; min-height: 0; width: 100%; max-width: none; margin: 0; flex-direction: column; justify-content: flex-start; }
	.cmm-col--nav { gap: 32px; padding: 7vh 5vw 0; overflow-y: auto; }
	.cmm-col--info { position: static; max-height: none; overflow: visible; padding: 32px 5vw 7vh; }
	.cmm-stage { min-height: 0; }   /* the right-section height is governed by your value */
}

/* ---- Mobile ---- */
@media (max-width: 900px) {
	.cmm-close { top: 18px; right: 18px; }
	.cmm-col--nav { flex-direction: column; gap: 0; padding: 84px 28px 20px; overflow-y: auto; }
	.cmm-col--sub { display: none; } /* submenu folds into accordion */
	.cmm-item { flex-wrap: wrap; padding: 0; }
	.cmm-item-link { font-size: clamp(26px, 8vw, 38px); }
	.cmm-item-toggle { display: block; }

	/* Smooth auto-height accordion via grid-template-rows 0fr → 1fr */
	.cmm-submobile {
		display: grid;
		flex-basis: 100%;
		grid-template-rows: 0fr;
		transition: grid-template-rows .4s ease;
	}
	.cmm-item.is-expanded .cmm-submobile { grid-template-rows: 1fr; }
	.cmm-subitems-mobile {
		list-style: none;
		margin: 0;
		padding: 0;           /* no padding here — it would leak as height when collapsed */
		min-height: 0;        /* required so the grid row can collapse to 0 */
		overflow: hidden;
	}
	/* spacing lives on the items (content), so it collapses cleanly to 0 */
	.cmm-subitems-mobile li { margin: 0 0 12px; }
	.cmm-subitems-mobile li:first-child { margin-top: 10px; }
	.cmm-subitems-mobile a { color: var(--cmm-muted); text-decoration: none; font-size: 15px; }
	.cmm-col--info { position: static; max-height: none; overflow: visible; padding: 0; }
}
