#gallery-defaultImageContainer {
	position: relative;
	width: 99%;
	height: 100%;
	flex: 1 1 auto;
	overflow: hidden; 
	display: flex;
	margin: 0.4vh 0 0 0.4vw;
	border: 0.1vh solid #222222;
	
	touch-action: none;
	
		/*border: 1px solid orange;*/		
}

#gallery-defaultImage {
    width: 100%;
	height: auto;
	object-fit: contain;
	
    display: block;
    user-select: none;
    -webkit-user-drag: none;
    transition: transform 0.25s ease;
	
	touch-action: none;	
}

.gallery-topBar,
.gallery-bottomBar {
    position: absolute;
    left: 0;
    width: 100%;
    padding: 0px 12px;
    background: rgba(0, 0, 0, 0.45);
    color: white;
	font-family: "Courier New", Courier, monospace;
	font-size: max(1.7vmin, 14px);
    display: flex;
    align-items: center;
    z-index: 20;
	opacity: 0; transition: opacity 0.3s ease;
    pointer-events: none; /* evita interferenze con swipe */
}

@media (orientation: portrait) {
	.gallery-topBar,
	.gallery-bottomBar {
		letter-spacing: -1px;
	}
}

.gallery-topBar {
    top: 0;
    justify-content: space-between;
}

.gallery-bottomBar {
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

#gallery-defaultTitle,
#gallery-fullScreenTitle {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0; /* fondamentale per flexbox */
    flex: 1;      /* permette al testo di occupare lo spazio centrale */
    text-align: center;
}

.gallery-topBar button {
    pointer-events: auto; /* riattiva click solo sul pulsante */
}

.gallery-topBar i,
.gallery-bottomBar i {
    font-size: 20px;
}

.gallery-controlsVisible .gallery-topBar,
.gallery-controlsVisible .gallery-bottomBar {
	opacity: 1;
}

/* Pulsanti */
.gallery-buttonNavigation {
    position: absolute;
    background: rgba(0,0,0,0.4);
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 10;
}

.gallery-buttonNavigation i {
    font-size: 24px;
    color: white;
    pointer-events: none; /* evita che il click colpisca l’icona invece del bottone */
}

/* Posizioni */
.gallery-buttonNavigation.gallery-buttonLeft {
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.gallery-buttonNavigation.gallery-buttonRight {
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.gallery-buttonNavigation.gallery-buttonExpand {
    top: 0;
    right: 10px;
}

.gallery-buttonNavigation.gallery-buttonCompress {
    top: 0;
    right: 20px;
    font-size: 24px;
    color: white;
}

/* Modalità full screen */
#gallery-fullScreenImageContainer {
    position: fixed;
    inset: 0;
    background: black;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
	
	touch-action: none;
}

#gallery-fullScreenImageContainer.gallery-hidden {
    display: none;
}

#gallery-fullScreenImageContainer img {
    max-width: 100%;
    max-height: 100%;
    user-select: none;
    -webkit-user-drag: none;
    transition: transform 0.25s ease;
    pointer-events: auto; /* NECESSARIO per il drag */
	
	touch-action: none;
}

.gallery-buttonNavigation {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-controlsVisible .gallery-buttonNavigation {
    opacity: 1;
}

#gallery-thumbsContainer {
	width: 99.1%;
	flex: 0 0 auto;
	overflow-x: scroll; 
	margin: 1.4vh 0 0 0.35vw;
	border: 0.1vh solid #222222;
	
		/*border: 1px solid blue;*/
}

#gallery-thumbsStrip {
	margin: 0 0 0 0;
}

.gallery-thumbSel {
	cursor: default;
	opacity: 0.75;
	filter: alpha(opacity=75);
	border: 0.2vmin solid #FFCC00;
	box-shadow: 0 0 1vmin #FFCC00;
	width: 5dvmax;
	height: auto;
	min-width: 48px;
	margin: 0 4px 0 4px;
}

.gallery-thumbUnsel {
	cursor: pointer;
	opacity: 0.5;
	filter: alpha(opacity=50);
	width: 5dvmax;
	height: auto;
	min-width: 48px;
	margin: 0 4px 0 4px;
}

.gallery-thumbUnsel:hover {
	opacity: 1;
	filter: alpha(opacity=100);
}