.tpg-gallery-grid,
.tpg-gallery-grid * {
	box-sizing: border-box;
}

.tpg-gallery-grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: flex-start;
	column-gap: 0;
	row-gap: 24px;
	margin: 28px 0;
}

.tpg-gallery-card {
	position: relative;
	display: block;
	flex: 0 1 400px;
	width: 400px;
	max-width: 100%;
	aspect-ratio: 400 / 267;
	padding: 0;
	border: 0;
	border-radius: 22px;
	overflow: hidden;
	background: #111;
	box-shadow: 0 18px 50px rgba(0, 0, 0, .18);
	cursor: pointer;
	isolation: isolate;
	appearance: none;
	text-align: left;
}

.tpg-gallery-card:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 4px;
}

.tpg-gallery-card__media,
.tpg-gallery-card__image,
.tpg-gallery-card__overlay {
	position: absolute;
	inset: 0;
	display: block;
}

.tpg-gallery-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform: scale(1.001);
	transition: transform .45s ease, filter .45s ease;
}

.tpg-gallery-card__overlay {
	z-index: 1;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 32%, rgba(0, 0, 0, .18) 56%, rgba(0, 0, 0, .68) 100%);
	transition: opacity .3s ease;
}

.tpg-gallery-card__title {
	position: absolute;
	left: 22px;
	right: 22px;
	bottom: 20px;
	z-index: 2;
	color: #fff;
	font-size: clamp(18px, 2vw, 24px);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -.02em;
	text-shadow: 0 2px 14px rgba(0, 0, 0, .55);
}

.tpg-gallery-card:hover .tpg-gallery-card__image,
.tpg-gallery-card:focus-visible .tpg-gallery-card__image {
	transform: scale(1.055);
	filter: saturate(1.08);
}

.tpg-gallery-notice {
	padding: 12px 16px;
	border-radius: 10px;
	background: #fff7d6;
	color: #5f4500;
	font-size: 14px;
}

body.tpg-lightbox-lock {
	overflow: hidden;
	touch-action: none;
}

.tpg-lightbox,
.tpg-lightbox * {
	box-sizing: border-box;
}

.tpg-lightbox[hidden] {
	display: none !important;
}

.tpg-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(18px, 4vw, 56px);
	color: #fff;
	font-family: inherit;
	opacity: 0;
	pointer-events: none;
	transition: opacity .24s ease;
}

.tpg-lightbox.is-open {
	opacity: 1;
	pointer-events: auto;
}

.tpg-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(6, 8, 12, .88);
	backdrop-filter: blur(8px);
}

.tpg-lightbox__dialog {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-rows: auto 1fr auto;
	width: min(1180px, 100%);
	height: min(820px, 100%);
	max-height: calc(100vh - clamp(36px, 8vw, 112px));
	border-radius: 28px;
	transform: translateY(14px) scale(.985);
	transition: transform .24s ease;
}

.tpg-lightbox.is-open .tpg-lightbox__dialog {
	transform: translateY(0) scale(1);
}

.tpg-lightbox__topbar {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	min-height: 44px;
	padding: 0 62px 14px 0;
}

.tpg-lightbox__title {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	font-size: clamp(18px, 2vw, 26px);
	font-weight: 700;
	line-height: 1.2;
	text-shadow: 0 2px 20px rgba(0, 0, 0, .35);
}

.tpg-lightbox__counter {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 64px;
	height: 34px;
	padding: 0 12px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .14);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
	backdrop-filter: blur(8px);
}

.tpg-lightbox__close {
	position: fixed;
	top: clamp(14px, 3vw, 28px);
	right: clamp(14px, 3vw, 28px);
	z-index: 3;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, .14);
	color: #fff;
	font-size: 34px;
	line-height: 40px;
	cursor: pointer;
	transition: background .2s ease, transform .2s ease;
	appearance: none;
}

.tpg-lightbox__close:hover,
.tpg-lightbox__close:focus-visible,
.tpg-lightbox__nav:hover,
.tpg-lightbox__nav:focus-visible,
.tpg-lightbox__retry:hover,
.tpg-lightbox__retry:focus-visible {
	background: rgba(255, 255, 255, .24);
	outline: none;
}

.tpg-lightbox__close:active,
.tpg-lightbox__nav:active {
	transform: scale(.96);
}

.tpg-lightbox__stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 220px;
	border-radius: 24px;
	overflow: hidden;
}

.tpg-lightbox__image {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 18px;
	box-shadow: 0 22px 90px rgba(0, 0, 0, .42);
	opacity: 0;
	transform: translateY(8px) scale(.995);
	transition: opacity .22s ease, transform .22s ease;
	user-select: none;
}

.tpg-lightbox__image.is-loaded {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.tpg-lightbox__nav {
	position: absolute;
	top: 50%;
	z-index: 2;
	width: 52px;
	height: 52px;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, .14);
	color: #fff;
	font-size: 42px;
	line-height: 48px;
	cursor: pointer;
	transform: translateY(-50%);
	transition: background .2s ease, opacity .2s ease, transform .2s ease;
	appearance: none;
}

.tpg-lightbox__nav--prev {
	left: 10px;
}

.tpg-lightbox__nav--next {
	right: 10px;
}

.tpg-lightbox.is-single .tpg-lightbox__nav {
	display: none;
}

.tpg-lightbox__loader {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: none;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 14px;
	background: radial-gradient(circle at center, rgba(255, 255, 255, .08), rgba(0, 0, 0, 0) 62%);
	font-size: 14px;
	color: rgba(255, 255, 255, .82);
	text-align: center;
}

.tpg-lightbox.is-loading .tpg-lightbox__loader {
	display: flex;
}

.tpg-lightbox__spinner {
	width: 44px;
	height: 44px;
	border-radius: 999px;
	border: 3px solid rgba(255, 255, 255, .2);
	border-top-color: #fff;
	animation: tpg-spin .8s linear infinite;
}

.tpg-lightbox__error {
	display: none;
	position: absolute;
	z-index: 2;
	inset: auto 20px 20px;
	max-width: 520px;
	margin: auto;
	padding: 18px 20px;
	border-radius: 18px;
	background: rgba(0, 0, 0, .58);
	text-align: center;
	backdrop-filter: blur(10px);
}

.tpg-lightbox.has-error .tpg-lightbox__error {
	display: block;
}

.tpg-lightbox__error-text {
	margin: 0 0 12px;
}

.tpg-lightbox__retry {
	min-height: 38px;
	padding: 0 16px;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, .16);
	color: #fff;
	font: inherit;
	cursor: pointer;
}

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

@media (max-width: 860px) {
	.tpg-gallery-grid {
		justify-content: center;
		row-gap: 20px;
	}
}

@media (max-width: 560px) {
	.tpg-gallery-grid {
		justify-content: stretch;
		row-gap: 18px;
	}

	.tpg-gallery-card {
		flex-basis: 100%;
		width: 100%;
	}

	.tpg-lightbox {
		padding: 12px;
	}

	.tpg-lightbox__dialog {
		width: 100%;
		height: 100%;
		max-height: 100%;
		border-radius: 0;
	}

	.tpg-lightbox__topbar {
		align-items: flex-start;
		gap: 10px;
		padding-right: 50px;
		padding-bottom: 10px;
	}

	.tpg-lightbox__counter {
		min-width: 56px;
		height: 30px;
		padding: 0 10px;
		font-size: 12px;
	}

	.tpg-lightbox__stage {
		border-radius: 0;
	}

	.tpg-lightbox__image {
		border-radius: 12px;
	}

	.tpg-lightbox__nav {
		width: 44px;
		height: 44px;
		font-size: 34px;
		line-height: 40px;
	}

	.tpg-lightbox__nav--prev {
		left: 0;
	}

	.tpg-lightbox__nav--next {
		right: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tpg-gallery-card__image,
	.tpg-gallery-card__overlay,
	.tpg-lightbox,
	.tpg-lightbox__dialog,
	.tpg-lightbox__image,
	.tpg-lightbox__nav,
	.tpg-lightbox__close {
		transition: none !important;
	}

	.tpg-lightbox__spinner {
		animation-duration: 1.6s;
	}
}
