/* =========================================================
   AF Video Tabs
   Todos los colores y medidas están en variables para que
   puedas ajustarlos desde el tema sin tocar este archivo.
   ========================================================= */

.afv {
	--afv-accent: #e0a341;
	--afv-accent-soft: #fdf1e0;
	--afv-border: #f99d3e;
	--afv-thumb-border: #dcdcdc;
	--afv-text: #1e1e1e;
	--afv-text-muted: #6b6b6b;
	--afv-tab-text: #4a4a4a;
	--afv-thumb-bg: #14100c;
	--afv-radius: 2px;
	--afv-zoom: 1.5;

	--afv-tabs-width: 110px;
	--afv-thumb-width: 200px;
	--afv-gap: 2.25rem;

	display: flex;
	align-items: flex-start;
	gap: var(--afv-gap);
	color: var(--afv-text);
}

.afv *,
.afv *::before,
.afv *::after {
	box-sizing: border-box;
}

/* ---------- Pestañas (años) ---------- */

.afv__tabs {
	flex: 0 0 var(--afv-tabs-width);
	width: var(--afv-tabs-width);
	display: flex;
	flex-direction: column;
	border-right: 1px solid var(--afv-border);
	border-top: 1px solid var(--afv-border);
}

.afv__tab {
	appearance: none;
	margin: 0;
	padding: 0.7em 0.5em;
	background: transparent;
	border: 0;
	border-bottom: 1px solid var(--afv-border);
	border-radius: 0;
	font: inherit;
	font-size: 1.375rem;
	line-height: 1.2;
	color: var(--afv-tab-text);
	text-align: center;
	cursor: pointer;
	transition: background-color 0.18s ease, color 0.18s ease;
}

.afv__tab:hover {
	background: var(--afv-accent-soft);
	color: var(--afv-text);
}

.afv__tab:focus-visible {
	outline: 2px solid var(--afv-accent);
	outline-offset: -2px;
}

/* En desktop el fondo ya distingue la pestaña activa: sin bordes extra. */
.afv__tab.is-active {
	background: var(--afv-accent-soft);
	color: var(--afv-text);
}

/* ---------- Paneles ---------- */

.afv__panels {
	flex: 1 1 auto;
	min-width: 0;
}

.afv__panel[hidden] {
	display: none;
}

.afv__panel:focus {
	outline: none;
}

.afv__section + .afv__section {
	margin-top: 3rem;
}

.afv__section-title {
	margin: 0 0 1.25rem;
	font-size: 2rem;
	font-weight: 400;
	line-height: 1.2;
	color: var(--afv-text);
}

/* ---------- Lista de videos ---------- */

.afv__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.afv__item + .afv__item {
	border-top: 1px solid var(--afv-border);
}

.afv__link {
	display: flex;
	align-items: flex-start;
	gap: 1.75rem;
	padding: 1rem 0;
	color: inherit;
	text-decoration: none;
	transition: background-color 0.18s ease;
}

a.afv__link:hover,
a.afv__link:focus-visible {
	background: #fafafa;
	text-decoration: none;
}

a.afv__link:focus-visible {
	outline: 2px solid var(--afv-accent);
	outline-offset: 2px;
}

/* Miniatura */

.afv__thumb {
	position: relative;
	flex: 0 0 var(--afv-thumb-width);
	width: var(--afv-thumb-width);
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--afv-thumb-bg);
	border: 1px solid var(--afv-thumb-border);
	border-radius: var(--afv-radius);
}

.afv__thumb .afv__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.35s ease, opacity 0.18s ease;
}

/* Se agotaron los fallbacks: mejor el fondo oscuro que el icono roto. */
.afv__thumb .afv__img--failed {
	opacity: 0;
}

a.afv__link:hover .afv__img {
	transform: scale(var(--afv-zoom));
}

/* Siempre visible. El círculo oscuro garantiza contraste en miniaturas claras. */
.afv__play {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

.afv__play::before {
	content: "";
	position: absolute;
	width: 54px;
	height: 54px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.5);
	transition: background-color 0.18s ease, transform 0.18s ease;
}

.afv__play svg {
	position: relative;
	width: 30px;
	height: 30px;
	margin-left: 2px;
	fill: #fff;
	transition: transform 0.18s ease;
}

a.afv__link:hover .afv__play::before,
a.afv__link:focus-visible .afv__play::before {
	background: rgba(0, 0, 0, 0.7);
	transform: scale(1.08);
}

a.afv__link:hover .afv__play svg,
a.afv__link:focus-visible .afv__play svg {
	transform: scale(1.08);
}

/* Texto */

.afv__content {
	flex: 1 1 auto;
	min-width: 0;
	display: block;
}

.afv__title {
	display: block;
	font-size: 1.3125rem;
	line-height: 1.3;
	color: var(--afv-text);
}

a.afv__link:hover .afv__title {
	color: #000;
}

.afv__subtitle {
	display: block;
	margin-top: 0.35em;
	font-size: 1rem;
	line-height: 1.4;
	color: var(--afv-text-muted);
}

.afv__desc {
	display: block;
	margin-top: 0.35em;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--afv-text-muted);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
	.afv {
		--afv-thumb-width: 160px;
		--afv-gap: 1.5rem;
	}

	.afv__section-title {
		font-size: 1.6rem;
	}
}

@media (max-width: 767px) {
	.afv {
		display: block;
	}

	.afv__tabs {
		width: auto;
		flex-direction: row;
		overflow-x: auto;
		margin-bottom: 1.75rem;
		border: 0;
		border-bottom: 1px solid var(--afv-border);
		scrollbar-width: thin;
		-webkit-overflow-scrolling: touch;
	}

	.afv__tab {
		flex: 0 0 auto;
		padding: 0.55em 1em;
		font-size: 1.125rem;
		border-bottom: 3px solid transparent;
	}

	.afv__tab.is-active {
		background: transparent;
		border-bottom-color: var(--afv-accent);
	}

	.afv__link {
		gap: 1rem;
	}
}

@media (max-width: 480px) {
	.afv {
		--afv-thumb-width: 120px;
	}

	.afv__play::before {
		width: 38px;
		height: 38px;
	}

	.afv__play svg {
		width: 21px;
		height: 21px;
	}

	.afv__title {
		font-size: 1.0625rem;
	}

	.afv__subtitle,
	.afv__desc {
		font-size: 0.9375rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.afv * {
		transition: none !important;
	}

	a.afv__link:hover .afv__img {
		transform: none;
	}
}
