/* =====================================================================
   LIGHTHUG — Portfolio Progetti
   Tutti i valori si regolano dal pannello Elementor (variabili CSS).
   ===================================================================== */

.lhp {
	--lhp-accent: #FF006E;
	position: relative;
}

/* ---------------------------------------------------------------- Filtri */

.lhp-filters {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	column-gap: 32px;
	row-gap: 16px;
	margin: 0 0 40px;
	padding: 0;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}
.lhp-filters::-webkit-scrollbar { display: none; }

.lhp .lhp-filters button.lhp-filter {
	-webkit-appearance: none;
	appearance: none;
	position: relative;
	flex: 0 0 auto;
	margin: 0;
	padding: 8px 0;
	background: transparent;
	border: 0 solid transparent;
	border-radius: 0;
	box-shadow: none;
	color: rgba(255, 255, 255, .6);
	font: inherit;
	font-size: 14px;
	line-height: 1.4;
	letter-spacing: .04em;
	text-transform: none;
	white-space: nowrap;
	cursor: pointer;
	transition: color .3s ease, background-color .3s ease, border-color .3s ease;
}
.lhp .lhp-filters button.lhp-filter:hover,
.lhp .lhp-filters button.lhp-filter:focus {
	background-color: transparent;
	color: #fff;
}
.lhp .lhp-filters button.lhp-filter.is-active {
	color: var(--lhp-accent);
}
.lhp .lhp-filters button.lhp-filter:focus { outline: none; }
.lhp .lhp-filters button.lhp-filter:focus-visible {
	outline: 1px solid var(--lhp-focus, var(--lhp-accent));
	outline-offset: 4px;
}
.lhp-filter::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: var(--lhp-line, 1px);
	background: var(--lhp-line-color, var(--lhp-accent));
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform .35s ease;
}
.lhp-filter.is-active::after { transform: scaleX(1); }
.lhp-filter__count {
	display: inline-block;
	margin-left: .35em;
	font-size: .72em;
	vertical-align: super;
	line-height: 0;
	opacity: .75;
}

/* ---------------------------------------------------------------- Griglia */

.lhp-grid {
	--lhp-row: 4px;
	display: grid;
	grid-template-columns: repeat(var(--lhp-cols, 12), minmax(0, 1fr));
	column-gap: var(--lhp-gap-x, 15px);
	row-gap: var(--lhp-gap-y, 15px);
	align-items: start;
	transition: opacity var(--lhp-fd, 200ms) ease;
}
.lhp-grid--dense { grid-auto-flow: row dense; }

/* Quando il JS ha calcolato le altezze: righe da 4px = incastro "puzzle" */
.lhp-grid.is-ready {
	grid-auto-rows: var(--lhp-row);
	row-gap: 0;
	margin-bottom: calc(-1 * var(--lhp-gap-y, 15px));
}
.lhp-grid.is-switching { opacity: 0; }

.lhp-item {
	min-width: 0;
	grid-column: span var(--lhp-span, 3);
}
.lhp-size-s  { --lhp-span: var(--lhp-span-s, 2); }
.lhp-size-m  { --lhp-span: var(--lhp-span-m, 3); }
.lhp-size-l  { --lhp-span: var(--lhp-span-l, 4); }
.lhp-size-xl { --lhp-span: var(--lhp-span-xl, 6); }
.lhp-item[hidden] { display: none !important; }

.lhp-blank {
	display: var(--lhp-blank-display, block);
	grid-column: span var(--lhp-span-blank, 2);
	aspect-ratio: 1 / 1;
	pointer-events: none;
}
.lhp-grid.is-ready .lhp-blank { aspect-ratio: auto; }
.lhp-grid.is-filtered.lhp-grid--hide-blanks .lhp-blank { display: none; }

/* ---------------------------------------------------------------- Card */

.lhp .lhp-card {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: var(--lhp-ratio, 1.5);
	background: var(--lhp-card-bg, #111);
	border-radius: var(--lhp-radius, 0);
	color: inherit;
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
	isolation: isolate;
}
.lhp-grid.is-ready .lhp-card {
	aspect-ratio: auto;
	height: var(--lhp-h, auto);
}
.lhp .lhp-card:focus { outline: none; }
.lhp .lhp-card:focus-visible {
	outline: 2px solid var(--lhp-focus, var(--lhp-accent));
	outline-offset: 3px;
}

.lhp-media {
	position: absolute;
	inset: 0;
	display: block;
	filter: grayscale(var(--lhp-gray, 100%)) brightness(var(--lhp-bright, 100%)) contrast(var(--lhp-contrast, 100%));
	transition: filter var(--lhp-dur, 700ms) ease, transform var(--lhp-dur, 700ms) ease;
	transform: translateZ(0);
}
.lhp .lhp-media img,
.lhp .lhp-media video {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	object-fit: cover;
	object-position: center;
}

.lhp-veil {
	position: absolute;
	inset: 0;
	background: var(--lhp-veil, transparent);
	transition: background-color var(--lhp-dur, 700ms) ease;
	pointer-events: none;
}

.lhp-title {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 28px 16px 14px;
	background: linear-gradient(to top, var(--lhp-title-shade, rgba(0, 0, 0, .55)), transparent);
	color: #fff;
	font-size: 14px;
	line-height: 1.3;
	pointer-events: none;
	transition: opacity .4s ease, transform .4s ease;
}
.lhp--title-hover .lhp-title {
	opacity: 0;
	transform: translateY(8px);
}

/* Stato "colore": passaggio del mouse, tastiera, touch */
.lhp .lhp-card:focus-visible .lhp-media {
	filter: grayscale(var(--lhp-gray-h, 0%)) brightness(var(--lhp-bright-h, 100%)) contrast(var(--lhp-contrast-h, 100%));
}
@media (hover: hover) {
	.lhp .lhp-card:hover .lhp-media {
		filter: grayscale(var(--lhp-gray-h, 0%)) brightness(var(--lhp-bright-h, 100%)) contrast(var(--lhp-contrast-h, 100%));
		transform: scale(var(--lhp-zoom, 1.03));
	}
	.lhp .lhp-card:hover .lhp-veil { background: var(--lhp-veil-h, transparent); }
	.lhp--title-hover .lhp-card:hover .lhp-title {
		opacity: 1;
		transform: none;
	}
}
@media (hover: none) {
	.lhp--touch-color .lhp-media,
	.lhp--touch-inview .lhp-item.is-active .lhp-media {
		filter: grayscale(var(--lhp-gray-h, 0%)) brightness(var(--lhp-bright-h, 100%)) contrast(var(--lhp-contrast-h, 100%));
	}
	.lhp--touch-color .lhp-veil,
	.lhp--touch-inview .lhp-item.is-active .lhp-veil { background: var(--lhp-veil-h, transparent); }
	.lhp--touch-inview.lhp--title-hover .lhp-item.is-active .lhp-title,
	.lhp--touch-color.lhp--title-hover .lhp-title {
		opacity: 1;
		transform: none;
	}
}

/* Animazione di entrata */
.lhp.lhp-js.lhp--reveal .lhp-item {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1);
}
.lhp.lhp-js.lhp--reveal .lhp-item.is-in {
	opacity: 1;
	transform: none;
}

.lhp-empty {
	margin: 0;
	padding: 48px 0;
	text-align: center;
	color: rgba(255, 255, 255, .6);
}
.lhp-empty[hidden] { display: none; }

/* ---------------------------------------------------------------- Lightbox */

html.lhp-lb-lock,
html.lhp-lb-lock body { overflow: hidden; }

.lhp-lb {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto auto;
	background: var(--lhp-lb-bg, rgba(0, 0, 0, .96));
	color: var(--lhp-lb-text-color, rgba(255, 255, 255, .7));
	font-family: var(--lhp-lb-font, inherit);
	opacity: 0;
	visibility: hidden;
	transition: opacity .35s ease, visibility 0s linear .35s;
}
.lhp-lb.is-open {
	opacity: 1;
	visibility: visible;
	transition: opacity .35s ease, visibility 0s;
}
.lhp-lb [hidden] { display: none !important; }

.lhp-lb__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 64px;
	padding: 10px 14px 10px 24px;
}
.lhp-lb__counter {
	font-size: var(--lhp-lb-text-size, 14px);
	letter-spacing: .08em;
	font-variant-numeric: tabular-nums;
}

.lhp-lb__stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 0;
	padding: 0 var(--lhp-lb-pad, 60px);
	touch-action: pan-y pinch-zoom;
	-webkit-user-select: none;
	user-select: none;
}
.lhp-lb__slide {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	animation: lhpFade .45s ease both;
}
.lhp-lb__slide.is-from-left  { animation-name: lhpFromLeft; }
.lhp-lb__slide.is-from-right { animation-name: lhpFromRight; }
.lhp-lb .lhp-lb__slide img,
.lhp-lb .lhp-lb__slide video {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	margin: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	object-fit: contain;
	background: transparent;
}
.lhp-lb .lhp-lb__slide video { width: 100%; height: 100%; }
.lhp-lb__slide.is-loading::before {
	content: "";
	position: absolute;
	width: 28px;
	height: 28px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	opacity: .5;
	animation: lhpSpin .8s linear infinite;
}

.lhp-lb button.lhp-lb__btn {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--lhp-lb-arrow, 44px);
	height: var(--lhp-lb-arrow, 44px);
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: var(--lhp-lb-ui, #fff);
	cursor: pointer;
	transition: color .25s ease, opacity .25s ease;
}
.lhp-lb button.lhp-lb__btn:hover,
.lhp-lb button.lhp-lb__btn:focus {
	background: transparent;
	color: var(--lhp-lb-ui-h, #FF006E);
	outline: none;
}
.lhp-lb button.lhp-lb__btn:focus-visible { outline: 1px solid currentColor; outline-offset: 2px; }
.lhp-lb button.lhp-lb__btn[disabled] { opacity: .2; cursor: default; }
.lhp-lb__btn svg {
	width: 62%;
	height: 62%;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.4;
	stroke-linecap: round;
	stroke-linejoin: round;
	filter: drop-shadow(0 0 3px rgba(0, 0, 0, .45));
	pointer-events: none;
}
.lhp-lb button.lhp-lb__prev,
.lhp-lb button.lhp-lb__next {
	position: absolute;
	top: 50%;
	z-index: 2;
	transform: translateY(-50%);
}
.lhp-lb button.lhp-lb__prev { left: max(4px, calc((var(--lhp-lb-pad, 60px) - var(--lhp-lb-arrow, 44px)) / 2)); }
.lhp-lb button.lhp-lb__next { right: max(4px, calc((var(--lhp-lb-pad, 60px) - var(--lhp-lb-arrow, 44px)) / 2)); }

.lhp-lb__info {
	width: 100%;
	max-width: 900px;
	margin: 0 auto;
	padding: 16px 24px 4px;
	text-align: center;
}
.lhp-lb .lhp-lb__title {
	margin: 0;
	padding: 0;
	color: var(--lhp-lb-title-color, #fff);
	font-family: inherit;
	font-size: var(--lhp-lb-title-size, 18px);
	font-weight: var(--lhp-lb-title-weight, 500);
	text-transform: var(--lhp-lb-title-transform, none);
	letter-spacing: .02em;
	line-height: 1.3;
}
.lhp-lb .lhp-lb__text,
.lhp-lb .lhp-lb__caption {
	margin: 6px 0 0;
	font-size: var(--lhp-lb-text-size, 14px);
	line-height: 1.5;
}
.lhp-lb .lhp-lb__caption { opacity: .8; font-style: italic; }

.lhp-lb__thumbs {
	display: var(--lhp-lb-thumbs-display, flex);
	gap: 8px;
	overflow-x: auto;
	padding: 12px 20px 18px;
	scrollbar-width: none;
}
.lhp-lb__thumbs::-webkit-scrollbar { display: none; }
.lhp-lb__thumbs > :first-child { margin-left: auto; }
.lhp-lb__thumbs > :last-child { margin-right: auto; }
.lhp-lb button.lhp-lb__thumb {
	position: relative;
	flex: 0 0 auto;
	width: var(--lhp-lb-thumb, 64px);
	height: var(--lhp-lb-thumb, 64px);
	padding: 0;
	border: 0;
	border-radius: 0;
	background: #222 center / cover no-repeat;
	opacity: .4;
	outline: 1px solid transparent;
	outline-offset: 2px;
	cursor: pointer;
	transition: opacity .25s ease, outline-color .25s ease;
}
.lhp-lb button.lhp-lb__thumb:hover { opacity: .8; background-color: #222; }
.lhp-lb button.lhp-lb__thumb.is-active {
	opacity: 1;
	outline-color: var(--lhp-lb-accent, #FF006E);
}
.lhp-lb__thumb.is-video::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	border-style: solid;
	border-width: 7px 0 7px 12px;
	border-color: transparent transparent transparent #fff;
	transform: translate(-40%, -50%);
	filter: drop-shadow(0 0 2px rgba(0, 0, 0, .6));
}

@keyframes lhpFade      { from { opacity: 0; } to { opacity: 1; } }
@keyframes lhpFromRight { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes lhpFromLeft  { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
@keyframes lhpSpin      { to { transform: rotate(360deg); } }

@media (max-width: 767px) {
	.lhp-lb__bar { min-height: 56px; padding-left: 16px; }
	.lhp-lb__info { padding: 12px 16px 4px; }
}

@media (prefers-reduced-motion: reduce) {
	.lhp-media,
	.lhp-grid,
	.lhp.lhp-js.lhp--reveal .lhp-item,
	.lhp-lb,
	.lhp-lb__slide { transition: none !important; animation: none !important; }
	.lhp.lhp-js.lhp--reveal .lhp-item { opacity: 1; transform: none; }
}
