/**
 * YT Elementor Widgets — frontend styles.
 */

.yte-widget {
	position: relative;
}

.yte-items {
	--yte-columns: 3;
	--yte-gap: 24px;

	display: grid;
	grid-template-columns: repeat(var(--yte-columns), minmax(0, 1fr));
	gap: var(--yte-gap);
}

.yte-items--list {
	grid-template-columns: 1fr;
}

.yte-items--list .yte-card {
	display: grid;
	grid-template-columns: minmax(140px, 34%) 1fr;
	align-items: start;
	gap: var(--yte-gap);
}

.yte-items--masonry {
	display: block;
	column-count: var(--yte-columns);
	column-gap: var(--yte-gap);
}

.yte-items--masonry .yte-card {
	break-inside: avoid;
	margin-bottom: var(--yte-gap);
	display: inline-block;
	width: 100%;
}

.yte-items--carousel {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: thin;
	padding-bottom: 8px;
}

.yte-items--carousel .yte-card {
	flex: 0 0 calc((100% - (var(--yte-columns) - 1) * var(--yte-gap)) / var(--yte-columns));
	scroll-snap-align: start;
	margin-right: var(--yte-gap);
}

.yte-items--carousel .yte-card:last-child {
	margin-right: 0;
}

/* Card */
.yte-card {
	position: relative;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.yte-card__media {
	--yte-ratio: 16-9;

	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #0000000d;
}

.yte-card__media[style*="height"] {
	aspect-ratio: auto;
}

.yte-card__media:has(> .yte-card__link) {
	line-height: 0;
}

.yte-card__link {
	display: block;
	position: relative;
	width: 100%;
	height: 100%;
}

.yte-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease, filter 0.4s ease;
}

.yte-card__media::after {
	content: "";
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
}

.yte-card--hover-zoom:hover .yte-card__img {
	transform: scale(1.07);
}

.yte-card--hover-zoom-out .yte-card__img {
	transform: scale(1.08);
}

.yte-card--hover-zoom-out:hover .yte-card__img {
	transform: scale(1);
}

.yte-card--hover-grayscale .yte-card__img {
	filter: grayscale(1);
}

.yte-card--hover-grayscale:hover .yte-card__img {
	filter: grayscale(0);
}

.yte-card--hover-blur:hover .yte-card__img {
	filter: blur(3px);
}

.yte-card__play {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 1em;
	height: 0.7em;
	font-size: 56px;
	color: #ff0000;
	pointer-events: none;
	transition: transform 0.25s ease, opacity 0.25s ease;
	opacity: 0.92;
}

.yte-card__play svg {
	width: 100%;
	height: 100%;
	display: block;
}

.yte-card__play-bg {
	fill: currentColor;
}

.yte-card:hover .yte-card__play {
	transform: scale(1.1);
	opacity: 1;
}

.yte-card__badge {
	position: absolute;
	right: 8px;
	bottom: 8px;
	padding: 2px 6px;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.8);
	color: #fff;
	font-size: 12px;
	line-height: 1.4;
	font-weight: 600;
}

.yte-card__badge--live {
	left: 8px;
	right: auto;
	top: 8px;
	bottom: auto;
	background: #ff0000;
}

.yte-card__badge--upcoming {
	left: 8px;
	right: auto;
	top: 8px;
	bottom: auto;
	background: #1f6feb;
}

.yte-card__badge--count {
	left: 8px;
	right: auto;
}

.yte-card__body {
	padding: 12px 0 0;
}

.yte-card__title {
	margin: 0 0 8px;
	font-size: 1rem;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.yte-card__title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.yte-card__desc {
	margin: 0 0 8px;
	font-size: 0.875rem;
	opacity: 0.85;
}

.yte-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	font-size: 0.8125rem;
	opacity: 0.75;
}

.yte-card__meta-item + .yte-card__meta-item::before {
	content: "·";
	margin-right: 12px;
}

.yte-card__player {
	position: absolute;
	inset: 0;
	background: #000;
}

.yte-card__player iframe {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

/* Buttons */
.yte-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 18px;
	border: 0;
	border-radius: 6px;
	background: #ff0000;
	color: #fff;
	font-size: 0.9375rem;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.yte-button:hover {
	opacity: 0.9;
	color: #fff;
}

.yte-card__button {
	margin-top: 12px;
}

.yte-loadmore,
.yte-pagination {
	display: flex;
	justify-content: center;
	gap: 12px;
	margin-top: 24px;
}

.yte-loadmore__btn.is-loading {
	opacity: 0.6;
	pointer-events: none;
}

.yte-sentinel {
	height: 1px;
	width: 100%;
}

.yte-notice {
	padding: 12px 16px;
	border: 1px dashed currentColor;
	border-radius: 6px;
	opacity: 0.75;
	font-size: 0.9375rem;
}

.yte-carousel-nav {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 12px;
}

.yte-carousel-nav__btn {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1px solid currentColor;
	background: transparent;
	color: inherit;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

/* Lightbox */
.yte-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.9);
	padding: 24px;
}

.yte-lightbox__inner {
	position: relative;
	width: min(1100px, 100%);
	aspect-ratio: 16 / 9;
}

.yte-lightbox iframe {
	width: 100%;
	height: 100%;
	border: 0;
}

.yte-lightbox__close {
	position: absolute;
	top: -44px;
	right: 0;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: #000;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

@media (max-width: 767px) {
	.yte-items--list .yte-card {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.yte-card,
	.yte-card__img,
	.yte-card__play {
		transition: none;
	}
}
