/* ==========================================================================
   Fuentes
   ========================================================================== */

@font-face {
	font-family: "Lora";
	src: url("../fonts/Lora-Regular.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Lora";
	src: url("../fonts/Lora-Medium.woff2") format("woff2");
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Lora";
	src: url("../fonts/Lora-Bold.woff2") format("woff2");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Segoe UI";
	src: url("../fonts/SegoeUI.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

/* ==========================================================================
   Tokens
   ========================================================================== */

:root {
	/* Ancho del contenido y margen lateral */
	--maxw: 1140px;
	--gutter: 30px;

	/* Colores de marca */
	--color-primario: #223B69;
	--color-secundario: #7AA9CC;
	--color-texto: #686868;
	--color-blanco: #FFFFFF;

	/* Fondos */
	--fondo-claro: #F7FAFF;
	--fondo-about: #1C3154;
	--fondo-strategies: #182A4A;
	--fondo-header: #020F22;
	--fondo-footer: #071834;

	/* Tipografía */
	--fuente-titulos: "Lora", serif;
	--fuente-texto: "Segoe UI", sans-serif;

	/* Barra de desplazamiento */
	--scrollbar-ancho: 8px;
	--scrollbar-riel: #11223E;
	--scrollbar-pulgar: #456189;
}

/* ==========================================================================
   Base
   ========================================================================== */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	overflow-x: hidden;
	scroll-behavior: smooth;
}

body {
	position: relative;
	margin: 0;
	font-family: var(--fuente-texto);
	font-size: 17px;
	font-weight: 400;
	line-height: 1.7;
	color: var(--color-texto);
	background: var(--color-blanco);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img,
video {
	max-width: 100%;
	height: auto;
}

/* Las imágenes no se pueden seleccionar ni arrastrar. */
img {
	-webkit-user-select: none;
	user-select: none;
	-webkit-user-drag: none;
}

::selection {
	color: #E0CC8F;
	background: var(--color-primario);
}

* {
	scrollbar-width: var(--scrollbar-ancho);
}

*::-webkit-scrollbar {
	width: var(--scrollbar-ancho);
	height: var(--scrollbar-ancho);
}

*::-webkit-scrollbar-track {
	background-color: var(--scrollbar-riel);
}

*::-webkit-scrollbar-thumb {
	background-color: var(--scrollbar-pulgar);
}

/* ==========================================================================
   Tipografía (en la etiqueta)
   ========================================================================== */

h1,
h2,
h3,
h5 {
	margin: 0;
}

h1 {
	font-family: var(--fuente-titulos);
	font-size: 74px;
	font-weight: 500;
	line-height: 1.2;
	color: var(--color-blanco);
}

h2 {
	font-family: var(--fuente-titulos);
	font-size: 50px;
	font-weight: 500;
	line-height: 1.2;
	color: var(--color-primario);
}

h3 {
	font-family: var(--fuente-titulos);
	font-size: 20px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--color-primario);
}

/* Antetítulo espaciado */
h5 {
	font-family: var(--fuente-texto);
	font-size: 24px;
	font-weight: 300;
	line-height: 1.2;
	letter-spacing: 10px;
	text-transform: uppercase;
	color: var(--color-secundario);
}

p {
	margin: 0 0 5px;
}

a {
	color: var(--color-texto);
}

@media (max-width: 1024px) {
	h1 {
		font-size: 64px;
	}
}

@media (max-width: 767px) {
	h1 {
		font-size: 54px;
	}

	h3 {
		font-size: 23px;
	}
}

/* ==========================================================================
   Ancho: cada <section> lleva dentro un .wrapper
   ========================================================================== */

.wrapper {
	width: 100%;
	max-width: calc(var(--maxw) + var(--gutter) * 2);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

@media (max-width: 767px) {
	:root {
		--maxw: 500px;
	}
}

/* ==========================================================================
   Accesibilidad
   ========================================================================== */

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

.skip-link:focus {
	top: 10px;
	left: 10px;
	z-index: 1000;
	width: auto;
	height: auto;
	margin: 0;
	padding: 10px 15px;
	clip: auto;
	color: var(--color-primario);
	background: var(--color-blanco);
}

/* ==========================================================================
   Animaciones de entrada (las activa main.js al entrar en pantalla)
   ========================================================================== */

.js [data-anim] {
	opacity: 0;
}

.js [data-anim].animado {
	animation-name: gr-fade;
	animation-duration: 1.25s;
	animation-fill-mode: both;
}

.js [data-anim="fade-up"].animado {
	animation-name: gr-fade-up;
}

.js [data-anim="fade-down"].animado {
	animation-name: gr-fade-down;
}

.js .anim-lenta.animado {
	animation-duration: 2s;
}

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

	to {
		opacity: 1;
	}
}

@keyframes gr-fade-up {
	from {
		opacity: 0;
		transform: translate3d(0, 100%, 0);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes gr-fade-down {
	from {
		opacity: 0;
		transform: translate3d(0, -100%, 0);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	.js [data-anim],
	.js [data-anim].animado {
		opacity: 1;
		animation: none;
	}
}

/* ==========================================================================
   Línea que acompaña a un título
   ========================================================================== */

.linea {
	position: relative;
}

.linea::after {
	content: "";
	position: absolute;
	top: 50%;
	width: 0;
	height: 1px;
	background: var(--color-secundario);
	transition: width 1s linear 0.8s;
}

.linea-izq::after {
	right: calc(100% + 15px);
}

.linea-der {
	width: fit-content;
	max-width: 100%;
}

.linea-der::after {
	left: calc(100% + 15px);
}

.linea.animado::after,
html:not(.js) .linea::after {
	width: 2000px;
}

@media (max-width: 768px) {
	.linea::after {
		transition: width 0.8s linear 0.6s;
	}

	.linea.animado::after {
		width: 768px;
	}
}

@media (max-width: 500px) {
	.linea.animado::after {
		width: 400px;
	}

	.linea-izq {
		width: fit-content;
		max-width: 100%;
	}

	.linea-izq::after {
		right: auto;
		left: calc(100% + 15px);
	}
}

/* ==========================================================================
   Corte diagonal en la esquina inferior derecha
   ========================================================================== */

.corte {
	position: relative;
}

.corte::before {
	content: "";
	position: absolute;
	right: -1px;
	bottom: -1px;
	z-index: 9;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 0 0 78px 78px;
	border-color: transparent transparent var(--corte-color, var(--fondo-about)) transparent;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 999;
	width: 100%;
	transition: all 0.3s linear;
}

.site-header::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	z-index: -1;
	width: 100%;
	height: calc(100% + 40px);
	background-image: linear-gradient(180deg, var(--fondo-header) 0%, rgba(255, 255, 255, 0) 100%);
	opacity: 1;
	pointer-events: none;
	transition: all 0.3s linear;
}

.site-header.compacto {
	background: var(--fondo-header);
}

.site-header.compacto::before {
	height: 100%;
	opacity: 0;
}

.site-header .wrapper {
	max-width: calc(1140px + var(--gutter) * 2);
}

.header-barra {
	display: flex;
	align-items: center;
	padding: 20px 0;
	transition: all 0.3s linear;
}

.site-header.compacto .header-barra {
	padding: 5px 0;
}

.header-marca {
	width: 20%;
	padding: 10px;
}

.site-logo {
	display: block;
}

.site-logo img {
	display: block;
	width: 100%;
	max-width: 188px;
	height: auto;
	transition: all 0.3s linear;
}

.site-header.compacto .site-logo img {
	max-width: 120px;
}

.header-nav {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	width: 80%;
}

.site-menu {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 0 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-menu li {
	display: flex;
}

.site-menu a {
	position: relative;
	display: flex;
	align-items: center;
	padding: 5px 0;
	font-family: var(--fuente-texto);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.1;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	color: var(--color-blanco);
	transition: 0.4s;
}

/* Subrayado que crece desde el centro */
.site-menu a::after {
	content: "";
	position: absolute;
	bottom: 0;
	left: 50%;
	width: 0;
	height: 0;
	background: var(--color-secundario);
	opacity: 0;
	transition: 0.3s cubic-bezier(0.58, 0.3, 0.005, 1);
}

.site-menu a:hover::after,
.site-menu a:focus-visible::after,
.site-menu a.activo::after {
	left: 0;
	width: 100%;
	height: 2px;
	opacity: 1;
}

.menu-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0.25em;
	font-size: 22px;
	line-height: 1;
	color: var(--color-blanco);
	background: #778AAB66;
	border: 0;
	border-radius: 3px;
	cursor: pointer;
}

.menu-toggle svg {
	display: block;
	width: 1em;
	height: 1em;
}

.menu-toggle .menu-toggle-cerrar,
.menu-toggle[aria-expanded="true"] .menu-toggle-abrir {
	display: none;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-cerrar {
	display: block;
}

@media (min-width: 1025px) {
	.site-menu .menu-contacto {
		align-items: center;
		margin-left: 10px;
		padding-left: 20px;
		border-left: 1px solid #ffffff2e;
	}

	.site-menu .menu-contacto::before {
		content: "";
		width: 18px;
		height: 18px;
		margin-top: 2px;
		background: var(--color-secundario);
		-webkit-mask: url("../img/telefono.svg") center / contain no-repeat;
		mask: url("../img/telefono.svg") center / contain no-repeat;
	}

	.site-menu .menu-contacto a {
		margin-left: 10px;
	}
}

@media (max-width: 1024px) {
	.header-marca {
		width: 40%;
		padding: 0;
	}

	.header-nav {
		width: 60%;
	}

	.menu-toggle {
		display: flex;
	}

	/* Sin desplazamiento en la entrada: una animación con transform haría que
	   el menú desplegable se midiera contra esta caja y no contra la barra. */
	.js .header-nav[data-anim].animado {
		animation-name: gr-fade;
	}

	/* Menú desplegable a todo el ancho, debajo de la barra */
	.site-nav {
		position: absolute;
		top: 100%;
		left: 0;
		width: 100%;
		max-height: 0;
		margin-top: 10px;
		overflow: hidden;
		background: var(--color-blanco);
		transform: scaleY(0);
		transform-origin: top;
		transition: max-height 0.3s, transform 0.3s;
	}

	.site-nav.abierto {
		max-height: 100vh;
		transform: scaleY(1);
	}

	.site-menu {
		display: block;
	}

	.site-menu li {
		display: block;
	}

	.site-menu a {
		padding: 10px 20px;
		font-size: 17px;
		line-height: 20px;
		text-transform: none;
		white-space: normal;
		color: var(--color-primario);
	}

	.site-menu a::after {
		content: none;
	}

	.site-menu a:hover,
	.site-menu a:focus-visible,
	.site-menu a.activo {
		background: var(--fondo-claro);
	}
}

@media (max-width: 767px) {
	.header-marca,
	.header-nav {
		width: 50%;
	}

	.site-nav {
		border: 1px solid #EEEEEE;
	}
}

/* ==========================================================================
   Banner de las páginas interiores
   ========================================================================== */

.banner {
	position: relative;
	z-index: 1;
	display: flex;
	min-height: 400px;
	overflow: hidden;
	background-color: var(--color-primario);
	background-position: center center;
	background-repeat: no-repeat;
	background-size: cover;
}

.banner-abajo {
	background-position: center bottom;
}

.banner::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: linear-gradient(195deg, rgba(255, 255, 255, 0) 42%, #000000 74%);
	opacity: 0.77;
}

.banner .wrapper {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	padding-top: 120px;
}

.banner-titulo {
	width: 83%;
	margin-top: 8px;
	font-size: 70px;
}

.banner-titulo.linea::after {
	top: 47px;
}

@media (max-width: 1024px) {
	.banner .wrapper {
		--maxw: 680px;
	}

	.banner-titulo {
		width: 80%;
		font-size: 60px;
	}

	.banner-titulo.linea::after {
		top: 36px;
	}
}

@media (max-width: 767px) {
	.banner {
		min-height: 300px;
	}

	.banner .wrapper {
		--maxw: 500px;
	}

	.banner-titulo {
		width: fit-content;
		max-width: 267px;
		margin-top: 0;
		font-size: 40px;
	}

	.banner-titulo.linea::after {
		top: 25px;
	}
}

/* ==========================================================================
   Páginas sin plantilla propia (dejan sitio a la barra fija)
   ========================================================================== */

.pagina,
.entrada,
.listado {
	padding: 180px 0 70px;
}

.pagina-titulo,
.entrada-titulo {
	color: var(--color-primario);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer-principal {
	position: relative;
	background-image: linear-gradient(180deg, #1C3154 0%, var(--fondo-footer) 100%);
}

.footer-principal::before {
	content: "";
	position: absolute;
	inset: 0;
	background: url("../img/fondo-azul-corte-footer.png") top left / cover no-repeat;
}

.footer-principal .wrapper {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 50px;
	padding-top: 100px;
	padding-bottom: 150px;
}

.footer-logo {
	display: block;
	width: 162px;
	max-width: 100%;
}

.footer-logo img {
	display: block;
	width: 100%;
	height: auto;
}

.footer-oficinas {
	display: flex;
	align-items: flex-start;
	gap: 30px;
	width: 80%;
}

.footer-oficina {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: flex-start;
	gap: 5px;
}

.footer-oficina:first-child {
	flex: none;
	width: 36.9%;
}

.footer-oficina-titulo {
	padding-bottom: 10px;
	color: var(--color-blanco);
}

.footer-oficina-linea {
	color: var(--color-blanco);
}

.footer-enlace {
	display: inline-block;
	padding: 0 0 3px;
	font-size: 17px;
	line-height: 1;
	text-decoration: none;
	color: #FFFFFFB3;
	border-bottom: 1px solid currentColor;
}

.footer-oficina-mapa {
	margin-top: 3px;
}

.footer-barra {
	background: var(--fondo-footer);
}

.footer-barra .wrapper {
	display: flex;
	justify-content: space-between;
	gap: 20px;
	padding-top: 10px;
	padding-bottom: 10px;
}

.footer-legales {
	display: flex;
	align-self: flex-start;
	gap: 20px;
	margin-top: 4px;
}

.footer-politica,
.footer-cookies {
	font-size: 16px;
	color: #FFFFFFB5;
}

.footer-copy {
	align-self: flex-end;
	margin: 0;
	font-size: 15px;
	line-height: 1.6;
	text-align: end;
	color: #FFFFFFB8;
}

@media (max-width: 767px) {
	.footer-principal .wrapper {
		--gutter: 20px;
		gap: 40px;
		padding-top: 50px;
		padding-bottom: 70px;
	}

	.footer-logo {
		margin-inline: auto;
	}

	.footer-oficinas {
		flex-direction: column;
		gap: 40px;
		width: 100%;
	}

	.footer-oficina,
	.footer-oficina:first-child {
		align-items: center;
		width: 100%;
		text-align: center;
	}

	.footer-oficina-mapa,
	.footer-politica,
	.footer-cookies,
	.footer-copy {
		font-size: 18px;
	}

	.footer-barra .wrapper {
		--maxw: 100%;
		flex-wrap: wrap;
		justify-content: center;
		align-items: center;
	}

	.footer-legales {
		flex-wrap: wrap;
		justify-content: center;
		align-self: center;
		margin-top: 0;
	}

	.footer-copy {
		align-self: center;
		text-align: center;
	}
}

/* ==========================================================================
   Aviso de cookies
   ========================================================================== */

.cookies {
	position: fixed;
	bottom: 20px;
	left: 20px;
	z-index: 1000;
	width: 360px;
	max-width: calc(100% - 40px);
	padding: 20px;
	color: var(--color-blanco);
	background: var(--fondo-header);
	border: 1px solid #ffffff2e;
}

.cookies[hidden] {
	display: none;
}

.cookies-titulo {
	margin-bottom: 8px;
	font-size: 18px;
	color: var(--color-blanco);
}

.cookies-texto {
	margin: 0 0 15px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--color-blanco);
}

.cookies-enlace {
	color: var(--color-secundario);
	text-decoration: underline;
}

.cookies-botones {
	display: flex;
	gap: 10px;
}

/* Los dos botones pesan lo mismo: rechazar es tan fácil como aceptar. */
.cookies-boton {
	flex: 1;
	margin: 0;
	padding: 9px 14px;
	font-family: var(--fuente-texto);
	font-size: 14px;
	line-height: 1.2;
	text-transform: uppercase;
	border: 1px solid var(--color-secundario);
	border-radius: 0;
	cursor: pointer;
	transition: all 0.2s linear;
}

.cookies-aceptar {
	color: var(--fondo-header);
	background: var(--color-secundario);
}

.cookies-rechazar {
	color: var(--color-blanco);
	background: transparent;
}

.cookies-aceptar:hover,
.cookies-aceptar:focus-visible {
	background: var(--color-blanco);
	border-color: var(--color-blanco);
}

.cookies-rechazar:hover,
.cookies-rechazar:focus-visible {
	color: var(--fondo-header);
	background: var(--color-blanco);
	border-color: var(--color-blanco);
}

.cookies-boton:focus-visible {
	outline: 2px solid var(--color-blanco);
	outline-offset: 2px;
}

.cookies-boton:active {
	transform: translateY(1px);
}

/* En el celular es una franja baja pegada al borde: texto corto y botones al lado. */
@media (max-width: 767px) {
	.cookies {
		bottom: 0;
		left: 0;
		display: flex;
		align-items: center;
		gap: 12px;
		width: 100%;
		max-width: none;
		padding: 10px 15px;
		border-width: 1px 0 0;
	}

	.cookies[hidden] {
		display: none;
	}

	.cookies-mensaje {
		flex: 1;
	}

	.cookies-titulo,
	.cookies-detalle {
		display: none;
	}

	.cookies-texto {
		margin: 0;
		font-size: 13px;
		line-height: 1.4;
	}

	.cookies-botones {
		gap: 6px;
	}

	.cookies-boton {
		flex: none;
		padding: 8px 10px;
		font-size: 12px;
	}
}
