/**
 * Estilos modernos para Galería de Playlists de YouTube.
 * 100% responsive y compatible con Divi.
 */

.gpy-container {
	--gpy-primary: #b2000a;
	--gpy-card-bg: #ffffff;
	--gpy-text: #1a1a1a;
	--gpy-muted: #666666;
	--gpy-border: rgba(0, 0, 0, 0.08);
	--gpy-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
	--gpy-radius: 14px;
	--gpy-transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
	
	max-width: 100%;
	margin: 2em auto;
	box-sizing: border-box;
	font-family: inherit;
}

.gpy-container *,
.gpy-container *::before,
.gpy-container *::after {
	box-sizing: inherit;
}

/* Título de la galería si se especificó */
.gpy-main-title {
	font-size: 1.6rem;
	font-weight: 700;
	margin: 0 0 1.2em;
	color: var(--gpy-text);
	border-left: 4px solid var(--gpy-primary);
	padding-left: 12px;
	line-height: 1.25;
}

/* ------------------------------------------------------------------------- */
/* 1. VISOR EXPANDIDO SUPERIOR (Featured Player)                            */
/* ------------------------------------------------------------------------- */

.gpy-featured-player {
	background: #0f0f11;
	border-radius: var(--gpy-radius);
	overflow: hidden;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
	margin-bottom: 2.2em;
	border: 1px solid rgba(255, 255, 255, 0.1);
	transition: var(--gpy-transition);
}

.gpy-video-responsive {
	position: relative;
	width: 100%;
	padding-bottom: 56.25%; /* Relación de aspecto 16:9 */
	height: 0;
	background: #000;
}

.gpy-video-responsive iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Barra inferior del reproductor */
.gpy-player-bar {
	padding: 16px 20px;
	background: #141418;
	color: #fff;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.gpy-player-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #d61f29;
}

.gpy-dot-pulse {
	width: 8px;
	height: 8px;
	background: #d61f29;
	border-radius: 50%;
	display: inline-block;
	box-shadow: 0 0 0 0 rgba(178, 0, 10, 0.75);
	animation: gpyPulse 1.8s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes gpyPulse {
	to {
		box-shadow: 0 0 0 10px rgba(178, 0, 10, 0);
	}
}

.gpy-player-title {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 600;
	color: #ffffff !important;
	line-height: 1.35;
}

/* ------------------------------------------------------------------------- */
/* 2. CUADRÍCULA DE MINIATURAS (Thumbnail Grid)                              */
/* ------------------------------------------------------------------------- */

.gpy-grid {
	display: grid;
	gap: 20px;
}

.gpy-cols-2 { grid-template-columns: repeat(2, 1fr); }
.gpy-cols-3 { grid-template-columns: repeat(3, 1fr); }
.gpy-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
	.gpy-cols-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
	.gpy-cols-4,
	.gpy-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
	.gpy-cols-4,
	.gpy-cols-3,
	.gpy-cols-2 { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------------- */
/* 3. TARJETAS DE VIDEO                                                      */
/* ------------------------------------------------------------------------- */

.gpy-card {
	background: var(--gpy-card-bg);
	border-radius: var(--gpy-radius);
	overflow: hidden;
	border: 1px solid var(--gpy-border);
	box-shadow: var(--gpy-shadow);
	cursor: pointer;
	display: flex;
	flex-direction: column;
	transition: var(--gpy-transition);
	position: relative;
	user-select: none;
	outline: none;
}

.gpy-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
	border-color: rgba(178, 0, 10, 0.4);
}

.gpy-card:focus-visible {
	box-shadow: 0 0 0 3px var(--gpy-primary);
}

/* Video actualmente activo */
.gpy-card.gpy-is-active {
	border-color: var(--gpy-primary);
	box-shadow: 0 0 0 2px var(--gpy-primary), 0 12px 24px rgba(178, 0, 10, 0.18);
	transform: scale(0.98);
}

/* Miniatura y Play button */
.gpy-thumb-wrap {
	position: relative;
	width: 100%;
	padding-bottom: 56.25%; /* 16:9 */
	background: #111;
	overflow: hidden;
}

.gpy-thumb {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.gpy-card:hover .gpy-thumb {
	transform: scale(1.06);
}

/* Capa de overlay oscuro */
.gpy-thumb-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: var(--gpy-transition);
}

.gpy-card:hover .gpy-thumb-overlay {
	background: rgba(0, 0, 0, 0.45);
}

/* Botón de reproducción */
.gpy-play-btn {
	width: 48px;
	height: 48px;
	background: rgba(178, 0, 10, 0.92);
	color: #ffffff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
	transition: transform 0.25s ease, background 0.25s ease;
}

.gpy-play-icon {
	width: 22px;
	height: 22px;
	margin-left: 3px;
}

.gpy-card:hover .gpy-play-btn {
	transform: scale(1.15);
	background: #b2000a;
}

/* Etiqueta de "Activo" en la miniatura */
.gpy-playing-pill {
	position: absolute;
	top: 10px;
	right: 10px;
	background: var(--gpy-primary);
	color: #fff;
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 3px 8px;
	border-radius: 999px;
	display: none;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.gpy-card.gpy-is-active .gpy-playing-pill {
	display: inline-block;
}

/* Info del video (Título y fecha) */
.gpy-card-info {
	padding: 14px 16px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex-grow: 1;
}

.gpy-card-title {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.35;
	color: var(--gpy-text) !important;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: color 0.2s ease;
}

.gpy-card.gpy-is-active .gpy-card-title,
.gpy-card:hover .gpy-card-title {
	color: var(--gpy-primary) !important;
}

.gpy-card-date {
	font-size: 0.8rem;
	color: var(--gpy-muted);
}

/* ------------------------------------------------------------------------- */
/* 4. MENSAJES Y ALERTAS                                                     */
/* ------------------------------------------------------------------------- */

.gpy-alert {
	padding: 14px 18px;
	border-radius: 10px;
	font-size: 0.95rem;
	margin: 1.5em 0;
}

.gpy-alert-warning {
	background: #fff8e6;
	color: #8a6200;
	border: 1px solid #ffd980;
}

.gpy-alert-error {
	background: #fde8e8;
	color: #9b1c1c;
	border: 1px solid #f8b4b4;
}
