.hse-yt {
	--hse-yt-accent: var(--primary-color, #d71920);
	margin: 0 0 2em;
}

.hse-yt__grid {
	display: grid;
	grid-template-columns: repeat(var(--hse-yt-cols, 3), minmax(0, 1fr));
	gap: 30px 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* El selector es más específico que ".col-inner ul li" del tema, que agrega un margen izquierdo a cada ítem. */
.hse-yt .hse-yt__grid > .hse-yt__item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.hse-yt__item[hidden] {
	display: none;
}

/* El tema pinta los enlaces en hover con su propio color; el título conserva el del texto de la página. */
.hse-yt__card,
.hse-yt__card:hover,
.hse-yt__card:focus,
.hse-yt__card:active {
	display: block;
	color: inherit;
	text-decoration: none;
	border-radius: 6px;
}

.hse-yt__thumb {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 6px;
	background: #111;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
	transition: box-shadow .2s, transform .2s;
}

.hse-yt__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
}

.hse-yt__play {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 60px;
	height: 60px;
	margin: -30px 0 0 -30px;
	border-radius: 50%;
	background: rgba(0, 0, 0, .65);
	transition: background .2s, transform .2s;
}

.hse-yt__play::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	margin: -11px 0 0 -7px;
	border-style: solid;
	border-width: 11px 0 11px 19px;
	border-color: transparent transparent transparent #fff;
}

.hse-yt__title {
	display: block;
	margin-top: .7em;
	font-weight: 700;
	font-size: 1.05em;
	line-height: 1.35;
}

.hse-yt__card:hover .hse-yt__thumb,
.hse-yt__card:focus-visible .hse-yt__thumb {
	box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
	transform: translateY(-2px);
}

.hse-yt__card:hover .hse-yt__play,
.hse-yt__card:focus-visible .hse-yt__play {
	background: var(--hse-yt-accent);
	transform: scale(1.08);
}

.hse-yt__card:focus-visible {
	outline: 3px solid var(--hse-yt-accent);
	outline-offset: 4px;
}

/* Paginación */
.hse-yt {
	scroll-margin-top: 110px;
}

.hse-yt__pager {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-top: 40px;
}

.hse-yt__pager .hse-yt__page {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: 42px;
	min-height: 0;
	height: 42px;
	margin: 0;
	padding: 0 12px;
	border: 1px solid rgba(6, 48, 58, .25);
	border-radius: 6px !important;
	background: transparent;
	box-shadow: none;
	color: inherit;
	font-size: 1em;
	font-weight: 700;
	letter-spacing: 0;
	line-height: 1;
	text-transform: none;
	cursor: pointer;
	transition: background .2s, color .2s, border-color .2s;
}

.hse-yt__pager .hse-yt__page:hover:not(:disabled),
.hse-yt__pager .hse-yt__page:focus-visible {
	border-color: var(--hse-yt-accent);
	background: var(--hse-yt-accent);
	color: #fff;
}

.hse-yt__pager .hse-yt__page[aria-current="page"] {
	border-color: var(--hse-yt-accent);
	background: var(--hse-yt-accent);
	color: #fff;
	cursor: default;
}

.hse-yt__pager .hse-yt__page:disabled {
	opacity: .35;
	cursor: default;
}

.hse-yt__gap {
	align-self: center;
	min-width: 20px;
	text-align: center;
}

/* Flechas anterior / siguiente, dibujadas con bordes para no depender de la tipografía. */
.hse-yt__page--prev::before,
.hse-yt__page--next::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 8px;
	height: 8px;
	margin: -4px 0 0 -4px;
	border: solid currentColor;
	border-width: 0 0 2px 2px;
	transform: translateX(2px) rotate(45deg);
}

.hse-yt__page--next::before {
	transform: translateX(-2px) rotate(-135deg);
}

.hse-yt-aviso {
	padding: 1em 1.2em;
	border-left: 4px solid var(--primary-color, #d71920);
	background: rgba(0, 0, 0, .04);
}

@media (max-width: 849px) {
	.hse-yt__grid {
		grid-template-columns: repeat(min(var(--hse-yt-cols, 3), 2), minmax(0, 1fr));
	}
}

@media (max-width: 549px) {
	.hse-yt__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 24px;
	}
}

/* Ventana del reproductor */
.hse-yt-modal {
	width: min(960px, 92vw);
	max-width: none;
	max-height: none;
	margin: auto;
	padding: 0;
	border: 0;
	background: transparent;
	overflow: visible;
}

.hse-yt-modal::backdrop {
	background: rgba(0, 0, 0, .85);
}

.hse-yt-modal__stage {
	aspect-ratio: 16 / 9;
	background: #000;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}

.hse-yt-modal__stage iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.hse-yt-modal__close {
	position: absolute;
	top: -46px;
	right: 0;
	box-sizing: border-box;
	width: 40px;
	height: 40px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50% !important;
	background: rgba(255, 255, 255, .2);
	cursor: pointer;
	box-shadow: none;
	transition: background .2s;
}

/* La X se dibuja con dos barras para que no dependa de la tipografía del tema. */
.hse-yt-modal__close::before,
.hse-yt-modal__close::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 20px;
	height: 3px;
	margin: -1.5px 0 0 -10px;
	border-radius: 2px;
	background: #fff;
	transform: rotate(45deg);
}

.hse-yt-modal__close::after {
	transform: rotate(-45deg);
}

.hse-yt-modal__close:hover,
.hse-yt-modal__close:focus-visible {
	background: var(--primary-color, #d71920);
}

.hse-yt-modal__yt {
	display: table;
	margin: 12px auto 0;
	color: #fff;
	font-size: .9em;
	text-align: center;
	opacity: .8;
}

.hse-yt-modal__yt:hover {
	color: #fff;
	opacity: 1;
}

html.hse-yt-lock {
	overflow: hidden;
}
