/**
 * Visor de la revista digital "101 Sweden" (flipbook a pantalla completa).
 * Independiente del resto del tema: esta hoja de estilos SOLO se carga en
 * la plantilla template-flipbook-101-sweden.php.
 *
 * Libro abierto de dos paginas. Solo la hoja que se pasa gira, pivotando
 * en el lomo del libro (giro comprobado y estable); dentro de esa hoja,
 * unas franjas verticales anaden una leve ondulacion local -como una
 * hoja de papel real- en vez de una placa plana y rigida. La pagina de
 * al lado que no se toca permanece fija todo el tiempo.
 */

* { box-sizing: border-box; }

html, body.psp-flipbook-body {
	margin: 0;
	padding: 0;
	height: 100%;
	background: #12181f;
	color: #fff;
	font-family: 'Open Sans', Arial, sans-serif;
	overflow: hidden;
}

.psp-fb-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 24px;
	background: #0b0f14;
	border-bottom: 1px solid rgba(255,255,255,.08);
}
.psp-fb-back {
	color: #fff;
	text-decoration: none;
	font-size: 13.5px;
	font-weight: 700;
	opacity: .85;
	flex: 0 0 auto;
	white-space: nowrap;
}
.psp-fb-back:hover { opacity: 1; color: var(--psp-yellow, #FFC72C); }
.psp-fb-title {
	font-family: 'Merriweather', serif;
	font-size: 16px;
	text-align: center;
	flex: 1 1 auto;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.psp-fb-title-sub { font-family: 'Open Sans', Arial, sans-serif; font-size: 12px; opacity: .6; margin-left: 8px; }
.psp-fb-page-indicator {
	font-size: 13px;
	font-weight: 700;
	background: rgba(255,255,255,.1);
	padding: 5px 12px;
	border-radius: 20px;
	flex: 0 0 auto;
	white-space: nowrap;
}

.psp-fb-stage {
	position: relative;
	height: calc(100% - 106px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	gap: 18px;
}

.psp-fb-book {
	position: relative;
	height: 100%;
	max-height: calc(100vh - 150px);
	aspect-ratio: 1.5354;
	max-width: 92vw;
	perspective: 2200px;
	box-shadow: 0 30px 80px rgba(0,0,0,.6);
	border-radius: 4px;
	background: #12181f;
	touch-action: pan-y;
}

/* Capa estatica de fondo: siempre muestra el spread actual (izq + der).
   La pagina que NO se esta pasando vive aqui sin moverse nunca. */
.psp-fb-static {
	position: absolute;
	inset: 0;
	display: flex;
	z-index: 1;
	border-radius: 4px;
	overflow: hidden;
}
.psp-fb-cell {
	position: relative;
	flex: 1 1 50%;
	min-width: 0;
	height: 100%;
	background: #e2e2e2;
	overflow: hidden;
}
.psp-fb-cell--left  { box-shadow: inset -10px 0 20px -14px rgba(0,0,0,.45); }
.psp-fb-cell--right { box-shadow: inset  10px 0 20px -14px rgba(0,0,0,.45); }
.psp-fb-cell img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	pointer-events: none;
	user-select: none;
	-webkit-user-drag: none;
	transition: opacity .18s ease;
}

/* La hoja que se pasa: ocupa solo la mitad del libro (izquierda o
   derecha segun hacia donde se pase) y gira pivotando en el lomo del
   libro. Tiene una cara delantera y una trasera reales (la trasera trae
   de fabrica un giro fijo de 180 grados, para que al terminar de girar
   quede exactamente donde debe, sin saltos). */
.psp-fb-flip {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 50%;
	z-index: 2;
	transform-style: preserve-3d;
	will-change: transform;
	cursor: grab;
}
.psp-fb-flip:active { cursor: grabbing; }
.psp-fb-face {
	position: absolute;
	inset: 0;
	background: #e2e2e2;
	overflow: hidden;
	backface-visibility: hidden;
	transform-style: preserve-3d;
}
.psp-fb-face--back { transform: rotateY(180deg); }

/* Dentro de cada cara, unas franjas verticales con una leve rotacion
   LOCAL propia (pequena, alrededor de su propio borde) dan la sensacion
   de ondulacion de papel, sin afectar el giro principal de la hoja. */
.psp-fb-strip {
	position: absolute;
	top: 0;
	height: 100%;
	overflow: hidden;
	will-change: transform;
}
.psp-fb-strip img {
	position: absolute;
	top: 0;
	height: 100%;
	display: block;
	pointer-events: none;
	user-select: none;
	-webkit-user-drag: none;
	max-width: none;
	transition: opacity .18s ease;
}

.psp-fb-blank { background: linear-gradient(135deg, #1c2733 0%, #0e141b 100%); }

/* Mientras una imagen nueva carga, se oculta (en vez de dejar la
   anterior pegada) y se ve el brillo de carga detras. */
.is-loading img { opacity: 0; }
.is-loading::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, #e2e2e2 25%, #ececec 37%, #e2e2e2 63%);
	background-size: 400% 400%;
	animation: psp-fb-shimmer 1.4s ease infinite;
}
@keyframes psp-fb-shimmer {
	0% { background-position: 0% 50%; }
	100% { background-position: 100% 50%; }
}

/* sombreado que simula el doblez de la hoja mientras gira */
.psp-fb-fold-shade {
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, rgba(0,0,0,.4), rgba(0,0,0,0) 45%);
	opacity: 0;
	pointer-events: none;
	z-index: 3;
}
.psp-fb-flip[data-dir="prev"] .psp-fb-fold-shade {
	background: linear-gradient(270deg, rgba(0,0,0,.4), rgba(0,0,0,0) 45%);
}

.psp-fb-nav {
	position: relative;
	z-index: 5;
	flex: 0 0 auto;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: none;
	background: rgba(255,255,255,.12);
	color: #fff;
	font-size: 17px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .2s ease, opacity .2s ease;
}
.psp-fb-nav:hover { background: rgba(255,255,255,.22); }
.psp-fb-nav:disabled { opacity: .25; cursor: default; }
.psp-fb-nav:disabled:hover { background: rgba(255,255,255,.12); }

.psp-fb-bottombar {
	padding: 8px 24px 16px;
	text-align: center;
}
.psp-fb-progress { height: 3px; background: rgba(255,255,255,.12); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.psp-fb-progress-bar { height: 100%; background: var(--psp-yellow, #FFC72C); width: 0%; transition: width .3s ease; }
.psp-fb-hint { margin: 0; font-size: 12px; opacity: .55; }

@media (max-width: 700px) {
	.psp-fb-topbar { padding: 10px 14px; gap: 8px; }
	.psp-fb-title-sub { display: none; }
	.psp-fb-title { font-size: 13px; }
	.psp-fb-page-indicator { font-size: 11.5px; padding: 4px 9px; }
	.psp-fb-nav { width: 36px; height: 36px; font-size: 14px; }
	.psp-fb-hint { font-size: 10.5px; }
	.psp-fb-book { max-width: 94vw; }
	.psp-fb-stage { gap: 8px; padding: 10px; }
}
