.poronin-post-gallery {
	--poronin-gallery-border: #c3b7a3;
	--poronin-gallery-accent: #326748;
	--poronin-gallery-radius: 16px;
	--poronin-gallery-thumb-radius: 8px;
	margin-top: clamp(28px, 4vw, 40px);
}

.poronin-post-gallery__main {
	position: relative;
	margin-bottom: 14px;
	overflow: hidden;
	border: 1px solid var(--poronin-gallery-border);
	border-radius: var(--poronin-gallery-radius);
	background: #fff;
	height: auto;
}

.poronin-post-gallery__main.swiper {
	height: auto;
}

.poronin-post-gallery__main .swiper-wrapper {
	height: auto;
	align-items: flex-start;
}

.poronin-post-gallery__main .swiper-slide {
	width: 100%;
	height: auto;
}

.poronin-post-gallery__main-trigger {
	display: block;
	width: 100%;
	padding: 20px;
	border: 0;
	background: transparent;
	cursor: zoom-in;
	box-sizing: border-box;
}

.poronin-post-gallery__main-image-wrap {
	display: block;
	width: 100%;
	overflow: hidden;
	border-radius: var(--poronin-gallery-radius);
}

.poronin-post-gallery__main-image {
	display: block;
	width: 100%;
	height: auto;
}

.poronin-post-gallery__main .poronin-post-gallery__nav {
	--swiper-navigation-size: 36px;
	top: 50%;
	width: 36px;
	height: 36px;
	margin-top: -18px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.45);
	border-radius: 50%;
	background: rgba(43, 37, 6, 0.58);
	color: #fff;
	transform: none;
	transition: background 0.2s ease, border-color 0.2s ease;
	overflow: hidden;
}

.poronin-post-gallery__main .poronin-post-gallery__nav svg {
	width: 11px;
	height: 11px;
}

.poronin-post-gallery__main .poronin-post-gallery__nav:hover,
.poronin-post-gallery__main .poronin-post-gallery__nav:focus {
	background: var(--poronin-gallery-accent);
	border-color: rgba(255, 255, 255, 0.55);
	outline: none;
}

.poronin-post-gallery__main .poronin-post-gallery__nav--prev {
	left: 12px;
}

.poronin-post-gallery__main .poronin-post-gallery__nav--next {
	right: 12px;
}

.poronin-post-gallery__thumbs-wrap {
	position: relative;
	overflow: hidden;
}

.poronin-post-gallery__thumbs-wrap::before,
.poronin-post-gallery__thumbs-wrap::after {
	content: '';
	position: absolute;
	top: 0;
	bottom: 0;
	width: clamp(28px, 8%, 56px);
	z-index: 2;
	pointer-events: none;
	opacity: 1;
	transition: opacity 0.25s ease;
}

.poronin-post-gallery__thumbs-wrap::before {
	left: 0;
	background: linear-gradient(to right, #fff 0%, rgba(255, 255, 255, 0) 100%);
}

.poronin-post-gallery__thumbs-wrap::after {
	right: 0;
	background: linear-gradient(to left, #fff 0%, rgba(255, 255, 255, 0) 100%);
}

.poronin-post-gallery__thumbs-wrap.is-at-start::before,
.poronin-post-gallery__thumbs-wrap.is-at-end::after {
	opacity: 0;
}

.poronin-post-gallery__thumbs {
	overflow: hidden;
	padding: 2px 0;
}

.poronin-post-gallery__thumbs .swiper-slide {
	width: 96px;
	height: 64px;
	border: 1px solid var(--poronin-gallery-border);
	border-radius: var(--poronin-gallery-thumb-radius);
	background: #f2efe2;
	cursor: pointer;
	overflow: hidden;
	box-sizing: border-box;
	opacity: 0.5;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.poronin-post-gallery__thumbs .swiper-slide:hover,
.poronin-post-gallery__thumbs .swiper-slide:focus-visible {
	border-color: var(--poronin-gallery-border);
	box-shadow: 0 0 0 1px var(--poronin-gallery-border);
	opacity: 0.75;
	outline: none;
}

.poronin-post-gallery__thumbs .swiper-slide-thumb-active {
	border-color: var(--poronin-gallery-accent);
	box-shadow: 0 0 0 1px var(--poronin-gallery-accent);
	opacity: 1;
}

.poronin-post-gallery__thumbs .swiper-slide img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: calc(var(--poronin-gallery-thumb-radius) - 1px);
}

.poronin-post-gallery-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
}

.poronin-post-gallery-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(43, 37, 6, 0.88);
}

.poronin-post-gallery-lightbox__dialog {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: clamp(16px, 3vw, 40px);
	box-sizing: border-box;
}

.poronin-post-gallery-lightbox__image-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: min(1200px, 92vw);
	max-height: 86vh;
	border-radius: var(--poronin-gallery-radius);
	overflow: hidden;
}

.poronin-post-gallery-lightbox__image-wrap.swiper {
	overflow: hidden;
}

.poronin-post-gallery-lightbox__image-wrap .swiper-wrapper {
	align-items: center;
}

.poronin-post-gallery-lightbox__image-wrap .swiper-slide {
	display: flex;
	align-items: center;
	justify-content: center;
	height: auto;
}

.poronin-post-gallery-lightbox__image {
	display: block;
	max-width: 100%;
	max-height: 86vh;
	width: auto;
	height: auto;
	object-fit: contain;
}

.poronin-post-gallery-lightbox__counter {
	position: absolute;
	top: 16px;
	left: 16px;
	padding: 6px 12px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	font-size: 14px;
	line-height: 1.2;
}

.poronin-post-gallery-lightbox__close,
.poronin-post-gallery-lightbox__nav {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.poronin-post-gallery-lightbox__close:hover,
.poronin-post-gallery-lightbox__close:focus,
.poronin-post-gallery-lightbox__nav:hover,
.poronin-post-gallery-lightbox__nav:focus {
	background: rgba(50, 103, 72, 0.85);
	border-color: rgba(255, 255, 255, 0.4);
	outline: none;
}

.poronin-post-gallery-lightbox__close {
	top: 16px;
	right: 16px;
}

.poronin-post-gallery-lightbox__nav--prev {
	left: 16px;
}

.poronin-post-gallery-lightbox__nav--next {
	right: 16px;
}

html.poronin-post-gallery-lightbox-open {
	overflow: hidden;
}

@media (max-width: 700px) {
	.poronin-post-gallery__main-trigger {
		padding: 16px;
	}

	.poronin-post-gallery__thumbs .swiper-slide {
		width: 72px;
		height: 48px;
	}

	.poronin-post-gallery__main .poronin-post-gallery__nav {
		--swiper-navigation-size: 32px;
		width: 32px;
		height: 32px;
		margin-top: -16px;
	}

	.poronin-post-gallery__main .poronin-post-gallery__nav svg {
		width: 10px;
		height: 10px;
	}

	.poronin-post-gallery__main .poronin-post-gallery__nav--prev {
		left: 8px;
	}

	.poronin-post-gallery__main .poronin-post-gallery__nav--next {
		right: 8px;
	}

	.poronin-post-gallery-lightbox__nav--prev {
		left: 8px;
	}

	.poronin-post-gallery-lightbox__nav--next {
		right: 8px;
	}
}
