/* ============================================
   Video Display Grid Creator - Frontend Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600&display=swap');

/* Grid layout */
.vdgc-grid {
	display: grid !important;
	gap: 24px !important;
	margin: 0 0 30px !important;
	box-sizing: border-box;
}

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

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

@media (max-width: 600px) {
	.vdgc-cols-2,
	.vdgc-cols-3,
	.vdgc-cols-4 { grid-template-columns: 1fr !important; }
}

/* Grid item */
.vdgc-item {
	display: flex !important;
	flex-direction: column !important;
	width: 100% !important;
	box-sizing: border-box !important;
	float: none !important;
}

/* Thumbnail button */
.vdgc-thumb-btn {
	all: unset;
	cursor: pointer;
	display: block;
	width: 100%;
	position: relative;
}

.vdgc-thumb-wrap {
	position: relative;
	width: 100%;
	padding-top: 56.25%; /* 16:9 */
	overflow: hidden;
	border-radius: 6px;
	background: #111;
}

.vdgc-thumb-wrap img,
.vdgc-thumb-placeholder {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease, filter 0.3s ease;
}

.vdgc-thumb-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #1a1a2e;
}

.vdgc-thumb-placeholder svg {
	width: 100%;
	height: 100%;
}

.vdgc-thumb-btn:hover .vdgc-thumb-wrap img,
.vdgc-thumb-btn:focus-visible .vdgc-thumb-wrap img {
	transform: scale(1.04);
	filter: brightness(0.85);
}

/* Play overlay */
.vdgc-play-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

.vdgc-play-icon {
	width: 60px;
	height: 42px;
	filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
	transition: transform 0.2s ease, filter 0.2s ease;
}

.vdgc-play-bg {
	fill: rgba(220, 0, 0, 0.85);
	transition: fill 0.2s ease;
}

.vdgc-play-triangle {
	fill: #fff;
}

.vdgc-thumb-btn:hover .vdgc-play-icon,
.vdgc-thumb-btn:focus-visible .vdgc-play-icon {
	transform: scale(1.12);
}

.vdgc-thumb-btn:hover .vdgc-play-bg {
	fill: rgba(220, 0, 0, 1);
}

/* Video title */
.vdgc-item-title {
	margin: 10px 0 0 !important;
	font-family: 'Oswald', sans-serif !important;
	font-size: 14px !important;
	font-weight: 500 !important;
	color: inherit !important;
	line-height: 1.4 !important;
	text-align: center !important;
	letter-spacing: 0.02em;
}

/* ==================
   Lightbox
   ================== */
.vdgc-lightbox {
	display: none;
	position: fixed;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	z-index: 2147483647 !important; /* maximum possible z-index */
	align-items: center;
	justify-content: center;
}

.vdgc-lightbox.is-active {
	display: flex !important;
}

.vdgc-lightbox.is-active {
	display: flex;
}

.vdgc-lightbox-overlay {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	background: rgba(0, 0, 0, 0.88);
	cursor: pointer;
	z-index: 1 !important;
}

.vdgc-lightbox-inner {
	position: relative;
	z-index: 2 !important;
	width: 90vw;
	max-width: 960px;
	background: #000;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 20px 60px rgba(0,0,0,0.7);
	animation: vdgcFadeIn 0.2s ease;
}

@keyframes vdgcFadeIn {
	from { opacity: 0; transform: scale(0.96); }
	to   { opacity: 1; transform: scale(1); }
}

.vdgc-lightbox-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px;
	background: #111;
}

.vdgc-lightbox-title {
	color: #fff;
	font-size: 0.9em;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: calc(100% - 48px);
}

.vdgc-lightbox-close {
	all: unset;
	cursor: pointer;
	color: #999;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	transition: background 0.15s, color 0.15s;
	flex-shrink: 0;
}

.vdgc-lightbox-close svg {
	width: 18px;
	height: 18px;
}

.vdgc-lightbox-close:hover {
	background: rgba(255,255,255,0.1);
	color: #fff;
}

.vdgc-iframe-wrap {
	position: relative;
	padding-top: 56.25%;
}

.vdgc-iframe-wrap iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Accessibility */
.vdgc-thumb-btn:focus-visible {
	outline: 3px solid #0073aa;
	outline-offset: 2px;
	border-radius: 6px;
}
