body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    background-color: var(--colorBackground);  
    font-family: var(--font-family-text);
    font-weight: 400;
    font-style: normal;
}

h1, h2, h3, h4 {
    color: var(--color2);
    font-family: var(--font-family-header);
  }
  
  h1 {font-size: 70px;}
  h2 {font-size: 30px;}
  h3 {font-size: 25px;}
  h4 {font-size: 15px;}
  
  p {line-height: 1.5em;}

.btn {
    text-decoration: none;
    padding: 1%;
    cursor: pointer;
    color: var(--text);
    background-color: var(--colorBackground);
    border: 1px solid var(--color5);
    border-radius: 8px;
    font-size: 16px;
    font-family: var(--buttons);
}

.btn:hover {
background-color: var(--color5);
}

.btn: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 */
}

.item-btn .btn {
    padding: 2%;
    transition: box-shadow 0.4s;
}

.item-btn .btn:hover {
    box-shadow: 0 12px 16px 0 rgba(0, 0, 0, 0.44), 0 17px 50px 0 rgba(0, 0, 0, 0.39);
}

#box {
    display: grid;
    grid-template-rows: 15vh auto 25vh;
}

/*================================================*/
/* ============== Inizio timeline ================*/
/*================================================*/

/* INIZIO SIDE SEARCH */

/* media query: left/right, row/row-reverse, transform */
#side-search {
    position: fixed;
    top: 30%;
    left: 0;
    z-index: 4;
    display: flex;
    flex-direction: row;
    padding-top: 0.5em;
    padding-bottom: 0.5em;
    transform: translateX(-78%);
    transition: transform 0.4s ease;
}

#side-search.shift {
    transform: translateX(0);
    transition: transform 0.4s ease;
}

#side-search.no-hover:hover {
    transform: unset;
}

/* media query border-radius */
#search-list {
    position: relative;
    padding-right: 1em;
    background-color: var(--color3);
    border-radius: 0 0 8px 0;
}

#search-list ul {
    margin-block-start: 0.5em;
    margin-block-end: 0.5em;
}

#search-list ul li {
    padding: 4px;
    width: fit-content;
    border-radius: 8px;
    color: var(--color5);
}

#search-list li.highlight {
    background-color: var(--color4);
    color: var(--text); 
}

#search-list a {
    text-decoration: none;
    color: var(--color5);
    font-size: calc(12px + 0.390625vw);
}

#search-list a:hover {
    text-decoration: underline;
}

#search-header {
    padding-top: 0.5em;
    text-align: center;
    color: var(--color5);
    font-size: calc(15px + 0.390625vw);
}

/* media query border radius */
#side-banner {
    position: relative;
    display: flex;
    align-items: center;
    width: 2.5em;
    height: 2.5em;
    padding-bottom: 0.5em;
    background-color: var(--color3);
    color: var(--color5);
    border-radius: 0 8px 8px 0;
}

#search-icon-box {
    margin-top: 0.5em;
    padding: 2px;
}

#search-icon {
    max-width: 100%;
    max-width: 100%;
}

/* FINE SIDE SEARCH */

#timeline {
    position: relative;
}

#timeline-start {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#timeline-start h2 {
    position: relative;
    text-align: center;
}

#timeline-start p {
    position: relative;
    text-align: center;
    color: var(--text);
}

#items {
    position: relative;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
}

#line {
    position: absolute;
    left: 49.7%;
    right: 49.7%;
    bottom: 0;
    top: 0;
    border-radius: 8px;
    background-color: var(--color5);
}

.item {
    position: relative;
    margin-top: 5vh;
    height: 50vh;
    width: 100%;
}

.item.last {
    margin-bottom: 15vh;
}

/*media query: width: 50%/100% left/right, row/row-reverse*/
.item-wrapper {
    position: absolute;
    height: inherit;
    display: flex;
}

.data-box {
    position: relative;
    width: 4em;
}

/*media query: left/right border-radius */
.data {
    position: absolute;
    text-align: center;
    width: 0;
    opacity: 0;
    transition: opacity 2s ease, width 0.5s ease;
    background-color: var(--color5);
    color: var(--text);
    font-size: 20px;
}

.entrance {
    width: 3em;
    opacity: 1;
}

.image-box {
    position: relative;
    height: inherit;
    width: auto;
    opacity: 0;
}

@keyframes left-enter {
from {
    opacity: 0;
    transform: translateX(-100%);
}
to {
    opacity: 1;
    transform: translateX(0%);
}  
}

@keyframes right-enter {
from {
    opacity: 0;
    transform: translateX(100%);
}
to {
    opacity: 1;
    transform: translateX(0%);
}
}

.enter { opacity: 1; }

.image-box img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
}

.info-bar {
    position: absolute;
    top: 0;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.4s;
    color: white;
    border-radius: 8px;
    box-shadow: 3px 3px rgba(0, 0, 0, 0.3);
}

.active {
    opacity: 1;
    transition: opacity 0.4s;
}

.info-btn { transition: box-shadow 0.4s; }

.info-btn:hover { box-shadow: 0 12px 16px 0 rgba(0, 0, 0, 0.44), 0 17px 50px 0 rgba(0, 0, 0, 0.39); }

.infoButton {
    position: absolute;
    right: 0;
    top: 0;
    height: 50px;
    width: 50px;
    border-radius: 50%;
    z-index: 1;
    visibility: visible;
}

.infoCloser {
    position: absolute;
    right: 0;
    top: 0;
    height: 50px;
    width: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    visibility: hidden;
}

.info-bar h3 {
    position: relative;
    text-align: center;
    color: white;
}

.item-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

/*================================================*/
/*================ Fine timeline =================*/
/*================================================*/

@media screen and (max-width: 830px) {

    div#upButton {
        height: 70px;
        width: 70px;
    }

    div.navbar-body {visibility: hidden;}

    /* media query: left/right, row/row-reverse */
    div#side-search {
        top: 15%;
        right: 0;
        left: unset;
        flex-direction: row-reverse;
        transform: translateX(75%);
    }

    div#side-search:hover {
        transform: translateX(70%);
    }

    /* media query border-radius */
    div#side-search div#search-list {border-radius: 0 0 0 8px;}

    div#side-banner {border-radius: 8px 0 0 8px;}

    span#line {
        left: 7vw;
        width: 1.5vw;
    }

    div.image-box {
        max-width: 75%;
        margin-left: 5%;
    }

    div.item-wrapper {
        width: 93vw; /* deve essere regolato in base a left e alle immagini */
        left: 7vw; /* deve essere lo stesso valore di #line*/
        flex-direction: row;
    }

    div.data {
        left: 0;
        border-radius: 0 8px 8px 0;
    }
}

@media screen and (min-width: 831px) {

    div#side-search:hover {
        transform: translateX(-70%);
    }

    div.item-wrapper {
        width: 50%;
    }

    /*media query: left/right, row/row-reverse*/
    div.item:nth-child(odd) div.item-wrapper {
        left: 0;
        flex-direction: row-reverse;
    }

    div.item:nth-child(even) div.item-wrapper {
        right: 0;
        flex-direction: row;
    }

    div.item:nth-child(odd) div.item-wrapper div.image-box {
        margin-right: 5%;
    }
    
    div.item:nth-child(even) div.item-wrapper div.image-box {
        margin-left: 5%;
    }


    /*media query: left/right*/
    div.item:nth-child(odd) div.data {
        right: 0;
        border-radius: 8px 0 0 8px;
    }

    div.item:nth-child(even) div.data {
        left: 0;
        border-radius: 0 8px 8px 0;
    }
}