/* ============================================================
   Stories — franja de círculos
   ============================================================ */

.nl-stories {
	background: var(--fondo, #fff);
	border-bottom: 1px solid var(--linea, #e8e2f0);
	width: 100%;
	overflow: hidden;
}

.nl-stories__pista {
	display: flex;
	overflow-x: auto;
	padding: 12px 12px 10px;
	gap: 2px;
	scrollbar-width: none;
	-ms-overflow-style: none;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
}

.nl-stories__pista::-webkit-scrollbar { display: none; }

/* ---- Ítem (botón) ---- */
.nl-stories__item {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 4px 6px;
	background: none;
	border: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	width: 76px;
	transition: transform 0.15s ease, opacity 0.2s;
}

.nl-stories__item:hover { transform: scale(1.06); }
.nl-stories__item:active { transform: scale(0.96); }

/* ---- Anillo de color ---- */
.nl-stories__anillo {
	width: 68px;
	height: 68px;
	border-radius: 50%;
	/* Gradiente por defecto — se sobreescribe con --story-color */
	background: linear-gradient(
		135deg,
		var(--story-color, var(--leon-purpura)) 0%,
		color-mix(in srgb, var(--story-color, var(--leon-purpura)) 60%, #c47200) 100%
	);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: background 0.3s ease;
}

/* Stories ya vistas — anillo gris */
.nl-stories__item.nl-vista .nl-stories__anillo {
	background: var(--linea, #d0cdd8);
}

.nl-stories__item.nl-vista {
	opacity: 0.6;
}

/* Thumbnail circular */
.nl-stories__thumb {
	width: 58px;
	height: 58px;
	border-radius: 50%;
	object-fit: cover;
	object-position: center top;
	border: 3px solid var(--fondo, #fff);
	display: block;
	background: var(--fondo-alt, #f0eaf8);
	box-sizing: content-box;
}

/* Etiqueta debajo del círculo */
.nl-stories__label {
	font-family: var(--fuente-ui);
	font-size: 10px;
	font-weight: 600;
	color: var(--tinta);
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 68px;
	line-height: 1.2;
	letter-spacing: 0.01em;
}

.nl-stories__item.nl-vista .nl-stories__label {
	color: var(--gris);
}

/* Centrar en desktop */
@media (min-width: 768px) {
	.nl-stories__pista {
		justify-content: center;
		padding: 14px 24px 12px;
		gap: 4px;
	}
}

/* ============================================================
   Visor fullscreen
   ============================================================ */

.nl-stories__visor {
	position: fixed;
	inset: 0;
	z-index: 2147483647; /* INT_MAX — por encima de cualquier banner de AdSense */
	background: rgba(0, 0, 0, 0.88);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.nl-stories__visor[hidden] { display: none; }

@keyframes nl-story-abrir {
	from { opacity: 0; transform: scale(0.96); }
	to   { opacity: 1; transform: scale(1); }
}

.nl-stories__visor:not([hidden]) {
	animation: nl-story-abrir 0.22s cubic-bezier(0.32, 0, 0.2, 1);
}

/* Contenedor interno: full-screen en móvil, card en desktop */
.nl-stories__visor-inner {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: #0a0a0a;
}

@media (min-width: 600px) {
	.nl-stories__visor-inner {
		width: 420px;
		height: min(90vh, 780px);
		border-radius: 18px;
		box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7);
	}
}

/* ---- Barras de progreso ---- */
.nl-stories__progreso {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	display: flex;
	gap: 4px;
	padding: 12px 12px 0;
	padding-top: max(12px, env(safe-area-inset-top, 12px));
	z-index: 10;
}

.nl-stories__barra {
	flex: 1;
	height: 2px;
	background: rgba(255, 255, 255, 0.3);
	border-radius: 2px;
	overflow: hidden;
}

.nl-stories__barra-fill {
	height: 100%;
	width: 0%;
	background: #fff;
	border-radius: 2px;
}

.nl-stories__barra--completa .nl-stories__barra-fill { width: 100%; }

/* ---- Botón cerrar ---- */
.nl-stories__cerrar {
	position: absolute;
	top: max(40px, calc(env(safe-area-inset-top, 0px) + 32px));
	right: 14px;
	z-index: 10;
	width: 38px;
	height: 38px;
	background: rgba(0, 0, 0, 0.45);
	border: none;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	cursor: pointer;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	transition: background 0.15s;
}

.nl-stories__cerrar:hover { background: rgba(0, 0, 0, 0.7); }

/* ---- Imagen ---- */
.nl-stories__visor-imagen {
	position: absolute;
	inset: 0;
	z-index: 1;
}

.nl-stories__visor-imagen img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
	display: block;
}

/* Gradiente sobre la imagen */
.nl-stories__visor-gradiente {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 70%;
	background: linear-gradient(
		to top,
		rgba(0, 0, 0, 0.9)  0%,
		rgba(0, 0, 0, 0.5) 40%,
		transparent        100%
	);
	pointer-events: none;
}

/* ---- Contenido overlay ---- */
.nl-stories__visor-contenido {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 15; /* por encima de los tap zones (z-index: 8) */
	padding: 28px 20px max(24px, env(safe-area-inset-bottom, 24px));
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* Badge de categoría */
.nl-stories__visor-cat {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	font-family: var(--fuente-ui);
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #fff;
	background: rgba(0, 0, 0, 0.45);
	padding: 4px 12px;
	border-radius: 100px;
	border: 1px solid rgba(255, 255, 255, 0.25);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	border-left: 3px solid var(--story-cat-color, #5b2a86);
}

/* Titular */
.nl-stories__visor-titulo {
	font-family: var(--fuente-display);
	font-size: clamp(1.25rem, 4.5vw, 1.65rem);
	font-weight: 800;
	color: #fff;
	margin: 0;
	line-height: 1.2;
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Botón "Leer más" */
.nl-stories__visor-leer {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	align-self: flex-start;
	color: #fff;
	font-family: var(--fuente-ui);
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
	border: 2px solid rgba(255, 255, 255, 0.75);
	padding: 10px 18px;
	border-radius: 100px;
	transition: background 0.15s, border-color 0.15s;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	background: rgba(255, 255, 255, 0.1);
	margin-top: 4px;
}

.nl-stories__visor-leer:hover,
.nl-stories__visor-leer:focus {
	background: rgba(255, 255, 255, 0.25);
	border-color: #fff;
	color: #fff;
}

/* ---- Zonas táctiles ---- */
.nl-stories__tap {
	position: absolute;
	top: 0;
	bottom: 30%;   /* no cubrir el área de contenido inferior */
	z-index: 8;
	background: transparent;
	border: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	padding: 0;
}

.nl-stories__tap--prev { left: 0; width: 30%; }
.nl-stories__tap--next { right: 0; width: 70%; }

/* ---- Overlay de anuncio en el visor ---- */
.nl-stories__visor-ad {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 15;
	padding: 28px 20px max(28px, env(safe-area-inset-bottom, 28px));
	display: flex;
	flex-direction: column;
	gap: 12px;
	align-items: center;
}

.nl-stories__visor-ad[hidden] { display: none; }

.nl-stories__visor-ad-badge {
	display: inline-flex;
	align-items: center;
	font-family: var(--fuente-ui);
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #fff;
	background: rgba(0, 0, 0, 0.45);
	padding: 4px 12px;
	border-radius: 100px;
	border: 1px solid rgba(255, 255, 255, 0.35);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}

.nl-stories__visor-ad-cta {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #fff;
	font-family: var(--fuente-ui);
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	background: rgba(91, 42, 134, 0.9);
	padding: 13px 22px;
	border-radius: 100px;
	transition: background 0.15s;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.nl-stories__visor-ad-cta:hover,
.nl-stories__visor-ad-cta:focus {
	background: rgba(91, 42, 134, 1);
	color: #fff;
}

/* ---- Dark mode ---- */
.nl-dark-mode .nl-stories {
	background: #16111f;
	border-color: #2d2040;
}

.nl-dark-mode .nl-stories__thumb {
	border-color: #16111f;
}

.nl-dark-mode .nl-stories__label {
	color: #d4c9e8;
}

.nl-dark-mode .nl-stories__item.nl-vista .nl-stories__label {
	color: #6b6080;
}

.nl-dark-mode .nl-stories__item.nl-vista .nl-stories__anillo {
	background: #3a3050;
}
