.dbg-gallery {
	display: grid;
	grid-template-columns: minmax(87px, 87px) 1fr;
	gap: 12px;
	align-items: stretch;
	position: relative;
}

.dbg-gallery.dbg-gallery--thumb-right {
	grid-template-columns: 1fr minmax(84px, 110px);
}

.dbg-gallery.dbg-gallery--thumb-right .dbg-gallery__thumb-rail-wrap {
	order: 2;
}

.dbg-gallery.dbg-gallery--thumb-right .dbg-gallery__main {
	order: 1;
}

.dbg-gallery__thumb-rail-wrap {
	display: grid;
	grid-template-rows: 28px auto 28px;
	gap: 16px;
	align-self: center;
}

.dbg-gallery__thumb-nav {
	background: transparent;
	border: none;
	color: #1b5ecc;
	font-size: 16px;
	cursor: pointer;
	line-height: 1;
	margin: 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 0;
    background: #E7F2FE;
    color: #0D80F2;
}

.dbg-gallery__thumb-nav span {
	display: inline-flex;
}

.dbg-gallery__thumb-rail {
	display: grid;
	grid-auto-rows: 87px;
	gap: 16px;
	max-height: calc((var(--dbg-gallery-thumb-size, 96px) * 4) + 20px);
	overflow: hidden;
/* 	scrollbar-width: thin; */
/* 	padding-right: 3px; */
}

.dbg-gallery__thumb {
	border: 1px solid #EFEFEF;
	background: #fff;
	border-radius: 12px;
	padding: 0;
	cursor: pointer;
	position: relative;
	overflow: hidden;
	padding: 4px;
}

.dbg-gallery__thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.dbg-gallery__thumb.is-active {
	border-color: #B4D8FB;
/* 	box-shadow: 0 0 0 2px rgba(17, 102, 255, 0.12); */
}

.dbg-gallery__thumb-play {
	position: absolute;
	right: 8px;
	bottom: 8px;
	width: 22px;
	height: 22px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(17, 102, 255, 0.9);
	color: #fff;
	font-size: 11px;
}

.dbg-gallery__main {
	border: 1px solid #ebeff8;
	border-radius: 24px;
	background: #fff;
	min-height: 420px;
	max-height: var(--dbg-gallery-max-height, 760px);
	position: relative;
	padding: 10px;
}

.dbg-gallery__panel {
	display: none;
	height: 100%;
}

.dbg-gallery__panel.is-active {
	display: flex;
	align-items: center;
	justify-content: center;
}

.dbg-gallery__main-image,
.dbg-gallery__main-video,
.dbg-gallery__main-iframe {
	width: 100%;
	height: 100%;
	min-height: 380px;
	max-height: calc(var(--dbg-gallery-max-height, 760px) - 20px);
	border: 0;
	object-fit: contain;
	background: #fff;
	border-radius: 16px;
}

.dbg-gallery__fallback {
	margin: 0;
}

.dbg-gallery-modal[hidden] {
	display: none !important;
}

.dbg-gallery-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
}

.dbg-gallery-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(3, 15, 42, 0.84);
}

.dbg-gallery-modal__dialog {
	position: relative;
	width: min(94vw, 1200px);
	height: min(88vh, 800px);
	margin: 6vh auto;
	border-radius: 18px;
	overflow: hidden;
	background: #fff;
	z-index: 1;
}

.dbg-gallery-modal__close {
	position: absolute;
	right: 14px;
	top: 10px;
	z-index: 3;
	border: none;
	background: transparent;
	font-size: 34px;
	line-height: 1;
	cursor: pointer;
	color: #1b2338;
}

.dbg-gallery-modal__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 3;
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: rgba(17, 102, 255, 0.92);
	color: #fff;
	font-size: 30px;
	line-height: 1;
	cursor: pointer;
}

.dbg-gallery-modal__nav--prev {
	left: 14px;
}

.dbg-gallery-modal__nav--next {
	right: 14px;
}

.dbg-gallery-modal__content {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.dbg-gallery-modal__content img,
.dbg-gallery-modal__content iframe,
.dbg-gallery-modal__content video {
	width: 100%;
	height: 100%;
	border: 0;
	object-fit: contain;
	background: #fff;
}

body.dbg-gallery-modal-open {
	overflow: hidden;
}

@media (max-width: 767px) {
	.dbg-gallery,
	.dbg-gallery.dbg-gallery--thumb-right {
		grid-template-columns: 1fr;
	}

	.dbg-gallery__main {
		order: 1;
	}

	.dbg-gallery__thumb-rail-wrap {
		order: 2;
	}

	.dbg-gallery__thumb-rail-wrap {
		grid-template-rows: auto;
		grid-template-columns: 28px 1fr 28px;
		align-items: center;
		gap: 0;
	}

	.dbg-gallery__thumb-nav--up span {
		display: inline-block;
		transform: rotate(-90deg);
	}

	.dbg-gallery__thumb-nav--down span {
		display: inline-block;
		transform: rotate(-90deg);
	}

	.dbg-gallery__thumb-rail {
		grid-auto-flow: column;
		grid-auto-columns: minmax(74px, var(--dbg-gallery-thumb-size, 96px));
		grid-auto-rows: auto;
		overflow-x: auto;
		overflow-y: hidden;
		max-height: none;
		max-width: calc((var(--dbg-gallery-thumb-size, 96px) * 3) + 20px);
		padding-bottom: 2px;
	}

	.dbg-gallery__main {
		min-height: 300px;
	}

	.dbg-gallery__main-image,
	.dbg-gallery__main-video,
	.dbg-gallery__main-iframe {
		min-height: 280px;
	}
}


@media screen and (max-width: 991px) {
	.dbg-gallery { grid-template-columns: minmax(56px, 56px) 1fr; }
	.dbg-gallery .dbg-gallery__thumb-rail { grid-auto-rows: 56px; gap: 12px; max-height: calc((var(--dbg-gallery-thumb-size, 56px) * 2) + 0px); overflow: hidden; }
	.dbg-gallery .dbg-gallery__main { min-height: 268px; max-height: 268px; border-radius: 16px; overflow: hidden; }
}

@media screen and (max-width: 767px) {
	.dbg-gallery {
        padding: 0rem;
		grid-template-columns: initial;
    }
	.dbg-gallery .dbg-gallery__main { 
		min-height: 398px;
        max-height: 398px;
		border-radius: 16px;
	}
	.dbg-gallery .dbg-gallery__thumb-rail { 
	 	grid-auto-columns: 56px;
		max-width: 100%;
		justify-content: center;
	}
}
