/* VB Видео: галерея, окно просмотра, страница одного видео */

.vbv-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 24px;
	margin: 8px 0 32px;
}

.vbv-card {
	display: flex;
	flex-direction: column;
	background: #fcfbf8;
	border-radius: 18px;
	box-shadow: inset 0 0 0 1px rgba(206, 212, 218, 0.5);
	overflow: hidden;
	color: #333;
	text-decoration: none;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.vbv-card:hover,
.vbv-card:focus-visible {
	transform: translateY(-3px);
	box-shadow: inset 0 0 0 1px rgba(206, 212, 218, 0.5), 0 10px 24px rgba(60, 45, 20, 0.12);
	color: #333;
}
.vbv-card:focus-visible {
	outline: 2px solid #e6b800;
	outline-offset: 2px;
}

.vbv-card__media {
	position: relative;
	display: block;
	aspect-ratio: 9 / 16;
	background: #ece3d2;
	overflow: hidden;
}
.vbv-card__media img,
.vbv-card__media video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	pointer-events: none;
}
.vbv-card__ph {
	position: absolute;
	inset: 0;
	background: linear-gradient(160deg, #f6e7b4 0%, #e6b800 100%);
}

.vbv-card__play {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 60px;
	height: 60px;
	margin: -30px 0 0 -30px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
	transition: transform 0.2s ease;
}
.vbv-card__play::after {
	content: "";
	position: absolute;
	left: 24px;
	top: 19px;
	border-style: solid;
	border-width: 11px 0 11px 18px;
	border-color: transparent transparent transparent #191817;
}
.vbv-card:hover .vbv-card__play {
	transform: scale(1.08);
}

.vbv-card__title {
	display: block;
	padding: 14px 16px 16px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.35;
	color: #333;
}

.vbv-empty {
	padding: 40px 0;
	text-align: center;
	color: #6b6b6b;
	font-size: 18px;
}

/* Страницы */
.vbv-pager {
	margin: 0 0 24px;
}
.vbv-pager ul {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.vbv-pager a,
.vbv-pager span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border-radius: 12px;
	background: #fcfbf8;
	box-shadow: inset 0 0 0 1px rgba(206, 212, 218, 0.7);
	color: #333;
	text-decoration: none;
}
.vbv-pager .current {
	background: #e6b800;
	box-shadow: none;
	font-weight: 600;
}

/* Окно просмотра */
html.vbv-lock {
	overflow: hidden;
}
.vbv-modal {
	position: fixed;
	inset: 0;
	z-index: 2000000; /* выше шапки темы (1000000) и чёрной панели админа */
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(18, 16, 12, 0.92);
	opacity: 0;
	transition: opacity 0.2s ease;
}
.vbv-modal.is-open {
	opacity: 1;
}
/* Тема принудительно ставит [role="dialog"] ниже шапки (z-index 999999 !important), перебиваем точнее */
.vbv-modal[role="dialog"] {
	z-index: 2000000 !important;
}
.vbv-modal__stage {
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: 100vw;
	max-height: 100vh;
}
.vbv-modal__stage .vbv-player {
	display: block;
	max-width: 92vw;
	max-height: 88vh;
	border-radius: 14px;
	background: #000;
}
.vbv-modal__title {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 10px;
	margin: 0;
	padding: 0 70px;
	text-align: center;
	color: #fff;
	font-size: 15px;
	line-height: 1.3;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
	pointer-events: none;
}
.vbv-modal__btn {
	position: absolute;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.16);
	color: #fff;
	font-size: 28px;
	line-height: 46px;
	text-align: center;
	cursor: pointer;
	transition: background 0.2s ease;
}
.vbv-modal__btn:hover,
.vbv-modal__btn:focus-visible {
	background: rgba(255, 255, 255, 0.32);
	outline: none;
}
.vbv-modal__btn[hidden] {
	display: none;
}
.vbv-modal__close {
	top: 16px;
	right: 16px;
}
.vbv-modal__prev {
	left: 16px;
	top: 50%;
	margin-top: -23px;
}
.vbv-modal__next {
	right: 16px;
	top: 50%;
	margin-top: -23px;
}

/* Рамки для iframe (YouTube, Vimeo, Instagram, TikTok) */
.vbv-frame {
	position: relative;
	background: #000;
	border-radius: 14px;
	overflow: hidden;
}
.vbv-frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}
.vbv-frame--v {
	aspect-ratio: 9 / 16;
	height: min(86vh, 780px);
	max-width: 92vw;
}
.vbv-frame--h {
	aspect-ratio: 16 / 9;
	width: min(92vw, 1100px);
}
.vbv-frame--ig {
	width: min(92vw, 420px);
	height: min(88vh, 800px);
	background: #fff;
}
.vbv-frame--tt {
	width: min(92vw, 340px);
	height: min(88vh, 760px);
	background: #fff;
}

/* Страница одного видео */
.vbv-single {
	display: flex;
	justify-content: center;
	margin: 0 0 24px;
}
.vbv-single .vbv-player {
	display: block;
	max-width: 100%;
	max-height: 80vh;
	border-radius: 14px;
	background: #000;
}
.vbv-single .vbv-frame--v {
	height: min(80vh, 720px);
}
.vbv-single .vbv-frame--h {
	width: 100%;
	max-width: 900px;
}
.vbv-back {
	margin-top: 24px;
}
.vbv-btn {
	display: inline-block;
	padding: 12px 28px;
	border-radius: 999px;
	background: #e6b800;
	color: #191817;
	font-weight: 600;
	text-decoration: none;
}

@media (max-width: 640px) {
	.vbv-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
	}
	.vbv-card {
		border-radius: 14px;
	}
	.vbv-card__title {
		padding: 10px 12px 12px;
		font-size: 14px;
	}
	.vbv-card__play {
		width: 46px;
		height: 46px;
		margin: -23px 0 0 -23px;
	}
	.vbv-card__play::after {
		left: 18px;
		top: 14px;
		border-width: 9px 0 9px 14px;
	}
	.vbv-modal__prev,
	.vbv-modal__next {
		display: none;
	}
	.vbv-modal__close {
		top: 10px;
		right: 10px;
	}
}

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