/* NavalHEAD — Galleria trascinabile con vista a tutto schermo (assets/js/gallery.js). */

/* Striscia: foto alla stessa altezza, larghezza naturale; si scorre col dito o trascinando col mouse. */
.nh-gallery__track {
	display: flex;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scrollbar-width: none; /* niente barra: si scorre trascinando */
	cursor: grab;
    box-shadow: 0 0 200px rgba(10, 61, 85, 0.1);
    border-bottom: 1px solid #e8edff;
    border-top: 1px solid #e8edff;
}

.nh-gallery__track::-webkit-scrollbar {
	display: none;
}

.nh-gallery__track.is-dragging {
	cursor: grabbing;
}

.nh-gallery__item {
	flex: 0 0 auto;
}

.nh-gallery__open {
	display: block;
	padding: 0;
	border: 0;
	background: none;
	cursor: inherit;
}

.nh-gallery__open:focus-visible {
	outline: 2px solid var(--nh-blue);
	outline-offset: -4px;
}

.nh-gallery__image {
	display: block;
	width: auto;
	height: clamp(12rem, 25vw, 24rem);
	max-width: none;
	-webkit-user-drag: none;
	user-select: none;
}

/* Vista a tutto schermo. */
.nh-lightbox {
	position: fixed;
	inset: 0;
	box-sizing: border-box;
	width: 100vw;
	height: 100vh;
	height: 100dvh;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: clamp(3.5rem, 6vw, 5rem) clamp(1rem, 6vw, 6rem);
	border: 0;
	background: rgb(0 0 0 / 0.92);
	color: #fff;
	overscroll-behavior: contain;
}

.nh-lightbox[open] {
	display: flex;
	align-items: center;
	justify-content: center;
	animation: nh-lightbox-in 0.35s ease;
}

.nh-lightbox::backdrop {
	background: transparent;
}

@keyframes nh-lightbox-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.nh-lightbox__figure {
	margin: 0;
	max-width: 100%;
	max-height: 100%;
}

.nh-lightbox__image {
	display: block;
	max-width: 100%;
	max-height: calc(100dvh - 2 * clamp(3.5rem, 6vw, 5rem));
	width: auto;
	height: auto;
	object-fit: contain;
	user-select: none;
	-webkit-user-drag: none;
}

/* Pulsanti: icone sottili bianche. */
.nh-lightbox__close,
.nh-lightbox__nav {
	position: absolute;
	display: grid;
	place-items: center;
	width: 3rem;
	height: 3rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	cursor: pointer;
	opacity: 0.8;
	transition: opacity 0.2s ease, background-color 0.2s ease;
}

.nh-lightbox__close:hover,
.nh-lightbox__nav:hover,
.nh-lightbox__close:focus-visible,
.nh-lightbox__nav:focus-visible {
	opacity: 1;
	background: rgb(255 255 255 / 0.12);
}

.nh-lightbox__close:focus-visible, .nh-lightbox__nav:focus-visible {
    outline: none;
    background: rgba(242, 242, 242, 0.3);
}

.nh-lightbox svg {
	width: 1.5rem;
	height: 1.5rem;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.nh-lightbox__close {
	top: clamp(0.5rem, 2vw, 1.25rem);
	right: clamp(0.5rem, 2vw, 1.25rem);
}

.nh-lightbox__nav {
	top: 50%;
	translate: 0 -50%;
}

.nh-lightbox__nav--prev {
	left: clamp(0.25rem, 2vw, 1.5rem);
}

.nh-lightbox__nav--next {
	right: clamp(0.25rem, 2vw, 1.5rem);
}

.nh-lightbox__counter {
	position: absolute;
	bottom: clamp(0.75rem, 2vw, 1.5rem);
	left: 50%;
	margin: 0;
	font-size: 0.875rem;
	opacity: 0.8;
	translate: -50% 0;
}

/* Pagina ferma sotto la vista a tutto schermo. */
html.nh-lightbox-open {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.nh-lightbox[open] {
		animation: none;
	}
}
