/* Header dropdown menus (one level). */
.main-navigation .menu-item-has-children { position: relative; }
/* Inline arrow that doesn't change the line height, so the parent lines up with the other items. */
.submenu-toggle { appearance: none; display: inline-flex; align-items: center; justify-content: center; width: 1.1rem; height: 1em; margin: 0 0 0 .3rem; padding: 0; border: 0; background: none; cursor: pointer; vertical-align: middle; line-height: 1; overflow: visible; }
.submenu-toggle svg { display: block; flex: none; }
.submenu-toggle svg { transition: transform .2s; }
.menu-item-has-children.is-open > .submenu-toggle svg { transform: rotate(180deg); }
.main-navigation .sub-menu { list-style: none; margin: 0; padding: 0; }
#masthead .sub-menu a.nav-link { display: block; color: #1a1814; }
#masthead .sub-menu a.nav-link:hover, #masthead .sub-menu a.nav-link.is-active { color: #000; }

/* Desktop: floating panel. */
@media (min-width: 768px) {
	.main-navigation .sub-menu {
		position: absolute; top: 100%; left: -1rem; z-index: 60;
		min-width: 13rem; padding: .5rem 0; margin-top: .6rem;
		background: #fff; border: 1px solid rgba(26, 24, 20, .1); border-radius: 6px; box-shadow: 0 10px 30px rgba(26, 24, 20, .12);
		opacity: 0; visibility: hidden; transform: translateY(4px);
		transition: opacity .15s, transform .15s, visibility 0s linear .15s;
	}
	/* Invisible bridge so the panel stays open while the pointer moves down to it. */
	.main-navigation .sub-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -.75rem; height: .75rem; }
	.main-navigation .menu-item-has-children:hover > .sub-menu,
	.main-navigation .menu-item-has-children.is-open > .sub-menu,
	.main-navigation .sub-menu:focus-within {
		opacity: 1; visibility: visible; transform: none; transition: opacity .15s, transform .15s;
	}
	.main-navigation .menu-item-has-children.is-closed:hover > .sub-menu { opacity: 0; visibility: hidden; }
	#masthead .sub-menu a.nav-link { padding: .55rem 1.1rem; white-space: nowrap; }
	#masthead .sub-menu a.nav-link:hover { background: #f4f4f2; }
}

/* Mobile: expands in place under its parent. */
@media (max-width: 767.98px) {
	.main-navigation .sub-menu { display: none; padding: 0 0 0 1rem; margin-top: .5rem; border-top: 1px solid rgba(26, 24, 20, .12); }
	.main-navigation .menu-item-has-children.is-open > .sub-menu { display: flex; flex-direction: column; }
	/* Big, easy-to-tap rows separated by a hairline. */
	.main-navigation .sub-menu > li { border-bottom: 1px solid rgba(26, 24, 20, .12); }
	#masthead .sub-menu a.nav-link { display: flex; align-items: center; min-height: 3rem; padding: .75rem 0; }
	#masthead #mobile-navigation .nav-link { font-size: .9375rem; } /* Parents and dropdown items the same size. */
	/* Larger tap target for the arrow without changing the row's look. */
	.submenu-toggle { width: 2.75rem; height: 2.75rem; margin: -.75rem -.75rem -.75rem .1rem; }

	/* Open menu: solid white header + panel, dark text (also over the homepage hero). */
	#masthead.is-menu-open { background: #fff; box-shadow: 0 8px 24px rgba(26, 24, 20, .12); }
	#masthead.is-menu-open #mobile-navigation { background: #fff; padding-bottom: 1.25rem; }
	body.has-hero #masthead.is-menu-open .site-branding__link,
	body.has-hero #masthead.is-menu-open .site-title,
	body.has-hero #masthead.is-menu-open .nav-link,
	body.has-hero #masthead.is-menu-open [data-nav-toggle] { color: #1a1814; }
	body.has-hero #masthead.is-menu-open .custom-logo { filter: none; }
}

@media (prefers-reduced-motion: reduce) {
	.main-navigation .sub-menu, .submenu-toggle svg { transition: none; }
}

/* Main menu: slightly larger type (footer menu unchanged). */
#site-navigation .nav-link, #mobile-navigation .nav-link { font-size: .8125rem; font-weight: 700; }
