/*
 * Huelva TV — "Nuestras Stories"
 * Franja de historias verticales + visor a pantalla completa.
 * Datos: carpeta REDES/HISTORIAS que mantiene Workflow HTV (10 ultimas + index.json).
 */

.htv-stories {
	position: relative;
	margin: 0 0 6px;
}

.htv-stories__track {
	display: flex;
	gap: 16px;
	overflow-x: auto;
	overflow-y: hidden;
	padding: 6px 2px 12px;
	margin: 0;
	list-style: none;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.htv-stories__track::-webkit-scrollbar {
	display: none;
	height: 0;
}

.htv-stories__item {
	flex: 0 0 auto;
	width: 96px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	background: none;
	border: 0;
	margin: 0;
	padding: 0;
	cursor: pointer;
	scroll-snap-align: start;
	font-family: inherit;
}

.htv-stories__ring {
	position: relative;
	width: 84px;
	height: 84px;
	border-radius: 50%;
	padding: 3px;
	background: linear-gradient(135deg, #ff5f6d 0%, #e2004d 45%, #7b1fa2 100%);
	display: block;
}

.htv-stories__thumb {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	border: 2px solid #fff;
	background: #101010;
	object-fit: cover;
	pointer-events: none;
}

.htv-stories__play {
	position: absolute;
	right: 0;
	bottom: 0;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 0 0 2px #101010;
	display: flex;
	align-items: center;
	justify-content: center;
}

.htv-stories__play::after {
	content: '';
	width: 0;
	height: 0;
	margin-left: 2px;
	border-style: solid;
	border-width: 5px 0 5px 8px;
	border-color: transparent transparent transparent #e2004d;
}

.htv-stories__label {
	font-size: 12px;
	line-height: 1.3;
	color: inherit;
	opacity: .8;
	text-align: center;
	max-width: 96px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.htv-stories__item:hover .htv-stories__ring,
.htv-stories__item:focus-visible .htv-stories__ring {
	filter: brightness(1.08);
}

/* ---------------------------------------------------------------- */
/* Plantilla "Tarjetas 9:16" (estilo RTVE)                          */
/* ---------------------------------------------------------------- */

.htv-stories--cards .htv-stories__track {
	gap: 10px;
}

.htv-stories--cards .htv-stories__item {
	position: relative;
	width: 104px;
	gap: 0;
}

.htv-stories--cards .htv-stories__ring {
	width: 104px;
	height: 185px;
	border-radius: 12px;
	padding: 0;
	background: #101010;
	overflow: hidden;
	transition: transform .15s ease, box-shadow .15s ease;
}

.htv-stories--cards .htv-stories__thumb {
	border-radius: 12px;
	border: 0;
}

.htv-stories--cards .htv-stories__play {
	display: none;
}

.htv-stories--cards .htv-stories__label {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	max-width: none;
	margin: 0;
	padding: 30px 8px 8px;
	background: linear-gradient(to top, rgba(0, 0, 0, .85), transparent);
	border-radius: 0 0 12px 12px;
	color: #fff;
	opacity: 1;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.25;
	text-align: left;
	-webkit-line-clamp: 3;
}

.htv-stories--cards .htv-stories__item:hover .htv-stories__ring,
.htv-stories--cards .htv-stories__item:focus-visible .htv-stories__ring {
	filter: none;
	transform: translateY(-3px);
	box-shadow: 0 8px 18px rgba(0, 0, 0, .3);
}

/* ---------------------------------------------------------------- */
/* Visor a pantalla completa                                        */
/* ---------------------------------------------------------------- */

.htv-stories-viewer {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: #000;
	display: flex;
	flex-direction: column;
	touch-action: none;
}

.htv-stories-viewer[hidden] {
	display: none !important;
}

body.htv-stories-open {
	overflow: hidden;
}

.htv-stories-viewer__bars {
	display: flex;
	gap: 4px;
	padding: 10px 10px 0;
}

.htv-stories-viewer__bar {
	position: relative;
	flex: 1 1 0;
	height: 3px;
	border-radius: 2px;
	background: rgba(255, 255, 255, .35);
	overflow: hidden;
}

.htv-stories-viewer__bar-fill {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 0%;
	background: #fff;
}

.htv-stories-viewer__topbar {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	color: #fff;
}

.htv-stories-viewer__source {
	font-weight: 700;
	font-size: 13px;
	letter-spacing: .02em;
}

.htv-stories-viewer__time {
	font-size: 12px;
	opacity: .75;
}

.htv-stories-viewer__actions {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 6px;
}

.htv-stories-viewer__mute,
.htv-stories-viewer__close {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 0;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.htv-stories-viewer__mute::before {
	content: '\1F507'; /* 🔇 */
	font-size: 15px;
}

.htv-stories-viewer__mute:not(.is-muted)::before {
	content: '\1F50A'; /* 🔊 */
}

.htv-stories-viewer__stage {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.htv-stories-viewer__video {
	max-width: 100%;
	max-height: 100%;
	height: 100%;
	width: auto;
	background: #000;
}

.htv-stories-viewer__nav {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 32%;
	border: 0;
	background: transparent;
	padding: 0;
	cursor: pointer;
}

.htv-stories-viewer__nav--prev {
	left: 0;
}

.htv-stories-viewer__nav--next {
	right: 0;
}

.htv-stories-viewer__caption {
	padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
	background: linear-gradient(to top, rgba(0, 0, 0, .75), transparent);
	margin-top: -90px;
	pointer-events: none;
}

.htv-stories-viewer__caption-text {
	margin: 0;
	color: #fff;
	font-size: 14px;
	line-height: 1.4;
	max-width: 640px;
}

@media (min-width: 640px) {
	.htv-stories-viewer__stage {
		padding: 24px 0;
	}

	.htv-stories-viewer__video {
		border-radius: 10px;
		max-height: calc(100% - 48px);
	}
}
