:root {
    --wideScreen: True;
    --color1: #cacaca;
    --color2: #f7d9ad;
    --color3: #542E71;
    --color4: #de7b0a;
    --color5: #d7b052;
    --color6: #2B1F4D;
    --colorBackground: #140221;
    --text: #e5e5e5;
    --dividers: #d1c2adda;
    --footer: #3b373dc7;
    --font-family-header: "Garamond", serif;
    --font-family-text: "Trebuchet MS", sans-serif;
    --font-family-navbar: "Roboto Condensed", sans-serif;
    --buttons: 'Tahoma', sans-serif;
  }

body {
    margin: 0;
    width: 100%;
    height: 100%;
    background-color: var(--colorBackground);
    overflow-x: hidden; /* Rimuove la barra di scorrimento orizzontale */
    font-family: var(--font-family-text);
    font-weight: 400;
    font-style: normal;
}

/************************/
/* INIZIO items gallery */
/************************/

#gallery {
    position: relative;
    width: 100%;
    display: grid;
    /* grid-template-rows: 7vh 5vh 65vh 13vh auto; */ /* Five rows in Gallery container */
    z-index: 2;
    padding-top: 30px;
}

#search-space {
    color: white;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: auto;
}


#search-bar {
    height: 100%;
    width: 830px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.search-div {
    color: white;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#narratives-space {
    height: 60%;
    gap: 5%;
}

/* Inizio area filtri narrative */

.narrative {
    height: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5%;
    font-size: 1.2em;
}

.select {
    position: relative;
    height: 1.4em;
    width: auto;
    display: flex;
    flex-direction: column;
    text-wrap: nowrap;
    background-color: var(--colorBackground);
    color: #252222;
    border: solid 0.5px #8a7d61b0;
    color: var(--color1);
    border-radius: 2px;
    padding: 8px;
}

.select:hover {
    border: solid 0.5px var(--dividers);
}

.selected-box {
    position: relative;
}

.selected {
    position: relative;
}

.arrow-down {
    position: absolute;
    top: 30%;
    right: 3%;
    width: 0; 
    height: 0; 
    border-left: calc(1em / 2.5) solid transparent;
    border-right: calc(1em / 2.5) solid transparent;
    border-top: calc(1em / 2.5) solid white;
}

.toggle-options {
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.options {
    background-color: var(--color3);
    z-index: 10 !important;
    visibility: hidden;
    transition: visibility 0.3s ease, opacity 0.3s ease; /* Animazione fluida */
    border-radius: 3px;
}
.options.visible {
    visibility: visible; /* Mostra il dropdown */
    opacity: 1; /* Rendi visibile */
}

.option {
    position: relative;
}

.option:hover {
    background-color: var(--color6);
}

/* Fine area filtri */

/* Stile per il bottone "filter" */
.button.filter {
    display: flex;
    background-color: var(--colorBackground);
    color: var(--text);
    border: none;
    border-radius: 8px;
    padding: 6px 16px;
    font-family: var(--buttons);
    font-weight: bold;
    font-size: 1.2em;
    cursor: pointer; /* Mostra il puntatore come cliccabile */
    transition: all 0.3s ease; /* Transizioni fluide per hover e active */
    align-items: center;
}

.filter-icon {
    width: 1.8vw;
    height: 1.7vw;
    margin-right: 8px; /* Distanza tra l'icona e il testo */
}

.filter-icon img {
    max-width: 100%; /* Adatta la larghezza dell'immagine al suo contenitore */
    height: auto;    /* Mantieni la proporzione originale */
}

.button.button.filter:hover {
    background-color: var(--color2);
    color: var(--colorBackground); /* Contrasto del testo in hover */
}

.button.filter:active {
    background-color: calc(--color2); /* Colore più scuro quando viene premuto */
    color: #ffffff; /* Testo bianco */
}

/* Hover combinato per il bottone e l'icona */
.button.filter:hover {
    background-color: var(--color2); /* Anche l'icona cambia colore in hover */
}


/* Fine bottone Filter */

#searchButton-space {
    height: 40%;
    gap: 2%;
    padding: 2%;
}

#results {
    font-style: italic;
    visibility: hidden;
    font-weight: 300;
    font-style: italic;
}

/* Fine spazio search/filter */

#item-space {
    position: relative;
    height: 100%;
    width: 100%;
    display: grid;
    grid-template-columns: 55% 40% auto;
    border-top: 1px solid var(--dividers);
    font-size: 1.3em;
    z-index: -1;
}

/* Inizio colonna sinistra, details e tabella */

#details-space {
    position: relative;
    display: flex;
    flex-direction: column;
    color: white;
    padding: 14% 14% 2% 14%;
}

/* Style Info Table */
.data-header{
    font-size: 0.9em;
    color: var(--text);
    font-family: var(--font-family-text);
}

#title-header {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 30px;
    text-align: center;
    letter-spacing: 1px;
    font-family: var(--font-family-header);
    color: var(--color1);
    display: flex;
    align-items: center;
}

#infoTable th {
    /* Stile specifico per th dentro infoTable */
    text-align: left;
    padding: 10px;
}
/* Stile generale per la tabella */
#details {
    width: 100%;
    max-width: 800px;
    margin: 20px auto; /* Centrare la tabella */
    border-collapse: collapse;
    font-size: 0.8em;
}

/* Stile per le celle di intestazione (th) */
#details th {
    text-align: left;
    font-family: var(--buttons);
    color: white; /* Colore del testo nell'intestazione */
    padding: 12px; /* Spaziatura interna */
    background-color: var(--colorBackground);
}

/* Stile per le celle di dati (td) */
#details td {
    padding: 12px;
    vertical-align: top; /* Allineamento verticale */
    color: var(--text);
}

#details tr:nth-child(odd) td {

    border-left: solid 1px #919191;
}

/* Hover effect uniforme per tutte le righe */
#details tr:hover th,
#details tr:hover td {
    background-color: #fff1d68d; /* Colore uniforme durante l'hover */
}
 
/* Stile per i link (bottoni) nelle celle */ 
#details a.btn {
    display: inline-block;
    padding: 5px 10px;
    text-decoration: none;
    color: white;
    background-color: #ff7300;
    border-radius: 4px;
    margin-right: 5px; /* Spaziatura tra i bottoni */
    margin-bottom: 7px;
    transition: background-color 0.3s ease; /* Transizione per l'hover */
}

#details a.btn:hover {
    background-color: #ffa45a;
}

/* Fine Info Table */

/* Stile per divisore prima del padding */
#divider {
    width: 100%; 
    height: 1px;
    background-color: var(--dividers);
    margin-bottom: 10px; /* Distanza tra la riga e il contenuto sottostante */
    border: none;
}

.hidden {
    display: none;
}

/* Inizio colonna destra, Image column */

#img-space {
    position: relative;
    padding-top: 5%;
}

#switchPanel {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    z-index: 3;
    opacity: 1 !important;
    background-color: transparent;
    display: grid;
    grid-template-rows: 9fr 1fr;
    transition: opacity 0.5s ease;
    cursor: pointer;
}

#switchPanel #arrowSection .switch {
    height: fit-content;
    width: fit-content;
}

#switchPanel #arrowSection .switch#left {
    position: absolute;
    left: 0;
    top: 40%;
}

#switchPanel #arrowSection .switch#right {
    position: absolute;
    right: 0;
    top: 40%;
}

.switchButton {
    height: 100px;
    width: 100px;
}

#switchPanel #indexSection {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#switchPanel #indexSection #indicesBox {
    position: relative;
    background-color: antiquewhite;
    height: max-content;
    min-height: 40px;
    width: max-content;
    min-width: 100px;
    padding-left: 2%;
    padding-right: 2%;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#switchPanel #indexSection #indicesBox .index {
    color: #b0b0b0;
    font-size: calc(14px + 0.390625vw);
    width: 1.5em;
    height: 1.5em;
    margin-left: 1%;
    margin-left: 1%;
    border-radius: 50%;
    display: flex;
    text-align: center;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    text-decoration: none !important;
}

#switchPanel #indexSection #indicesBox .index:hover {
    background-color: var(--color1);
    color: white;
}

#switchPanel #indexSection #indicesBox .highlighted {
    background-color: var(--color4);
    color: white;
}

.switchButton#rightButton {transform: rotate(180deg);}

/* Fine pannello switch */

.image-box {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

.image-box img {
    position: absolute;
    max-height: 100%;
    max-width: 100%;
    border-radius: 10px;
    z-index: 2;
    box-shadow: 0px 3px 20px #b0b0b0a3;
}

/* FINE Image column */

#description {
    position: relative;
    display: flex;
    flex-direction: column;
    color: white;
    padding: 4% 8% 8% 8%;
    font-size: 1.4em;
}

/****************/
/* FINE gallery */
/****************/

footer.footer {
    height: 100%;
    bottom: 0; /* Aligns it to the bottom of the parent */
    background-color: var(--footer);
    display: flex; /* Enables flexbox */
    flex-direction: column; /* Aligns items vertically */
    justify-content: center;
    align-items: center;
    text-align: center !important; 
    color: var(--text);
    overflow: hidden;
    padding: 0% 4% 2% 4%;
    position: static;
}

/* Less & More buttons */

.desc-button {
    padding: 12px 27px;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--colorBackground);
    border: 1px solid var(--color2);
    border-radius: 8px;
}

.desc-button:hover {
    background-color: var(--color2);
    border: 1px solid var(--color2);
    color: #fff;
}

.desc-button:active {
    background-color: #f5e2c6;
    transform: scale(0.95); /* Effetto di pressione */
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.2); /* Ombra interna */
}

.desc-button:disabled {
    background-color: #100202a9;
    color: #dcdcdcba; /* Colore del testo sbiadito */
    border: 1px solid #f5e2c6be;
    cursor: not-allowed; /* Cambia il cursore per indicare che il bottone è disabilitato */
    opacity: 0.6; /* Riduce l'opacità per un effetto visivo */
    box-shadow: none; /* Rimuove eventuali ombre */
    transform: none; /* Disabilita effetti di pressione */
}

.desc-button:hover:disabled {
    background-color: #100202a9;
    color: #dcdcdcba; /* Colore del testo sbiadito */
    border: 1px solid #f5e2c6be;
    cursor: not-allowed; /* Cambia il cursore per indicare che il bottone è disabilitato */
    opacity: 0.6; /* Riduce l'opacità per un effetto visivo */
    box-shadow: none; /* Rimuove eventuali ombre */
    transform: none; /* Disabilita effetti di pressione */
}


/* Stile icona OGETTI */
.icon-obj {
    margin-right: 20px;  /* Distanza tra l'icona e il titolo */
    width: 5vw; 
    height: 5vw;  
}

/* Stile per l'immagine all'interno dellO spazio icona */
.icon-obj img {
    width: 100%;  /* L'immagine si adatta alla dimensione del div */
    height: 100%;  /* L'immagine si adatta alla dimensione del div */
    object-fit: contain;  /* Mantiene le proporzioni dell'immagine */
}


/* INIZIO MEDIA QUERIES */

/*  Larghezza finestra inferiore o uguale a 830px */
@media screen and (max-width: 830px) {

    div#page-container {
        grid-template-rows: auto 25vh;
    }
    
    div#page-container div#main-container {
        grid-template-rows: 15vh auto;
    }

    div.navbar-body {visibility: hidden;}

    div#gallery {grid-template-rows: 25vh auto;}

    .space-between {
        height: 80px;
    }


    div#item-space {
        grid-template-columns: none;
        grid-template-rows: 100vh;
    }

    div#img-space {grid-row: 1;}

    div#info-space {grid-row: 2;}

    div#search-bar {
        width: 80%;
    }

    .options {
        z-index: 10 !important;
        background-color: calc(--color2) !important;
    }
    
    #search-bar .narrative {
        margin-bottom: 6%; /* Add margin for each narrative item */
    }
    
    div#narratives-space {
        width: fit-content;
        align-self: center;
        align-items: flex-start;
        flex-direction: column;
    }

    div.narrative {
        height: calc(100% / 3);
    }

    .filter-icon {
        width: 5vw;
        height: 5vw;
    }

    .icon-obj {
        width: 14vw;
        height: 14vw;
    }

    footer.footer {
        padding: 3% 5%;
        font-size: 0.85rem; 
        word-break: break-word; 
        margin-right: 0;
    }

}

/* larghezza finestra superiore o uguale a 831px */
@media screen and (min-width: 831px) {

    div.menu {visibility: hidden;}
}
/* FINE MEDIA QUERIES */



/* ============================== */
/*         ANIMAZIONI            */
/* ============================== */

/* Dissolvenza in entrata */
.fade-in {
    display: block;
    opacity: 0;
    animation: fadeIn 0.7s forwards;
}

/* Dissolvenza in uscita */
.fade-out {
    opacity: 1;
    animation: fadeOut 0.3s forwards; /* Durata dell'animazione 0.3s */
}

/* Keyframes per le animazioni */
@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes fadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}
