/* ==========================================================
   HEADER
   ========================================================== */
#header {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow: hidden;
}

#header_video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;                    /* riempie la section, senza deformare */
    z-index: 0;
}
#header nav {
    position: relative;
    z-index: 1;                           /* i link restano sopra il video */
}
#home_top,
#home_middle {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 0.75rem;
}
.BaseContainer {
    width: fit-content;
}

.BaseContainer a {
    display: block;
    padding: 0.25em 1.05em;                 /* just a bit bigger than the text */
    line-height: 1.2;                      /* keeps the box tight around the text */
    background: #411D13;
    transition: background 0.2s ease, color 0.2s ease;
    font-size: var(--fs-link);
    color: #E5E1D8 !important;
    text-decoration: none;

}

.BaseContainer a:hover {
    background: #E5E1D8;
    color: #411D13 !important;
}

#home_top {
    align-items: flex-start;
    justify-content: space-between;
}
#home_middle {
    flex: 1;
    align-items: center;
    justify-content: space-between;   /* first button under CONTACT, last under ITALIANO */
    flex-wrap: wrap;
}

@media (max-width: 900px), (max-aspect-ratio: 1/1) {
    #home_middle {
        display: grid;
        grid-template-columns: 1fr 1fr;   /* two equal columns */
        gap: 0.5rem;                     /* same distance between all boxes */
        align-items: center;
        justify-items: start;             /* left column aligned with CONTACT */
    }

    /* Right column aligned with ITALIANO */
    #home_middle .BaseContainer:nth-child(even) {
        justify-self: end;
    }

    .BaseContainer {
        flex: none;
    }
}
