/* Bloque Colecciones: carrusel con flechas o rejilla */
/* ——— Carrusel (tema oscuro, referencia diseño Generación Maldita) ——— */
.fm-colecciones--carousel {
	--fm-colecciones-bg: #0a0b0d;
	--fm-colecciones-card-border: rgba(255, 255, 255, 0.2);
	--fm-colecciones-media-bg: #c4c4c4;
	--fm-colecciones-title-bg: #0a0b0d;
	color: #fff;
	padding: 0.35rem 0 0.85rem;
}

.fm-colecciones--carousel .fm-colecciones__viewport {
	position: relative;
	display: block;
}

.fm-colecciones--carousel .fm-colecciones__scroll {
	overflow-x: auto;
	overflow-y: hidden;
	scroll-behavior: smooth;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
	min-width: 0;
	padding: 0.35rem 2.85rem 0.5rem;
	/* Referencia para ~25% de ancho por tarjeta (unidades cqi) */
	container-type: inline-size;
	container-name: fm-colecciones-carousel;
	/* Firefox: ocultar barra conservando scroll */
	scrollbar-width: none;
	/* IE / Edge antiguo */
	-ms-overflow-style: none;
}

/* Chromium / Safari / WebKit: sin barra visible */
.fm-colecciones--carousel .fm-colecciones__scroll::-webkit-scrollbar {
	display: none;
	width: 0;
	height: 0;
	background: transparent;
}

/* WebKit que ignore display:none en scrollbar: barra totalmente transparente */
.fm-colecciones--carousel .fm-colecciones__scroll::-webkit-scrollbar-track {
	background: transparent;
}

.fm-colecciones--carousel .fm-colecciones__scroll::-webkit-scrollbar-thumb {
	background: transparent;
}

.fm-colecciones--carousel .fm-colecciones__scroll::-webkit-scrollbar-button {
	width: 0;
	height: 0;
	display: none;
}

.fm-colecciones--carousel .fm-colecciones__track {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: 20px;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* ~25% del ancho visible del carrusel; 20px entre tarjetas (4 columnas → 3 huecos) */
.fm-colecciones--carousel .fm-colecciones__item {
	flex: 0 0 auto;
	min-width: 0;
	scroll-snap-align: start;
	width: min(11.25rem, calc((100vw - 6rem) / 4));
	max-width: calc(100vw - 4rem);
}

@supports (width: 1cqi) {
	.fm-colecciones--carousel .fm-colecciones__item {
		width: calc((100cqi - 60px) / 4);
		max-width: none;
	}
}

.fm-colecciones--carousel .fm-colecciones__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.6rem;
	height: 2.6rem;
	margin: 0;
	padding: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	cursor: pointer;
	line-height: 1;
	backdrop-filter: blur(4px);
	transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.fm-colecciones--carousel .fm-colecciones__nav:hover:not(:disabled),
.fm-colecciones--carousel .fm-colecciones__nav:focus-visible:not(:disabled) {
	background: rgba(255, 255, 255, 0.26);
	border-color: rgba(255, 255, 255, 0.55);
	outline: none;
}

.fm-colecciones--carousel .fm-colecciones__nav:disabled {
	opacity: 0.28;
	cursor: not-allowed;
}

.fm-colecciones--carousel .fm-colecciones__nav--prev {
	left: 0.2rem;
}

.fm-colecciones--carousel .fm-colecciones__nav--next {
	right: 0.2rem;
}

.fm-colecciones--carousel .fm-colecciones__nav-icon {
	font-size: 1.65rem;
	font-weight: 600;
	line-height: 1;
	user-select: none;
}

/* Pie sobre la miniatura: anclado abajo, texto alineado a la izquierda (carrusel y rejilla) */
.fm-colecciones__caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: flex-end;
	gap: 0.25rem;
	width: 100%;
	min-width: 0;
	box-sizing: border-box;
	margin: 0;
	padding: 0.55rem 0.65rem 0.6rem;
	text-align: left;
	color: #fff;
	pointer-events: none;
	background: linear-gradient(
		to top,
		rgb(0 0 0 / 0.82) 0%,
		rgb(0 0 0 / 0.45) 55%,
		transparent 100%
	);
}

.fm-colecciones__title {
	margin: 0;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	text-align: left;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.02em;
	text-shadow: 0 1px 4px rgb(0 0 0 / 0.75);
}

.fm-colecciones__count {
	margin: 0;
	width: 100%;
	max-width: 100%;
	font-size: 10px;
	font-weight: 300;
	line-height: 1.25;
	letter-spacing: 0.06em;
	font-variant-numeric: tabular-nums;
	text-align: left;
	text-shadow: 0 1px 4px rgb(0 0 0 / 0.75);
}

/* Tarjetas carrusel: proporción 9:16; título/recuento sobre la miniatura */
.fm-colecciones--carousel .fm-colecciones__card {
	border-radius: 6px;
	background: #121418;
	color: #fff;
	overflow: hidden;
}

.fm-colecciones--carousel .fm-colecciones__media {
	flex: 1 1 auto;
	min-height: 0;
	width: 100%;
	background: var(--fm-colecciones-media-bg);
}

.fm-colecciones--carousel .fm-colecciones__placeholder {
	background: var(--fm-colecciones-media-bg);
}

.fm-colecciones--carousel .fm-colecciones__caption {
	padding: 0.5rem 0.6rem 0.55rem;
}

/* ——— Rejilla (p. ej. generacionmaldita.com/colecciones/) ——— */
.fm-colecciones--grid .fm-colecciones__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
	gap: clamp(1rem, 3vw, 1.75rem);
	list-style: none;
	margin: 0;
	padding: 0;
}

.fm-colecciones--grid .fm-colecciones__item {
	width: 100%;
	min-width: 0;
}

.fm-colecciones--grid .fm-colecciones__caption {
	padding: 0.55rem 0.5rem 0.65rem;
}

/* ——— Tarjetas compartidas ——— */
.fm-colecciones__card {
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	width: 100%;
	aspect-ratio: 9 / 16;
	height: auto;
	text-decoration: none;
	color: inherit;
	border-radius: 4px;
	overflow: hidden;
}

.fm-colecciones--grid .fm-colecciones__card {
	border-color: rgba(0, 0, 0, 0.08);
}

.fm-colecciones__media {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	width: 100%;
	background: #f0f0f0;
	overflow: hidden;
	display: flex;
	align-items: stretch;
	justify-content: center;
}

/* Degradado inferior: negro → transparente hacia arriba (sobre miniatura) */
.fm-colecciones__media::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: linear-gradient(
		to top,
		rgb(0 0 0 / 0.72) 0%,
		rgb(0 0 0 / 0.35) 38%,
		transparent 72%
	);
}

.fm-colecciones__thumb-img {
	position: relative;
	z-index: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transform: scale(1);
	transform-origin: center center;
	transition: transform 0.45s cubic-bezier(0.33, 1, 0.68, 1);
}

.fm-colecciones__placeholder {
	position: relative;
	z-index: 0;
	width: 100%;
	height: 100%;
	min-height: 100%;
	background: linear-gradient(135deg, #e8e8e8, #f5f5f5);
	transform: scale(1);
	transform-origin: center center;
	transition: transform 0.45s cubic-bezier(0.33, 1, 0.68, 1);
}

.fm-colecciones__card:hover .fm-colecciones__thumb-img,
.fm-colecciones__card:focus-visible .fm-colecciones__thumb-img {
	transform: scale(1.08);
}

.fm-colecciones__card:hover .fm-colecciones__placeholder,
.fm-colecciones__card:focus-visible .fm-colecciones__placeholder {
	transform: scale(1.08);
}

@media (prefers-reduced-motion: reduce) {
	.fm-colecciones__thumb-img,
	.fm-colecciones__placeholder {
		transition: none;
	}

	.fm-colecciones__card:hover .fm-colecciones__thumb-img,
	.fm-colecciones__card:focus-visible .fm-colecciones__thumb-img,
	.fm-colecciones__card:hover .fm-colecciones__placeholder,
	.fm-colecciones__card:focus-visible .fm-colecciones__placeholder {
		transform: scale(1);
	}
}

.fm-colecciones__empty {
	margin: 0;
}

.fm-colecciones-editor .components-notice {
	margin: 0 0 0.75rem;
}
