/*
 * Booklet viewer (booklet-viewer.js). Dark, full screen, with the disco's
 * color glowing behind; pages drawn by PDF.js. The "Escuchar" button uses
 * the site player (.urtext-player, discos-ui.css): while the viewer is open
 * it sits on the right on wide screens / phones held sideways, and as a bar
 * at the bottom on phones and tablets held upright (rules at the end).
 */
.ubv {
	--ubv-gold: #d4b062;
	--ubv-ink: #f3f1ec;
	--ubv-pw: clamp(260px, 30vw, 400px);
	--ubv-dock: calc(212px + env(safe-area-inset-bottom));
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto auto;
	/* clip, not just hidden: a hidden box can still be scrolled by the
	   browser, and the whole viewer used to slide left at the last pages. */
	overflow: hidden;
	overflow: clip;
	color: var(--ubv-ink);
	background: #0b0d12;
	font-family: Montserrat, system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 14px;
	line-height: 1.3;
	text-align: left;
	opacity: 0;
	transition: opacity .3s ease, padding .4s cubic-bezier(.2, .8, .2, 1);
	-webkit-font-smoothing: antialiased;
}
.ubv[hidden] {
	display: none;
}
.ubv.is-open {
	opacity: 1;
}
.ubv button {
	margin: 0;
	font: inherit;
	letter-spacing: normal;
	text-transform: none;
	line-height: 1;
	box-shadow: none;
	min-height: 0;
	-webkit-tap-highlight-color: transparent;
}
.ubv svg {
	flex: none;
}
.ubv__glow {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
	background:
		radial-gradient(60% 55% at 50% 38%, rgba(var(--ubv-rgb, 30, 91, 184), .42), transparent 70%),
		radial-gradient(120% 80% at 50% 120%, rgba(var(--ubv-rgb, 30, 91, 184), .18), transparent 60%);
}
.ubv__grooves {
	position: absolute;
	left: 50%;
	top: 42%;
	width: 150vmax;
	height: 150vmax;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	pointer-events: none;
	opacity: .06;
	background: repeating-radial-gradient(circle at center, #fff 0 1px, transparent 1px 7px);
	-webkit-mask: radial-gradient(circle, #000 20%, transparent 60%);
	mask: radial-gradient(circle, #000 20%, transparent 60%);
}

/* ---------- Top bar ---------- */
.ubv__top {
	position: relative;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 20px;
	background: linear-gradient(rgba(11, 13, 18, .85), rgba(11, 13, 18, 0));
	container-type: inline-size;
}
.ubv__id {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}
.ubv__cover {
	width: 42px;
	height: 42px !important;
	flex: none;
	border-radius: 3px;
	object-fit: cover;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .4);
}
.ubv__id > div {
	min-width: 0;
}
.ubv__eyebrow {
	display: block;
	color: var(--ubv-gold);
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: .2em;
	text-transform: uppercase;
}
.ubv__title {
	display: block;
	overflow: hidden;
	font-family: "Cormorant Garamond", Georgia, serif;
	font-size: 20px;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	text-overflow: ellipsis;
}
.ubv__tools {
	display: flex;
	flex: none;
	align-items: center;
	gap: 6px;
}
.ubv__btn {
	display: inline-grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .07);
	color: var(--ubv-ink) !important;
	text-decoration: none;
	cursor: pointer;
	transition: background .2s, color .2s;
}
.ubv__btn:hover {
	background: rgba(255, 255, 255, .16);
	color: var(--ubv-ink) !important;
}
.ubv__btn[aria-pressed="true"] {
	background: var(--ubv-gold);
	color: #1a1405 !important;
}
.ubv__btn:disabled {
	opacity: .3;
	cursor: default;
}
.ubv__btn[hidden] {
	display: none;
}
.ubv__btn svg {
	width: 19px;
	height: 19px;
}
.ubv__sep {
	width: 1px;
	height: 22px;
	margin: 0 6px;
	background: rgba(255, 255, 255, .14);
}
.ubv__seg,
.ubv__zoom {
	display: inline-flex;
	align-items: center;
	padding: 3px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .07);
}
.ubv__seg button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 34px;
	padding: 0 12px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: rgba(243, 241, 236, .75);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
}
.ubv__seg button svg {
	width: 17px;
	height: 17px;
}
.ubv__seg button[aria-pressed="true"] {
	background: var(--ubv-ink);
	color: #11141b;
}
.ubv__seg button:disabled {
	opacity: .3;
	cursor: default;
}
.ubv__zoom {
	gap: 2px;
}
.ubv__zoom .ubv__btn {
	width: 34px;
	height: 34px;
	background: transparent;
}
.ubv__zoom .ubv__btn:hover {
	background: rgba(255, 255, 255, .12);
}
.ubv__zoom span {
	min-width: 58px;
	font-size: 12px;
	font-weight: 600;
	text-align: center;
	font-variant-numeric: tabular-nums;
}
.ubv__close {
	margin-left: 6px;
	background: var(--ubv-ink);
	color: #11141b !important;
}
.ubv__close:hover {
	background: #fff;
	color: #11141b !important;
}

/* "Escuchar" */
.ubv__listen {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 40px;
	margin-right: 4px !important;
	padding: 0 16px 0 13px;
	border: 1px solid rgba(212, 176, 98, .55);
	border-radius: 999px;
	background: rgba(212, 176, 98, .12);
	color: var(--ubv-gold);
	font-size: 13px !important;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
	transition: background .2s, color .2s, border-color .2s;
}
.ubv__listen:hover {
	background: rgba(212, 176, 98, .24);
}
.ubv__listen[hidden] {
	display: none;
}
.ubv__listen svg {
	width: 16px;
	height: 16px;
}
.ubv__listen[aria-pressed="true"] {
	border-color: var(--ubv-gold);
	background: var(--ubv-gold);
	color: #1a1405;
}
.ubv__listen[aria-pressed="true"] .ubv__play {
	display: none;
}
.ubv__eq {
	display: none;
	align-items: flex-end;
	justify-content: center;
	gap: 2px;
	width: 16px;
	height: 14px;
	flex: none;
}
.ubv__listen[aria-pressed="true"] .ubv__eq {
	display: inline-flex;
}
.ubv__eq i {
	display: block;
	width: 3px;
	height: 40%;
	border-radius: 1px;
	background: currentColor;
	animation: ubv-eq 1s ease-in-out infinite;
}
.ubv__eq i:nth-child(2) {
	animation-delay: -.4s;
}
.ubv__eq i:nth-child(3) {
	animation-delay: -.75s;
}
@keyframes ubv-eq {
	0%, 100% { height: 30%; }
	50% { height: 100%; }
}

/* The top bar hides things by its own width (also with the player open). */
@container (max-width: 1000px) {
	.ubv__seg .ubv__t { display: none; }
	.ubv__seg button { padding: 0 10px; }
}
@container (max-width: 800px) {
	.ubv__zoom, .ubv__sep { display: none; }
}
@container (max-width: 620px) {
	.ubv__full { display: none !important; }
}
@container (max-width: 480px) {
	.ubv__id > div { display: none; }
	.ubv__listen { margin-right: 0 !important; }
}
@container (max-width: 330px) {
	.ubv__listen { width: 38px; padding: 0; }
	.ubv__listen .ubv__t { display: none; }
}

/* ---------- Stage ---------- */
.ubv__stage {
	position: relative;
	z-index: 1;
	display: grid;
	overflow: auto;
	padding: 18px 96px 22px;
	outline: none;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, .25) transparent;
	touch-action: manipulation;
}
.ubv__stage.is-zoomed {
	cursor: grab;
}
.ubv__stage.is-dragging {
	cursor: grabbing;
	user-select: none;
}
.ubv-spread {
	position: relative;
	grid-area: 1 / 1;
	display: flex;
	margin: auto;
	transition: opacity .38s ease, transform .5s cubic-bezier(.2, .75, .2, 1);
}
.ubv-spread::after {
	content: "";
	position: absolute;
	left: 6%;
	right: 6%;
	bottom: -26px;
	z-index: -1;
	height: 30px;
	border-radius: 50%;
	background: radial-gradient(closest-side, rgba(0, 0, 0, .55), transparent);
	filter: blur(4px);
	pointer-events: none;
}
.ubv-spread.from-next { opacity: 0; transform: translateX(5%) scale(.985); }
.ubv-spread.from-prev { opacity: 0; transform: translateX(-5%) scale(.985); }
.ubv-spread.to-prev { opacity: 0; transform: translateX(-4%) scale(.97); }
.ubv-spread.to-next { opacity: 0; transform: translateX(4%) scale(.97); }
.ubv-spread.is-leaving { pointer-events: none; }
.ubv-page {
	position: relative;
	overflow: hidden;
	border-radius: 3px;
	background: #f6f3ec;
	box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 24px 60px -20px rgba(0, 0, 0, .75);
}
.ubv-page canvas {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	opacity: 0;
	transition: opacity .35s;
}
.ubv-page.is-ready canvas {
	opacity: 1;
}
.ubv-page:not(.is-ready)::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%) #ece7dc;
	background-size: 220% 100%;
	animation: ubv-shimmer 1.4s linear infinite;
}
@keyframes ubv-shimmer {
	from { background-position: 120% 0; }
	to { background-position: -120% 0; }
}
/* Open booklet: the fold in the middle */
.ubv-spread.is-pair .ubv-page:first-child { border-radius: 3px 0 0 3px; }
.ubv-spread.is-pair .ubv-page:last-child { border-radius: 0 3px 3px 0; }
.ubv-spread.is-pair .ubv-page::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	z-index: 2;
	width: 9%;
	pointer-events: none;
}
.ubv-spread.is-pair .ubv-page:first-child::after {
	right: 0;
	background: linear-gradient(to left, rgba(0, 0, 0, .22), rgba(0, 0, 0, .05) 40%, transparent);
}
.ubv-spread.is-pair .ubv-page:last-child::after {
	left: 0;
	background: linear-gradient(to right, rgba(0, 0, 0, .22), rgba(255, 255, 255, .08) 30%, transparent);
}

/* Loading: the cover with its record sliding out */
.ubv__loading {
	grid-area: 1 / 1;
	display: grid;
	justify-items: center;
	gap: 22px;
	margin: auto;
	text-align: center;
}
.ubv__loading[hidden] {
	display: none;
}
.ubv__disc {
	position: relative;
	width: min(240px, 52vw);
	aspect-ratio: 1;
}
.ubv__disc[hidden] {
	display: none;
}
.ubv__disc img {
	position: relative;
	z-index: 2;
	width: 100%;
	height: 100% !important;
	border-radius: 3px;
	object-fit: cover;
	box-shadow: 0 20px 50px -10px rgba(0, 0, 0, .7);
}
.ubv__vinyl {
	position: absolute;
	inset: 4%;
	z-index: 1;
	border-radius: 50%;
	animation: ubv-out 1s .2s cubic-bezier(.2, .75, .2, 1) forwards;
}
.ubv__vinyl i {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background:
		radial-gradient(circle, rgba(var(--ubv-rgb, 30, 91, 184), 1) 0 16%, #0c0c0c 16.5% 18%, transparent 18.5%),
		repeating-radial-gradient(circle, #151515 0 2px, #1f1f1f 2px 3px);
	box-shadow: 0 10px 30px rgba(0, 0, 0, .6);
	animation: ubv-spin 1.8s linear infinite;
}
.ubv__vinyl i::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: conic-gradient(from 30deg, transparent 0 10%, rgba(255, 255, 255, .08) 14%, transparent 20% 60%, rgba(255, 255, 255, .06) 64%, transparent 70%);
}
@keyframes ubv-out { to { transform: translateX(42%); } }
@keyframes ubv-spin { to { transform: rotate(360deg); } }
.ubv__pct {
	color: rgba(243, 241, 236, .75);
	font-size: 12px;
	letter-spacing: .18em;
	text-transform: uppercase;
}
.ubv__pct b {
	color: var(--ubv-gold);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}
.ubv__err {
	max-width: 340px;
	font-size: 14px;
	line-height: 1.6;
	letter-spacing: normal;
	text-transform: none;
}
.ubv__err a {
	color: var(--ubv-gold) !important;
}

/* Side arrows */
.ubv__nav {
	position: absolute;
	top: 50%;
	z-index: 3;
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	margin-top: -10px !important;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .14);
	border-radius: 50%;
	background: rgba(20, 22, 30, .45);
	color: #fff;
	cursor: pointer;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	transition: background .2s, opacity .2s, transform .2s;
}
.ubv__nav:hover {
	background: rgba(255, 255, 255, .16);
	transform: scale(1.05);
}
/* First / last page: the arrow stays, faded. */
.ubv__nav:disabled {
	opacity: .28;
	cursor: default;
	transform: none;
	background: rgba(20, 22, 30, .45);
}
.ubv__nav svg {
	width: 24px;
	height: 24px;
}
.ubv__nav--prev { left: 22px; }
.ubv__nav--next { right: 22px; }

/* Thumbnails */
.ubv__strip {
	position: relative;
	z-index: 3;
	display: flex;
	gap: 14px;
	overflow-x: auto;
	padding: 14px 20px 12px;
	border-top: 1px solid rgba(255, 255, 255, .08);
	background: rgba(8, 9, 13, .6);
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, .25) transparent;
}
.ubv__strip[hidden] {
	display: none;
}
.ubv-thumb {
	display: grid;
	flex: 0 0 auto;
	justify-items: center;
	gap: 6px;
	padding: 0;
	border: 0;
	background: none;
	color: rgba(243, 241, 236, .6);
	font-size: 11px !important;
	font-variant-numeric: tabular-nums;
	cursor: pointer;
}
.ubv-thumb span:first-child {
	display: block;
	overflow: hidden;
	height: 92px;
	border-radius: 2px;
	background: #ece7dc;
	outline: 2px solid transparent;
	outline-offset: 3px;
	transition: outline-color .2s, transform .2s;
}
.ubv-thumb canvas {
	display: block;
	width: 100%;
	height: 100%;
}
.ubv-thumb:hover span:first-child {
	transform: translateY(-2px);
}
.ubv-thumb.is-current {
	color: var(--ubv-gold);
}
.ubv-thumb.is-current span:first-child {
	outline-color: var(--ubv-gold);
}

/* Bottom bar */
.ubv__bottom {
	position: relative;
	z-index: 3;
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 12px 24px 16px;
}
.ubv__count {
	min-width: 118px;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}
.ubv__count small {
	display: block;
	color: rgba(243, 241, 236, .55);
	font-size: 10.5px;
	font-weight: 500;
	letter-spacing: .16em;
	text-transform: uppercase;
}
.ubv__progress {
	position: relative;
	display: flex;
	flex: 1;
	align-items: center;
}
.ubv__progress input {
	width: 100%;
	height: 24px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}
.ubv__progress input::-webkit-slider-runnable-track {
	height: 3px;
	border-radius: 3px;
	background: linear-gradient(to right, var(--ubv-gold) var(--p, 0%), rgba(255, 255, 255, .18) var(--p, 0%));
}
.ubv__progress input::-moz-range-track {
	height: 3px;
	border-radius: 3px;
	background: linear-gradient(to right, var(--ubv-gold) var(--p, 0%), rgba(255, 255, 255, .18) var(--p, 0%));
}
.ubv__progress input::-webkit-slider-thumb {
	width: 15px;
	height: 15px;
	margin-top: -6px;
	border: 3px solid var(--ubv-gold);
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
	-webkit-appearance: none;
}
.ubv__progress input::-moz-range-thumb {
	width: 9px;
	height: 9px;
	border: 3px solid var(--ubv-gold);
	border-radius: 50%;
	background: #fff;
}
.ubv__progress output {
	position: absolute;
	bottom: 26px;
	padding: 4px 9px;
	border-radius: 6px;
	background: var(--ubv-ink);
	color: #11141b;
	font-size: 11.5px;
	font-weight: 600;
	white-space: nowrap;
	transform: translateX(-50%);
	opacity: 0;
	pointer-events: none;
	transition: opacity .15s;
}
.ubv__progress.is-scrubbing output {
	opacity: 1;
}
.ubv__hint {
	color: rgba(243, 241, 236, .5);
	font-size: 11.5px;
	white-space: nowrap;
}
.ubv__hint kbd {
	margin: 0 1px;
	padding: 1px 5px;
	border: 1px solid rgba(255, 255, 255, .22);
	border-radius: 4px;
	background: none;
	color: inherit;
	font-family: inherit;
	font-size: 10.5px;
}
.ubv__bnav {
	display: none;
}

@media (max-width: 1000px) {
	.ubv__hint { display: none; }
}
@media (max-width: 1500px) {
	.ubv.has-player .ubv__hint { display: none; }
}
@media (max-width: 760px) {
	.ubv__top { gap: 8px; padding: 10px 12px; }
	.ubv__cover { width: 34px; height: 34px !important; }
	.ubv__title { font-size: 17px; }
	.ubv__seg, .ubv__zoom, .ubv__sep, .ubv__full { display: none !important; }
	.ubv__btn { width: 38px; height: 38px; }
	.ubv__stage { padding: 8px 12px 10px; }
	.ubv__nav { display: none; }
	.ubv__bottom { gap: 10px; padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); }
	.ubv__bnav { display: inline-grid; }
	.ubv__bnav--prev { order: 1; }
	.ubv__count { order: 2; flex: 0 0 auto; min-width: 0; text-align: center; }
	.ubv__progress { order: 3; }
	.ubv__bnav--next { order: 4; }
	.ubv-thumb span:first-child { height: 76px; }
}

/* ---------- The site player while the viewer is open ----------
   Upright phones and tablets: a bar at the bottom (Spotify's compact
   player), so the booklet stays in view above it. */
html.has-urtext-booklet {
	overflow: hidden;
}
body.has-urtext-booklet .urtext-player {
	top: auto;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 100002;
	width: auto;
	height: var(--ubv-dock, calc(212px + env(safe-area-inset-bottom)));
	padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
	border-top: 1px solid rgba(255, 255, 255, .1);
	border-radius: 16px 16px 0 0;
	background: rgba(10, 11, 16, .94);
	box-shadow: 0 -14px 40px rgba(0, 0, 0, .45);
	transform: translateY(105%);
}
body.has-urtext-booklet .urtext-player__head {
	margin-bottom: 8px;
}
body.has-urtext-booklet .urtext-player__cover {
	width: 36px;
	height: 36px;
}
body.has-urtext-booklet .urtext-player__frame {
	flex: 0 0 152px;
}
body.has-urtext-booklet .urtext-player__note {
	display: none;
}
.ubv.has-player {
	padding-bottom: var(--ubv-dock);
}
.ubv.has-player .ubv__nav {
	top: calc(50% - var(--ubv-dock) / 2);
}
/* Wide screens and phones held sideways: a column on the right. */
@media (min-width: 1000px), (orientation: landscape) and (max-height: 600px) {
	body.has-urtext-booklet .urtext-player {
		top: 0;
		left: auto;
		width: clamp(260px, 30vw, 400px);
		height: auto;
		padding: 16px;
		border-top: 0;
		border-left: 1px solid rgba(255, 255, 255, .08);
		border-radius: 0;
		box-shadow: -20px 0 60px rgba(0, 0, 0, .35);
		transform: translateX(105%);
	}
	body.has-urtext-booklet .urtext-player__cover {
		width: 56px;
		height: 56px;
	}
	body.has-urtext-booklet .urtext-player__frame {
		flex: 1;
	}
	body.has-urtext-booklet .urtext-player__note {
		display: block;
	}
	.ubv.has-player {
		padding-bottom: 0;
		padding-right: var(--ubv-pw);
	}
	.ubv.has-player .ubv__nav {
		top: 50%;
	}
	.ubv.has-player .ubv__nav--next {
		right: calc(var(--ubv-pw) + 22px);
	}
}
@media (max-height: 520px) {
	body.has-urtext-booklet .urtext-player { padding: 10px 12px; }
	body.has-urtext-booklet .urtext-player__note { display: none !important; }
}
body.has-urtext-booklet .urtext-player.is-in {
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.ubv, .ubv-spread, .ubv-page canvas { transition: none; }
	.ubv__vinyl, .ubv__vinyl i, .ubv-page::before, .ubv__eq i { animation: none; }
	.ubv__vinyl { transform: translateX(42%); }
}
