/* Copyright PartirOu.com - Gilles PFOTZER - 02/09/2026
 * PartirOu.com — visionneuse photos
 * en remplacement des styles hs-g1 (Highslide) de 2013
 */

/* Vignettes dans la page */
a.po-lb-link img,
.illu a[href$=".jpg"] img,
.illu a[href$=".JPG"] img,
.illu a[href$=".jpeg"] img,
.illu a[href$=".webp"] img,
.illu a[href$=".png"] img,
div.phs a img {
	border: 1px solid #d0d0d0;
	cursor: zoom-in;
	transition: border-color 0.15s ease;
}
a.po-lb-link:hover img,
.illu a[href$=".jpg"]:hover img,
.illu a[href$=".JPG"]:hover img,
.illu a[href$=".jpeg"]:hover img,
.illu a[href$=".webp"]:hover img,
.illu a[href$=".png"]:hover img,
div.phs a:hover img {
	border-color: #a0a0a0;
}

/* Overlay */
.po-lb {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
	font-family: Verdana, Helvetica, sans-serif;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}
.po-lb.is-open {
	opacity: 1;
	visibility: visible;
}
.po-lb.is-open .po-lb__backdrop {
	opacity: 0.85;
}

.po-lb__backdrop {
	position: absolute;
	inset: 0;
	background: #000;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.po-lb__stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	max-width: 100%;
	max-height: 100%;
	padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
	box-sizing: border-box;
	pointer-events: none;
	touch-action: manipulation;
}

.po-lb__frame {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	/* 100% du stage (pas 100vw/vh : sur iOS zoomé, vw suit le visual viewport
	   et recontraint l'image après le counter-scale) */
	max-width: calc(100% - 30px);
	max-height: calc(100% - 30px);
	pointer-events: auto;
	background: transparent;
	box-shadow: none;
}

.po-lb__viewport {
	position: relative;
	overflow: hidden;
	touch-action: none;
	background: transparent;
	box-shadow: none;
	min-width: 120px;
	min-height: 80px;
}
.po-lb__track {
	display: flex;
	height: 100%;
	will-change: transform;
}
.po-lb__track.is-animating {
	transition: transform 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.po-lb__pane {
	flex: 0 0 100%;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	height: 100%;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}
.po-lb__pane.is-empty {
	pointer-events: none;
}
.po-lb__pane.is-empty .po-lb__img-adj {
	display: none;
}
.po-lb.is-swiping .po-lb__img,
.po-lb.is-swiping .po-lb__img-adj {
	pointer-events: none;
}
.po-lb__viewport.is-zoomed {
	cursor: grab;
}
.po-lb__viewport.is-zoomed.is-dragging {
	cursor: grabbing;
}

.po-lb__img,
.po-lb__img-adj {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	user-select: none;
	-webkit-user-drag: none;
	transform-origin: center center;
	background: transparent;
	box-shadow: none;
}
.po-lb__img {
	will-change: transform;
}

.po-lb__title {
	margin: 0 48px 5px 4px;
	padding: 0;
	color: #fff;
	font-size: 0.95em;
	line-height: 1.3;
	font-weight: normal;
	text-shadow: 1px 1px 5px #000, 1px 1px 5px #000;
	pointer-events: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.po-lb__title:empty {
	display: none;
	margin: 0;
}

.po-lb__caption {
	padding: 2px 4px 0;
	color: gray;
	font-size: 0.8em;
	text-align: left;
	text-shadow: none;
	background: transparent;
	margin-top: 2px;
	pointer-events: none;
}
.po-lb__caption:empty {
	display: none;
	margin: 0;
}

.po-lb__close {
	position: absolute;
	top: max(8px, env(safe-area-inset-top));
	right: max(8px, env(safe-area-inset-right));
	z-index: 5;
	width: 44px;
	height: 44px;
	padding: 0;
	border: none;
	background: transparent url(/images/i/24/fermer.png) center / 24px 24px no-repeat;
	cursor: pointer;
	opacity: 0.55;
	transition: opacity 0.15s ease;
	pointer-events: auto;
}
.po-lb__close:hover,
.po-lb__close:focus-visible {
	opacity: 1;
	outline: none;
}

.po-lb__reset-zoom {
	position: absolute;
	top: max(8px, env(safe-area-inset-top));
	right: max(56px, calc(env(safe-area-inset-right) + 48px));
	z-index: 5;
	width: 44px;
	height: 44px;
	padding: 0;
	border: none;
	background: transparent;
	color: #fff;
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	filter: drop-shadow(0 0 2px #000);
	transition: opacity 0.15s ease, visibility 0.15s ease;
}
.po-lb.is-zoomed .po-lb__reset-zoom {
	opacity: 0.85;
	visibility: visible;
	pointer-events: auto;
}
.po-lb__reset-zoom:hover,
.po-lb__reset-zoom:focus-visible {
	opacity: 1;
	outline: none;
}
.po-lb__reset-zoom svg {
	display: block;
	width: 32px;
	height: 32px;
	margin: 6px auto;
}

.po-lb__nav {
	flex-shrink: 0;
	width: 64px;
	height: 64px;
	padding: 0;
	border: none;
	background: transparent center / contain no-repeat;
	cursor: pointer;
	opacity: 0.45;
	transition: opacity 0.15s ease;
	pointer-events: auto;
}
.po-lb__nav:hover,
.po-lb__nav:focus-visible {
	opacity: 1;
	outline: none;
}
.po-lb__nav:disabled {
	opacity: 0.12;
	cursor: default;
	pointer-events: none;
}
.po-lb__nav--prev {
	background-image: url(/images/i/64/fleche-gauche.png);
	margin-right: 14px;
}
.po-lb__nav--next {
	background-image: url(/images/i/64/fleche-droite.png);
	margin-left: 9px;
}

.po-lb__loader {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	padding: 8px 12px 8px 32px;
	background: #fff url(/images/loader.white.gif) 8px center no-repeat;
	border: 1px solid #ccc;
	color: #000;
	font-size: 11px;
	font-weight: bold;
	text-transform: uppercase;
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.15s ease;
}
.po-lb.is-loading .po-lb__loader {
	opacity: 1;
	visibility: visible;
}

body.po-lb-open {
	overflow: hidden;
}

/* Mobile : image centrée, textes collés au cadre photo */
@media (max-width: 768px), (hover: none) and (pointer: coarse) {
	.po-lb__stage {
		padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
	}

	.po-lb__frame {
		max-width: calc(100% - 16px);
		max-height: calc(100% - 16px);
		width: auto;
		height: auto;
		background: transparent;
		box-shadow: none;
	}

	.po-lb__viewport {
		flex: none;
		background: transparent;
		box-shadow: none;
	}

	.po-lb__title {
		font-size: 1.05em;
		margin-right: 56px;
	}
	.po-lb.is-zoomed .po-lb__title {
		margin-right: 108px;
	}

	.po-lb__close {
		width: 48px;
		height: 48px;
		background-size: 28px 28px;
		opacity: 0.85;
	}

	.po-lb__reset-zoom {
		width: 48px;
		height: 48px;
		right: max(60px, calc(env(safe-area-inset-right) + 52px));
	}
	.po-lb__reset-zoom svg {
		width: 34px;
		height: 34px;
		margin: 7px auto;
	}

	.po-lb__nav {
		position: absolute;
		top: 50%;
		transform: translateY(-50%);
		width: 48px;
		height: 48px;
		margin: 0;
		opacity: 0.55;
		z-index: 2;
	}
	.po-lb__nav--prev {
		left: max(3px, env(safe-area-inset-left));
	}
	.po-lb__nav--next {
		right: max(3px, env(safe-area-inset-right));
	}

	.po-lb__stage .po-lb__nav {
		display: block;
	}
}

/* Desktop : flèches à côté de l'image */
@media (min-width: 769px) and (hover: hover), (min-width: 769px) and (pointer: fine) {
	.po-lb__frame {
		flex-shrink: 0;
	}
}
