/* ==========================================================================
   Mobile drawer accordion (see assets/js/mobile-menu.js).
   Scoped to the theme's drawer breakpoint (max-width: 768px).
   ========================================================================== */

.aph-submenu-toggle {
	display: none;
}

@media (max-width: 768px) {
	.aph-accordion li.menu-item-has-children {
		position: relative;
	}

	/* Leave room on the row for the chevron button. */
	.aph-accordion li.menu-item-has-children > a {
		padding-inline-end: 52px;
	}

	.aph-submenu-toggle {
		position: absolute;
		inset-block-start: 4px;
		inset-inline-end: -10px;
		display: grid;
		place-items: center;
		width: 44px;
		height: 44px;
		padding: 0;
		border: 0;
		border-radius: 50%;
		background: transparent;
		color: inherit;
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
	}

	.aph-submenu-toggle:focus-visible {
		outline: 2px solid var(--primary-color, #f15502);
		outline-offset: -2px;
	}

	.aph-submenu-toggle svg {
		transition: transform .25s ease;
	}

	.aph-open > .aph-submenu-toggle {
		color: var(--primary-color, #f15502);
	}

	.aph-open > .aph-submenu-toggle svg {
		transform: rotate(180deg);
	}

	.aph-accordion li.menu-item-has-children > .sub-menu {
		display: none;
	}

	.aph-accordion li.aph-open > .sub-menu {
		display: block;
		animation: aph-submenu-in .25s ease both;
	}

	@keyframes aph-submenu-in {
		from { opacity: 0; transform: translateY(-6px); }
		to { opacity: 1; transform: none; }
	}
}

@media (prefers-reduced-motion: reduce) {
	.aph-submenu-toggle svg,
	.aph-accordion li.aph-open > .sub-menu {
		transition: none;
		animation: none;
	}
}
