/**
 * Caprigran – Cabecera (rediseño 10/2026)
 * Todo va bajo .cgh para no chocar con los estilos antiguos de mycss.css.
 * Escritorio ≥ 1100 px: una línea con desplegables. Por debajo: barra + menú a pantalla completa.
 */

.cgh {
	--cgh-green: #619828;
	--cgh-orange: #d6663c;
	--cgh-orange-dark: #bb5229;
	--cgh-navy: #1d1e39;
	--cgh-muted: rgba(29, 30, 57, .6);
	--cgh-line: rgba(29, 30, 57, .1);
	--cgh-h: 108px;
	--cgh-serif: "Libre Baskerville", Georgia, serif;
	--cgh-sans: "Montserrat", Helvetica, Arial, sans-serif;
	--cgh-ease: cubic-bezier(.2, .7, .2, 1);

	position: sticky;
	top: 0;
	z-index: 1000;
	font-family: var(--cgh-sans);
	color: var(--cgh-navy);
	line-height: 1.3;
}

/* #page tiene overflow:hidden en mycss.css, que anula position:sticky.
   clip recorta igual sin crear contenedor de scroll (si el navegador no lo
   entiende, se queda el hidden y la cabecera simplemente no se fija). */
#page.site-wrapper {
	overflow: clip;
}

/* Los enlaces a anclas no quedan tapados por la cabecera fija */
html {
	scroll-padding-top: 110px;
}

.admin-bar .cgh { top: 32px; }

@media (max-width: 782px) {
	.admin-bar .cgh { top: 46px; }
}

@media (max-width: 600px) {
	.admin-bar .cgh { top: 0; }
}

/* Reset local: mycss.css da márgenes a li, p, h5 y estilos a a/button.
   Con :where() no suman especificidad y no pisan los estilos de abajo. */
header#masthead.cgh {
	position: sticky;
	width: auto;
	padding: 0;
	background: none;
	transition: none;
}

.cgh :where(ul, li) {
	margin: 0;
	padding: 0;
	list-style: none;
}

.cgh :where(a) {
	text-decoration: none;
}

.cgh :where(button) {
	margin: 0;
	font: inherit;
	color: inherit;
}

.cgh :where(img) {
	display: block;
	max-width: none;
}

.cgh [hidden] {
	display: none !important;
}

/* Colores de enlaces visitados (reset.css los pone en morado) */
.cgh .cgh-nav__link:visited,
.cgh .cgh-sub__list a:visited,
.cgh .cgh-tools__catalog:visited {
	color: var(--cgh-navy);
}

.cgh .cgh-sub__title:visited {
	color: var(--cgh-green);
}

.cgh .cgh-lang a:visited {
	color: var(--cgh-muted);
}

.cgh a.cgh-cta:visited {
	color: #fff;
}

.cgh :focus-visible {
	outline: 2px solid var(--cgh-green);
	outline-offset: 3px;
	border-radius: 2px;
}

.cgh-sr,
.cgh-skip:not(:focus) {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.cgh-skip:focus {
	position: fixed;
	top: 12px;
	left: 12px;
	z-index: 2000;
	padding: 10px 16px;
	background: var(--cgh-navy);
	color: #fff;
	font: 600 14px/1 var(--cgh-sans, sans-serif);
}

#cgh-main:focus {
	outline: none;
}

/* Barra ---------------------------------------------------------------- */

.cgh__bar {
	position: relative;
	z-index: 2;
	background: #fff;
	border-bottom: 1px solid var(--cgh-line);
	transition: box-shadow .25s ease;
}

.cgh.is-scrolled .cgh__bar {
	box-shadow: 0 6px 24px -12px rgba(29, 30, 57, .28);
}

.cgh__inner {
	display: flex;
	align-items: center;
	gap: 32px;
	max-width: 1170px;
	height: var(--cgh-h);
	margin: 0 auto;
	padding: 0 15px;
	box-sizing: content-box;
	transition: height .3s var(--cgh-ease);
}

.cgh.is-scrolled {
	--cgh-h: 76px;
}

/* Marca: logo + sello */
.cgh__brand {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 16px;
}

.cgh__logo img {
	width: auto;
	height: 90px;
	transition: height .3s var(--cgh-ease);
}

.cgh__seal {
	padding-left: 16px;
	border-left: 1px solid var(--cgh-line);
}

.cgh__seal img {
	width: auto;
	height: 72px;
	transition: height .3s var(--cgh-ease), opacity .2s;
}

.cgh__seal:hover img {
	opacity: .85;
}

.cgh.is-scrolled .cgh__logo img { height: 62px; }
.cgh.is-scrolled .cgh__seal img { height: 52px; }

/* Botón de menú (solo móvil) */
.cgh__burger {
	display: none;
}

/* Panel (escritorio: en línea) ----------------------------------------- */

.cgh__panel {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-width: 0;
}

.cgh-nav__list {
	display: flex;
	align-items: center;
	gap: 4px;
}

.cgh-nav__link {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 12px 14px;
	background: none;
	border: 0;
	font-family: var(--cgh-serif);
	font-size: 15px;
	line-height: 1.2;
	color: var(--cgh-navy);
	cursor: pointer;
	white-space: nowrap;
	transition: color .2s;
}

.cgh-nav__link::after {
	content: "";
	position: absolute;
	right: 14px;
	bottom: 4px;
	left: 14px;
	height: 2px;
	background: var(--cgh-green);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform .25s var(--cgh-ease);
}

.cgh-nav__link:hover,
.cgh-nav__item.is-open > .cgh-nav__link {
	color: var(--cgh-green);
}

.cgh-nav__link:hover::after,
.cgh-nav__item.is-open > .cgh-nav__link::after,
.cgh-nav__item.is-current > .cgh-nav__link::after {
	transform: scaleX(1);
}

.cgh-caret {
	width: 10px;
	height: 6px;
	transition: transform .25s var(--cgh-ease);
}

.cgh-nav__item.is-open .cgh-caret {
	transform: rotate(180deg);
}

/* Desplegable --------------------------------------------------------- */

.cgh-sub {
	position: absolute;
	top: 100%;
	right: 0;
	left: 0;
	z-index: 1;
	background: #fff;
	box-shadow: 0 30px 50px -30px rgba(29, 30, 57, .35);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-8px);
	transition: opacity .2s ease, transform .25s var(--cgh-ease), visibility 0s linear .25s;
}

.cgh-nav__item.is-open > .cgh-sub {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity .2s ease, transform .25s var(--cgh-ease), visibility 0s;
}

.cgh-sub__inner {
	display: grid;
	grid-template-columns: 300px repeat(auto-fit, minmax(170px, 1fr));
	gap: 40px;
	max-width: 1170px;
	margin: 0 auto;
	padding: 32px 15px 40px;
	box-sizing: content-box;
}

.cgh-sub__feature {
	position: relative;
	display: block;
	overflow: hidden;
	height: 200px;
	border-radius: 6px;
	color: #fff;
}

.cgh-sub__feature img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .6s var(--cgh-ease);
}

.cgh-sub__feature::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(29, 30, 57, 0) 35%, rgba(29, 30, 57, .82) 100%);
}

.cgh-sub__feature:hover img {
	transform: scale(1.04);
}

.cgh-sub__feature-text {
	position: absolute;
	right: 20px;
	bottom: 18px;
	left: 20px;
	z-index: 1;
	font-family: var(--cgh-serif);
	font-size: 18px;
	line-height: 1.3;
	color: #fff;
}

.cgh-sub__kicker {
	display: block;
	margin-bottom: 4px;
	font-family: var(--cgh-sans);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: #b9e08c;
}

.cgh-sub__title {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
	font-family: var(--cgh-serif);
	font-size: 17px;
	line-height: 1.3;
	color: var(--cgh-green);
}

.cgh-arrow {
	width: 16px;
	height: 10px;
	transition: transform .25s var(--cgh-ease);
}

.cgh-sub__title:hover {
	color: var(--cgh-navy);
}

.cgh-sub__title:hover .cgh-arrow {
	transform: translateX(4px);
}

.cgh-sub__list a {
	display: block;
	padding: 6px 0;
	font-size: 14px;
	line-height: 1.4;
	color: var(--cgh-navy);
	transition: color .2s, transform .2s var(--cgh-ease);
}

.cgh-sub__list a:hover,
.cgh-sub__list .current-menu-item > a {
	color: var(--cgh-green);
}

.cgh-sub__list a:hover {
	transform: translateX(3px);
}

/* Herramientas: catálogo, idioma y botón -------------------------------- */

.cgh-tools {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 22px;
}

.cgh-tools__catalog {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 500;
	color: var(--cgh-navy);
	white-space: nowrap;
	transition: color .2s;
}

.cgh-tools__catalog:hover {
	color: var(--cgh-green);
}

.cgh-icon {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	color: var(--cgh-green);
}

.cgh-lang {
	display: flex;
	align-items: center;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .04em;
}

.cgh-lang li + li::before {
	content: "";
	display: inline-block;
	width: 1px;
	height: 12px;
	margin: 0 8px;
	vertical-align: -1px;
	background: var(--cgh-line);
}

.cgh-lang a {
	color: var(--cgh-muted);
	transition: color .2s;
}

.cgh-lang a:hover {
	color: var(--cgh-green);
}

.cgh-lang__current {
	color: var(--cgh-navy);
}

.cgh-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 22px;
	border-radius: 4px;
	background: var(--cgh-orange);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	color: #fff;
	white-space: nowrap;
	transition: background-color .2s, transform .2s var(--cgh-ease);
}

.cgh a.cgh-cta:hover,
.cgh a.cgh-cta:focus-visible {
	background: var(--cgh-orange-dark);
	color: #fff;
	transform: translateY(-1px);
}

/* Fondo oscurecido bajo un desplegable abierto */
.cgh__overlay {
	position: fixed;
	inset: 0;
	z-index: 0;
	background: rgba(29, 30, 57, .28);
	animation: cgh-fade .2s ease;
}

@keyframes cgh-fade {
	from { opacity: 0; }
}

/* Escritorio estrecho: el catálogo se queda en icono */
@media (min-width: 1100px) and (max-width: 1179px) {
	.cgh__inner { gap: 20px; }
	.cgh-nav__link { padding-right: 10px; padding-left: 10px; }
	.cgh-nav__link::after { right: 10px; left: 10px; }
	.cgh-tools { gap: 16px; }
	.cgh-tools__catalog span {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}
}

/* Móvil y tablet ------------------------------------------------------- */

@media (max-width: 1099px) {
	.cgh {
		--cgh-h: 64px;
	}

	.cgh.is-scrolled {
		--cgh-h: 64px;
	}

	.cgh__logo img,
	.cgh.is-scrolled .cgh__logo img {
		height: 54px;
	}

	.cgh__seal {
		display: none;
	}

	.cgh__burger {
		position: relative;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 46px;
		height: 46px;
		margin-left: auto;
		margin-right: -8px;
		padding: 0;
		background: none;
		border: 0;
		cursor: pointer;
	}

	.cgh__burger-box {
		position: relative;
		width: 24px;
		height: 16px;
	}

	.cgh__burger-box span {
		position: absolute;
		left: 0;
		width: 100%;
		height: 2px;
		border-radius: 2px;
		background: var(--cgh-navy);
		transition: transform .3s var(--cgh-ease), opacity .2s, top .3s var(--cgh-ease);
	}

	.cgh__burger-box span:nth-child(1) { top: 0; }
	.cgh__burger-box span:nth-child(2) { top: 7px; }
	.cgh__burger-box span:nth-child(3) { top: 14px; }

	.cgh.is-menu-open .cgh__burger-box span:nth-child(1) { top: 7px; transform: rotate(45deg); }
	.cgh.is-menu-open .cgh__burger-box span:nth-child(2) { opacity: 0; }
	.cgh.is-menu-open .cgh__burger-box span:nth-child(3) { top: 7px; transform: rotate(-45deg); }

	.cgh__panel {
		position: fixed;
		top: var(--cgh-offset, 64px);
		right: 0;
		bottom: 0;
		left: 0;
		display: flex;
		flex-direction: column;
		align-items: stretch;
		justify-content: flex-start;
		gap: 0;
		padding: 8px 20px 32px;
		overflow-y: auto;
		overscroll-behavior: contain;
		background: #fff;
		opacity: 0;
		visibility: hidden;
		transform: translateY(-10px);
		transition: opacity .2s ease, transform .3s var(--cgh-ease), visibility 0s linear .3s;
	}

	.cgh.is-menu-open .cgh__panel {
		opacity: 1;
		visibility: visible;
		transform: none;
		transition: opacity .2s ease, transform .3s var(--cgh-ease), visibility 0s;
	}

	.cgh-nav__list {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}

	.cgh-nav__item {
		border-bottom: 1px solid var(--cgh-line);
	}

	.cgh-nav__link {
		justify-content: space-between;
		width: 100%;
		padding: 18px 0;
		font-size: 19px;
		text-align: left;
	}

	.cgh-nav__link::after {
		display: none;
	}

	.cgh-caret {
		width: 12px;
		height: 8px;
	}

	.cgh-sub,
	.cgh-nav__item.is-open > .cgh-sub {
		position: static;
		display: none;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
		transition: none;
	}

	.cgh-nav__item.is-open > .cgh-sub {
		display: block;
	}

	.cgh-sub__inner {
		display: block;
		padding: 0 0 18px;
	}

	.cgh-sub__feature {
		display: none;
	}

	.cgh-sub__col + .cgh-sub__col {
		margin-top: 18px;
	}

	.cgh-sub__title {
		margin-bottom: 4px;
		font-size: 16px;
	}

	.cgh-sub__list {
		padding-left: 12px;
		border-left: 2px solid rgba(97, 152, 40, .25);
	}

	.cgh-sub__list a {
		padding: 8px 0;
		font-size: 15px;
	}

	.cgh-tools {
		flex-direction: column;
		align-items: stretch;
		gap: 18px;
		margin-top: 28px;
	}

	.cgh-cta {
		order: -1;
		padding: 16px 22px;
		font-size: 16px;
	}

	.cgh-tools__catalog {
		justify-content: center;
		font-size: 15px;
	}

	.cgh-lang {
		justify-content: center;
		font-size: 15px;
	}

	.cgh__overlay {
		display: none !important;
	}

	html.cgh-lock,
	html.cgh-lock body {
		overflow: hidden;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cgh *,
	.cgh *::before,
	.cgh *::after {
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
	}
}

/* Estados hover con más peso que los :visited de arriba */
.cgh .cgh-nav__link:hover,
.cgh .cgh-nav__item.is-open > .cgh-nav__link,
.cgh .cgh-sub__list a:hover,
.cgh .cgh-sub__list .current-menu-item > a,
.cgh .cgh-tools__catalog:hover,
.cgh .cgh-lang a:hover {
	color: var(--cgh-green);
}

.cgh .cgh-sub__title:hover {
	color: var(--cgh-navy);
}
