/* =============================================================================
   Julia Zimmerman Widgets — YouTube Grid
   ============================================================================= */

/* Grid container */
.jzw-youtube-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	column-gap: 20px;
	row-gap: 20px;
	width: 100%;
}

/* Card — column flex so info area can grow and push meta to the bottom */
.jzw-video-card {
	display: flex;
	flex-direction: column;
	background-color: #fff;
	overflow: hidden;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	height: 100%; /* fills the grid cell so all cards in a row are equal height */
}

.jzw-video-card:hover {
	transform: translateY(-3px);
}

/* Thumbnail wrapper — maintains aspect ratio */
.jzw-video-thumb-wrap {
	position: relative;
	width: 100%;
	padding-bottom: 56.25%; /* 16:9 default, overridden by Elementor selector */
	overflow: hidden;
	background-color: #000;
}

.jzw-video-thumb {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}

.jzw-video-card:hover .jzw-video-thumb {
	transform: scale(1.04);
}

/* Overlay */
.jzw-video-overlay {
	position: absolute;
	inset: 0;
	background-color: transparent;
	transition: background-color 0.25s ease;
}

/* Play button */
.jzw-play-btn {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) scale(0.85);
	width: 56px;
	height: 56px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background-color: rgba(0, 0, 0, 0.55);
	opacity: 0;
	transition: opacity 0.25s ease, transform 0.25s ease;
	pointer-events: none;
}

.jzw-play-btn svg {
	fill: #fff;
	width: 60%;
	height: 60%;
	margin-left: 4px; /* optical center for play triangle */
}

.jzw-video-card:hover .jzw-play-btn {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

/* Link reset */
.jzw-video-thumb-link {
	display: block;
	text-decoration: none;
	color: inherit;
}

/* Info area — flex column so meta always sticks to the bottom */
.jzw-video-info {
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex: 1; /* stretch to fill remaining card height */
}

/* Title */
.jzw-video-title {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.4;
	font-weight: 600;
}

.jzw-video-title a {
	color: inherit;
	text-decoration: none;
}

/* hover underline is controlled via Elementor switcher — no default here */
.jzw-video-title a:hover {
	text-decoration: none;
}

/* Meta — pushed to bottom of the info area */
.jzw-video-meta {
	margin: 0;
	margin-top: auto;
	font-size: 0.8rem;
	color: #888;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

/* Icon shown only when .jzw-has-icon is present */
.jzw-video-date.jzw-has-icon::before {
	content: "📅 ";
	font-style: normal;
}

.jzw-video-views::before {
	content: "▶ ";
}

/* Description */
.jzw-video-description {
	margin: 0;
	font-size: 0.85rem;
	color: #555;
	line-height: 1.5;
}

/* Notice / error states */
.jzw-notice {
	padding: 16px 20px;
	background-color: #f9f9f9;
	border-left: 4px solid #ccc;
	font-size: 0.9rem;
	color: #333;
	border-radius: 4px;
}

.jzw-notice.jzw-error {
	border-color: #dc3232;
	background-color: #fdf3f3;
	color: #dc3232;
}

/* =============================================================================
   Lightbox
   ============================================================================= */

.jzw-lightbox {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 99999;
	background-color: rgba(0, 0, 0, 0.88);
	align-items: center;
	justify-content: center;
}

.jzw-lightbox.is-open {
	display: flex;
}

.jzw-lightbox-inner {
	position: relative;
	width: 90vw;
	max-width: 960px;
}

.jzw-lightbox-inner::before {
	content: "";
	display: block;
	padding-bottom: 56.25%;
}

.jzw-lightbox-inner iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.jzw-lightbox-close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 40px;
	height: 40px;
	border: none;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	font-size: 1.4rem;
	line-height: 1;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.2s ease;
}

.jzw-lightbox-close:hover {
	background: rgba(255, 255, 255, 0.3);
}

/* =============================================================================
   Responsive fallbacks (overridden by Elementor responsive selectors)
   ============================================================================= */

@media (max-width: 1024px) {
	.jzw-youtube-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 767px) {
	.jzw-youtube-grid {
		grid-template-columns: 1fr;
	}
}
