/**
 * Estilos base de las ediciones.
 * Usan variables del tema cuando existen, con un valor de respaldo,
 * para que el child theme pueda mandar sin tocar este archivo.
 */

.rev-edicion {
	display: flex;
	flex-direction: column;
	gap: clamp( 2rem, 5vw, 3.5rem );
}

.rev-titulo {
	margin: 0;
	text-align: center;
	line-height: 1.15;
	text-wrap: balance;
}

/* Flipbook ------------------------------------------------------------- */

.rev-flipbook {
	width: 100%;
	max-width: var( --rev-flipbook-max, 1080px );
	margin-inline: auto;
}

.rev-todas {
	display: flex;
	flex-direction: column;
	gap: clamp( 2.5rem, 6vw, 4rem );
}

.rev-flipbook .real3dflipbook {
	max-width: 100%;
}

/* Ediciones anteriores ------------------------------------------------- */

.rev-anteriores__titulo {
	margin: 0 0 1.25rem;
	font-size: clamp( 1.25rem, 2.5vw, 1.75rem );
}

.rev-anteriores__grid {
	display: grid;
	grid-template-columns: repeat( 4, minmax( 0, 1fr ) );
	gap: clamp( 1rem, 2.5vw, 2rem );
	margin: 0;
	padding: 0;
	list-style: none;
}

@media ( max-width: 900px ) {
	.rev-anteriores__grid {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}
}

@media ( max-width: 480px ) {
	.rev-anteriores__grid {
		grid-template-columns: minmax( 0, 1fr );
	}
}

.rev-card {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	text-decoration: none;
	color: inherit;
}

.rev-card__img {
	display: block;
	overflow: hidden;
	border-radius: 4px;
	background: rgba( 0, 0, 0, 0.06 );
	box-shadow: 0 2px 10px rgba( 0, 0, 0, 0.12 );
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.rev-card__img img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 4;
	object-fit: cover;
}

.rev-card__sin-portada {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 4;
}

.rev-card:hover .rev-card__img,
.rev-card:focus-visible .rev-card__img {
	transform: translateY( -4px );
	box-shadow: 0 8px 22px rgba( 0, 0, 0, 0.18 );
}

.rev-card__titulo {
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
}

/* Navegación ----------------------------------------------------------- */

.rev-nav {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	flex-wrap: wrap;
	margin: 0;
}

/**
 * wpautop envuelve en <p> el contenido en línea de la salida de un
 * shortcode. Con display:contents ese párrafo desaparece del layout y sus
 * hijos participan directamente en el flex, sin heredar márgenes.
 */
.rev-nav > p,
.rev-paginacion > p,
.rev-acciones > p {
	display: contents;
}

.rev-nav__anios {
	align-items: center;
}

.rev-nav__todas {
	display: flex;
	align-items: center;
}

.rev-nav__anios {
	display: flex;
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rev-nav__anio {
	position: relative;
}

.rev-nav__anio summary {
	cursor: pointer;
	padding: 0.35rem 0.15rem;
	font-weight: 600;
	list-style: none;
}

.rev-nav__anio summary::-webkit-details-marker {
	display: none;
}

.rev-nav__anio summary::after {
	content: "";
	display: inline-block;
	margin-left: 0.45em;
	border: 0.3em solid transparent;
	border-top-color: currentColor;
	transform: translateY( 0.15em );
}

.rev-nav__lista {
	position: absolute;
	z-index: 20;
	top: 100%;
	left: 0;
	min-width: 11rem;
	margin: 0.35rem 0 0;
	padding: 0.5rem 0;
	list-style: none;
	background: var( --wp--preset--color--base, #fff );
	border: 1px solid rgba( 0, 0, 0, 0.1 );
	border-radius: 6px;
	box-shadow: 0 10px 28px rgba( 0, 0, 0, 0.14 );
}

.rev-nav__lista a {
	display: block;
	padding: 0.4rem 1rem;
	text-decoration: none;
	color: inherit;
	white-space: nowrap;
}

.rev-nav__lista a:hover,
.rev-nav__lista a:focus-visible {
	background: rgba( 0, 0, 0, 0.06 );
}

.rev-nav__actual {
	font-weight: 700;
}

.rev-nav__archivo {
	text-decoration: none;
	font-weight: 600;
}

/* Avisos solo visibles para el equipo ---------------------------------- */

.rev-aviso {
	padding: 0.85rem 1rem;
	border-left: 4px solid #d63638;
	background: #fcf0f1;
	color: #8a1f21;
	font-size: 0.9rem;
}

/* Lista simple de ediciones (footer) ----------------------------------- */

.rev-lista {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.rev-lista a {
	text-decoration: none;
	color: inherit;
}

.rev-lista a:hover {
	text-decoration: underline;
}

/* Anterior / siguiente ------------------------------------------------- */

.rev-paginacion {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding-top: 1.5rem;
	border-top: 1px solid rgba( 0, 0, 0, 0.1 );
}

.rev-paginacion__enlace {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	text-decoration: none;
	color: inherit;
	max-width: 45%;
}

.rev-paginacion__siguiente {
	text-align: right;
	margin-left: auto;
}

.rev-paginacion__etiqueta {
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.6;
}

.rev-paginacion__nombre {
	font-weight: 600;
}

.rev-paginacion__enlace:hover .rev-paginacion__nombre {
	text-decoration: underline;
}

/* Descargar y compartir ------------------------------------------------ */

.rev-acciones {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 0.75rem 1.25rem;
}

.rev-acciones__compartir {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.rev-acciones__etiqueta {
	font-size: 0.78rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.6;
}

.rev-boton {
	display: inline-block;
	padding: 0.55rem 1.15rem;
	border-radius: 999px;
	border: 1px solid currentColor;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	color: inherit;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.rev-boton:hover,
.rev-boton:focus-visible {
	background: var( --wp--preset--color--contrast, #14161a );
	color: var( --wp--preset--color--base, #ffffff );
	border-color: transparent;
}

.rev-boton--suave {
	padding: 0.4rem 0.85rem;
	font-weight: 500;
	border-color: rgba( 0, 0, 0, 0.2 );
}

/* Bandas a ancho completo ---------------------------------------------- */

/**
 * Se salen del contenedor con margen negativo y vuelven a acotar el
 * contenido por dentro. No usamos 100vw porque incluye el ancho de la barra
 * de desplazamiento y provoca scroll horizontal.
 */
.rev-banda {
	margin-inline: calc( 50% - 50vw );
	padding-block: clamp( 2rem, 5vw, 4rem );
	padding-inline: 1.5rem;
}

.rev-banda__interior {
	max-width: var( --rev-ancho, 1200px );
	margin-inline: auto;
}

.rev-banda--oscura {
	background: var( --rev-banda-oscura, #515558 );
	color: #f4f4f5;
}

.rev-banda--papel {
	background: var( --wp--preset--color--base-2, #f5f2ec );
}

.rev-banda--oscura .rev-flipbook {
	max-width: var( --rev-flipbook-max, 1080px );
}

/* Cabecera de la edición ------------------------------------------------ */

.rev-cabecera {
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
}

.rev-cabecera__marca {
	margin: 0;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	opacity: 0.55;
}

.rev-cabecera__meta {
	margin: 0;
	font-size: 0.8rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	opacity: 0.5;
}

.rev-cabecera .rev-titulo {
	margin: 0;
}

/* Tarjetas -------------------------------------------------------------- */

.rev-card__img {
	position: relative;
}

.rev-card__distintivo {
	position: absolute;
	top: 0.6rem;
	left: 0.6rem;
	z-index: 2;
	padding: 0.25rem 0.6rem;
	border-radius: 999px;
	background: var( --wp--preset--color--accent, #b4482f );
	color: #fff;
	font-size: 0.65rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.rev-card__leer {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba( 20, 22, 26, 0.55 );
	color: #fff;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.rev-card:hover .rev-card__leer,
.rev-card:focus-visible .rev-card__leer {
	opacity: 1;
}

@media ( hover: none ) {
	.rev-card__leer {
		display: none;
	}
}

.rev-banda--papel .rev-anteriores {
	padding-top: 0;
	border-top: 0;
}
