/* YouTube Shorts Grid */
.ysg-wrap {
	--ysg-cols: 4;
	--ysg-accent: #1f7a1f;
	max-width: 100%;
	box-sizing: border-box;
}
.ysg-wrap *,
.ysg-wrap *::before,
.ysg-wrap *::after { box-sizing: border-box; }

.ysg-toolbar { margin: 0 0 1.25rem; }
.ysg-search {
	width: 100%;
	max-width: 460px;
	padding: .75rem 1.1rem;
	font-size: 1.05rem;
	border: 1px solid #d4d4d4;
	border-radius: 999px;
	outline: none;
	transition: border-color .15s, box-shadow .15s;
}
.ysg-search:focus {
	border-color: var(--ysg-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--ysg-accent) 25%, transparent);
}

.ysg-grid {
	display: grid;
	grid-template-columns: repeat(var(--ysg-cols), minmax(0, 1fr));
	gap: 1.1rem;
}

.ysg-card {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	cursor: pointer;
	background: #fff;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 2px 10px rgba(0,0,0,.10);
	transition: transform .18s ease, box-shadow .18s ease;
}
.ysg-card:hover,
.ysg-card:focus-visible {
	transform: translateY(-3px);
	box-shadow: 0 10px 26px rgba(0,0,0,.18);
}
.ysg-card[hidden] { display: none !important; }

.ysg-thumb {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 9 / 16;
	background: #111;
	overflow: hidden;
}
.ysg-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.ysg-play {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: .85;
	transition: opacity .18s;
}
.ysg-card:hover .ysg-play { opacity: 1; }

.ysg-views {
	position: absolute;
	left: 8px;
	bottom: 8px;
	background: rgba(0,0,0,.72);
	color: #fff;
	font-size: .72rem;
	font-weight: 600;
	line-height: 1;
	padding: .35em .6em;
	border-radius: 999px;
	letter-spacing: .02em;
}
.ysg-body {
	display: block;
	padding: .75rem .85rem .95rem;
}
.ysg-title {
	display: -webkit-box;
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.3;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.ysg-desc {
	display: -webkit-box;
	margin-top: .4rem;
	font-size: .9rem;
	font-weight: 400;
	line-height: 1.45;
	color: #5f6368;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ysg-empty {
	padding: 1.5rem 0;
	color: #666;
	font-style: italic;
}
.ysg-notice {
	padding: 1rem 1.2rem;
	background: #fff6f6;
	border: 1px solid #f0c2c2;
	border-radius: 8px;
	color: #8a1f1f;
}

/* Modal / lightbox */
.ysg-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
}
.ysg-modal[hidden] { display: none; }
.ysg-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,.82);
	backdrop-filter: blur(2px);
}
.ysg-modal-inner {
	position: relative;
	width: min(92vw, 420px);
	aspect-ratio: 9 / 16;
	max-height: 92vh;
	background: #000;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.ysg-player, .ysg-player iframe {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}
.ysg-close {
	position: absolute;
	top: -44px;
	right: 0;
	width: 38px;
	height: 38px;
	font-size: 28px;
	line-height: 1;
	color: #fff;
	background: transparent;
	border: 0;
	cursor: pointer;
	z-index: 2;
}
@media (max-width: 480px) {
	.ysg-close { top: 6px; right: 6px; background: rgba(0,0,0,.5); border-radius: 50%; }
}

/* Responsive columns */
@media (max-width: 1024px) { .ysg-grid { grid-template-columns: repeat(min(var(--ysg-cols), 3), minmax(0, 1fr)); } }
@media (max-width: 680px)  { .ysg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 380px)  { .ysg-grid { grid-template-columns: 1fr; } }
