/* Telemeriendas: the collector's album (album/, 2026-10-23). A cardboard cover with the count,
   then cream album sheets of numbered slots; collected cromos are glossy white-bordered stickers,
   a little tilted; empty slots are dashed with their number. Loaded after style.css */

.album {
	display: grid;
	gap: 28px;
	width: min(100%, var(--page-width));  /* with its 16px sides: 1248px of content, as the bar and the TV */
	margin: 0 auto;
	padding: 40px 16px 48px;  /* 48px clear above the footer */
}

/* ---- Cover ------------------------------------------------------------------------------ */
.album-cover {
	position: relative;
	overflow: hidden;
	padding: 34px 24px 28px;
	background: linear-gradient(160deg, #c8392b, #8e2318);
	border-radius: 18px;
	box-shadow: 0 14px 30px rgba(91, 52, 32, 0.3), inset 0 0 0 6px rgba(255, 255, 255, 0.12);
	color: #fff7e6;
	text-align: center;
}
.album-kicker {
	margin-top: 0;
	color: #fbe7a6;
	font-size: 0.8125rem;
	font-weight: 800;
	letter-spacing: 0.2em;
	text-transform: uppercase;
}
.album-title {
	margin: 4px 0 0;
	color: var(--cola-cao);
	font-family: var(--font-display);
	font-size: clamp(2.2rem, 6vw, 3.6rem);
	font-weight: 700;
	line-height: 1.05;
	text-shadow: 3px 3px 0 var(--cocoa-dark);
}
.album-sub {
	margin-top: 6px;
	font-weight: 700;
}
.album-count {
	margin-top: 16px;
	font-family: "VT323", ui-monospace, monospace;
	font-size: 1.75rem;
}
.album-progress {
	overflow: hidden;
	width: min(100%, 420px);
	height: 12px;
	margin: 8px auto 0;
	background: rgba(46, 27, 16, 0.45);
	border-radius: 6px;
}
/* The fill is the whole width, scaled from the left (album.js sets scale: <fraction> 1): a
   cheaper animation than width. The scale property, not transform, which style.css's reduced
   motion forces to none: there it still shows the right fill, only without the slide.
   No radius of its own: scaled, it would be squashed; the track's rounded clip is enough
   (2026-10-27) */
.album-progress span {
	display: block;
	width: 100%;
	height: 100%;
	background: var(--cola-cao);
	transform-origin: left;
	scale: 0 1;
	transition: scale 0.4s;
}

/* The new cromos' numbers, links to their slots (album.js, 2026-11-05) */
.album-new {
	margin: 12px 0 0;
	font-weight: 700;
}
.album-new a {
	color: var(--cola-cao);
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* ---- Sheets and slots --------------------------------------------------------------------- */
/* The pages side by side, turned sideways (owner, 2026-11-05: "Haz que las páginas del álbum se
   pasen en horizontal"; until then one under another): a scroller that stops at each sheet, a
   whole sheet wide, with no scrollbar (the pager above turns them; album.js). Every sheet is laid
   out: the off-screen ones skipped layout (content-visibility) while they were one under another,
   but side by side an estimated height could leave the scroller taller than the page shown.
   Its bottom padding keeps the sheets' shadow; it is the sheets' offsetParent (album.js) */
.album-book {
	position: relative;
	display: grid;
	gap: 14px;
}
/* While album.js builds the album (2026-11-06): the server's first sheet is there, its final size,
   and over its middle a cocoa pill says "Montando tu álbum…", its dot pulsing (still with reduced
   motion); out of the flow, so nothing moves when album.js removes it */
.album-building {
	position: absolute;
	top: 55%;
	left: 50%;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 10px 18px;
	background: var(--cocoa-dark);
	border-radius: 999px;
	box-shadow: 0 6px 18px rgba(46, 27, 16, 0.35);
	color: #fff;
	font-family: var(--font-display);
	font-size: 1.0625rem;
	font-weight: 600;
	white-space: nowrap;
	transform: translate(-50%, -50%);
	pointer-events: none;
}
.album-building-dot {
	width: 10px;
	height: 10px;
	background: var(--cola-cao);
	border-radius: 50%;
	animation: album-building 1s ease-in-out infinite;
}
@keyframes album-building {
	0%, 100% { opacity: 0.3; transform: scale(0.8); }
	50% { opacity: 1; transform: scale(1.15); }
}
@media (prefers-reduced-motion: reduce) {
	.album-building-dot {
		animation: none;
	}
}
/* The server's sheet under it, faded, as a page still being filled */
.album-book:has(.album-building) #album-pages {
	opacity: 0.55;
}
#album-pages {
	position: relative;
	display: flex;
	align-items: stretch;  /* a section's last sheet as tall as a full one (2026-11-05) */
	gap: 20px;
	overflow-x: auto;
	overflow-y: hidden;
	padding: 4px 0 26px;
	margin-bottom: -26px;
	scroll-snap-type: x mandatory;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
}
#album-pages::-webkit-scrollbar {
	display: none;
}
#album-pages:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 2px;
	border-radius: 18px;
}
.album-sheet {
	flex: 0 0 100%;
	min-width: 0;
	scroll-snap-align: start;
	scroll-snap-stop: always;
	padding: 18px 20px 24px;
	background: #fffaf0;
	background-image: linear-gradient(rgba(91, 52, 32, 0.05) 1px, transparent 1px);
	background-size: 100% 28px;
	border: 1px solid var(--border);
	border-radius: 8px 18px 18px 8px;
	box-shadow: inset 10px 0 14px -10px rgba(91, 52, 32, 0.35), 0 10px 24px rgba(91, 52, 32, 0.18);
}
/* The pager: Anterior, "Página n de N", Siguiente */
.album-pager {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.album-at {
	margin: 0;
	color: var(--cocoa);
	font-family: var(--font-display);
	font-size: 1.125rem;
	font-weight: 700;
	text-align: center;
}
.album-turn {
	padding: 9px 16px;
	background: var(--cola-cao);
	border: 2px solid var(--cocoa);
	border-radius: 999px;
	box-shadow: 0 2px 0 rgba(91, 52, 32, 0.3);
	color: var(--cocoa-dark);
	font: inherit;
	font-weight: 800;
	cursor: pointer;
	white-space: nowrap;
}
.album-turn:hover:not(:disabled) {
	background: #ffd84d;
}
.album-turn:disabled {
	opacity: 0.4;
	cursor: default;
}
@media only screen and (max-width: 420px) {
	.album-turn {
		padding: 8px 12px;
		font-size: 0.875rem;
	}
	.album-at {
		font-size: 1rem;
	}
}
/* The sections (owner, 2026-11-05: "organiza el álbum en series, concursos, programas... con su
   categoría clara en el álbum"): each its colour (--section), on its sheets' ribbon and edge and
   on its button. White text on each, 4.5:1 or more */
.section-dibujos { --section: #c0392b; }
.section-series { --section: #2b62a8; }
.section-programas { --section: #2e7d4f; }
.section-concursos { --section: #7a3d9e; }
.section-peliculas { --section: #5e3520; }
.section-anuncios { --section: #a8520c; }
.section-otros { --section: #6b6259; }
.album-sheet {
	border-top: 6px solid var(--section, var(--border));
}
/* The sheet's heading: its section's name on a ribbon (it said "Página n" until 2026-11-05) */
.album-sheet-head {
	margin: 0 0 14px;
	font-family: var(--font-display);
	font-size: 1.125rem;
	font-weight: 700;
}
.album-ribbon {
	display: inline-block;
	padding: 4px 16px 4px 12px;
	background: var(--section, var(--cocoa));
	border-radius: 4px 0 0 4px;
	clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 50%, 100% 100%, 0 100%);
	color: #ffffff;
	letter-spacing: 0.02em;
}

/* The sections' buttons, over the pager: the name and "have/total"; the one shown filled in */
.album-sections {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}
.album-section {
	display: inline-flex;
	align-items: baseline;
	gap: 6px;
	padding: 6px 12px;
	background: var(--surface);
	border: 2px solid var(--section);
	border-radius: 999px;
	color: var(--section);
	font: inherit;
	font-size: 0.875rem;
	font-weight: 800;
	cursor: pointer;
}
.album-section-count {
	font-family: "VT323", ui-monospace, monospace;
	font-size: 1.0625rem;
	font-weight: 400;
}
.album-section:hover {
	text-decoration: underline;
	text-underline-offset: 2px;
}
.album-section[aria-current] {
	background: var(--section);
	color: #ffffff;
}
.album-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 18px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.cromo-slot {
	position: relative;
	aspect-ratio: 3 / 4;
	border-radius: 10px;
}
/* An empty slot: its number and, under it, the cromo's name and year (owner, 2026-11-05: "que
   cada hueco del cromo tenga el título del cromo") */
.cromo-slot.is-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px 6px;
	background: rgba(236, 211, 174, 0.35);
	border: 2px dashed rgba(91, 52, 32, 0.3);
	text-align: center;
}
.cromo-slot-name {
	display: grid;
	gap: 2px;
	max-width: 100%;
}
.cromo-slot-name .cromo-title {
	color: rgba(91, 52, 32, 0.75);
	-webkit-line-clamp: 3;
	line-clamp: 3;
}
.cromo-slot-name .cromo-year {
	color: rgba(91, 52, 32, 0.6);
}
.cromo-number {
	color: rgba(91, 52, 32, 0.45);
	font-family: "VT323", ui-monospace, monospace;
	font-size: 2rem;
}
.cromo-slot:not(.is-empty) .cromo-number {
	position: absolute;
	top: -10px;
	left: -8px;
	z-index: 1;
	display: grid;
	place-items: center;
	min-width: 30px;
	height: 30px;
	padding: 0 6px;
	background: var(--cocoa);
	border-radius: 15px;
	color: var(--cola-cao);
	font-size: 1.25rem;
}

/* A collected cromo: white border, picture, the name in a coloured band, a gloss */
.cromo {
	position: relative;
	display: flex;
	overflow: hidden;
	flex-direction: column;
	height: 100%;
	margin: 0;
	padding: 7px 7px 0;
	background: #ffffff;
	border-radius: 10px;
	box-shadow: 0 4px 10px rgba(46, 27, 16, 0.28);
	rotate: var(--tilt, 0deg);
	transition: rotate 0.2s, scale 0.2s;
}
.cromo:hover {
	rotate: 0deg;
	scale: 1.04;
}
.cromo::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(125deg, rgba(255, 255, 255, 0.45), transparent 35%, transparent 70%, rgba(255, 255, 255, 0.15));
	pointer-events: none;
}
.cromo img {
	flex: 1;
	min-height: 0;
	width: 100%;
	object-fit: cover;
	background: var(--cocoa-dark);
	border-radius: 6px;
}
.cromo figcaption {
	display: grid;
	gap: 1px;
	padding: 6px 2px 8px;
	text-align: center;
}
/* Up to two lines, then cut; the full name is in its title (album.js). One line cut most
   of the long names short (2026-10-27) */
.cromo-title {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	color: var(--text);
	font-family: var(--font-display);
	font-size: 0.875rem;
	font-weight: 700;
	line-height: 1.15;
	overflow-wrap: anywhere;
}
.cromo-year {
	color: var(--accent);
	font-size: 0.75rem;
	font-weight: 800;
}
.cromo-new {
	position: absolute;
	top: 12px;
	right: -26px;
	padding: 3px 30px;
	background: var(--accent-bg);
	color: #ffffff;
	font-size: 0.6875rem;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	rotate: 35deg;
}

/* ---- How cromos are made (owner, 2026-10-28): four numbered steps under the cover, four
   across, two on tablets, one under the other on phones ------------------------------------ */
.album-howto {
	padding: 20px 22px 22px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 18px;
	box-shadow: 0 10px 24px rgba(91, 52, 32, 0.18);
}
.album-howto h2 {
	margin: 0 0 14px;
	color: var(--cocoa);
	font-family: var(--font-display);
	font-size: 1.375rem;
	font-weight: 700;
}
.album-steps {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 14px 22px;
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: album-step;
}
.album-steps li {
	position: relative;
	padding-left: 42px;
	color: var(--text);
	font-size: 0.9375rem;
	line-height: 1.45;
	counter-increment: album-step;
}
/* The step's number in a red cromo-like badge, the cover's colours */
.album-steps li::before {
	content: counter(album-step);
	position: absolute;
	top: 0;
	left: 0;
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	background: linear-gradient(160deg, #c8392b, #8e2318);
	border-radius: 8px;
	color: var(--cola-cao);
	font-family: var(--font-display);
	font-size: 1.125rem;
	font-weight: 700;
}
.album-steps strong {
	display: block;
	color: var(--cocoa);
	font-weight: 800;
}
.album-steps a {
	color: var(--accent);
	text-decoration: underline;
}
@media only screen and (max-width: 1000px) {
	.album-steps {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
@media only screen and (max-width: 600px) {
	.album-steps {
		grid-template-columns: minmax(0, 1fr);
	}
}

.album-empty {
	color: var(--cocoa);
	font-family: var(--font-display);
	font-size: 1.125rem;
	font-weight: 600;
	text-align: center;
}
.album-empty a {
	color: var(--accent);
	text-decoration: underline;
}
.album-tools {
	text-align: center;
}
.album-tools button {
	padding: 7px 14px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 999px;
	color: var(--muted);
	font: inherit;
	font-size: 0.8125rem;
	font-weight: 700;
	cursor: pointer;
}
/* Hover: the accent, an underline and a warmer border, so it reads as a button (2026-10-27) */
.album-tools button:hover {
	border-color: var(--border-hover);
	color: var(--accent);
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* The footer stays at the bottom with the same space above it (as on the TV page) */
.album-page .site-footer {
	flex-grow: 1;
	margin-top: 0;
}

/* Four across on every screen (owner, 2026-11-05: "4 cromos por fila en móvil"; until then 3 up to
   760px and 2 up to 520px): narrower screens take tighter gaps, thinner borders and a smaller letter */
@media only screen and (max-width: 760px) {
	.album-grid {
		gap: 12px;
	}
	.cromo {
		padding: 5px 5px 0;
	}
	.cromo figcaption {
		padding: 4px 1px 6px;
	}
	.cromo-title {
		font-size: 0.75rem;
	}
}
@media only screen and (max-width: 520px) {
	.album {
		padding-top: 24px;
	}
	.album-grid {
		gap: 10px 8px;
	}
	.album-sheet {
		padding: 10px 10px 14px;
		border-radius: 6px 12px 12px 6px;
	}
	.album-sheet-head {
		margin-bottom: 10px;
	}
	.cromo-slot,
	.cromo {
		border-radius: 6px;
	}
	.cromo {
		padding: 3px 3px 0;
		box-shadow: 0 2px 5px rgba(46, 27, 16, 0.28);
	}
	.cromo img {
		border-radius: 3px;
	}
	.cromo figcaption {
		padding: 3px 0 4px;
	}
	/* The name only, two lines (the full one in its title); the year is left out */
	.cromo-title {
		font-size: 0.6875rem;
		line-height: 1.1;
	}
	.cromo-year {
		display: none;
	}
	.cromo-slot.is-empty {
		gap: 2px;
		padding: 4px 3px;
		border-width: 1px;
	}
	.cromo-number {
		font-size: 1.375rem;
	}
	.cromo-slot.is-empty .cromo-number {
		line-height: 1;
	}
	.cromo-slot-name .cromo-title {
		font-size: 0.625rem;
	}
	.album-sheet {
		border-top-width: 4px;
	}
	.album-sheet-head {
		font-size: 0.9375rem;
	}
	.album-ribbon {
		padding: 3px 14px 3px 9px;
	}
	.album-section {
		padding: 5px 10px;
		font-size: 0.8125rem;
	}
	.cromo-slot:not(.is-empty) .cromo-number {
		top: -7px;
		left: -5px;
		min-width: 20px;
		height: 20px;
		padding: 0 4px;
		border-radius: 10px;
		font-size: 0.9375rem;
	}
	.cromo-new {
		top: 6px;
		right: -24px;
		padding: 2px 24px;
		font-size: 0.5rem;
	}
}
@media (prefers-reduced-motion: reduce) {
	.cromo,
	.album-progress span {
		transition: none;
	}
}

/* 12. A new cromo lands in its slot like a sticker being pressed on (album.js, a delay per
       new cromo); its tilt is kept */
.cromo.is-sticking {
	animation: cromo-stick 0.55s cubic-bezier(0.3, 1.5, 0.5, 1) both;
	animation-delay: var(--stick-delay, 0ms);
}
@keyframes cromo-stick {
	0% { opacity: 0; scale: 1.45; translate: 0 -24px; }
	60% { opacity: 1; scale: 0.94; translate: 0 0; }
	100% { opacity: 1; scale: 1; translate: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
	.cromo.is-sticking {
		animation: none;
	}
}
