/* FLOWIM Portfolio - lightbox globale */

.flowim-lb {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	background: #0b0b0b;
	color: #f2f2f2;
	font-family: inherit;
}

.flowim-lb.is-open {
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto;
	height: 100dvh;
	opacity: 0;
	transition: opacity .26s ease;
}

.flowim-lb.is-visible { opacity: 1; }

/* La barre et le pied entrent avec un léger décalage : l'image reste le
   sujet, l'habillage arrive ensuite. */
.flowim-lb-bar,
.flowim-lb-foot {
	opacity: 0;
	transform: translateY(-6px);
	transition: opacity .3s ease .06s, transform .4s cubic-bezier(.22, .61, .36, 1) .06s;
}

.flowim-lb-foot { transform: translateY(6px); }

.flowim-lb.is-visible .flowim-lb-bar,
.flowim-lb.is-visible .flowim-lb-foot {
	opacity: 1;
	transform: translateY(0);
}

html.flowim-lb-locked {
	overflow: hidden;
}

.flowim-lb-bar {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 16px;
	font-size: 12px;
	letter-spacing: .08em;
}

.flowim-lb-count,
.flowim-lb-dims {
	font-variant-numeric: tabular-nums;
	color: #8a8a8a;
	white-space: nowrap;
}

.flowim-lb-dims { color: #6d757c; }

.flowim-lb-fs { margin-inline-start: auto; }

.flowim-lb-bar svg {
	width: 17px;
	height: 17px;
	display: block;
}

.flowim-lb-fs,
.flowim-lb-close {
	color: #9aa2a9;
	padding: 7px;
	transition: color .18s ease;
}

.flowim-lb-fs:hover,
.flowim-lb-close:hover { color: #fff; }

.flowim-lb-fs.on { color: #fff; }

.flowim-lb-bar button {
	appearance: none;
	background: none;
	border: 0;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
	cursor: pointer;
	padding: 6px 8px;
	line-height: 1;
	border-radius: 2px;
}

.flowim-lb button:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.flowim-lb-bar button:hover { color: #fff; }

/* Barre de zoom */

.flowim-lb-zoomset {
	display: flex;
	align-items: center;
	gap: 0;
	border: 1px solid #333b42;
	border-radius: 3px;
	overflow: hidden;
}

.flowim-lb-zoomset button {
	padding: 6px 12px;
	border-radius: 0;
	border-right: 1px solid #333b42;
	color: #9aa2a9;
	min-width: 40px;
	display: grid;
	place-items: center;
	font-variant-numeric: tabular-nums;
	transition: background-color .15s ease, color .15s ease;
}

.flowim-lb-zoomset button:hover { color: #fff; }

.flowim-lb-zoomset button:last-of-type { border-right: 0; }

.flowim-lb-zoomset button.on {
	background: #f2f2f2;
	color: #111;
}


.flowim-lb-zoomval {
	font-variant-numeric: tabular-nums;
	color: #6d757c;
	min-width: 3.6em;
}


/* Scène.
   min-width / min-height à 0 : sans ça la taille minimale automatique d'un
   élément remplacé impose sa dimension intrinsèque et l'image déborde du
   viewport. C'est la cause du « ça ne tient pas à l'écran ». */

.flowim-lb-stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	min-height: 0;
	overflow: hidden;
	padding: 0 clamp(16px, 6vw, 110px);
	touch-action: none;
}

/*
 * Le zoom passe par une transformation sur un calque, jamais par la taille de
 * mise en page de l'image. Une transformation s'applique aux deux axes à la
 * fois : il devient impossible qu'une règle extérieure contraigne la largeur
 * sans toucher la hauteur, ce qui déformait l'image.
 */
.flowim-lb-canvas {
	position: absolute;
	top: 0;
	left: 0;
	transform-origin: 0 0;
	will-change: transform;
	flex: none;
}

.flowim-lb-stage img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	min-width: 0;
	min-height: 0;
	object-fit: fill;
	opacity: 0;
	user-select: none;
	-webkit-user-drag: none;
}

.flowim-lb.is-zoomed .flowim-lb-stage img { cursor: grab; }
.flowim-lb.is-panning .flowim-lb-stage img { cursor: grabbing; }

/* Les flèches gênent l'inspection : on les efface dès qu'on zoome. */
.flowim-lb.is-zoomed .flowim-lb-nav {
	opacity: 0;
	pointer-events: none;
}

.flowim-lb-nav {
	position: absolute;
	top: 0;
	bottom: 0;
	width: clamp(56px, 9vw, 130px);
	display: grid;
	place-items: center;
	color: #fff;
	z-index: 2;
	transition: opacity .2s ease;
	padding: 0;
}

.flowim-lb-nav::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, rgba(0, 0, 0, .45), transparent);
	opacity: 0;
	transition: opacity .25s ease;
}

.flowim-lb-next::before {
	background: linear-gradient(270deg, rgba(0, 0, 0, .45), transparent);
}

.flowim-lb-nav:hover::before { opacity: 1; }

.flowim-lb .flowim-lb-nav,
.flowim-lb .flowim-lb-nav * {
	font-size: 0 !important;
	line-height: 0 !important;
	text-indent: -9999px;
	overflow: hidden;
	appearance: none;
	background: none;
	border: 0;
	cursor: pointer;
}

.flowim-lb-nav::after {
	content: "";
	position: relative;
	width: 54px;
	height: 54px;
	border: 1px solid rgba(255, 255, 255, .45);
	border-radius: 50%;
	background: rgba(0, 0, 0, .3) center / 18px 18px no-repeat;
	backdrop-filter: blur(3px);
	transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}

.flowim-lb-prev::after {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 4 L7 12 L15 20'/%3E%3C/svg%3E");
}

.flowim-lb-next::after {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 4 L17 12 L9 20'/%3E%3C/svg%3E");
}

.flowim-lb-nav:hover::after {
	background-color: rgba(255, 255, 255, .18);
	border-color: #fff;
	transform: scale(1.08);
}

.flowim-lb-nav::after {
	transition: background-color .22s ease, border-color .22s ease, transform .35s cubic-bezier(.22, .61, .36, 1);
}

.flowim-lb-nav:active::after { transform: scale(.96); }

.flowim-lb-prev { left: 0; }
.flowim-lb-next { right: 0; }

.flowim-lb-foot {
	display: flex;
	flex-wrap: wrap;
	gap: .3em 1.5em;
	padding: 14px 18px 22px;
	font-size: 13px;
	line-height: 1.45;
	color: #b8b8b8;
	min-height: 3em;
}

.flowim-lb-credit {
	margin-inline-start: auto;
	color: #7d7d7d;
}

.flowim-lb-spinner {
	position: absolute;
	width: 22px;
	height: 22px;
	border: 2px solid #3a3a3a;
	border-top-color: #f2f2f2;
	border-radius: 50%;
	animation: flowim-spin .7s linear infinite;
	opacity: 0;
	pointer-events: none;
}

.flowim-lb.is-loading .flowim-lb-spinner { opacity: 1; }

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

@media (max-width: 780px) {
	.flowim-lb-stage { padding: 0 8px; }
	.flowim-lb-nav { width: 52px; }
	.flowim-lb-nav::after { width: 40px; height: 40px; background-size: 15px 15px; }
	.flowim-lb-zoomset button { padding: 6px 9px; }
	.flowim-lb-foot { font-size: 12px; }
	.flowim-lb-fs { display: none; }
	.flowim-lb-zoomval,
	.flowim-lb-dims { display: none; }
	.flowim-lb-bar { gap: .5em; font-size: 11px; }
}
