/*
 * Navigation affordances outside the guides cluster.
 *
 * Colours are read from the Blocksy palette so this sheet follows the site
 * instead of pinning its own values.
 */

/*
 * Header menu — hover feedback on the current page's item.
 *
 * Blocksy styles the current item from two "active" values that the Customizer
 * sets on this site, and neither rule is qualified by :hover, so both win over
 * the hover state:
 *
 *   --menu-indicator-active-color: rgba(0, 0, 0, 0)  → the underline
 *   --theme-link-active-color: #e3e3e3               → the label colour
 *
 * The current item therefore stays completely inert under the cursor. Since
 * "Mes Tarifs", "Mon Parcours" and "FAQ" all link to the homepage, WordPress
 * marks the three of them current there, so three of the four entries look
 * broken on the homepage and the dead one moves with the page being viewed.
 *
 * Restoring the active values would put three permanent underlines and three
 * permanently gold labels on the homepage. Instead, hover and keyboard focus
 * take precedence over the active state: the current item stays quiet at rest
 * and behaves exactly like its neighbours under the cursor.
 */
[data-menu] > ul > li[class*="current-menu-"]:hover > a::before,
[data-menu] > ul > li[class*="current-menu-"]:hover > a::after,
[data-menu] > ul > li[class*="current-menu-"]:focus-within > a::before,
[data-menu] > ul > li[class*="current-menu-"]:focus-within > a::after {
	background-color: var(
		--menu-indicator-hover-color,
		var(--theme-palette-color-2, #daa520)
	);
}

nav[class*="menu"] li[class*="current-menu-"]:hover > .ct-menu-link,
nav[class*="menu"] li[class*="current-menu-"]:hover > .ct-sub-menu-parent,
nav[class*="menu"] li[class*="current-menu-"]:focus-within > .ct-menu-link,
nav[class*="menu"] li[class*="current-menu-"]:focus-within > .ct-sub-menu-parent {
	color: var(--theme-link-hover-color, var(--theme-palette-color-2, #daa520));
}

/*
 * Homepage — link to the guide directory.
 *
 * The theme button is the site's commercial call to action; it is also what the
 * header "Contact" button wears. Browsing the directory is navigation, not
 * conversion, so it takes the surface of the /guides panels and of the
 * end-of-article cards instead, and closes the section as a full-width row.
 */
body.home .wp-block-button__link[href$="/guides"] {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.6em;
	width: 100%;
	padding: 1.25rem 1.5rem;
	border: 1px solid var(--theme-palette-color-6, #383838);
	border-radius: var(--theme-button-border-radius, 15px);
	background: #121212;
	color: var(--theme-palette-color-3, #e3e3e3);
	font-size: var(--theme-button-font-size, 15px);
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
}

body.home .wp-block-buttons:has(> .wp-block-button > .wp-block-button__link[href$="/guides"]) {
	display: block;
}

body.home .wp-block-button:has(> .wp-block-button__link[href$="/guides"]) {
	width: 100%;
}

/* Decorative: the destination is already named by the label. */
body.home .wp-block-button__link[href$="/guides"]::after {
	content: "→";
	font-size: 1.1em;
	line-height: 1;
}

body.home .wp-block-button__link[href$="/guides"]:hover,
body.home .wp-block-button__link[href$="/guides"]:focus-visible {
	border-color: var(--theme-palette-color-2, #daa520);
	background: #121212;
	color: var(--theme-palette-color-2, #daa520);
}

/* Blocksy focuses buttons with #8d0010, which is 2.1:1 on the page background. */
body.home .wp-block-button__link[href$="/guides"]:focus-visible {
	outline: 3px solid var(--theme-palette-color-7, #fdfdfd);
	outline-offset: 3px;
}
