/*
 * CKC desktop menu: submenu toggle buttons (see inc/nav-keyboard.js).
 *
 * Everything is scoped to .ckc-has-submenu-toggles, which the script adds once
 * the buttons exist, so without JavaScript the menu looks and works as before.
 * Spacing and colours match the arrow that used to sit inside the parent link
 * (assets/main.scss: .ckc-nav-menu > .nav-item.dropdown > .nav-link .caret).
 */

.ckc-nav-menu.ckc-has-submenu-toggles > .nav-item.dropdown {
	display: flex;
	align-items: stretch;
}

/* The arrow moves from inside the link into the button. */
.ckc-nav-menu.ckc-has-submenu-toggles > .nav-item.dropdown > .nav-link {
	padding-right: 0;
}

.ckc-nav-menu.ckc-has-submenu-toggles > .nav-item.dropdown > .nav-link .caret {
	display: none;
}

.ckc-nav-menu .ckc-submenu-toggle {
	display: flex;
	align-items: center;
	margin: 0;
	padding: 0 12px 0 16px; /* 16px after the label, 12px after the arrow, as before */
	border: 0;
	border-radius: 0;
	background: transparent;
	color: inherit;
	line-height: 1;
	cursor: pointer;
}

.ckc-nav-bar-public .ckc-nav-menu .ckc-submenu-toggle {
	color: #fff;
}

.ckc-nav-bar-members .ckc-nav-menu .ckc-submenu-toggle {
	color: #212121;
}

.ckc-submenu-toggle__caret {
	display: block;
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
}

.ckc-nav-menu .ckc-submenu-toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -4px;
}

/* Opened with the button. Mouse hover still opens it through the theme's own rule. */
.ckc-nav-menu > .nav-item.dropdown.ckc-submenu-open > .dropdown-menu {
	display: block;
}
