/*
 * Header, footer and sale banner (parts/header.html, parts/footer.html).
 * CSS because these are states and responsive art direction theme.json can't express: the sticky header, what the
 * header shows at each width, the menu links that only appear inside the phone menu, and the footer's muted text.
 * Values are design tokens only.
 */

/* Sticky header: the template-part wrapper would otherwise limit position: sticky (block-theme skill, quirks). */
.wp-block-template-part:has(> .rc-header),
.wp-block-template-part:has(> .rc-sale-banner) {
	display: contents;
}

/* Jump links (/#guide, #free…) land below the sticky header, not under it; the section keeps its own top padding. */
:where(section[id], .wp-block-group[id]) {
	scroll-margin-top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--wp--custom--layout--header-height));
}

.rc-header {
	position: sticky;
	top: 0;
	z-index: var(--wp--custom--z--sticky);
	background: var(--wp--preset--color--base);
	border-bottom: var(--wp--custom--border--hairline) solid var(--wp--preset--color--accent-6);
}

.admin-bar .rc-header {
	top: var(--wp-admin--admin-bar--height, 0px);
}

.rc-header__bar {
	min-height: var(--wp--custom--layout--header-height);
	gap: var(--wp--preset--spacing--40);
}

.rc-header__bar > .rc-nav {
	flex: 1 1 auto;
}

.rc-nav {
	font-size: var(--wp--preset--font-size--small);
	font-weight: var(--wp--custom--font-weight--semibold);
}

/* Three sections with dropdowns, then the one gold action (owner, 2026-11-14: Courses, Students, Robert, Free lesson). */
.rc-nav .wp-block-navigation__container {
	gap: var(--wp--preset--spacing--40);
}

.rc-nav .wp-block-navigation__submenu-icon {
	width: var(--wp--custom--icon--xs);
	height: var(--wp--custom--icon--xs);
	margin-left: var(--wp--preset--spacing--20);
	color: var(--wp--preset--color--accent-4);
	transition: transform var(--wp--custom--transition--fast);
}

.rc-nav .wp-block-navigation-submenu:hover > .wp-block-navigation__submenu-icon,
.rc-nav .wp-block-navigation-submenu:focus-within > .wp-block-navigation__submenu-icon {
	color: var(--wp--preset--color--accent-1);
	transform: rotate(180deg);
}

/* Dropdown panel: a dark card like the rest of the site (core's default is a white box). */
.rc-nav.wp-block-navigation:not(.has-background) .wp-block-navigation__submenu-container {
	min-width: 17rem;
	padding: var(--wp--preset--spacing--20);
	border: var(--wp--custom--border--hairline) solid var(--wp--preset--color--accent-6);
	border-radius: var(--wp--custom--radius--card);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
	box-shadow: var(--wp--preset--shadow--md);
}

/* One line per item: the panel grows to its longest name (core fixes it at 200px, so long names wrapped). */
.rc-nav.wp-block-navigation .wp-block-navigation__submenu-container {
	width: max-content;
}

.rc-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	white-space: nowrap;
	width: 100%;
	padding: 0 var(--wp--preset--spacing--30);
	border-radius: var(--wp--custom--radius--button);
	font-weight: var(--wp--custom--font-weight--medium);
}

.rc-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover,
.rc-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content:focus-visible {
	background: var(--wp--preset--color--accent-5);
	color: var(--wp--preset--color--contrast);
}

/* Courses: "Where to start" first, in gold; "All courses" last, below a rule. */
.rc-nav .wp-block-navigation-submenu:has(> a[href$="/product-categories/"]) .wp-block-navigation__submenu-container > li:first-child .wp-block-navigation-item__content {
	color: var(--wp--preset--color--accent-1);
}

.rc-nav .wp-block-navigation-submenu:has(> a[href$="/product-categories/"]) .wp-block-navigation__submenu-container > li:last-child {
	margin-top: var(--wp--preset--spacing--20);
	padding-top: var(--wp--preset--spacing--20);
	border-top: var(--wp--custom--border--hairline) solid var(--wp--preset--color--accent-6);
}

/* Free lesson: the header's one button (on-accent on accent-1, the checked pair). */
.rc-nav .rc-nav__cta > .wp-block-navigation-item__content {
	padding: 0 var(--wp--preset--spacing--40);
	border-radius: var(--wp--custom--radius--button);
	background: var(--wp--preset--color--accent-1);
	color: var(--wp--preset--color--on-accent);
	font-weight: var(--wp--custom--font-weight--bold);
}

.rc-nav .rc-nav__cta > .wp-block-navigation-item__content:hover,
.rc-nav .rc-nav__cta.current-menu-item > .wp-block-navigation-item__content {
	background: var(--wp--preset--color--accent-1-strong);
	color: var(--wp--preset--color--on-accent);
}

.rc-nav .wp-block-navigation-item__content {
	display: inline-flex;
	align-items: center;
	min-height: var(--wp--custom--control--min);
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}

.rc-nav .wp-block-navigation-item__content:hover,
.rc-nav .current-menu-item > .wp-block-navigation-item__content {
	color: var(--wp--preset--color--accent-1);
}

/* Shortcuts for students live in the tools area on wide screens and inside the menu on phones. */
.rc-nav .rc-nav__util {
	display: none;
}

.rc-nav .wp-block-navigation__responsive-container.is-menu-open .rc-nav__util {
	display: flex;
}

/* A thin rule above the student shortcuts inside the phone menu. */
.rc-nav .wp-block-navigation__responsive-container.is-menu-open .rc-nav__util:nth-last-child(2) {
	margin-top: var(--wp--preset--spacing--40);
	padding-top: var(--wp--preset--spacing--40);
	border-top: var(--wp--custom--border--hairline) solid var(--wp--preset--color--accent-6);
}

.rc-header__tools {
	gap: var(--wp--preset--spacing--30);
}

.rc-header__util {
	margin: 0;
	font-size: var(--wp--preset--font-size--x-small);
	white-space: nowrap;
}

.rc-header__util a {
	display: inline-flex;
	align-items: center;
	min-height: var(--wp--custom--control--min);
	color: var(--wp--preset--color--accent-4);
	text-decoration: none;
}

.rc-header__util a:hover {
	color: var(--wp--preset--color--contrast);
}

/* Account: the theme's user icon (WooCommerce's block showed the WordPress profile picture when signed in). */
.rc-header__account {
	margin: 0;
}

.rc-header__account a::before {
	content: "";
	width: var(--wp--custom--icon--md);
	height: var(--wp--custom--icon--md);
	background: currentColor;
	-webkit-mask: url(../icons/wp/user.svg) center / contain no-repeat;
	mask: url(../icons/wp/user.svg) center / contain no-repeat;
}

.rc-header__account a:hover {
	color: var(--wp--preset--color--accent-1);
}

.rc-header__tools .rc-header__account a,
.rc-header__tools .wc-block-mini-cart__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: var(--wp--custom--control--min);
	min-height: var(--wp--custom--control--min);
	color: var(--wp--preset--color--contrast);
}

/* Phone menu: full screen, large links. The selectors outweigh core's white overlay
   (.wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open). */
.rc-nav.wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	padding: var(--wp--preset--spacing--40) var(--wp--custom--layout--gutter-mobile);
}

.rc-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	align-items: flex-start;
	gap: var(--wp--preset--spacing--20);
	padding-top: var(--wp--preset--spacing--70);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--x-large);
}

.rc-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	align-items: flex-start;
}

.rc-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .rc-nav__util {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--medium);
}

.rc-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	color: var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--x-large);
}

.rc-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .rc-nav__util .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--medium);
	color: var(--wp--preset--color--accent-4);
}

/* Phone menu: each section's links listed under it (core opens every dropdown inside the overlay); section names
   aligned with their links (the menu's centred layout centred them). */
.rc-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
	align-items: flex-start;
}

.rc-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	padding: 0 0 var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
	border: 0;
	background: none;
	box-shadow: none;
}

.rc-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--medium);
	color: var(--wp--preset--color--accent-4);
	padding: 0;
}

.rc-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-icon {
	display: none;
}

.rc-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .rc-nav__cta > .wp-block-navigation-item__content {
	margin-top: var(--wp--preset--spacing--30);
	padding: 0 var(--wp--preset--spacing--50);
	color: var(--wp--preset--color--on-accent);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--medium);
}

/* The sticky header is its own layer: lift it above page content (gallery zoom buttons) while the menu is open. */
.rc-header:has(.is-menu-open) {
	z-index: var(--wp--custom--z--modal);
}

.rc-nav .wp-block-navigation__responsive-container-open,
.rc-nav .wp-block-navigation__responsive-container-close {
	min-width: var(--wp--custom--control--min);
	min-height: var(--wp--custom--control--min);
	justify-content: center;
}

@media (max-width: 1023px) {
	.rc-header__util {
		display: none;
	}
}

@media (max-width: 599px) {
	.rc-header__bar {
		min-height: var(--wp--custom--layout--header-height-mobile);
	}

	/* Phone order: menu, logo, account and cart. */
	.rc-header__bar > .rc-nav {
		flex: 0 0 auto;
		order: -1;
	}

	.rc-header__bar > .rc-logo {
		margin-right: auto;
	}
}

/* Sale banner: shown only while a sale runs (rc-site removes it otherwise). */
/* Gold strip: on-accent on accent-1 is the checked button pair (contrast.md). */
.rc-sale-banner {
	background: var(--wp--preset--color--accent-1);
	color: var(--wp--preset--color--on-accent);
	font-size: var(--wp--preset--font-size--small);
	font-weight: var(--wp--custom--font-weight--semibold);
	padding-top: var(--wp--preset--spacing--20);
	padding-bottom: var(--wp--preset--spacing--20);
}

.rc-sale-banner p {
	margin: 0;
}

.rc-sale-banner a {
	color: inherit;
}

.rc-sale-banner a:focus-visible {
	outline-color: var(--wp--preset--color--on-accent);
}

/* Footer */
.rc-footer {
	margin-top: var(--wp--preset--spacing--80);
	padding-top: var(--wp--preset--spacing--70);
	padding-bottom: var(--wp--preset--spacing--50);
	border-top: var(--wp--custom--border--hairline) solid var(--wp--preset--color--accent-6);
	background: var(--wp--preset--color--surface);
	font-size: var(--wp--preset--font-size--small);
}

.rc-footer__cols {
	gap: var(--wp--preset--spacing--60);
}

.rc-footer__title {
	font-size: var(--wp--preset--font-size--medium);
	margin-bottom: var(--wp--preset--spacing--30);
}

.rc-footer__muted {
	color: var(--wp--preset--color--accent-4);
}

.rc-footer__links {
	list-style: none;
	margin: 0;
	padding: 0;
}

.rc-footer__links a {
	display: inline-flex;
	align-items: center;
	min-height: var(--wp--custom--control--min);
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}

.rc-footer__links a:hover {
	color: var(--wp--preset--color--accent-1);
	text-decoration: underline;
}

.rc-footer__legal {
	margin-top: var(--wp--preset--spacing--60);
	padding-top: var(--wp--preset--spacing--40);
	border-top: var(--wp--custom--border--hairline) solid var(--wp--preset--color--accent-6);
	color: var(--wp--preset--color--accent-4);
	font-size: var(--wp--preset--font-size--x-small);
}

.rc-footer__legal p {
	margin: 0;
}

.rc-footer__legal a {
	color: inherit;
}

/* ---------- Free lesson sign-up (rc-site inc/free-lesson.php): the form, and the dialog every "Free lesson" link opens ---------- */
.rc-free-form {
	display: grid;
	gap: var(--wp--preset--spacing--20);
	margin: 0;
}

.rc-free-form__label {
	font-size: var(--wp--preset--font-size--small);
	font-weight: var(--wp--custom--font-weight--semibold);
}

.rc-free-form__row {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--20);
}

.rc-free-form__input {
	flex: 1 1 14rem;
	min-width: 0;
	min-height: var(--wp--custom--control--height);
	padding: 0 var(--wp--custom--control--input-padding-x);
	border: var(--wp--custom--border--hairline) solid var(--wp--preset--color--border-strong);
	border-radius: var(--wp--custom--radius--input);
	background: var(--wp--preset--color--accent-5);
	color: var(--wp--preset--color--contrast);
	font: inherit;
	font-size: var(--wp--preset--font-size--medium);
}

.rc-free-form__input::placeholder {
	color: var(--wp--preset--color--accent-4);
	opacity: 1;
}

.rc-free-form__input:focus-visible {
	border-color: var(--wp--preset--color--contrast);
	outline: var(--wp--custom--border--focus) solid var(--wp--preset--color--focus);
	outline-offset: var(--wp--custom--border--focus-offset);
}

.rc-free-form__button {
	flex: 0 0 auto;
	min-height: var(--wp--custom--control--height);
	padding: 0 var(--wp--custom--control--padding-x);
	border: 0;
	border-radius: var(--wp--custom--radius--button);
	background: var(--wp--preset--color--accent-1);
	color: var(--wp--preset--color--on-accent);
	font: inherit;
	font-weight: var(--wp--custom--font-weight--bold);
	cursor: pointer;
}

.rc-free-form__button:hover {
	background: var(--wp--preset--color--accent-1-strong);
}

.rc-free-form__notice {
	margin: 0;
	padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
	border-radius: var(--wp--custom--radius--input);
	background: var(--wp--preset--color--error-surface);
	color: var(--wp--preset--color--error);
	font-size: var(--wp--preset--font-size--small);
}

.rc-free-form__small {
	margin: 0;
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--accent-4);
}

/* Spam trap: off-screen for people, still in the form for bots. */
.rc-free-form__trap {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
}

.rc-free-dialog {
	box-sizing: border-box;
	width: min(32rem, calc(100vw - 2 * var(--wp--custom--layout--gutter-mobile)));
	padding: var(--wp--preset--spacing--60) var(--wp--preset--spacing--50) var(--wp--preset--spacing--50);
	border: var(--wp--custom--border--hairline) solid var(--wp--preset--color--accent-6);
	border-radius: var(--wp--custom--radius--card);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
	box-shadow: var(--wp--preset--shadow--md);
}

.rc-free-dialog::backdrop {
	background: color-mix(in srgb, var(--wp--preset--color--base) 80%, transparent);
}

.rc-free-dialog > * {
	margin-block: 0 var(--wp--preset--spacing--30);
}

.rc-free-dialog__title {
	font-size: var(--wp--preset--font-size--x-large);
	line-height: var(--wp--custom--line-height--heading);
}

.rc-free-dialog__lead {
	color: var(--wp--preset--color--accent-4);
}

.rc-free-dialog .rc-free-form {
	margin-bottom: 0;
}

.rc-free-dialog__close {
	position: absolute;
	top: var(--wp--preset--spacing--20);
	right: var(--wp--preset--spacing--20);
	width: var(--wp--custom--control--min);
	height: var(--wp--custom--control--min);
	margin: 0;
	border: 0;
	border-radius: var(--wp--custom--radius--button);
	background: transparent;
	color: var(--wp--preset--color--contrast);
	cursor: pointer;
}

.rc-free-dialog__close::before {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: var(--wp--custom--icon--sm);
	height: var(--wp--custom--icon--sm);
	background: currentColor;
	-webkit-mask: url(../icons/wp/x.svg) center / contain no-repeat;
	mask: url(../icons/wp/x.svg) center / contain no-repeat;
}

.rc-free-dialog__close:hover {
	background: var(--wp--preset--color--accent-5);
}

.rc-free-dialog__close:focus-visible {
	outline: var(--wp--custom--border--focus) solid var(--wp--preset--color--focus);
	outline-offset: var(--wp--custom--border--focus-offset);
}
