/* Core Block Variables */
.gr-cg-wrapper {
	--gr-cg-gap: 20px;
	--gr-cg-cols: 3;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	box-sizing: border-box;
}

/* Layouts */
.gr-cg-grid {
	display: grid;
	grid-template-columns: repeat(var(--gr-cg-cols), 1fr);
	gap: var(--gr-cg-gap);
}
.gr-cg-masonry {
	column-count: var(--gr-cg-cols);
	column-gap: var(--gr-cg-gap);
}
.gr-cg-masonry .gr-cg-item {
	break-inside: avoid;
	margin-bottom: var(--gr-cg-gap);
	display: inline-block;
	width: 100%;
}
.gr-cg-carousel {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	gap: var(--gr-cg-gap);
	padding-bottom: 10px;
}
.gr-cg-carousel .gr-cg-item {
	flex: 0 0 calc((100% / var(--gr-cg-cols)) - var(--gr-cg-gap));
	scroll-snap-align: start;
}

/* Responsive Overrides */
@media (max-width: 1024px) { .gr-cg-resp-1-2-3, .gr-cg-resp-1-3-4 { --gr-cg-cols: 2 !important; } }
@media (max-width: 600px) {
	.gr-cg-resp-1-2-3, .gr-cg-resp-1-3-4, .gr-cg-resp-stack { --gr-cg-cols: 1 !important; }
	.gr-cg-masonry { column-count: 1; }
}

/* Card Design */
.gr-cg-item {
	position: relative;
	background: #1a1a1a;
	overflow: hidden;
	cursor: pointer;
	border-radius: var(--gr-cg-radius, 0px);
	transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.3s ease;
}
.gr-cg-style-rounded { --gr-cg-radius: 8px; }
.gr-cg-style-cinematic { --gr-cg-radius: 12px; box-shadow: 0 10px 20px rgba(0,0,0,0.3); padding: 15px; border: 1px solid #FFF; border-radius: 15px;
}

/* Aspect Ratios */
.gr-cg-ratio-16-9 .gr-cg-thumb { aspect-ratio: 16 / 9; }
.gr-cg-ratio-4-3 .gr-cg-thumb { aspect-ratio: 4 / 3; }
.gr-cg-ratio-1-1 .gr-cg-thumb { aspect-ratio: 1 / 1; }
.gr-cg-ratio-9-16 .gr-cg-thumb { aspect-ratio: 9 / 16; }
.gr-cg-ratio-21-9 .gr-cg-thumb { aspect-ratio: 21 / 9; }

/* Thumbnails & Overlays */
.gr-cg-thumb {
	width: 100%;
	background-size: cover;
	background-position: center;
	transition: transform 0.6s ease;
}
.gr-cg-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0,0,0,var(--gr-cg-overlay-opacity)) 0%, rgba(0,0,0,0) 60%);
	transition: background 0.3s ease;
	z-index: 1;
}

/* Hover Effects */
.gr-cg-hover-zoom:hover .gr-cg-thumb { transform: scale(1.05); }
.gr-cg-hover-zoom-darken:hover .gr-cg-thumb { transform: scale(1.05); filter: brightness(0.7); }
.gr-cg-hover-lift:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.4); }

/* Play Icon */
.gr-cg-play-icon {
	position: absolute;
	top: 50%; left: 50%;
	transform: translate(-50%, -50%);
	z-index: 2;
	width: 60px; height: 60px;
	border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	color: #fff;
	transition: all 0.3s ease;
}
.gr-cg-play-center-solid { background: rgba(220, 38, 38, 0.9); box-shadow: 0 4px 15px rgba(0,0,0,0.3); }
.gr-cg-play-outline { background: rgba(0,0,0,0.5); border: 2px solid #fff; backdrop-filter: blur(4px); }
.gr-cg-play-animated { background: #dc2626; animation: gr-cg-pulse 2s infinite; }
.gr-cg-item:hover .gr-cg-play-icon { transform: translate(-50%, -50%) scale(1.1); }
.gr-cg-play-icon::after { content: ''; display: block; border-style: solid; border-width: 10px 0 10px 16px; border-color: transparent transparent transparent #fff; margin-left: 4px; }

@keyframes gr-cg-pulse {
	0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); }
	70% { box-shadow: 0 0 0 15px rgba(220, 38, 38, 0); }
	100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* Metadata */
.gr-cg-meta {
	position: absolute;
	bottom: 0; left: 0; right: 0;
	padding: 20px;
	z-index: 3;
	color: #fff;
}
.gr-cg-title { margin: 0 0 5px 0; font-size: 18px; line-height: 1.3; font-weight: 700; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.gr-cg-excerpt { font-size: 13px; margin: 0 0 10px 0; opacity: 0.8; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gr-cg-tags { display: flex; gap: 10px; font-size: 12px; font-weight: 600; text-transform: uppercase; }
.gr-cg-duration { background: rgba(0,0,0,0.7); padding: 3px 6px; border-radius: 3px; backdrop-filter: blur(4px); }
.gr-cg-cat { color: #dc2626; }

/* Type Styles */
.gr-cg-type-bold .gr-cg-title { font-weight: 900; text-transform: uppercase; letter-spacing: 0.5px; }
.gr-cg-type-minimal .gr-cg-title { font-weight: 400; font-size: 16px; }

/* Lightbox Modal System */
.gr-lightbox-active { overflow: hidden !important; }
.gr-lightbox-overlay {
	position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
	background: rgba(0,0,0, var(--gr-lb-dim, 0.9));
	z-index: 999999;
	display: flex; align-items: center; justify-content: center;
	opacity: 0;
	transition: opacity 0.4s ease;
}
.gr-lightbox-overlay.gr-lb-blur { backdrop-filter: blur(10px); }
.gr-lightbox-overlay.gr-lb-show { opacity: 1; }

.gr-lightbox-container {
	position: relative;
	width: 90%; max-width: 1200px;
	aspect-ratio: 16/9;
	background: #000;
	box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
	opacity: 0; transform: scale(0.95);
	transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.gr-lightbox-overlay.gr-lb-show .gr-lightbox-container { opacity: 1; transform: scale(1); }

/* Fullscreen Mode */
.gr-lightbox-mode-fullscreen .gr-lightbox-container { width: 100vw; height: 100vh; max-width: none; aspect-ratio: auto; }

.gr-lightbox-iframe, .gr-lightbox-video { width: 100%; height: 100%; border: none; outline: none; }

/* Lightbox Controls */
.gr-lb-btn {
	position: absolute;
	background: rgba(0,0,0,0.5); color: #fff;
	border: none; border-radius: 50%;
	width: 50px; height: 50px;
	display: flex; align-items: center; justify-content: center;
	cursor: pointer; z-index: 10;
	transition: background 0.2s;
}
.gr-lb-btn:hover { background: #dc2626; }
.gr-lb-close { top: -60px; right: 0; }
.gr-lightbox-mode-fullscreen .gr-lb-close { top: 20px; right: 20px; }
.gr-lb-prev { left: -70px; top: 50%; transform: translateY(-50%); }
.gr-lb-next { right: -70px; top: 50%; transform: translateY(-50%); }

.gr-lb-btn::before { content: ''; display: block; width: 12px; height: 12px; border-top: 2px solid #fff; border-right: 2px solid #fff; }
.gr-lb-close::before { transform: rotate(45deg) translate(2px, 2px); border-bottom: 2px solid #fff; border-left: 2px solid #fff; border:none; width: 20px; height: 2px; background: #fff; position: absolute; }
.gr-lb-close::after { content: ''; position: absolute; width: 20px; height: 2px; background: #fff; transform: rotate(-45deg); }
.gr-lb-prev::before { transform: rotate(-135deg); margin-left: 4px; }
.gr-lb-next::before { transform: rotate(45deg); margin-right: 4px; }

@media (max-width: 1400px) {
	.gr-lb-prev { left: 10px; } .gr-lb-next { right: 10px; }
	.gr-lb-close { top: -40px; right: 0; width: 30px; height: 30px; }
}

.gr-lb-title-bar {
	position: absolute; bottom: 100%; left: 0; width: 100%;
	color: #fff; padding-bottom: 10px; font-size: 18px; font-weight: bold;
}
.gr-lightbox-mode-fullscreen .gr-lb-title-bar { bottom: 20px; left: 20px; width: auto; z-index: 10; text-shadow: 0 2px 4px #000; }