*{
box-sizing:border-box;
margin:0;
padding:0;
}
body{
background-color:#e0e0e0;
color:#000;
font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
overflow:hidden;
height:100dvh;
touch-action:none;
}
#gallery{
margin-top:0;
}
.gallery-viewport{
display:flex;
justify-content:center;
align-items:center;
width:100vw;
height:100vh;
overflow:hidden;
position:relative;
}
.viewport-vignette{
position:absolute;
top:50%;
left:50%;
width:600px;
height:600px;
background:radial-gradient(circle,rgba(255,255,255,0.1)0%,rgba(0,0,0,0)80%);
pointer-events:none;
z-index:0;
transform:translate(-50%,-50%);
}
.gallery-container {
    width: auto;
    height: 100dvh;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    /* Cambia 0.8s in 2.5s o 3s per un movimento molto più fluido e lento */
    transition: transform 2.5s linear;
    will-change: transform;
}
.gallery-container.smooth-walk{
transition:transform 4s cubic-bezier(0.42,0,0.58,1);
}
.grand-wall{
display:flex;
flex-direction:row;
width:auto;
height:100dvh;
}
.wall-left,.wall-right,.wall-module{
width:100vw;
height:100dvh;
flex-shrink:0;
display:flex;
justify-content:center;
align-items:center;
}
.grand-wall.wall-left {
    display: flex;
    flex-direction: row;
    width: auto;
    height: 100dvh;
    flex-wrap: nowrap;
}
.wall-module {
    position: relative; /* Il frame absolute si posizionerà rispetto a questo */
    width: 100vw;
    height: 100dvh;
    flex-shrink: 0;
    display: flex; /* Aggiunto per aiutare il posizionamento */
    justify-content: center;
    align-items: center;
}
.frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #0d0d0d;
    padding: 12px;
    z-index: 100;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-end;
    gap: 20px;
    box-shadow: 0 8px 14px rgba(0,0,0,.4), 0 40px 80px rgba(0,0,0,.3);
}
.frame.active{
}
.frame.loaded::after{
content:'';
position:absolute;
top:0;
left:0;
right:0;
bottom:0;
pointer-events:none;
}
.frame img{
width:auto;
height:auto;
max-height:calc(100dvh - 400px);
max-width:calc(100dvw - 60px);
object-fit:contain;
display:block;
backface-visibility:hidden;
-webkit-backface-visibility:hidden;
image-rendering:-webkit-optimize-contrast;
image-rendering:crisp-edges;
filter:contrast(1.08) saturate(1.08) brightness(1.02);
}
.frame.loaded img{
}

.frame-content {
    cursor: grab;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}
.artwork-label {
    display:none;
    position: absolute;
    left: calc(100% + 20px);
    bottom: 0;
    margin-top: 0;
    padding: 12px 20px;
    background: #f2ede4;
    border: 4px solid #fff;
    color: #0d0d0d;
    font-family: serif;
    font-size: 16px;
    text-align: center;
    box-shadow: 4px 4px 0 rgba(0,0,0,.2);
    min-width: 180px;
    max-width: 200px;
    z-index: 999;
    flex-shrink: 0;
}
.artwork-label .label-number{
font-size:15px;
font-weight:bold;
color:#555;
border-bottom:1px solid #ddd;
padding-bottom:4px;
}
.artwork-label .label-title{
font-style:italic;
font-weight:600;
text-transform:uppercase;
}

.audio-control {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000;
    cursor: pointer;
    pointer-events: auto;

}
.audio-icon {
    width: 28px;
    height:28px;
}


body.zoomed .ui-panel,body.zoomed #stepIndicator{
opacity:0;
pointer-events:none;
transition:opacity .3s ease;
}
body.zoomed .gallery-viewport{
width:100vw;
height:100vh;
}
.ui-container{
position:fixed;
bottom:10px;
left:50%;
transform:translateX(-50%);
z-index:10000;
display:flex;
justify-content:center;
}
.nav-main{
display:flex;
justify-content:space-between;
align-items:center;
width:100%;
gap:8px;
}
.step-txt{
font-size:16px;
text-transform:uppercase;
letter-spacing:1px;
color:#000;
min-width:70px;
text-align:center;
}
.btn-arrow,.btn-jump,.btn-sec,.btn-reset{
background:rgba(255,255,255,.8);
border:1px solid #333;
padding:5px 12px;
font-size:13px;
cursor:pointer;
border-radius:4px;
}
.nav-shortcuts{
display:flex;
justify-content:space-between;
gap:5px;
width:100%;
border-top:1px solid #222;
padding-top:10px;
margin-top:3px;
}
.nav-reset{
margin-top:6px;
display:flex;
justify-content:center;
}
nav,.nav-main,.nav-main2{
z-index:9999;
pointer-events:none;
background:transparent!important;
}
.nav-main,.nav-main2,#menu,.btn-arrow,.btn-jump,.btn-sec,.btn-reset{
pointer-events:auto;
}
.btn-arrow {
    font-size: 18px;
    padding:3px;
    font-weight: 400;

}

.nav-hidden{
display:none!important;
}
.mobile-notice{
position:fixed;
top:50%;
left:50%;
transform:translate(-50%,-50%);
width:85%;
background:rgba(0,0,0,.75);
color:#fff;
text-align:center;
padding:20px;
z-index:9999;
border:1px solid #444;
border-radius:8px;
box-shadow:0 0 20px rgba(0,0,0,.5);
font-size:22px!important;
pointer-events:auto;
}

#audio-control{
filter: drop-shadow(1px 0 0 white)
            drop-shadow(-1px 0 0 white)
            drop-shadow(0 1px 0 white)
            drop-shadow(0 -1px 0 white);

}

/* Contenitore principale della nuova UI */
.ui-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    z-index: 100;
}

.ui-panel {
    background: rgba(255, 255, 255, 0);
    padding: 12px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.gallery-label-container {
    margin-bottom: 8px;
    text-align: center;
}

.gallery-work-title {
    color: #000;
    font-size: 14px;
    font-weight:800;
    letter-spacing: 1px;
    text-transform: uppercase;
    filter: drop-shadow(1px 0 0 rgba(255, 255, 255, 0.5))
        drop-shadow(-1px 0 0 rgba(255, 255, 255, 0.5))
        drop-shadow(0 1px 0 rgba(255, 255, 255, 0.5))
        drop-shadow(0 -1px 0 rgba(255, 255, 255, 0.5));
}

.thumb-nav-wrapper, {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    margin-top: 10px;
}

.ui-panel {
    width: 100%;
    margin-top: 10px;
}

.btn-thumb-arrow#thumbPrev,
.btn-thumb-arrow#thumbNext {
    background: transparent;
    color: #000000;
    border: none;
    width: 42px;
    height: 42px;
    cursor: pointer;
    z-index: 9999;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 80px;
    filter: drop-shadow(1px 0 0 white) drop-shadow(-1px 0 0 white) drop-shadow(0 1px 0 white) drop-shadow(0 -1px 0 white);
}

button.btn-thumb-arrow#thumbPrev {
    left: 20px;
}

button.btn-thumb-arrow#thumbNext {
    right: 20px;
}

button.btn-thumb-arrow#thumbPrev:hover,
button.btn-thumb-arrow#thumbNext:hover {
background: #eeeeee;
    transform: scale(1.05);
}

.thumb-nav-container {
    width: 100%;
    height: 70px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0);
    border-radius: 6px;
}

.thumb-nav-container::-webkit-scrollbar {
    display: none;
}

.thumb-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 14px;
    padding: 0;
    align-items: center;
    padding-left: calc(50% - 25px);
    padding-right: calc(50% - 25px);
}

.thumb-item {
    width: 60px;
    height: 60px;
    object-fit: cover;
    opacity: 0.25;
    cursor: pointer;
    border: 1px solid transparent;
    transition: opacity 0.3s, transform 0.3s, border-color 0.3s;
    flex-shrink: 0;
}

.thumb-item.active {
    opacity: 1;
    transform: scale(1.15);
    border-color: #ffffff;
}

@media(max-width:1920px) and (max-height:1080px){
    .thumb-item {
    width: 50px;
    height: 50px;
    }
  .artwork-label { transform: scale(var(--ui-scale)); }
  .ui-panel { transform: scale(calc(1.2 * var(--ui-scale))); }
  .frame img{
    max-height: calc(100dvh - (400px * var(--ui-scale)));
    max-width: calc(100dvw - (60px * var(--ui-scale)));
  }
  .viewport-vignette { transform: scale(var(--ui-scale)); }
  .frame { padding: calc(12px * var(--ui-scale)); }
  .audio-control{ transform:scale(.75); }
}

@media(max-width:1920px) and (min-height:1081px) {
  .artwork-label{
    top:-80px; right: 0; left: auto; bottom: auto; margin-top:0;
    padding:12px 20px; background:#f2ede4; min-width:180px; max-width:200px;
    z-index:999; transform:scale(.96);
  }
}

@media(max-width:1024px){
  #audio-control{ transform:scale(.7); }
  .artwork-label{ transform:scale(.6); margin-top:5px; }
  .frame { flex-direction: column; align-items: center; }
  .ui-panel{ transform:scale(.92); }
  .viewport-vignette{ transform:scale(.8); }
  button.btn-thumb-arrow#thumbPrev,
  button.btn-thumb-arrow#thumbNext {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  button.btn-thumb-arrow#thumbPrev { left: -18px; }
  button.btn-thumb-arrow#thumbNext { right: -18px; }
}

@media(max-width:600px){
  .artwork-label{ transform:scale(.5); margin-top:5px; }
  .ui-panel{ transform:scale(.96); }
  .viewport-vignette{ transform:scale(.85); }
  button.btn-thumb-arrow#thumbPrev,
  button.btn-thumb-arrow#thumbNext {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  button.btn-thumb-arrow#thumbPrev { left: -16px; }
  button.btn-thumb-arrow#thumbNext { right: -16px; }
}
