/* Historia Histórica · ficha de batalla · versión 0.7.0
   Se carga solo en la plantilla nueva de batalla (D35). Todas las clases llevan el prefijo hh-.
   Primero móvil; los cambios para pantallas grandes van al final. */

.hh-ficha {
	background: var(--hh-marfil);
	color: var(--hh-carbon);
	font-family: var(--hh-fuente-texto);
}

.hh-ficha h1,
.hh-ficha h2,
.hh-ficha h3 {
	font-family: var(--hh-fuente-titulos);
	font-weight: 700;
	line-height: 1.15;
}

/* ---------- Hero ---------- */

.hh-hero {
	position: relative;
	background: var(--hh-carbon);
	color: var(--hh-marfil);
	overflow: hidden;
}

.hh-hero__wrap {
	position: relative;
	margin: 0 auto;
}

.hh-hero__media {
	position: relative;
}

.hh-hero__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

/* El difuminado se dibuja aquí, no en la imagen (D36). */
.hh-hero__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(0deg, var(--hh-carbon) 0%, rgba(23, 25, 27, 0) 55%);
	pointer-events: none;
}

.hh-hero__inner {
	position: relative;
	padding: 0 var(--hh-hero-margen) var(--hh-esp-8);
}

.hh-hero__media + .hh-hero__inner {
	margin-top: calc(var(--hh-esp-12) * -1);
}

.hh-migas {
	margin: 0 0 var(--hh-esp-4);
	font-size: 0.8125rem;
	color: #CFCDC6;
}

.hh-migas ol {
	display: flex;
	flex-wrap: wrap;
	gap: var(--hh-esp-2);
	margin: 0;
	padding: 0;
	list-style: none;
}

.hh-migas li + li::before {
	content: "›";
	margin-right: var(--hh-esp-2);
}

.hh-migas [aria-current="page"] {
	color: var(--hh-marfil);
}

.hh-migas a {
	color: #CFCDC6;
	text-decoration: none;
}

.hh-migas a:hover,
.hh-migas a:focus {
	color: var(--hh-marfil);
	text-decoration: underline;
}

.hh-eyebrow {
	margin: 0 0 var(--hh-esp-3);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--hh-rojo-claro);
}

.hh-hero__titulo {
	margin: 0 0 var(--hh-esp-3);
	font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem);
	color: var(--hh-marfil);
}

.hh-hero__subtitulo {
	margin: 0 0 var(--hh-esp-4);
	font-family: var(--hh-fuente-titulos);
	font-size: clamp(1.125rem, 1rem + 0.6vw, 1.5rem);
	font-weight: 700;
	line-height: 1.3;
	color: var(--hh-marfil);
}

.hh-hero__meta {
	margin: 0 0 var(--hh-esp-6);
	font-size: 1rem;
	color: var(--hh-marfil);
}

.hh-hero__credito {
	margin: var(--hh-esp-4) 0 0;
	font-size: 0.75rem;
	line-height: 1.4;
	color: #CFCDC6;
}

/* ---------- Beligerantes ---------- */

.hh-bandos__rotulo {
	margin: 0 0 var(--hh-esp-3);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #CFCDC6;
}

.hh-bandos__lista {
	display: flex;
	flex-direction: column;
	gap: var(--hh-esp-4);
}

.hh-bando {
	display: flex;
	align-items: center;
	gap: var(--hh-esp-3);
}

.hh-bando__emblema {
	flex: none;
	width: auto;
	height: 2.5rem;
	max-width: 6rem;
	object-fit: contain;
}

.hh-bando__nombre,
.hh-bando__detalle {
	margin: 0;
}

.hh-bando__nombre {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #CFCDC6;
}

.hh-bando__nombre a {
	color: inherit;
	text-decoration: none;
}

.hh-bando__nombre a:hover,
.hh-bando__nombre a:focus {
	text-decoration: underline;
}

.hh-bando__detalle {
	font-size: 1rem;
	font-weight: 600;
	color: var(--hh-marfil);
}

/* ---------- Cuerpo y barra lateral ---------- */

.hh-cuerpo {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--hh-esp-8);
	max-width: var(--hh-contenedor);
	margin: 0 auto;
	padding: var(--hh-esp-8) var(--hh-esp-6) var(--hh-esp-16);
}

.hh-cuerpo__principal {
	min-width: 0;
}

.hh-mapa {
	margin: 0 0 var(--hh-esp-8);
}

.hh-mapa__img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--hh-radio);
}

.hh-contenido {
	font-size: 1.0625rem;
	line-height: 1.7;
}

.hh-contenido h2 {
	margin: var(--hh-esp-12) 0 var(--hh-esp-4);
	font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem);
	scroll-margin-top: var(--hh-esp-8);
}

.hh-contenido h3 {
	margin: var(--hh-esp-8) 0 var(--hh-esp-3);
	font-size: 1.375rem;
	scroll-margin-top: var(--hh-esp-8);
}

.hh-contenido a {
	color: var(--hh-rojo-oscuro);
}

.hh-contenido a:hover,
.hh-contenido a:focus {
	color: var(--hh-rojo);
}

.hh-cuerpo__lateral {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--hh-esp-6);
	align-content: start;
	min-width: 0;
}

.hh-tarjeta {
	min-width: 0;
	background: var(--hh-tarjeta);
	border: 1px solid var(--hh-borde);
	border-radius: var(--hh-radio);
	padding: var(--hh-esp-6);
}

.hh-tarjeta__titulo {
	margin: 0 0 var(--hh-esp-4);
	padding-bottom: var(--hh-esp-3);
	border-bottom: 1px solid var(--hh-borde);
	font-size: 1.25rem;
}

/* Índice */
.hh-indice ol {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: hh-indice;
}

.hh-indice li {
	counter-increment: hh-indice;
	margin: 0 0 var(--hh-esp-3);
}

.hh-indice li:last-child {
	margin-bottom: 0;
}

.hh-indice a {
	display: flex;
	gap: var(--hh-esp-3);
	color: var(--hh-carbon);
	text-decoration: none;
}

.hh-indice a::before {
	content: counter(hh-indice) ".";
	color: var(--hh-rojo-oscuro);
	font-weight: 600;
}

.hh-indice a:hover,
.hh-indice a:focus {
	color: var(--hh-rojo-oscuro);
	text-decoration: underline;
}

/* Datos clave */
.hh-datos dl {
	margin: 0;
}

.hh-datos__fila {
	display: grid;
	grid-template-columns: 1fr 1.4fr;
	gap: var(--hh-esp-3);
	padding: var(--hh-esp-3) 0;
	border-bottom: 1px solid var(--hh-borde);
}

.hh-datos__fila:last-child {
	border-bottom: 0;
}

.hh-datos dt {
	font-weight: 600;
}

.hh-datos dd {
	margin: 0;
	color: var(--hh-texto-suave);
}

/* Enlaces rápidos */
.hh-enlaces ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.hh-enlaces li {
	margin: 0 0 var(--hh-esp-3);
}

.hh-enlaces li:last-child {
	margin-bottom: 0;
}

.hh-enlaces a {
	color: var(--hh-carbon);
	text-decoration: none;
}

.hh-enlaces a::before {
	content: "→ ";
	color: var(--hh-rojo-oscuro);
}

.hh-enlaces a:hover,
.hh-enlaces a:focus {
	color: var(--hh-rojo-oscuro);
	text-decoration: underline;
}

/* Siguiente en la serie */
.hh-siguiente {
	display: block;
	padding: var(--hh-esp-6);
	background: var(--hh-carbon);
	border-radius: var(--hh-radio);
	text-decoration: none;
}

.hh-siguiente__rotulo {
	display: block;
	margin-bottom: var(--hh-esp-2);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--hh-rojo-claro);
}

.hh-siguiente__titulo {
	display: block;
	font-family: var(--hh-fuente-titulos);
	font-size: 1.375rem;
	font-weight: 700;
	color: var(--hh-marfil);
}

.hh-siguiente:hover .hh-siguiente__titulo,
.hh-siguiente:focus .hh-siguiente__titulo {
	text-decoration: underline;
}

/* Foco visible */
.hh-ficha a:focus-visible {
	outline: 2px solid var(--hh-rojo);
	outline-offset: 2px;
}

.hh-hero a:focus-visible {
	outline-color: var(--hh-rojo-claro);
}

/* ---------- Pantallas anchas ---------- */

@media (min-width: 640px) {
	.hh-bandos__lista {
		flex-direction: row;
		gap: var(--hh-esp-8);
	}

	.hh-bando + .hh-bando {
		padding-left: var(--hh-esp-8);
		border-left: 1px solid rgba(243, 240, 232, 0.25);
	}
}

@media (min-width: 960px) {
	.hh-hero__wrap {
		display: flex;
		align-items: center;
		min-height: 26rem;
		max-width: var(--hh-contenedor-hero);
	}

	.hh-hero__media {
		position: absolute;
		top: 0;
		right: 0;
		bottom: 0;
		width: 68%;
	}

	.hh-hero__img {
		height: 100%;
		aspect-ratio: auto;
	}

	.hh-hero__media::after {
		background:
			linear-gradient(90deg, var(--hh-carbon) 0%, rgba(23, 25, 27, 0) 55%),
			linear-gradient(270deg, var(--hh-carbon) 0%, rgba(23, 25, 27, 0) 12%);
	}

	.hh-hero__media + .hh-hero__inner {
		margin-top: 0;
	}

	.hh-hero__inner {
		width: 100%;
		padding-top: var(--hh-esp-12);
		padding-bottom: var(--hh-esp-12);
	}

	.hh-hero__texto {
		max-width: 36rem;
	}

	.hh-hero__credito {
		position: absolute;
		right: var(--hh-esp-6);
		bottom: var(--hh-esp-4);
		max-width: 24rem;
		margin: 0;
		text-align: right;
	}

	.hh-cuerpo {
		grid-template-columns: minmax(0, 1fr) var(--hh-lateral);
		grid-template-rows: auto 1fr;
		column-gap: var(--hh-esp-12);
		row-gap: var(--hh-esp-6);
		padding-top: var(--hh-esp-12);
	}

	.hh-cuerpo__principal {
		grid-column: 1;
		grid-row: 1 / span 2;
	}

	.hh-cuerpo__lateral {
		grid-column: 2;
		grid-row: 1;
	}

	.hh-siguiente {
		grid-column: 2;
		grid-row: 2;
		align-self: start;
	}

	.hh-tarjeta {
		padding: var(--hh-esp-6);
	}
}

/* ---------- Índice plegable y enlaces en fichas (móvil primero) ---------- */

.hh-indice summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--hh-esp-3);
	font-family: var(--hh-fuente-titulos);
	font-size: 1.25rem;
	font-weight: 700;
	list-style: none;
	cursor: pointer;
}

.hh-indice summary::-webkit-details-marker {
	display: none;
}

.hh-indice summary::after {
	content: "+";
	flex: none;
	font-family: var(--hh-fuente-texto);
	font-size: 1.5rem;
	line-height: 1;
	color: var(--hh-rojo-oscuro);
}

.hh-indice details[open] summary::after {
	content: "\2013";
}

.hh-indice ol {
	margin-top: var(--hh-esp-4);
	padding-top: var(--hh-esp-3);
	border-top: 1px solid var(--hh-borde);
}

@media (max-width: 959px) {
	.hh-cuerpo {
		gap: var(--hh-esp-4);
	}

	.hh-cuerpo__lateral {
		gap: var(--hh-esp-4);
	}

	.hh-tarjeta {
		padding: var(--hh-esp-4);
	}

	.hh-tarjeta__titulo {
		margin-bottom: var(--hh-esp-3);
		padding-bottom: var(--hh-esp-2);
		font-size: 1.125rem;
	}

	/* Enlaces rápidos como fila deslizable */
	.hh-enlaces {
		padding-right: 0;
	}

	.hh-enlaces ul {
		display: flex;
		gap: var(--hh-esp-2);
		overflow-x: auto;
		padding-bottom: var(--hh-esp-2);
		scroll-snap-type: x proximity;
	}

	.hh-enlaces li {
		flex: none;
		margin: 0;
		scroll-snap-align: start;
	}

	.hh-enlaces a {
		display: block;
		padding: var(--hh-esp-2) var(--hh-esp-4);
		border: 1px solid var(--hh-borde);
		border-radius: 999px;
		background: var(--hh-marfil);
		white-space: nowrap;
	}

	.hh-enlaces a::before {
		content: none;
	}
}
