/**
 * Accessible Mega Menu: desktop layout.
 * Loaded with a (min-width: breakpoint + 1px) media query from PHP, after amm.css.
 *
 * Panel position/width are set by amm.js (--amm-left, --amm-top, --amm-width) so the panel
 * sits directly under the header bar and matches its width.
 */

.amm__list {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	width: auto;
	gap: 0.25rem 2rem;
}

.amm__list .amm__item {
	border-bottom: 0;
}

/* Top-level controls ------------------------------------------------ */

.amm__list .amm__toggle,
.amm__list .amm__link {
	width: auto;
	padding: 0.5rem 0;
	gap: 0.6rem;
	color: var(--amm-text);
}

.amm__list .amm__icon {
	width: 2.5rem;
	height: 2.5rem;
	background: transparent;
}

.amm__list .amm__icon img {
	width: 1.5rem;
	height: 1.5rem;
}

/* Current section / open item: icon pill + underline */
.amm__list .is-current > .amm__toggle .amm__icon,
.amm__list .is-current > .amm__link .amm__icon,
.amm__list .amm__toggle[aria-expanded="true"] .amm__icon {
	background: var(--amm-card-bg);
}

.amm__list .is-current > .amm__toggle .amm__label,
.amm__list .is-current > .amm__link .amm__label,
.amm__list .amm__toggle[aria-expanded="true"] .amm__label {
	border-bottom-color: var(--amm-accent);
}

.amm__list .amm__chevron {
	margin-inline: 0.25rem 0;
}

/* Panel ------------------------------------------------------------------ */

.amm__list .amm__panel {
	position: absolute;
	z-index: 999;
	top: var(--amm-top, 100%);
	left: var(--amm-left, 0);
	box-sizing: border-box;
	width: var(--amm-width, 100%);
	padding: 1.75rem 0 2.25rem;
	background: var(--amm-panel-bg);
	box-shadow: 0 14px 28px rgba(0, 0, 0, 0.12);
}

.amm__list .amm__panel-inner {
	display: grid;
	grid-template-columns: minmax(260px, 34%) minmax(0, 1fr);
	gap: 2.5rem;
	box-sizing: border-box;
	max-width: var(--amm-container, 1200px);
	margin: 0 auto;
	padding: 0 var(--amm-gutter, 20px);
}

/* Intro card */
.amm__list .amm__card {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	align-self: start;
	margin: 0;
	padding: 2rem;
	border-radius: 14px;
	background: var(--amm-card-bg);
	color: var(--amm-card-text);
}

.amm__list .amm__card-icon {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 3.5rem;
	height: 3.5rem;
	border-radius: 50%;
	background: #fff;
}

.amm__list .amm__card-icon img {
	display: block;
	width: 2rem;
	height: 2rem;
	max-width: none;
	object-fit: contain;
}

.amm__list .amm__card-title,
.amm__list .amm__card-title:focus-within {
	position: static;
	width: auto;
	height: auto;
	margin: 0 0 0.35rem;
	overflow: visible;
	clip: auto;
	white-space: normal;
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--amm-card-text);
}

.amm__list .amm__card-title a {
	color: inherit;
	text-decoration: none;
}

.amm__list .amm__card-title a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Make the whole card clickable through the single title link. */
.amm__list .amm__card-title a::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 14px;
}

.amm__list .amm__card-title a:focus-visible {
	outline: none;
	box-shadow: none;
}

.amm__list .amm__card-title a:focus-visible::after {
	outline: 3px solid var(--amm-focus);
	outline-offset: 2px;
}

.amm__list .amm__card-desc {
	padding: 0;
	font-size: 1.0625rem;
	color: var(--amm-card-text);
}

/* Columns */
.amm__list .amm__cols {
	display: flex;
	gap: 3rem;
	padding-inline: 2.5rem 0;
	border-inline-start: 1px solid var(--amm-line);
}

.amm__list .amm__col {
	flex: 1 1 0;
	min-width: 0;
	margin: 0;
}

.amm__list .amm__heading {
	font-size: 1.5rem;
}

.amm__list .amm__links {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 2rem;
	padding: 0.5rem 0 0;
}

.amm__list .amm__link-sub {
	font-size: 1.25rem;
}

@media (forced-colors: active) {
	.amm__list .amm__card-title a:focus-visible::after {
		outline-color: Highlight;
	}
	.amm__list .is-current > .amm__toggle .amm__label,
	.amm__list .is-current > .amm__link .amm__label,
	.amm__list .amm__toggle[aria-expanded="true"] .amm__label {
		border-bottom-color: LinkText;
	}
}
