/* ==========================================================================
   RESET E FONTS
   ========================================================================== */
:root {
    --margine-universale: 20px;
}

@font-face {
    font-family: "EvenMono";
    src: url("../fonts/EvenMono-Regular.otf") format("opentype");
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

*::-webkit-scrollbar { 
    display: none !important; 
    width: 0 !important; 
    height: 0 !important; 
    background: transparent !important; 
}

html, body { 
    -ms-overflow-style: none !important; 
    scrollbar-width: none !important; 
    width: 100%; 
    height: 100%; 
}

body {
    font-family: "EvenMono", monospace;
    font-size: 10px;
    background: black; 
    color: #ffffff; 
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body:not(.home-page) { 
    padding-top: 55px; 
    padding-bottom: 0px; 
}

body.home-page { 
    overflow: hidden !important; 
    position: fixed !important; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    touch-action: none; 
}

a { 
    color: inherit; 
    text-decoration: none; 
}

p, .text-eng span, .text-it span {
    margin-bottom: var(--margine-universale);
    line-height: 1.6;
}

.info-title, .info-year, .info-materials {
    margin-bottom: 0; 
    line-height: 1.6;
}

/* ==========================================================================
   LINGUA IN ALTO A SINISTRA
   ========================================================================== */
#topLeftLang {
    position: fixed;
    top: var(--margine-universale);
    left: var(--margine-universale);
    z-index: 2500;
    display: flex;
    gap: 8px;
}

.lang-switcher { 
    font-size: 10px; 
    cursor: pointer; 
    display: flex; 
    align-items: center;
    line-height: 1; 
}

.lang-btn { 
    cursor: pointer; 
    color: #ffffff; 
    opacity: 0.4;
    transition: opacity 0.3s ease;
    border-bottom: none; 
    padding-bottom: 0; 
}

.lang-btn.active { 
    opacity: 1;
}

/* ==========================================================================
   BARRA NERA IN ALTO
   ========================================================================== */
.top-bar-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 45px; 
    background: black;
    z-index: 1500; 
}

/* ==========================================================================
   MENU IN ALTO A DESTRA
   ========================================================================== */
#topRightMenu {
    position: fixed;
    top: var(--margine-universale);
    right: var(--margine-universale);
    display: flex;
    flex-direction: column;
    align-items: flex-end; 
    text-align: right;
    z-index: 2000;
    gap: var(--margine-universale);
}

.site-name {
    font-size: 10px;
    line-height: 1;
    color: #ffffff;
}

a.site-name {
    transition: opacity 0.3s ease;
}

a.site-name:hover {
    opacity: 1;
}

.menu-item {
    font-size: 10px;
    cursor: pointer;
    line-height: 1;
    color: #ffffff; 
}

/* TENDINE */
#projectsDropdown, #aboutDropdown {
    display: none; 
    flex-direction: column;
    align-items: flex-end;
}

.active-drop {
    display: flex !important;
    animation: dropDownOpen 0.4s ease forwards;
}

.closing-drop {
    display: flex !important;
    animation: dropDownClose 0.4s ease forwards;
}

.menu-sub-item { 
    font-size: 10px;
    line-height: 1.6; 
    cursor: pointer;
    color: #ffffff; 
}

.clicked-underline {
    text-decoration: underline;
    text-decoration-color: #ffffff;
    text-underline-offset: 3px;
}

#aboutDropdown {
    width: 90vw;
    max-width: 450px; 
    text-align: right;
    margin-top: 0; 
    background: transparent !important;
}

.about-section-dropdown {
    font-size: 10px;
    display: flex;
    flex-direction: column;
    background: transparent !important;
    color: #ffffff;
}

.about-section-dropdown p {
    margin: 0; 
    line-height: 1.6;
}

/* ==========================================================================
   LA SFERA (CINEMATIC BACKGROUND)
   ========================================================================== */
:root {
    --sfera-dimensione: 40vw;       
    --sfera-opacita: 1.0;           
}
#cinematic-background {
    position: fixed;
    top: 50%; left: 50%;
    width: var(--sfera-dimensione);
    height: var(--sfera-dimensione);
    margin-top: calc(var(--sfera-dimensione) / -2);
    margin-left: calc(var(--sfera-dimensione) / -2);
    background-image: url('../logosito.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    opacity: var(--sfera-opacita);
    z-index: 500; 
    pointer-events: none;
    animation-name: orbFloatRandom;
    animation-duration: var(--sfera-velocita-random, 45s);
    animation-timing-function: ease-in-out;
    animation-delay: var(--sfera-ritardo, 0s);
    animation-iteration-count: infinite;
    animation-direction: alternate;
}
@keyframes orbFloatRandom {
    0% { transform: translate(0px, 0px) scale(1); }
    33% { transform: translate(var(--rx1), var(--ry1)) scale(var(--rs1)); }
    66% { transform: translate(var(--rx2), var(--ry2)) scale(var(--rs2)); }
    100% { transform: translate(var(--rx3), var(--ry3)) scale(var(--rs3)); }
}

/* ==========================================================================
   BARRA INFERIORE (Copyright etc)
   ========================================================================== */
.overlay-bottom { 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    height: 45px; 
    background: black; 
    padding: 0 var(--margine-universale); 
    z-index: 2000; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}

body.home-page .overlay-bottom {
    background: transparent !important;
}

.bottom-left, .bottom-right { 
    display: flex; 
    align-items: center; 
    width: max-content !important; 
    min-width: max-content !important; 
    flex-shrink: 0 !important;
}
.bottom-center { 
    position: absolute; 
    left: 50%; 
    transform: translateX(-50%) translateY(-1px); 
    display: flex; 
    align-items: center; 
    white-space: nowrap; 
}
.nav-btn { 
    font-size: 10px; 
    cursor: pointer; 
    transition: opacity 0.3s; 
    border-bottom: none; 
    padding-bottom: 2px; 
    white-space: nowrap !important; 
}
.nav-btn:hover { opacity: 1; }
.copyright { font-size: 10px; display: flex; align-items: center; }
.copy-symbol { margin-right: 4px; font-size: 12px; }

/* ==========================================================================
   GRIGLIE PROGETTI E PAGINE SINGOLE (Artworks / Graphics)
   ========================================================================== */
#bookPages, #graphicsPages { 
    width: 100%; 
    padding: 0 var(--margine-universale) 45px var(--margine-universale); 
    margin-bottom: 0; 
}
.grafica-project { margin-bottom: 80px; }
.grafica-project:last-child { margin-bottom: 0; }

.grafica-images { margin-top: var(--margine-universale) !important; margin-bottom: var(--margine-universale); }
.grafica-images:last-child { margin-bottom: 0; } 

#bookPages.opere-2x2, .grafica-images.opere-2x2, #graphicsPages.opere-2x2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--margine-universale); }
#bookPages.opere-3x3, .grafica-images.opere-3x3, #graphicsPages.opere-3x3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--margine-universale); }
.grafica-images.opere-3x2 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--margine-universale); }

#bookPages img, #bookPages video, .grafica-images img, .grafica-images video, #graphicsPages img, #graphicsPages video { 
    width: 100%; height: auto; display: block; object-fit: cover; z-index: 1000; position: relative;
}
#bookPages img:not(:last-child), #bookPages video:not(:last-child) { margin-bottom: var(--margine-universale); }
#bookPages.opere-2x2 img, #bookPages.opere-2x2 video, #graphicsPages.opere-2x2 img, #graphicsPages.opere-2x2 video { margin-bottom: 0px; }

.info-grid { 
    display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--margine-universale); width: 100%; 
    align-items: start; 
    margin-top: 0; 
    padding: 0 var(--margine-universale) var(--margine-universale) var(--margine-universale); 
}
#graphicsPages .info-grid, #bookPages .info-grid { padding: 0 0 var(--margine-universale) 0; }
.info-left, .info-right { display: flex; flex-direction: column; } 


.span-2 {
    grid-column: span 2;
}



/* ==========================================================================
   MOBILE E FIX
   ========================================================================== */
@media (max-width: 600px) { 
    :root { --sfera-dimensione: 64vw; }
    #cinematic-background { top: 46%; }
    .grafica-images { margin-top: 0px !important; }
    .grafica-images.opere-3x2 { grid-template-columns: repeat(2, 1fr); }
    .grid-container, #bookPages.opere-2x2, .grafica-images.opere-2x2, #graphicsPages.opere-2x2, .info-grid, .opere-6x6, #bookPages.opere-3x3, .grafica-images.opere-3x3, #graphicsPages.opere-3x3 { grid-template-columns: 1fr; }
    
    /* NUOVO CODICE: Nasconde i <br> su mobile nel menu About */
    .about-section-dropdown p br {
        display: none;
    }

    .br-desktop { 
        display: none; 
    }
    .br-mobile { 
        display: initial; 
    }


    .span-2 {
        grid-column: span 1;
    }

    
}

/* Nascondi di default gli a capo per il mobile */
.br-mobile {
    display: none;
}




html[lang="IT"] .text-eng { display: none !important; }
html[lang="ENG"] .text-it { display: none !important; }

video::-webkit-media-controls { display: none !important; opacity: 0 !important; }
video { pointer-events: none !important; user-select: none !important; outline: none !important; }


/* ==========================================================================
   READ MORE / READ LESS BUTTONS
   ========================================================================== */
.read-more-btn {
    cursor: pointer;
    color: #ffffff;
    opacity: 1;
    transition: opacity 0.3s ease;
    font-size: 10px;
    text-decoration: none;
    
    /* Si comporta come un normale testo a capo */
    display: inline-block; 
    margin: 0; 
}

.read-less-btn {
    cursor: pointer;
    color: #ffffff;
    opacity: 1;
    transition: opacity 0.3s ease;
    font-size: 10px;
    text-decoration: none;
    
    /* Aggiunge lo spazio esatto sopra, quello sotto è gestito dalla griglia */
    display: block; 
    margin-top: var(--margine-universale); 
    margin-bottom: 0; 
}

.read-more-btn:hover, .read-less-btn:hover {
    opacity: 1;
}

.hidden-text {
    display: none;
}