/* ==========================================================================
   BSA site header and footer (Theme Builder: Global Header / Footer)
   Mockup: Main.dc.html on the mockups canvas. Logo 146x90, 20px above and
   below; a nav bar (48px here, tighter than the mockup's 60) between two hairlines; 16px Figtree 600 links,
   ink, Blue + underline on hover.

   Spacing between sections, rows and modules is Divi settings, not CSS:
     Section 1 (logo row):  padding 0 top / 0 bottom
     Row 1:                 padding 20px top / 20px bottom
     Logo Image module:     max width 146px, bottom margin 0
     Section 2 (nav):       padding 0 (already)
     Row 2:                 padding 0 top / 0 bottom
   This file only styles the Menu module. Desktop only (Divi swaps in its
   hamburger menu at 980px and below); mobile comes later.
   Menu selectors start "body #et-boc": on pages with a Theme Builder
   body template (Events, News, category archives) Divi prints its menu
   CSS as ".et-db #et-boc .et-l ...", which outranks a plain class chain.
   Needs tokens.css. Replaces the old "last item opens leftward" rule that
   was in style.css (delete that one).
   ========================================================================== */

@media (min-width: 981px) {

	/* ------------------------------------------------------------------
	   0. Header spacing (desktop). Done here rather than in Divi because
	      the global Row preset prints 16px row padding with !important
	      on every row, header included. Mobile keeps Divi's settings.
	      First section = logo + buttons; --with-menu = the nav bar.
	   ------------------------------------------------------------------ */

	body #et-boc .et-l--header > .et_builder_inner_content > .et_pb_section:first-child:not(#bsa) {
		padding-top: 0 !important;
		padding-bottom: 0 !important;
	}

	body #et-boc .et-l--header > .et_builder_inner_content > .et_pb_section:first-child > .et_pb_row:not(#bsa) {
		padding-top: var(--space-6) !important;    /* 24px, slight breathing room over the mockup's 20 */
		padding-bottom: var(--space-6) !important;
	}

	body #et-boc .et-l--header > .et_builder_inner_content > .et_pb_section:first-child .et_pb_image:not(#bsa) {
		max-width: 146px;                          /* mockup logo: 146 x 90 */
		margin-bottom: 0 !important;
	}

	body #et-boc .et-l--header .et_pb_section--with-menu > .et_pb_row:not(#bsa) {
		padding-top: 0 !important;
		padding-bottom: 0 !important;
	}

	/* ------------------------------------------------------------------
	   1. Top-level links: the full 48px bar is the hover/click target,
	      so dropdowns open right at the bar's bottom edge.
	   ------------------------------------------------------------------ */

	body #et-boc .et-l--header .et_pb_menu .et-menu-nav > .et-menu:not(#bsa) {
		display: flex;
		flex-wrap: nowrap;            /* never a second line on desktop */
		justify-content: space-between;
		align-items: stretch;
		gap: var(--space-4);          /* minimum gap; space-between spreads the rest */
		margin: 0;
	}

	body #et-boc .et-l--header .et_pb_menu .et-menu > li:not(#bsa) {
		display: flex;
		align-items: stretch;
		margin: 0;
		padding: 0;
	}

	body #et-boc .et-l--header .et_pb_menu .et-menu > li > a:not(#bsa) {
		display: inline-flex;
		align-items: center;
		gap: 6px;
		min-height: 48px;             /* bar height; 48px keeps a comfy tap target */
		padding: 0;
		font-family: var(--font-sans);
		font-size: 1rem;              /* 16px */
		line-height: 20px;
		font-weight: 600;
		letter-spacing: 0.02em;
		white-space: nowrap;
		color: var(--ink) !important; /* beats the module's colour setting */
		text-decoration: none;
		text-underline-offset: 6px;
		text-decoration-thickness: 2px;
		opacity: 1;                   /* Divi fades links on hover */
		transition: color 0.15s ease;
	}

	/* Narrowest desktop widths: drop the letter-spacing so the seven
	   items fit on one line down to 981px. */
	@media (max-width: 1100px) {
		body #et-boc .et-l--header .et_pb_menu .et-menu > li > a:not(#bsa) {
			letter-spacing: 0;
		}
	}

	/* Hover, keyboard focus inside, or its dropdown open: Blue + underline */
	body #et-boc .et-l--header .et_pb_menu .et-menu > li:is(:hover, :focus-within, .et-hover) > a:not(#bsa) {
		color: var(--Blue) !important;
		text-decoration-line: underline;
	}

	/* The section you're in: Blue, no underline until hover */
	body #et-boc .et-l--header .et_pb_menu .et-menu > li:is(.current-menu-item, .current-menu-ancestor, .current_page_ancestor) > a:not(#bsa) {
		color: var(--Blue) !important;
	}

	body #et-boc .et-l--header .et_pb_menu .et-menu a:focus-visible {
		outline: 3px solid var(--focus);
		outline-offset: 2px;
		border-radius: var(--radius-sm);
	}

	/* Chevron: Lucide chevron-down (16px) in place of Divi's icon font,
	   flips when the dropdown is open. */
	body #et-boc .et-l--header .et_pb_menu .et-menu > li.menu-item-has-children > a:not(#bsa)::after {
		content: "";
		position: static;
		display: block;
		flex: none;
		width: 16px;
		height: 16px;
		margin: 0;
		background-color: currentColor;
		-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
		        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
		transition: transform 0.15s ease;
	}

	body #et-boc .et-l--header .et_pb_menu .et-menu > li.menu-item-has-children:is(:hover, :focus-within, .et-hover) > a:not(#bsa)::after {
		transform: rotate(180deg);
	}


	/* ------------------------------------------------------------------
	   2. Dropdowns: a white card hanging from the bar's bottom hairline.
	      Item text lines up with the parent link's text (the panel is
	      pulled left by the items' 20px padding).
	   ------------------------------------------------------------------ */

	body #et-boc .et-l--header .et_pb_menu .et-menu > li > .sub-menu:not(#bsa) {
		top: calc(100% + 1px);        /* just under the hairline */
		left: -20px;
		right: auto;
		width: auto;
		min-width: 240px;
		padding: var(--space-2) 0;
		background: var(--surface) !important;
		border: 1px solid var(--border);
		border-top: 0;
		border-radius: 0 0 var(--radius-md) var(--radius-md);
		box-shadow: 0 12px 24px -12px rgba(29, 32, 51, 0.18);
	}

	/* The last two items sit near the right edge: their dropdowns open
	   leftward (right edges aligned), so nothing hangs off the page. A
	   hidden dropdown still counts for width, and Join's long "Exhibiting
	   Member Review Panel" made the page scroll sideways below ~1150px. */
	body #et-boc .et-l--header .et_pb_menu .et-menu > li:nth-last-child(-n+2) > .sub-menu:not(#bsa) {
		left: auto;
		right: -20px;
	}

	/* Keyboard users: open on focus too (Divi only opens on hover). */
	body #et-boc .et-l--header .et_pb_menu .et-menu li:focus-within > .sub-menu {
		visibility: visible;
		opacity: 1;
	}

	body #et-boc .et-l--header .et_pb_menu .et-menu .sub-menu li:not(#bsa) {
		display: block;
		width: 100%;
		padding: 0;
		margin: 0;
		line-height: inherit;
	}

	body #et-boc .et-l--header .et_pb_menu .et-menu .sub-menu a:not(#bsa) {
		display: block;
		width: auto;
		padding: 10px 20px;
		white-space: nowrap;
		font-family: var(--font-sans);
		font-size: 1rem;              /* 16px */
		line-height: 24px;
		font-weight: 400;
		letter-spacing: 0;
		color: var(--ink) !important;
		text-decoration: none;
		opacity: 1;
		transition: background-color 0.15s ease, color 0.15s ease;
	}

	body #et-boc .et-l--header .et_pb_menu .et-menu .sub-menu a:not(#bsa):hover,
	body #et-boc .et-l--header .et_pb_menu .et-menu .sub-menu a:not(#bsa):focus-visible {
		background-color: var(--blue-50);
		color: var(--Blue) !important;
	}

	body #et-boc .et-l--header .et_pb_menu .et-menu .sub-menu a:focus-visible {
		outline-offset: -3px;         /* ring inside the card */
		border-radius: 0;
	}

	/* Current page in a dropdown */
	body #et-boc .et-l--header .et_pb_menu .et-menu .sub-menu .current-menu-item > a:not(#bsa) {
		color: var(--Blue) !important;
		font-weight: 600;
	}
}


/* ==========================================================================
   Footer (Theme Builder: Global Footer)
   Mockup: Footer.dc.html on the mockups canvas.
   Markup: one Code module (.bsa-footer) in the paper-coloured section
   between the stripe and the copyright bar. Section padding (64px top and
   bottom) is a Divi setting.
   Headings, paragraphs and the icon list use the same "body #et-boc .et-l"
   prefix as typography.css's in-layout heading rules, so they win.
   Desktop: three blocks spaced evenly (space-between), vertically centred.
   1023px and narrower: stacked, first two centred, the Support card full
   width.
   ========================================================================== */

.bsa-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: var(--space-8);
	font-size: 0.9375rem;         /* 15px */
	line-height: 24px;
	color: var(--ink);
}

body #et-boc .et-l .bsa-footer p {
	margin: 0;
	padding: 0;
}

/* 1. Logo, address, social icons */
.bsa-footer-org {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 20px;
	flex: none;
}

.bsa-footer-logo {
	display: block;
	line-height: 0;
}

.bsa-footer-logo img {
	display: block;
	width: 130px;
	height: auto;
}

body #et-boc .et-l .bsa-footer address {
	margin: 0;
	padding: 0;
	font-style: normal;
}

.bsa-footer address strong {
	font-weight: 600;
}

body #et-boc .et-l .bsa-footer-social {
	display: flex;
	align-items: center;
	gap: var(--space-1);
	margin: -12px 0 0 -11px;      /* tuck under the address; icon edge lines up with text */
	padding: 0;
	list-style: none;
}

body #et-boc .et-l .bsa-footer-social li {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
	line-height: 0;
}

.bsa-footer-social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: var(--radius-sm);
	color: var(--ink);
	transition: color 0.15s ease;
}

.bsa-footer-social a:hover {
	color: var(--Blue);
}

.bsa-footer-social a:focus-visible {
	outline: 3px solid var(--focus);
	outline-offset: 0;
}

.bsa-footer-social .bsa-icon {
	width: 22px;
	height: 22px;
	vertical-align: 0;
}

/* 2. For members, centred */
.bsa-footer-members {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-4);
	flex: 0 1 340px;
	min-width: 0;
	text-align: center;
}

body #et-boc .et-l .bsa-footer .bsa-footer-eyebrow {
	margin: 0;
	padding: 0;
	font-family: var(--font-sans);
	font-size: 0.8125rem;         /* 13px */
	line-height: 16px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ink-muted);
}

/* 3. Support card */
.bsa-footer-support {
	display: flex;
	flex-direction: column;
	gap: var(--space-4);
	flex: 0 1 384px;
	min-width: 0;
	box-sizing: border-box;
	padding: var(--space-8);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
}

body #et-boc .et-l .bsa-footer-support h2 {
	margin: 0;
	padding: 0;
	font-family: var(--font-serif);
	font-size: 1.5625rem;         /* 25px, the h3 size */
	line-height: 32px;
	font-weight: 400;
}

/* Stacked: tablet and phone */
@media (max-width: 1023px) {
	.bsa-footer {
		flex-direction: column;
		align-items: stretch;
		gap: var(--space-12);
	}

	.bsa-footer-org,
	.bsa-footer-members {
		align-items: center;
		text-align: center;
		flex: none;
	}

	.bsa-footer-members {
		max-width: 340px;
		align-self: center;
	}

	body #et-boc .et-l .bsa-footer-social {
		margin: -12px 0 0;
	}

	.bsa-footer-support {
		flex: none;
		width: 100%;
		max-width: 480px;
		align-self: center;
		text-align: center;
	}
}
