/* Telemeriendas: Zapping (zapping/, 2026-11-17), the catalogue's videos one under another as
   Instagram's Reels. After style.css (its tokens, the bar, the tablecloth, the skip link, the
   consent strip) and before season.css (the themes change the bar and the tokens used here).
   In the site's look (owner, 2026-11-17: "Make the zapping page a style consistent with the rest
   of the site"; until then black, with a bar of its own, as Instagram's): the chocolate bar with
   the menu, the gingham tablecloth, cream pills, the title in Cola Cao yellow with the red shadow
   of the bar's name, chocolate shades over the picture. Each slide is the feed's whole height
   (under the bar); on a phone the picture fills it, its sides cut; where the picture fits whole
   (a computer), it is a rounded screen in a cream border on the tablecloth, the text and buttons
   on it. zapping.js lays the players (.zap-stage) over the slide on screen */

:root {
	--zap-cream: #f3dfc0;  /* the bar's light text */
	--zap-shade: 46, 27, 16;  /* --cocoa-dark, for the shades over the picture */
	--zap-feed-height: calc(100dvh - var(--bar-height, 72px));
	/* The column the text and buttons are in: the screen's width on phones, a phone's elsewhere,
	   the picture's own on wide screens (below) */
	--zap-column: min(100vw, max(560px, calc(var(--zap-feed-height) * 9 / 16)));
	--zap-inset: 0px;  /* the room around the picture: none on phones */
}
/* Wide screens (the picture fits whole): a screen on the tablecloth, 20px from the bar's strip
   and the bottom, as wide as it is (4:3), the text and buttons on it */
@media (min-aspect-ratio: 3 / 2) {
	:root {
		--zap-inset: 24px;
		--zap-column: calc((var(--zap-feed-height) - 2 * var(--zap-inset)) * 4 / 3);
	}
}

html, body.zapping {
	height: 100%;
	overflow: hidden;
}
body.zapping {
	overscroll-behavior: none;
}

/* ---- The sound, a cream pill over the feed's top right corner, as the bar's links -------------- */
.zap-sound {
	position: fixed;
	z-index: 5;
	top: calc(var(--bar-height, 72px) + var(--zap-inset) + 22px);
	right: max(12px, calc((100vw - var(--zap-column)) / 2 + 12px));
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 7px 14px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 999px;
	box-shadow: 0 3px 10px rgba(var(--zap-shade), 0.35);
	color: var(--text);
	font: 700 0.875rem/1.2 var(--font-text);
	cursor: pointer;
}
.zap-sound:hover {
	background: var(--surface-hover);
	border-color: var(--border-hover);
}
.zap-sound .icon-sound,
.zap-sound[aria-pressed="true"] .icon-muted {
	display: none;
}
.zap-sound[aria-pressed="true"] .icon-sound {
	display: block;
}
@media (max-width: 360px) {
	.zap-sound {
		padding: 9px 11px;
	}
	.zap-sound-label {
		display: none;
	}
}

/* ---- The feed ------------------------------------------------------------------------------- */
/* Its own scroller (not the page's: a phone's address bar coming and going would resize the
   slides), under the bar (zapping.js keeps --bar-height). Positioned but without a z-index: the
   slides' offsetTop is the feed's scrollTop, and the slides' layers and the fixed players still
   share the page's stacking: the player over the picture, the taps and the buttons over it */
.zap-feed {
	position: relative;
	margin-top: var(--bar-height, 72px);
	height: calc(100vh - var(--bar-height, 72px));
	height: var(--zap-feed-height);
	overflow-y: auto;
	overscroll-behavior: contain;
	scroll-snap-type: y mandatory;
	scrollbar-width: none;
	outline: none;
}
.zap-feed::-webkit-scrollbar {
	display: none;
}
.zap-slide {
	position: relative;
	height: 100%;
	overflow: hidden;
	scroll-snap-align: start;
	scroll-snap-stop: always;
}
/* Centred with margins, not a translate: that would make the column a stacking context of its
   own, under the fixed player, which then would cover the taps' layer and the buttons */
.zap-column {
	position: absolute;
	top: var(--zap-inset);
	bottom: var(--zap-inset);
	left: 0;
	right: 0;
	width: var(--zap-column);
	margin: 0 auto;
}
/* The picture: 4:3, as the catalogue's video window, the column's whole height, centred (owner,
   2026-11-17: "Make the videos take the full height…"; for a while that day 60% on phones; then
   "take full height instead avoiding to show the video title from the video": see .zap-stage
   iframe): on a phone its sides go off the screen, cut by the slide. A 16:9 video still has
   YouTube's black bands above and below inside it */
.zap-frame {
	position: absolute;
	top: 0;
	left: 50%;
	height: 100%;
	width: auto;
	aspect-ratio: 4 / 3;
	translate: -50% 0;
	background: var(--cocoa-dark);
}
/* On wide screens a screen with rounded tube corners in a cream border, as the catalogue's
   pictures, on the tablecloth */
@media (min-aspect-ratio: 3 / 2) {
	.zap-frame {
		border-radius: 18px / 20px;
		overflow: hidden;
		box-shadow: 0 0 0 6px var(--surface), 0 14px 30px 4px rgba(91, 52, 32, 0.35);
	}
	.zap-stage {
		border-radius: 18px / 20px;
	}
}
.zap-poster {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
/* A video YouTube won't play: in the column's middle, not the frame's edge (off the screen) */
.zap-note {
	position: absolute;
	left: 50%;
	bottom: 40%;
	width: max-content;
	max-width: calc(min(100vw, var(--zap-column)) - 32px);
	translate: -50% 0;
	padding: 10px 16px;
	background: var(--cocoa-dark);
	border: 2px solid var(--surface);
	border-radius: 12px;
	color: var(--surface);
	font: 600 1rem/1.3 var(--font-display);
	text-align: center;
}

/* The players, fixed where the slide on screen has its picture (zapping.js sets their box) */
.zap-stage {
	position: fixed;
	z-index: 1;
	top: 0;
	left: 0;
	width: 0;
	height: 0;
	opacity: 0;
	pointer-events: none;
	overflow: hidden;
	--player-band: 96px;
}
/* Fades in, but goes at once: a player fading out while paused showed YouTube's pause sign */
.zap-stage.is-shown {
	opacity: 1;
	transition: opacity 0.15s;
}
/* Only the picture (owner, 2026-11-17: "avoiding to show the video title from the video"), as
   the TV's screen (tele.css): the player is --player-band taller at the top and at the bottom
   than its box, and moved up by it. YouTube fits the video to the player's width and centres it,
   so the picture is as big as the box, while its title band (at the player's top) and its logo
   (bottom right) lie in those bands, cut off by the stage. Fixed pixels, as YouTube's title is */
.zap-stage iframe {
	position: absolute;
	left: 0;
	top: calc(-1 * var(--player-band));
	display: block;
	width: 100%;
	height: calc(100% + 2 * var(--player-band));
	border: 0;
}

/* Taps on the picture: the slide's whole width (on wide screens the tablecloth either side too) */
.zap-tap {
	position: absolute;
	z-index: 2;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 100vw;
	translate: -50% 0;
	display: grid;
	place-items: center;
	cursor: pointer;
	touch-action: manipulation;
	-webkit-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
}
/* What a tap did (the sound, paused): a chocolate disc in a cream ring */
.zap-glyph {
	display: grid;
	place-items: center;
	width: 78px;
	height: 78px;
	background: rgba(var(--zap-shade), 0.78) center / 34px no-repeat;
	border: 3px solid var(--surface);
	border-radius: 50%;
	box-shadow: 0 6px 16px rgba(var(--zap-shade), 0.4);
	opacity: 0;
	scale: 0.8;
	transition: opacity 0.2s, scale 0.2s;
	grid-area: 1 / 1;
}
.zap-glyph.is-shown {
	opacity: 1;
	scale: 1;
}
.zap-glyph[data-glyph="muted"] {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fbeedb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5L6 9H3v6h3l5 4z'/%3E%3Cpath d='M22 9l-6 6M16 9l6 6'/%3E%3C/svg%3E");
}
.zap-glyph[data-glyph="sound"] {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fbeedb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5L6 9H3v6h3l5 4z'/%3E%3Cpath d='M15.5 8.5a5 5 0 0 1 0 7M18.5 5.5a9 9 0 0 1 0 13'/%3E%3C/svg%3E");
}
.zap-glyph[data-glyph="paused"] {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f6b91a'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
}
/* The double tap's heart, where the finger was (zapping.js sets left and top): the tablecloth's
   red with a cream edge */
.zap-heart {
	position: absolute;
	width: 96px;
	height: 96px;
	margin: -48px 0 0 -48px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23c8392b' stroke='%23fbeedb' stroke-width='1.2' stroke-linejoin='round' d='M12 20.5s-7.5-4.6-9.3-9.2C1.4 8 3.4 4.5 7 4.5c2 0 3.6 1.1 5 3 1.4-1.9 3-3 5-3 3.6 0 5.6 3.5 4.3 6.8-1.8 4.6-9.3 9.2-9.3 9.2z'/%3E%3C/svg%3E") center / contain no-repeat;
	filter: drop-shadow(0 4px 12px rgba(var(--zap-shade), 0.5));
	opacity: 0;
	pointer-events: none;
}
.zap-heart.is-shown {
	animation: zap-heart 0.8s ease-out;
}
@keyframes zap-heart {
	0% { opacity: 0; scale: 0.3; rotate: -12deg; }
	15% { opacity: 1; scale: 1.15; rotate: -12deg; }
	30% { scale: 0.95; }
	45% { scale: 1; }
	80% { opacity: 1; translate: 0 0; }
	100% { opacity: 0; scale: 0.9; translate: 0 -60px; }
}

/* ---- The title and its tags, bottom left ---------------------------------------------------- */
/* The chocolate shades that keep the text readable over the picture: a light one at the top
   (under the sound), a deep one at the bottom; as wide as the column (the picture's own width on
   wide screens, its corners rounded as it) */
.zap-column::before,
.zap-column::after {
	content: "";
	position: absolute;
	z-index: 2;
	left: 0;
	right: 0;
	pointer-events: none;
}
.zap-column::before {
	top: 0;
	height: 110px;
	background: linear-gradient(to bottom, rgba(var(--zap-shade), 0.5), transparent);
}
.zap-column::after {
	bottom: 0;
	height: 48%;
	background: linear-gradient(to top, rgba(var(--zap-shade), 0.92), rgba(var(--zap-shade), 0.55) 45%, transparent);
}
@media (min-aspect-ratio: 3 / 2) {
	.zap-column::before {
		border-radius: 18px 18px 0 0 / 20px 20px 0 0;
	}
	.zap-column::after {
		border-radius: 0 0 18px 18px / 0 0 20px 20px;
	}
}
.zap-info {
	position: absolute;
	z-index: 3;
	left: 0;
	right: 84px;
	bottom: 0;
	padding: 60px 16px max(24px, calc(env(safe-area-inset-bottom) + 16px));
	pointer-events: none;
}
/* The name as the bar's: Cola Cao yellow with the tablecloth's red shadow */
.zap-title {
	margin: 0 0 6px;
	color: var(--cola-cao);
	font: 600 1.5rem/1.15 var(--font-display);
	text-shadow: 2px 2px 0 var(--accent-bg);
	text-wrap: balance;
}
/* The year and the length only (owner, 2026-11-17: "Muestra el título, año y duración. No el
   resto de detalles") */
.zap-meta {
	color: var(--zap-cream);
	font-size: 0.9375rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}
/* A cream badge, as the catalogue's counts (the end of the feed's button) */
.zap-chip {
	padding: 1px 9px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 999px;
	color: var(--cocoa);
	font: 800 0.75rem/1.5 var(--font-badge);
}

/* ---- The buttons, right: cream discs with chocolate icons --------------------------------------- */
/* Clear of the free host's badge, fixed in the bottom right corner (180 × 45px; see .consent) */
.zap-actions {
	position: absolute;
	z-index: 3;
	right: 8px;
	bottom: max(84px, calc(env(safe-area-inset-bottom) + 76px));
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}
.zap-actions > button, .zap-actions > a {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	min-width: 68px;
	padding: 0;
	background: transparent;
	border: 0;
	color: var(--surface);
	font: 800 0.6875rem/1.2 var(--font-text);
	text-shadow: 0 1px 3px rgba(var(--zap-shade), 0.9);
	cursor: pointer;
}
.zap-actions > [hidden] {
	display: none;
}
.zap-actions svg {
	box-sizing: content-box;
	width: 24px;
	height: 24px;
	padding: 12px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 50%;
	box-shadow: 0 4px 12px rgba(var(--zap-shade), 0.4);
	color: var(--cocoa);
	transition: scale 0.15s, background-color 0.15s;
}
.zap-actions > button:hover svg, .zap-actions > a:hover svg {
	background-color: var(--surface-hover);
}
.zap-actions > :active svg {
	scale: 0.9;
}
.zap-like svg {
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linejoin: round;
}
.zap-like[aria-pressed="true"] svg {
	fill: var(--accent-bg);
	stroke: var(--accent-bg);
}

/* Short screens (an older phone): the buttons closer together */
@media (max-height: 700px) {
	.zap-actions {
		gap: 6px;
	}
	.zap-actions svg {
		padding: 9px;
	}
}

/* ---- How far the video has got, along the bottom edge: Cola Cao on chocolate ------------------ */
.zap-progress {
	position: absolute;
	z-index: 4;
	left: 0;
	right: 0;
	bottom: 0;
	height: 4px;
	background: rgba(var(--zap-shade), 0.6);
}
@media (min-aspect-ratio: 3 / 2) {
	.zap-progress {
		left: 18px;
		right: 18px;
		border-radius: 2px;
		overflow: hidden;
	}
}
.zap-progress span {
	display: block;
	width: 100%;
	height: 100%;
	background: var(--cola-cao);
	transform: scaleX(0);
	transform-origin: left;
}

/* ---- Loading, the end, the copied link, the hint -------------------------------------------- */
.zap-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	height: 100%;
	padding: 0 16px;
	color: var(--cocoa);
	font: 600 1.25rem/1.2 var(--font-display);
	text-align: center;
	scroll-snap-align: start;
}
.zap-loading[hidden] {
	display: none;
}
.zap-loading .zap-chip {
	padding: 8px 16px;
	font-size: 0.9375rem;
	cursor: pointer;
}
.zap-spinner {
	width: 38px;
	height: 38px;
	border: 4px solid rgba(91, 52, 32, 0.2);
	border-top-color: var(--accent-bg);
	border-right-color: var(--cola-cao);
	border-radius: 50%;
	animation: zap-spin 0.8s linear infinite;
}
@keyframes zap-spin {
	to { rotate: 360deg; }
}
/* As the season's notice (season.css): a chocolate pill with light text */
.zap-toast,
.zap-hint {
	position: fixed;
	z-index: 7;
	left: 50%;
	width: max-content;
	max-width: calc(100vw - 32px);
	padding: 10px 18px;
	background: var(--cocoa-dark);
	border-radius: 999px;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
	color: #ffffff;
	font: 600 0.9375rem/1.3 var(--font-display);
	text-align: center;
	pointer-events: none;
}
.zap-toast {
	bottom: 96px;
	translate: -50% 10px;
	opacity: 0;
	transition: opacity 0.2s, translate 0.2s;
}
.zap-toast.is-shown {
	opacity: 1;
	translate: -50% 0;
}
/* The hint on the first video: sound is off until a tap. Under the sound's pill */
.zap-hint {
	z-index: 5;
	top: calc(var(--bar-height, 72px) + var(--zap-inset) + 76px);
	translate: -50% 0;
	transition: opacity 0.3s;
}
.zap-hint.is-gone {
	opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
	.zap-heart.is-shown {
		animation-duration: 0.01s;
	}
	.zap-glyph, .zap-stage, .zap-toast, .zap-actions svg {
		transition: none;
	}
	.zap-spinner {
		animation-duration: 3s;
	}
}
