/*
 * Site menu.
 *
 * On phones the header shows only the Cr8 Focus icon and a hamburger. The hamburger
 * opens a dropdown panel directly under the header. The menu is built on <details>,
 * so it works without JavaScript. Desktop keeps the full logo, the header links and
 * the register button, and the menu is not shown.
 *
 * Every rule is scoped to .cr8rr and only touches menu elements, so page colours and
 * layouts are unchanged.
 */

.cr8rr .cr8rr-s-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Logo: full logo on desktop, icon only on phones ---------- */

.cr8rr .cr8rr-logo img.cr8rr-logo__icon { display: none; width: auto; height: 40px; }

/* ---------- Hamburger and dropdown: hidden on desktop ---------- */

.cr8rr .cr8rr-s-dd { display: none; }

.cr8rr .cr8rr-s-dd__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 46px;
	height: 46px;
	margin: 0;
	padding: 0;
	list-style: none;
	border: 1px solid var(--rr-line);
	border-radius: 999px;
	background: var(--rr-white);
	color: var(--rr-indigo);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.cr8rr .cr8rr-s-dd__btn::-webkit-details-marker { display: none; }
.cr8rr .cr8rr-s-dd__btn::marker { content: ""; }
.cr8rr .cr8rr-s-dd__btn:focus-visible { outline: 3px solid var(--rr-amber); outline-offset: 3px; }

.cr8rr .cr8rr-s-dd__bars { position: relative; display: block; width: 18px; height: 14px; }
.cr8rr .cr8rr-s-dd__bars span {
	position: absolute;
	left: 0;
	right: 0;
	height: 2px;
	border-radius: 2px;
	background: currentColor;
	transition: transform .25s var(--rr-ease), opacity .2s, top .25s var(--rr-ease);
}
.cr8rr .cr8rr-s-dd__bars span:nth-child(1) { top: 0; }
.cr8rr .cr8rr-s-dd__bars span:nth-child(2) { top: 6px; }
.cr8rr .cr8rr-s-dd__bars span:nth-child(3) { top: 12px; }
.cr8rr .cr8rr-s-dd[open] .cr8rr-s-dd__bars span:nth-child(1) { top: 6px; transform: rotate(45deg); }
.cr8rr .cr8rr-s-dd[open] .cr8rr-s-dd__bars span:nth-child(2) { opacity: 0; }
.cr8rr .cr8rr-s-dd[open] .cr8rr-s-dd__bars span:nth-child(3) { top: 6px; transform: rotate(-45deg); }

.cr8rr .cr8rr-s-dd__panel { display: none; }

/* ---------- Phones and small tablets ---------- */

@media (max-width: 899px) {
	.cr8rr .cr8rr-logo img.cr8rr-logo__full { display: none; }
	.cr8rr .cr8rr-logo img.cr8rr-logo__icon { display: block; }
	.cr8rr .cr8rr-s-cta { display: none; }

	.cr8rr .cr8rr-s-dd { display: block; margin-left: auto; position: static; }

	/* The panel is positioned against the sticky header, so it opens flush beneath it. */
	.cr8rr .cr8rr-s-dd[open] > .cr8rr-s-dd__panel {
		display: block;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		max-height: calc(100vh - 72px);
		max-height: calc(100dvh - 72px);
		overflow-y: auto;
		padding: 8px 20px calc(24px + env(safe-area-inset-bottom));
		background: var(--rr-paper);
		border-bottom: 1px solid var(--rr-line);
		box-shadow: 0 18px 40px rgba(7, 2, 89, .14);
		animation: cr8rr-dd-in .2s var(--rr-ease);
	}
	.cr8rr .cr8rr-s-dd__panel ul { list-style: none; margin: 0; padding: 0; }
	.cr8rr .cr8rr-s-dd__panel li { border-bottom: 1px solid var(--rr-line); }
	.cr8rr .cr8rr-s-dd__panel li:last-child { border-bottom: 0; }
	.cr8rr .cr8rr-s-dd__panel a:not(.cr8rr-s-dd__cta) {
		display: flex;
		align-items: center;
		justify-content: space-between;
		min-height: 56px;
		font-family: var(--rr-font-display);
		font-size: 1.3rem;
		font-weight: 650;
		letter-spacing: -.02em;
		color: var(--rr-ink);
		text-decoration: none;
	}
	.cr8rr .cr8rr-s-dd__panel a[aria-current="page"]:not(.cr8rr-s-dd__cta) { color: var(--rr-indigo); }
	.cr8rr .cr8rr-s-dd__panel a[aria-current="page"]:not(.cr8rr-s-dd__cta)::after {
		content: "";
		width: 8px;
		height: 8px;
		border-radius: 50%;
		background: var(--rr-amber);
	}
	.cr8rr .cr8rr-s-dd__panel a:focus-visible { outline: 3px solid var(--rr-amber); outline-offset: 3px; }
	.cr8rr .cr8rr-s-dd__cta { margin-top: 18px; width: 100%; justify-content: center; }
}

@media (max-width: 600px) {
	.cr8rr .cr8rr-logo img.cr8rr-logo__icon { height: 36px; }
}

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

@media (prefers-reduced-motion: reduce) {
	.cr8rr .cr8rr-s-dd__bars span { transition: none; }
	.cr8rr .cr8rr-s-dd[open] > .cr8rr-s-dd__panel { animation: none; }
}
