/**
 * Syspro YouTube Gallery - front-end styles.
 *
 * Defaults intentionally mirror YouTube's own grid so the gallery looks
 * right out of the box. Every value here is overridable by the Elementor
 * Style tab, which emits higher-specificity rules scoped to the widget.
 */

.syt-gallery {
	font-family: "Roboto", "Arial", "Helvetica Neue", Helvetica, sans-serif;
	color: #0f0f0f;
	-webkit-font-smoothing: antialiased;
}

.syt-gallery *,
.syt-gallery *::before,
.syt-gallery *::after {
	box-sizing: border-box;
}

/* -------------------------------------------------------------------------
 * Toolbar: search (left) + filter (right)
 * ---------------------------------------------------------------------- */
.syt-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px;
	margin: 0 0 20px;
}

.syt-toolbar-left {
	display: flex;
	align-items: center;
	flex: 0 1 auto;
	min-width: 0;
}

.syt-toolbar-right {
	display: flex;
	align-items: center;
	flex: 1 1 auto;
	justify-content: flex-end;
	min-width: 0;
}

/* When only one of the two is present, let it take the natural side. */
.syt-toolbar-left:empty {
	display: none;
}

/* -------------------------------------------------------------------------
 * Search field
 * ---------------------------------------------------------------------- */
.syt-search {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 280px;
	max-width: 100%;
	padding: 0 12px;
	border: 1px solid #ccc;
	border-radius: 8px;
	background: #ffffff;
	transition: border-color .15s ease;
}

.syt-search:focus-within {
	border-color: #0f0f0f;
}

.syt-search-icon {
	display: inline-flex;
	align-items: center;
	flex: none;
	color: #606060;
}

.syt-search-input {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	border: 0;
	outline: none;
	background: transparent;
	padding: 9px 0;
	font-family: inherit;
	font-size: 14px;
	color: #0f0f0f;
	box-shadow: none;
}

.syt-search-input::placeholder {
	color: #909090;
	opacity: 1;
}

/* Hide the native clear button for a cleaner look. */
.syt-search-input::-webkit-search-decoration,
.syt-search-input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

/* -------------------------------------------------------------------------
 * Filter: chips and dropdown
 * ---------------------------------------------------------------------- */
.syt-filter {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin: 0;
	padding: 0;
}

.syt-filter--dropdown {
	flex: none;
}

.syt-filter-select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	max-width: 100%;
	padding: 8px 36px 8px 14px;
	border: 1px solid #ccc;
	border-radius: 8px;
	background-color: #f2f2f2;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23606060' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	color: #0f0f0f;
	cursor: pointer;
}

.syt-filter-select:focus {
	outline: none;
	border-color: #0f0f0f;
}

.syt-chip {
	display: inline-flex;
	align-items: center;
	height: 32px;
	padding: 0 12px;
	border: 0;
	border-radius: 8px;
	background: #f2f2f2;
	color: #0f0f0f;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.syt-chip:hover {
	background: #e5e5e5;
}

.syt-chip.is-active {
	background: #0f0f0f;
	color: #ffffff;
}

/* -------------------------------------------------------------------------
 * Grid
 * ---------------------------------------------------------------------- */
.syt-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 16px;
}

/* -------------------------------------------------------------------------
 * Card
 * ---------------------------------------------------------------------- */
.syt-card {
	display: block;
	color: inherit;
	text-decoration: none;
}

.syt-card:focus-visible {
	outline: 2px solid #065fd4;
	outline-offset: 2px;
}

.syt-thumb {
	position: relative;
	aspect-ratio: 16 / 9;
	border-radius: 12px;
	overflow: hidden;
	background: #e5e5e5;
}

/* Fallback for older browsers without aspect-ratio support. */
@supports not (aspect-ratio: 16 / 9) {
	.syt-thumb {
		height: 0;
		padding-bottom: 56.25%;
	}
}

.syt-thumb img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .25s ease;
}

/* Hover tint layer. Transparent by default; the Elementor "overlay on hover"
   control paints this in. */
.syt-thumb::after {
	content: "";
	position: absolute;
	inset: 0;
	background: transparent;
	pointer-events: none;
	transition: background-color .2s ease;
}

.syt-duration {
	position: absolute;
	right: 8px;
	bottom: 8px;
	z-index: 2;
	padding: 3px 4px;
	border-radius: 4px;
	background: rgba(0, 0, 0, .8);
	color: #ffffff;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: .3px;
}

/* Center play glyph. Hidden by default (YouTube grids show no play button);
   the Elementor "show play icon on hover" control fades it in. */
.syt-play {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 2;
	width: 48px;
	height: 48px;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: rgba(0, 0, 0, .65);
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease;
}

.syt-play::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-44%, -50%);
	border-style: solid;
	border-width: 9px 0 9px 15px;
	border-color: transparent transparent transparent #ffffff;
}

.syt-info {
	padding-top: 12px;
}

.syt-title {
	margin: 0;
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
	color: #0f0f0f;
	overflow: hidden;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	word-break: break-word;
}

.syt-title.syt-lines-1 {
	-webkit-line-clamp: 1;
}

.syt-title.syt-lines-2 {
	-webkit-line-clamp: 2;
}

.syt-title.syt-lines-3 {
	-webkit-line-clamp: 3;
}

.syt-meta {
	margin-top: 4px;
	font-size: 12px;
	font-weight: 400;
	line-height: 18px;
	color: #606060;
}

/* -------------------------------------------------------------------------
 * Load more
 * ---------------------------------------------------------------------- */
.syt-loadmore-wrap {
	display: flex;
	justify-content: center;
	margin-top: 24px;
}

.syt-loadmore {
	border: 0;
	border-radius: 18px;
	padding: 10px 16px;
	background: #f2f2f2;
	color: #0f0f0f;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.syt-loadmore:hover {
	background: #e5e5e5;
}

.syt-loadmore[hidden] {
	display: none;
}

/* -------------------------------------------------------------------------
 * Empty search results
 * ---------------------------------------------------------------------- */
.syt-noresults {
	margin: 8px 0 0;
	padding: 24px 0;
	text-align: center;
	color: #606060;
	font-size: 14px;
}

.syt-noresults[hidden] {
	display: none;
}

/* -------------------------------------------------------------------------
 * Toolbar responsive: stack search above the filter on narrow screens
 * ---------------------------------------------------------------------- */
@media (max-width: 600px) {
	.syt-toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.syt-toolbar-right {
		justify-content: flex-start;
	}

	.syt-search {
		width: 100%;
	}

	/* Let chips scroll horizontally instead of stacking tall. */
	.syt-filter--chips {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.syt-filter--chips::-webkit-scrollbar {
		display: none;
	}

	.syt-chip {
		flex: none;
	}

	.syt-filter--dropdown,
	.syt-filter-select {
		width: 100%;
	}
}

/* -------------------------------------------------------------------------
 * Admin "no videos yet" notice
 * ---------------------------------------------------------------------- */
.syt-empty {
	padding: 20px 24px;
	border: 1px dashed #c4c4c4;
	border-radius: 8px;
	background: #fafafa;
	color: #444;
	font-family: "Roboto", "Arial", sans-serif;
	font-size: 14px;
	line-height: 1.6;
}

.syt-empty a {
	color: #065fd4;
}

/* -------------------------------------------------------------------------
 * Lightbox
 * ---------------------------------------------------------------------- */
.syt-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(0, 0, 0, .9);
}

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

.syt-lightbox-inner {
	position: relative;
	width: 100%;
	max-width: 960px;
}

.syt-lightbox-frame {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: 8px;
	overflow: hidden;
}

@supports not (aspect-ratio: 16 / 9) {
	.syt-lightbox-frame {
		height: 0;
		padding-bottom: 56.25%;
	}
}

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

.syt-lightbox-close {
	position: absolute;
	top: -42px;
	right: 0;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #ffffff;
	font-size: 30px;
	line-height: 36px;
	cursor: pointer;
}

.syt-lightbox-close:hover {
	opacity: .8;
}

@media (max-width: 480px) {
	.syt-lightbox-close {
		top: -38px;
		font-size: 26px;
	}
}
