/* ───────────────────────────────────────────────
 * FDM Divi Menu v2 — frontend styles
 *
 * Class names changed from v1 (fdm_*) to v2 (fdm-m2-*) so that
 * stale page-cache / CDN HTML cannot pair with fresh CSS.
 * ─────────────────────────────────────────────── */

/* Hide header / footer on single menu-post view (layout editing) */
body.single-fdm_menu #main-header,
body.single-fdm_menu .et-l--footer {
	display: none !important;
}

/* Hide Divi's default mobile hamburger ONLY below the desktop
   breakpoint, where FDM provides its own trigger.  Desktop is
   never touched — this was the source of the v1 cache bug. */
@media (max-width: 980px) {
	.mobile_menu_bar {
		display: none !important;
	}
}

/* ── Desktop kill-switch (redundant backup) ──
   Duplicated in <style id="fdm-m2-critical"> (inline, priority 1)
   and in the JS-injected trigger stylesheet.  Three layers ensures
   that no combination of stale cache can show the menu on desktop. */
@media (min-width: 981px) {
	.fdm-m2-trigger,
	.fdm-m2-js,
	.fdm-m2-overlay,
	.fdm-m2-close,
	.fdm-m2-sc,
	#fdm-m2-close-btn,
	/* Legacy v1 selectors — protect cached pages during rollout */
	.fdm_menu_trigger_sc,
	.fdm-js-trigger,
	.fdm_inline_fullscreen_menu,
	.fdm_close_btn,
	#fdm_close_menu {
		display: none !important;
		visibility: hidden !important;
		pointer-events: none !important;
	}
}

/* ── Fullscreen overlay ── */
.fdm-m2-overlay {
	display: none !important;
	position: fixed;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	z-index: 2147483647;
	overflow-y: auto;
	background-color: #000;
	touch-action: manipulation;
}
.fdm-m2-overlay.fdm-m2-open {
	display: block !important;
}

/* ── Inline close button (inside overlay) ── */
.fdm-m2-close--inline {
	cursor: pointer;
	position: absolute;
	right: 30px;
	top: 34px;
	z-index: 2147483647;
	display: block;
	width: 32px;
	height: 32px;
}

/* ══════════════════════════════════════════════
 * Static menu styles (no Divi dependency)
 * Uses native <details>/<summary> for accordions.
 *
 * All user-tunable values are driven by --fdm-m2-* CSS variables
 * emitted by fdm_mobile_css_vars() on :root. Hardcoded fallbacks
 * are kept so the menu still looks correct on the very first page
 * render before the inline <style> block lands.
 * ══════════════════════════════════════════════ */

/* Overlay background color var (tag the overlay, not the body) */
.fdm-m2-overlay {
	background-color: var(--fdm-m2-overlay-bg, #000) !important;
}

/* ── Header / logo ── */
.fdm-m2-nav-header {
	padding: 30px 20px 10px;
	font-family: var(--fdm-m2-font-family, inherit);
}
.fdm-m2-nav-logo {
	max-height: var(--fdm-m2-logo-max, 60px);
	width: auto;
}
.fdm-m2-nav-logo-link {
	display: inline-block;
	line-height: 0;
}

/* ── Nav container ── */
.fdm-m2-nav {
	padding: 20px 20px 40px;
	font-family: var(--fdm-m2-font-family, inherit);
}

/* ── Direct links (e.g. "The Problems") ── */
.fdm-m2-nav-link {
	display: block;
	font-size: var(--fdm-m2-nav-font-size, 26px);
	font-weight: 700;
	color: var(--fdm-m2-link, #fff) !important;
	text-decoration: none !important;
	padding: 14px 0;
}
.fdm-m2-nav-link:hover,
.fdm-m2-nav-link:active {
	color: var(--fdm-m2-link-hover, #fff) !important;
}

/* ── Dropdown (details/summary) ── */
.fdm-m2-dropdown {
	border: none;
	margin: 0;
	padding: 0;
}

.fdm-m2-dropdown summary {
	list-style: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: var(--fdm-m2-nav-font-size, 26px);
	font-weight: 700;
	color: var(--fdm-m2-link, #fff);
	padding: 14px 0;
	cursor: pointer;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	user-select: none;
}

/* Remove default disclosure triangle */
.fdm-m2-dropdown summary::-webkit-details-marker {
	display: none;
}
.fdm-m2-dropdown summary::marker {
	display: none;
	content: '';
}

/* Chevron — colored from the top-level link color so it tracks the heading */
.fdm-m2-dropdown summary::after {
	content: '';
	flex-shrink: 0;
	width: 12px;
	height: 12px;
	margin-left: 16px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.2s ease;
}
.fdm-m2-dropdown[open] summary::after {
	transform: rotate(-135deg);
}

/* ── Dropdown body ── */
.fdm-m2-dropdown-body {
	padding: 4px 0 12px 8px;
}
.fdm-m2-dropdown-body a {
	display: block;
	color: var(--fdm-m2-sub-link, rgba(255,255,255,0.85)) !important;
	text-decoration: none !important;
	font-size: var(--fdm-m2-sub-font-size, 15px);
	font-weight: 600;
	padding: 6px 0;
	line-height: 1.4;
}
.fdm-m2-dropdown-body a:hover,
.fdm-m2-dropdown-body a:active {
	color: var(--fdm-m2-link-hover, #fff) !important;
}

/* ── Multi-column layout (e.g. Give Together) ── */
.fdm-m2-columns {
	display: flex;
	gap: 20px;
}
.fdm-m2-column {
	flex: 1;
}
.fdm-m2-col-heading {
	color: var(--fdm-m2-heading, #fff);
	font-size: 16px;
	font-weight: 700;
	margin: 0 0 8px;
	padding: 0;
}

/* ── CTA button ── */
.fdm-m2-cta {
	display: inline-block;
	margin-top: 24px;
	padding: 16px 48px;
	background: var(--fdm-m2-cta-bg, #b5985a);
	color: var(--fdm-m2-cta-text, #fff) !important;
	text-decoration: none !important;
	font-size: 18px;
	font-weight: 600;
	border-radius: 50px;
	text-align: center;
}
.fdm-m2-cta:hover,
.fdm-m2-cta:active {
	filter: brightness(0.92);
}

/* ── Eliminate mobile tap delay ── */
.fdm-m2-trigger {
	touch-action: manipulation;
}

/* ══════════════════════════════════════════════
 * Divi-rendered menu styles (legacy, used when
 * Menu Source is set to "Divi Builder")
 * ══════════════════════════════════════════════ */

/* ── Divi layout normalisation inside overlay ── */
.fdm-m2-overlay .et_pb_section,
.et_slide_in_menu_container .et_pb_section {
	padding-left: 0 !important;
	padding-right: 0 !important;
}
.fdm-m2-overlay .et_pb_row,
.et_slide_in_menu_container .et_pb_row {
	width: 100% !important;
	max-width: 100% !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
}

/* ── Divi toggle / accordion fixes ── */
.fdm-m2-overlay .et_pb_toggle_title,
.et_slide_in_menu_container .et_pb_toggle_title {
	position: relative !important;
	padding-right: 54px !important;
	cursor: pointer;
	touch-action: manipulation;
}

.fdm-m2-overlay .et_pb_toggle_title:before,
.et_slide_in_menu_container .et_pb_toggle_title:before {
	position: absolute !important;
	right: 16px !important;
	left: auto !important;
	top: 50% !important;
}
.fdm-m2-overlay .et_pb_toggle_close .et_pb_toggle_title:before,
.et_slide_in_menu_container .et_pb_toggle_close .et_pb_toggle_title:before {
	transform: translateY(-50%) rotate(0deg) !important;
}
.fdm-m2-overlay .et_pb_toggle_open .et_pb_toggle_title:before,
.et_slide_in_menu_container .et_pb_toggle_open .et_pb_toggle_title:before {
	transform: translateY(-50%) rotate(180deg) !important;
}

.fdm-m2-overlay .et_pb_toggle,
.fdm-m2-overlay .et_pb_toggle_content,
.et_slide_in_menu_container .et_pb_toggle,
.et_slide_in_menu_container .et_pb_toggle_content {
	transition: none !important;
	animation: none !important;
}

.fdm-m2-overlay .et_pb_toggle_close .et_pb_toggle_content,
.et_slide_in_menu_container .et_pb_toggle_close .et_pb_toggle_content {
	max-height: 0 !important;
	overflow: hidden !important;
	visibility: hidden !important;
}
.fdm-m2-overlay .et_pb_toggle_open .et_pb_toggle_content,
.et_slide_in_menu_container .et_pb_toggle_open .et_pb_toggle_content {
	max-height: none !important;
	overflow: visible !important;
	visibility: visible !important;
}
