/* Full-screen image viewer for single news posts (SVG controls revision). */
.single-post .site-main > article .post-thumbnail img,
.single-post .site-main > article .entry-content img {
	cursor: zoom-in;
}

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

.tivisi-lightbox[hidden] {
	display: none;
}

.tivisi-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	background: rgba(8, 12, 20, 0.96);
	color: #fff;
	grid-template-rows: 1fr auto;
	isolation: isolate;
}

.tivisi-lightbox__stage {
	display: flex;
	position: relative;
	min-width: 0;
	min-height: 0;
	padding: 54px 82px 18px;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	touch-action: pan-y;
}

.tivisi-lightbox__image {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: calc(100dvh - 132px);
	border-radius: 4px;
	box-shadow: 0 18px 54px rgba(0, 0, 0, 0.42);
	object-fit: contain;
	opacity: 1;
	transition: opacity 0.18s ease;
	user-select: none;
	-webkit-user-drag: none;
	transform-origin: 0 0;
	will-change: transform;
	cursor: zoom-in;
}

body.tivisi-lightbox-open .tivisi-lightbox.is-zoomed .tivisi-lightbox__stage {
	touch-action: none;
	cursor: grab;
}

.tivisi-lightbox.is-zoomed .tivisi-lightbox__image {
	cursor: grab;
}

.tivisi-lightbox.is-zoomed .tivisi-lightbox__stage.is-dragging {
	cursor: grabbing;
}

.tivisi-lightbox.is-zoomed .tivisi-lightbox__image.is-dragging {
	cursor: grabbing;
}

.tivisi-lightbox__image.is-loading {
	opacity: 0.35;
}

.tivisi-lightbox__close,
.tivisi-lightbox__arrow {
	display: inline-flex;
	position: absolute;
	z-index: 2;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.28);
	background: rgba(15, 23, 42, 0.72);
	box-shadow: none;
	color: #fff;
	cursor: pointer;
	line-height: 1;
	transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
	-webkit-tap-highlight-color: transparent;
}

.tivisi-lightbox__close:hover,
.tivisi-lightbox__close:focus-visible,
.tivisi-lightbox__arrow:hover,
.tivisi-lightbox__arrow:focus-visible {
	border-color: rgba(255, 255, 255, 0.72);
	background: rgba(30, 58, 138, 0.92);
	color: #fff;
}

.tivisi-lightbox__close {
	top: 16px;
	right: 18px;
	width: 44px;
	height: 44px;
	border-radius: 50%;
}

.tivisi-lightbox__close svg {
	display: block;
	width: 24px;
	height: 24px;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
}

.tivisi-lightbox__arrow {
	top: 50%;
	width: 50px;
	height: 50px;
	border-radius: 50%;
	transform: translateY(-50%);
}

.tivisi-lightbox__arrow svg {
	display: block;
	width: 26px;
	height: 26px;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.tivisi-lightbox__arrow:hover,
.tivisi-lightbox__arrow:focus-visible {
	transform: translateY(-50%) scale(1.05);
}

.tivisi-lightbox__arrow--prev {
	left: 18px;
}

.tivisi-lightbox__arrow--next {
	right: 18px;
}

.tivisi-lightbox__footer {
	display: grid;
	min-height: 72px;
	padding: 12px 24px 18px;
	align-items: center;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	gap: 20px;
	background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.38));
}

.tivisi-lightbox__caption {
	grid-column: 2;
	max-width: min(760px, 72vw);
	margin: 0;
	font-size: 14px;
	line-height: 1.45;
	text-align: center;
}

.tivisi-lightbox__counter {
	grid-column: 3;
	justify-self: end;
	color: rgba(255, 255, 255, 0.76);
	font-size: 13px;
	font-variant-numeric: tabular-nums;
}

@media (max-width: 760px) {
	.tivisi-lightbox__stage {
		padding: 58px 12px 72px;
	}

	.tivisi-lightbox__image {
		max-height: calc(100dvh - 150px);
	}

	.tivisi-lightbox__close {
		top: max(12px, env(safe-area-inset-top));
		right: 12px;
		width: 42px;
		height: 42px;
	}

	.tivisi-lightbox__arrow {
		top: auto;
		bottom: 14px;
		width: 44px;
		height: 44px;
		transform: none;
	}

	.tivisi-lightbox__arrow svg {
		width: 24px;
		height: 24px;
	}

	.tivisi-lightbox__arrow:hover,
	.tivisi-lightbox__arrow:focus-visible {
		transform: scale(1.05);
	}

	.tivisi-lightbox__arrow--prev {
		left: 14px;
	}

	.tivisi-lightbox__arrow--next {
		right: 14px;
	}

	.tivisi-lightbox__footer {
		position: absolute;
		right: 64px;
		bottom: 14px;
		left: 64px;
		min-height: 44px;
		padding: 0;
		grid-template-columns: 1fr;
		gap: 2px;
		background: none;
	}

	.tivisi-lightbox__caption {
		display: -webkit-box;
		grid-column: 1;
		max-width: 100%;
		overflow: hidden;
		font-size: 12px;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
	}

	.tivisi-lightbox__counter {
		grid-column: 1;
		justify-self: center;
		font-size: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tivisi-lightbox__image,
	.tivisi-lightbox__close,
	.tivisi-lightbox__arrow {
		transition: none;
	}
}
