/*
 * Transpirenaica Trail — header (01.01): GeneratePress header + Menu Plus, ported from base.css / mobile.css of
 * the approved design (.site-header, .main-nav, .site-header__cta, .menu-toggle).
 *
 * What comes from the database and is NOT repeated here:
 * - Customizer: logo (custom_logo), «Principal» in primary and «Menu mobile» in slideout; colours of the
 *   navigation (cream, hover and current mustard), dropdown and Off Canvas panel; header band forest-900;
 *   menu typography (Barlow 600 15 px uppercase .07em).
 * - Spacing: header padding 30/14 (16 px above a 72 px row) and 18/10 on mobile; menu items 44 px tall with
 *   16 px each side (32 px between labels, as the design).
 * - Menu Plus: Off Canvas only on mobile, mobile menu from 1200 px down (the full menu needs ~1190 px).
 * - Header Element «Cabecera fusionada»: merges the header over the hero (front page, Preguntas, Galerías and
 *   the galleries), without navigation colours.
 * The CTA («¡Inscríbete!», last item of «Principal» with class menu-cta) is painted as .btn in components.css.
 */

/* Logo: 26 px tall (13 px on mobile), width from the image ratio */
.site-header .site-logo {
	display: flex;
	flex: none;
	line-height: 0;
}

.site-header .site-logo .header-image {
	width: auto;
	height: 26px;
}

/* «En imágenes»: GP's dropdown arrow replaced by the chevron of the design (12 px, 6 px gap, 80 % opacity) */
#site-navigation .main-nav > ul > li.menu-item-has-children > a .dropdown-menu-toggle {
	display: inline-flex;
	align-items: center;
	padding-left: 6px;
	line-height: 1;
}

#site-navigation .main-nav > ul > li.menu-item-has-children > a .dropdown-menu-toggle .gp-icon {
	width: 12px;
	height: 12px;
	top: 0;
	background-color: currentColor;
	opacity: .8;
	-webkit-mask: url("../icons/chevron.svg?v=1") center / contain no-repeat;
	mask: url("../icons/chevron.svg?v=1") center / contain no-repeat;
}

#site-navigation .main-nav > ul > li.menu-item-has-children > a .dropdown-menu-toggle .gp-icon svg {
	display: none;
}

/* Dropdown of «En imágenes» (colours from the Customizer) */
#site-navigation .main-nav ul ul {
	padding: var(--space-2) 0;
	border-radius: var(--radius-media);
	box-shadow: none;
	overflow: hidden;
}

#site-navigation .main-nav ul ul li a {
	font-size: 14px;
	letter-spacing: .05em;
}

/*
 * CTA: 32 px after the last label (16 px of that label's padding + 16 px here). Its children in the menu (the
 * signup links of each departure, kept from the current site) are not shown in the header: the approved design
 * has a plain button. They stay editable in Appearance › Menus.
 */
#site-navigation .main-nav > ul > li.menu-cta {
	display: flex;
	align-items: center;
	margin-left: var(--space-4);
}

#site-navigation .main-nav > ul > li.menu-cta > ul,
#site-navigation .main-nav > ul > li.menu-cta > a .dropdown-menu-toggle {
	display: none;
}

/*
 * Pages where the header is merged (Header Element) but there is no dark hero under it yet, or the client
 * removed it: the header goes back to the flow with its forest band, so the cream menu stays readable.
 */
body:not(:has(.hero, .page-hero)) .header-wrap {
	position: relative;
}

body:not(:has(.hero, .page-hero)) .header-wrap .site-header {
	background: var(--forest-900);
}

/* Tablet gutter of the design (32 px) */
@media (max-width: 1100px) and (min-width: 768px) {
	.site-header .inside-header {
		padding-left: var(--gutter);
		padding-right: var(--gutter);
	}
}

/*
 * Mobile menu (Menu Plus breakpoint, 1200 px): logo, CTA and toggle in one row. The ul of «Principal» stays
 * visible with only its li.menu-cta, placed before the toggle; the toggle opens the Off Canvas panel.
 */
@media (max-width: 1200px) {
	.site-header .inside-header {
		flex-direction: row;
		flex-wrap: nowrap;
		align-items: center;
	}

	.has-inline-mobile-toggle #site-navigation {
		order: 1;
		flex-basis: auto;
		margin-left: auto;
		background: transparent;
	}

	.has-inline-mobile-toggle #mobile-menu-control-wrapper {
		order: 2;
		margin-left: var(--space-3);
	}

	#site-navigation:not(.toggled) .main-nav > ul {
		display: flex;
	}

	#site-navigation .main-nav > ul > li:not(.menu-cta) {
		display: none;
	}

	#site-navigation .main-nav > ul > li.menu-cta {
		margin-left: 0;
	}

	#mobile-menu-control-wrapper .menu-toggle,
	#mobile-menu-control-wrapper .menu-toggle:is(:hover, :focus, :active) {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		padding: 0;
		border: 1px solid rgba(244, 239, 227, .4);
		border-radius: 12px;
		background: rgba(13, 26, 17, .35);
		color: var(--on-dark);
		line-height: 1;
	}

	#mobile-menu-control-wrapper .menu-toggle .gp-icon {
		width: 24px;
		height: 24px;
		background-color: currentColor;
		-webkit-mask: url("../icons/menu.svg?v=1") center / contain no-repeat;
		mask: url("../icons/menu.svg?v=1") center / contain no-repeat;
	}

	#mobile-menu-control-wrapper .menu-toggle .gp-icon svg {
		display: none;
	}
}

@media (max-width: 767px) {
	.site-header .site-logo .header-image {
		height: 13px;
	}
}

/* Off Canvas panel («Menu mobile»): colours from the Customizer, type of the main menu */
#generate-slideout-menu .main-nav ul li a {
	font-family: var(--font-body);
	font-weight: 600;
	font-size: var(--fs-small);
	letter-spacing: .07em;
	text-transform: uppercase;
}

#generate-slideout-menu .inside-navigation {
	padding-top: var(--space-8);
}

#generate-slideout-menu .main-nav ul li a:focus-visible {
	box-shadow: inset var(--shadow-focus);
}
