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

.tmpg-gallery {
	--tmpg-accent: #17395c;
	--tmpg-border: #d9dde3;
	--tmpg-radius: 10px;
	--tmpg-thumb-size: 68px;
	--tmpg-gap: 8px;
	width: 100%;
	position: relative;
}

.tmpg-stage {
	position: relative;
	width: 100%;
	overflow: hidden;
	border-radius: var(--tmpg-radius);
	background: #fff;
}

.tmpg-main-track {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3;
	touch-action: pan-y;
}

.tmpg-slide {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	pointer-events: none;
	transition: opacity 180ms ease;
}

.tmpg-slide.is-active {
	opacity: 1;
	pointer-events: auto;
}

.tmpg-main-button {
	display: block;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: zoom-in;
}

.tmpg-main-image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
	background: #fff;
}

.tmpg-arrow {
	position: absolute;
	top: 50%;
	z-index: 3;
	width: 38px;
	height: 38px;
	border: 1px solid rgba(0,0,0,.12);
	border-radius: 999px;
	background: rgba(255,255,255,.94);
	box-shadow: 0 2px 8px rgba(0,0,0,.12);
	transform: translateY(-50%);
	font-size: 27px;
	line-height: 1;
	display: grid;
	place-items: center;
	cursor: pointer;
}

.tmpg-arrow--prev { left: 10px; }
.tmpg-arrow--next { right: 10px; }

.tmpg-counter {
	position: absolute;
	right: 10px;
	bottom: 10px;
	z-index: 3;
	padding: 5px 9px;
	border-radius: 999px;
	background: rgba(20,20,20,.72);
	color: #fff;
	font-size: 12px;
	line-height: 1;
}

.tmpg-zoom-hint {
	position: absolute;
	left: 10px;
	bottom: 10px;
	z-index: 3;
	width: 30px;
	height: 30px;
	border-radius: 999px;
	background: rgba(255,255,255,.94);
	box-shadow: 0 2px 8px rgba(0,0,0,.12);
	display: grid;
	place-items: center;
	pointer-events: none;
}

.tmpg-zoom-hint svg {
	width: 17px;
	height: 17px;
	fill: #222;
}

.tmpg-thumbs-wrap {
	position: relative;
	margin-top: 10px;
}

.tmpg-thumbs {
	display: flex;
	gap: var(--tmpg-gap);
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	padding: 2px;
}

.tmpg-thumbs::-webkit-scrollbar {
	display: none;
}

.tmpg-thumb {
	flex: 0 0 var(--tmpg-thumb-size);
	width: var(--tmpg-thumb-size);
	height: var(--tmpg-thumb-size);
	padding: 0;
	border: 2px solid transparent;
	border-radius: 8px;
	background: #fff;
	overflow: hidden;
	scroll-snap-align: start;
	cursor: pointer;
	transition: border-color 140ms ease, transform 140ms ease;
}

.tmpg-thumb:hover {
	border-color: #9aa7b5;
}

.tmpg-thumb.is-active {
	border-color: var(--tmpg-accent);
}

.tmpg-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tmpg-thumb-scroll {
	display: none;
}

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

.tmpg-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: rgba(0,0,0,.94);
	display: grid;
	place-items: center;
	padding: 54px 14px 42px;
}

.tmpg-lightbox-inner {
	width: 100%;
	height: 100%;
	display: grid;
	place-items: center;
	overflow: auto;
}

.tmpg-lightbox-image {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.tmpg-lightbox-close,
.tmpg-lightbox-arrow {
	position: fixed;
	z-index: 2;
	border: 0;
	color: #fff;
	background: rgba(255,255,255,.12);
	cursor: pointer;
}

.tmpg-lightbox-close {
	top: 12px;
	right: 12px;
	width: 40px;
	height: 40px;
	border-radius: 999px;
	font-size: 30px;
	line-height: 1;
}

.tmpg-lightbox-arrow {
	top: 50%;
	width: 42px;
	height: 54px;
	transform: translateY(-50%);
	font-size: 34px;
}

.tmpg-lightbox-arrow--prev { left: 8px; }
.tmpg-lightbox-arrow--next { right: 8px; }

.tmpg-lightbox-counter {
	position: fixed;
	bottom: 12px;
	left: 50%;
	transform: translateX(-50%);
	color: #fff;
	font-size: 13px;
}

body.tmpg-lightbox-open {
	overflow: hidden;
}

.tmpg-notice {
	padding: 10px 12px;
	border: 1px solid #dcdcde;
	background: #fff;
}

@media (min-width: 768px) {
	.tmpg-gallery {
		--tmpg-thumb-size: 78px;
		--tmpg-gap: 10px;
	}

	.tmpg-main-track {
		aspect-ratio: 1 / 1;
	}

	.tmpg-thumbs-wrap {
		padding-inline: 34px;
	}

	.tmpg-thumb-scroll {
		position: absolute;
		top: 50%;
		z-index: 4;
		display: grid;
		place-items: center;
		width: 28px;
		height: 44px;
		padding: 0;
		border: 1px solid var(--tmpg-border);
		border-radius: 7px;
		background: #fff;
		transform: translateY(-50%);
		font-size: 24px;
		line-height: 1;
		cursor: pointer;
	}

	.tmpg-thumb-scroll--prev { left: 0; }
	.tmpg-thumb-scroll--next { right: 0; }
}

@media (hover: none) {
	.tmpg-arrow {
		width: 34px;
		height: 34px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tmpg-slide,
	.tmpg-thumb {
		transition: none;
	}
}
