.yrg-gallery-wrap {
	max-width: 1200px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-sizing: border-box;
}

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

.yrg-error {
	padding: 16px 20px;
	background: #fdecea;
	border: 1px solid #f5c2c0;
	color: #7a1f1a;
	border-radius: 6px;
	font-size: 15px;
}

/* Desktop: 4 columns */
.yrg-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 24px;
}

/* Tablet: 2 columns */
@media (max-width: 1024px) {
	.yrg-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* Mobile: 1 column */
@media (max-width: 600px) {
	.yrg-grid {
		grid-template-columns: 1fr;
	}
}

.yrg-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.yrg-card:hover {
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
	transform: translateY(-2px);
}

.yrg-thumb-link {
	display: block;
	text-decoration: none;
}

.yrg-thumb-wrap {
	position: relative;
	display: block;
	padding-top: 56.25%; /* 16:9 */
	background: #000;
	overflow: hidden;
}

.yrg-thumb {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.yrg-play-icon {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 56px;
	height: 56px;
	transform: translate(-50%, -50%);
	background: rgba(0, 0, 0, 0.55);
	border-radius: 50%;
	pointer-events: none;
}

.yrg-play-icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 54%;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 10px 0 10px 16px;
	border-color: transparent transparent transparent #fff;
}

.yrg-card-body {
	padding: 14px 16px 18px;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.yrg-title {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	color: #1a1a1a;
	text-decoration: none;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.yrg-title:hover {
	color: #cc0000;
}

.yrg-date {
	font-size: 13px;
	color: #777;
}

.yrg-loading {
	text-align: center;
	padding: 20px 0 4px;
	font-size: 14px;
	color: #555;
}

.yrg-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid #ccc;
	border-top-color: #cc0000;
	border-radius: 50%;
	animation: yrg-spin 0.7s linear infinite;
	vertical-align: middle;
	margin-right: 8px;
}

@keyframes yrg-spin {
	to { transform: rotate(360deg); }
}

.yrg-pagination {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 24px;
	flex-wrap: wrap;
}

.yrg-page-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	height: 34px;
	padding: 0 8px;
	border-radius: 6px;
	background: #f2f2f2;
	color: #333;
	font-size: 14px;
	cursor: pointer;
	user-select: none;
	transition: background 0.15s ease, color 0.15s ease;
}

.yrg-page-number:hover {
	background: #e2e2e2;
}

.yrg-page-number.active {
	background: #cc0000;
	color: #fff;
}

.yrg-load-more {
	display: block;
	margin: 24px auto 0;
	padding: 12px 32px;
	background: #cc0000;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, opacity 0.15s ease;
}

.yrg-load-more:hover {
	background: #a80000;
}

.yrg-load-more:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.yrg-no-more {
	text-align: center;
	margin-top: 20px;
	color: #888;
	font-size: 14px;
}

/* Popup video player */
.yrg-modal {
	display: none;
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 999999;
	align-items: center;
	justify-content: center;
	padding: 56px 16px 16px;
	background: rgba(0, 0, 0, 0.85);
	box-sizing: border-box;
}

.yrg-modal.yrg-modal-open {
	display: flex;
}

.yrg-modal *,
.yrg-modal *::before,
.yrg-modal *::after {
	box-sizing: border-box;
}

.yrg-modal .yrg-modal-dialog {
	position: relative;
	/* Largest 16:9 box that fits both the width and the height of the viewport. */
	width: min(100%, 960px, calc((100vh - 96px) * 1.7778));
	margin: 0;
	padding: 0;
	background: transparent;
}

.yrg-modal .yrg-modal-frame {
	position: relative;
	width: 100%;
	padding-top: 56.25%; /* 16:9 */
	background: #000;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.yrg-modal .yrg-modal-frame iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
	margin: 0;
	padding: 0;
}

.yrg-modal .yrg-modal-close {
	position: absolute;
	top: -44px;
	right: 0;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 28px;
	font-weight: 400;
	line-height: 36px;
	text-align: center;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	cursor: pointer;
	transition: background 0.15s ease;
}

.yrg-modal .yrg-modal-close:hover,
.yrg-modal .yrg-modal-close:focus {
	background: #cc0000;
	color: #fff;
	outline: none;
}

.yrg-modal .yrg-modal-close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}
