/* ================= RESET ================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@font-face {
    font-family: "Roboto Flex", sans-serif;
    src: url('https://fonts.googleapis.com/css2?family=Roboto+Flex:opsz,wght@8..144,100..1000&display=swap');
}

@font-face {
    font-family: "AR BONNIE";
    src: url("https://db.onlinewebfonts.com/t/0ff9d4abfc356dd5dc727833ef593aab.eot");
    src: url("https://db.onlinewebfonts.com/t/0ff9d4abfc356dd5dc727833ef593aab.eot?#iefix")format("embedded-opentype"),
    url("https://db.onlinewebfonts.com/t/0ff9d4abfc356dd5dc727833ef593aab.woff2")format("woff2"),
    url("https://db.onlinewebfonts.com/t/0ff9d4abfc356dd5dc727833ef593aab.woff")format("woff"),
    url("https://db.onlinewebfonts.com/t/0ff9d4abfc356dd5dc727833ef593aab.ttf")format("truetype"),
    url("https://db.onlinewebfonts.com/t/0ff9d4abfc356dd5dc727833ef593aab.svg#AR BONNIE")format("svg");
}

body {
    font-family: "Roboto Condensed", sans-serif;
    background-color: #161616;
    user-select: none;
    -webkit-touch-callout: none; 
}

body::-webkit-scrollbar {
    display: none;
}

a {
    text-decoration: none;
}

a:visited {
    color: white;
    outline: none;
}

a:link {
    color: white;
}


/* ================= PAGE GRID ================= */

.page-container {
    display: grid;
    min-height: 100vh;
    grid-template-rows: auto 1fr auto;
}

/* ================= HEADER ================= */

.header {
    font-family: "AR BONNIE", sans-serif;
    color: #0c0c0c;
    height: 10vh;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    padding: 20px;
    flex-wrap:wrap;
    background-image: linear-gradient(to right, #161616, #161616, #161616, #161616, #161616, #161616, #171717, #242424, #313131, #3e3e3e, #4c4c4c, #595959, #666666, #737373, #808080, #7f7f7f,#7f7f7f,#7f7f7f,#7f7f7f,#7f7f7f,#7f7f7f,#7f7f7f,#7f7f7f,#7f7f7f,#7f7f7f,#7f7f7f,#7f7f7f,#7f7f7f,#7f7f7f,#7f7f7f,#7f7f7f,#7f7f7f,#7f7f7f);
}

.box-MISA{
    width: 72px;
    height: 72px;
    text-align: center;
    cursor: pointer;
    position: absolute;
    left: 5%;
    justify-content: center;
}

    .box-MISA img {
    width: 100%;
    height: 100%;
    object-fit: fill; /* or contain */
    }

.box-AZIENDA {
    font-family: 'AR BONNIE';
    font-size: 4rem;
    color: black;
    width: 150px;
    height: 65px;
    text-align: center;
    cursor: pointer;
    position: absolute;
    left: 55%;
    justify-content: center;
}

    .box-AZIENDA img {
    width: 100%;
    height: 100%;
    object-fit: fill; /* or contain */
    }

.box-PORTFOLIO {
    font-family: 'AR BONNIE';
    font-size: 4rem;
    color: black;
    width: 210px;
    height: 65px;
    text-align: center;
    cursor: pointer;
    position: absolute;
    left: 67%;
    justify-content: center;
}

    .box-PORTFOLIO img {
    width: 100%;
    height: 100%;
    object-fit: fill; /* or contain */
    }

.box-CONTATTI {
    font-family: 'AR BONNIE';
    font-size: 4rem;
    color: black;
    width: 150px;
    height: 65px;
    text-align: center;
    cursor: pointer;
    position: absolute;
    left: 85%;
    justify-content: center;
}

    .box-CONTATTI img {
    width: 100%;
    height: 100%;
    object-fit: fill; /* or contain */
    }

/* ================= MAIN ================= */

.main-content {
    padding: 40px;
    justify-content: center;
}

.schermo{
    height: 100vh;
    width: 100vw;
}

.sub-container {
    display: grid;
    gap: 20px;
    padding: 20px;
    color: #afafaf;
    font-weight: bolder;
    align-items: center;
}

.sub-containerAZIENDA {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
    color: #afafaf;
    font-weight: bolder;
    align-items: center;
}


.sub-containerINDEX {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
    color: #afafaf;
    font-weight: bolder;
    align-items: center;
}

.sub-containerCONTATTI {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
    color: #afafaf;
    font-weight: bolder;
    align-items: center;
}

    .sub-colonna-sectors-section{
        align-items: center;
        padding: 10%;
    }

/* ================= GLOBE ================= */

.containerGlobe {
    position: relative;
    width: 100%;
    height: 85vh;
    display: flex;
    justify-content: center;
}

#earth_div{
    width: 100%;
    height: 100%;
}

/* ================= TEXT ================= */

.big-title {
    font-size: 3.5rem;
    line-height: 1;
}

.medium-title {
    font-size: 1.5rem;
    margin-top: 20px;
    margin-bottom: 15px;
}

.info p {
    margin-bottom: 5px;
}

.info{
    color: #afafaf;
    font-weight: bolder;
}

.infoINDEX:hover {
    color: rgb(255, 255, 255);
    transform: scale(1.7);
    transform-origin: left;
}

/* ================= SECTORS GRID ================= */

.grid-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

.grid-row-AZIENDA{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.sector-box {
    height: 180px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* video element should cover the box but not interfere with overlays/interaction */
.sector-box .sector-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none; /* clicks still go through to the box */
    z-index: 0; /* sit behind the overlay */
}

/* simple text defaults; detailed rules come later */
.overlay {
    color: white;
    font-weight: bold;
    text-align: center;
}

/* Keep your background images from original CSS */
.rettangolo1 {
    /* background-image removed to allow video playback */
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    overflow: hidden;
    transition-property: all;
    transition-duration: 0.3s;
}

.rettangolo1:hover .overlay {
    position: flex;
    width: 100%;
    height: 100%;
    background-color: #16161600;
    color: rgba(255, 255, 255, 0);
    display: flex;
}

.rettangolo1:hover {
    transform: scale(1.5);
    z-index: 10;
}

.rettangolo2{
    /* background-image removed to allow video */
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    overflow: hidden;
    transition-property: all;
    transition-duration: 0.3s;
}

.rettangolo2:hover .overlay {
    position: flex;
    width: 100%;
    height: 100%;
    background-color: #16161600;
    color: rgba(255, 255, 255, 0);
    display: flex;
}

.rettangolo2:hover {
    transform: scale(1.5);
    z-index: 10;
}

.rettangolo3{
    /* background-image removed to allow video */
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    overflow: hidden;
    transition-property: all;
    transition-duration: 0.3s;
}

.rettangolo3:hover .overlay {
    position: flex;
    width: 100%;
    height: 100%;
    background-color: #16161600;
    color: rgba(255, 255, 255, 0);
    display: flex;
}

.rettangolo3:hover {
    transform: scale(1.5);
    z-index: 10;
}

.rettangolo4{
    /* background-image removed to allow video */
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    overflow: hidden;
    transition-property: all;
    transition-duration: 0.3s;
}

.rettangolo4:hover .overlay {
    position: flex;
    width: 100%;
    height: 100%;
    background-color: #16161600;
    color: rgba(255, 255, 255, 0);
    display: flex;
}

.rettangolo4:hover {
    transform: scale(1.5);
    z-index: 10;
}

.rettangolo5{
    /* background-image removed to allow video */
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    overflow: hidden;
    transition-property: all;
    transition-duration: 0.3s;
}

.rettangolo5:hover .overlay {
    position: flex;
    width: 100%;
    height: 100%;
    background-color: #16161600;
    color: rgba(255, 255, 255, 0);
    display: flex;
}

.rettangolo5:hover {
    transform: scale(1.5);
    z-index: 10;
}

.rettangolo6 {
    /* background-image removed to allow video */
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    overflow: hidden;
    transition-property: all;
    transition-duration: 0.3s;
}

.rettangolo6:hover .overlay {
    position: flex;
    width: 100%;
    height: 100%;
    background-color: #16161600;
    color: rgba(255, 255, 255, 0);
    display: flex;
}

.rettangolo6:hover {
    transform: scale(1.5);
    z-index: 10;
}

.sector-box.touched {
    /* keep on top so its video plays above neighbors, but don’t scale
       – scaling was hiding the other boxes once one became active */
    z-index: 10;
    /* no transform here; hover rules still handle the zoom effect */
}

.overlay {
    position: relative; /* provide stacking context */
    z-index: 1; /* sit above the video */
    width: 100%;
    height: 100%;
    background-color: #161616bd; /* semi‑transparent dark overlay */
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 14px;
}

/* ================= FOOTER ================= */

.footer{
    text-align: center;
    background-image: linear-gradient(to bottom,#161616,#7f7f7f);
    padding: 20px;
    width: 100vw;
    bottom: 0;
    position: fixed;
    height: fit-content;
    z-index: 1000;
    pointer-events: auto;
    padding-right: 0;
}

.foot{
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    font-weight:bolder;
    color: #f7f5fb;
    font-size: 0.725vw;
    pointer-events: auto;
    position: relative;
}


/* ================= LANGUAGE SELECTOR ================= */

.language-selector-container {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
}

.language-selector-btn {
    background-color: rgba(127, 127, 127, 0.5);
    border: 2px solid #ffffff;
    color: #ffffff;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-family: "Roboto Condensed", sans-serif;
}

.language-selector-btn:hover {
    background-color: rgba(127, 127, 127, 0.7);
}

.language-selector-btn:active {
    background-color: rgba(127, 127, 127, 0.9);
}

/* ================= LEGEND BOX ================= */

.legend-box {
    position: absolute;
    right: 30px;
    top: 40%;
    background-color: rgba(0, 0, 0, 0.25);
    color: #ffffff;
    padding: 15px 20px;
    font-size: 14px;
    border-radius: 8px;
    z-index: 1000;
    font-family: "Roboto Condensed", sans-serif;
    min-width: 200px;
}

.legend-title {
    font-weight: bold;
    margin-bottom: 12px;
    font-size: 16px;
    border-bottom: 1px solid #ffffff;
    padding-bottom: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
    border: 1px solid #ffffff;
}

.legend-label {
    font-size: 13px;
}

/* ================= CONTACT PAGE ================= */

.section-title {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.email-link {
    text-decoration: underline;
    color: #afafaf;
    display: inline-block;
    margin-bottom: 10px;
}

.spacer {
    height: 30px;
}

/* Map Responsive Container */

.map-container {
    width: 100%;
    height: 400px;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* ================= AZIENDA ================= */

.containerPA {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0px 60px;
}

.sub-containerPA {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 80px;
    max-width: 1400px;
    width: 100%;
    min-height: 90vh; 
}

/* Each column */
.sub-colonnaPA {
    flex: 1;
    display: flex;
    justify-content: center;
}

.info2PA {
    text-align: center;
    max-width: 420px;
    color: #afafaf;
    font-weight: bolder;
}

/* Titles */
.info2PA p:first-child {
    font-size: 42px;
    letter-spacing: 2px;
    font-weight: 600;
    margin-bottom: 30px;
}

/* Paragraph text */
.info2PA p:last-child {
    font-size: 16px;
    line-height: 1.7;
    color: #bfbfbf;
}

/* ================= RESPONSIVE ================= */

/* Tablet */
@media (max-width: 1800px) /*1024*/ {

    .box-MISA{
    width: 36px;
    height: 36px;
    text-align: center;
    cursor: pointer;
    position: absolute;
    left: 5%;
    justify-content: center;
    }

    .box-MISA img {
    width: 100%;
    height: 100%;
    object-fit: fill; /* or contain */
    }

    .box-AZIENDA {
        font-family: "AR BONNIE", sans-serif;
        color: #161616;
        font-size: 1.5rem;
        width: 75px;
        height: 32px;
        text-align: center;
        cursor: pointer;
        position: absolute;
        left: 30%;
        justify-content: center;
    }

    .box-AZIENDA img {
    width: 100%;
    height: 100%;
    object-fit: fill; /* or contain */
    }

    .box-PORTFOLIO {
        font-family: "AR BONNIE", sans-serif;
        color: #161616;
        font-size: 1.5rem;
        width: 105px;
        height: 32px;
        text-align: center;
        cursor: pointer;
        position: absolute;
        left: 50%;
        justify-content: center;
    }

    .box-PORTFOLIO img {
    width: 100%;
    height: 100%;
    object-fit: fill; /* or contain */
    }

    .box-CONTATTI {
        font-family: "AR BONNIE", sans-serif;
        color: #161616;
        font-size: 1.5rem;
        width: 75px;
        height: 32px;
        text-align: center;
        cursor: pointer;
        position: absolute;
        left: 80%;
        justify-content: center;
    }

    .box-CONTATTI img {
    width: 100%;
    height: 100%;
    object-fit: fill; /* or contain */
    }

    .big-title {
    font-size: 3.5rem;
    line-height: 1;
    text-align: center;
    }

    .medium-title {
    font-size: 1.5rem;
    line-height: 1;
    text-align: center;
    }

        .sub-container {
        grid-template-columns: 1fr;
        padding: 30px;
        justify-content: center;
        text-align: center;
    }

        .sub-containerINDEX {
        grid-template-columns: 1fr;
        padding: 30px;
        justify-content: center;
        text-align: center;
    }

        .sub-containerCONTATTI {
        grid-template-columns: 1fr;
        padding: 30px;
        justify-content: center;
        text-align: center;
    }

        /* .sub-containerPA {
        grid-template-columns: 1fr;
        padding: 30px;
        justify-content: center;
        text-align: center;
    } */

    .main-content {
        padding: 20px;
        justify-content: center;
    }

    .map-container {
        height: 350px;
    }

    .info {
        text-align: center;
    }

    .infoIndex {
    text-align: justify;
    }

    .infoINDEX:hover {
    color: rgb(255, 255, 255);
    transform: scale(1);
    }

    .footer{
    text-align: center;
    background-image: linear-gradient(to bottom,#161616,#7f7f7f);
    padding: 20px;
    width: 100vw;
    position: relative;
    }

    .sub-containerPA {
    grid-template-columns: 1fr;
    padding: 30px;
    justify-content: center;
    text-align: center;
    display: grid;
    }

    #sub-colonna3PA {
        display: flex;
        width: 100%;
        height: 100%;
        background-color: #161616;
        color:rgb(255, 255, 255);
        box-sizing: border-box;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .info2PA{
    width: 100%;
    color: #afafaf;
    font-weight: bolder;
    height: 100%;
    }

    .language-selector-container {
        position: absolute;
        /* bottom: 25px; */
        bottom: 2%;
        right: auto;
        top: auto;
        width: auto;
        text-align: center;
        background-color: transparent;
        padding: 10px 0;
        z-index: 1001;
    }

}

/* Mobile */
@media (max-width: 768px) {

    .schermo {
        padding-bottom: 200px;
    }

    .header {
    font-family: "AR BONNIE", sans-serif;
    color: #161616;
    height: 10vh;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    padding: 20px;
    flex-wrap: nowrap ;
    background-image: linear-gradient(to right, #161616, #161616, #161616, #161616, #161616, #161616, #171717, #242424, #313131, #3e3e3e, #4c4c4c, #595959, #666666, #737373, #808080, #7f7f7f,#7f7f7f,#7f7f7f,#7f7f7f,#7f7f7f,#7f7f7f,#7f7f7f,#7f7f7f,#7f7f7f,#7f7f7f,#7f7f7f,#7f7f7f,#7f7f7f,#7f7f7f,#7f7f7f,#7f7f7f,#7f7f7f,#7f7f7f);
    }

    .box-MISA{
    width: 36px;
    height: 36px;
    text-align: center;
    cursor: pointer;
    position: absolute;
    left: 5%;
    justify-content: center;
    }

    .box-MISA img {
    width: 100%;
    height: 100%;
    object-fit: fill; /* or contain */
    }

    .box-AZIENDA {
        font-family: 'AR BONNIE';
        font-size: 1.5rem;
        width: 75px;
        height: 32px;
        text-align: center;
        cursor: pointer;
        position: absolute;
        left: 30%;
        justify-content: center;
    }

    .box-AZIENDA img {
    width: 100%;
    height: 100%;
    object-fit: fill; /* or contain */
    }

    .box-PORTFOLIO {
        font-family: 'AR BONNIE';
        font-size: 1.5rem;
        width: 105px;
        height: 32px;
        text-align: center;
        cursor: pointer;
        position: absolute;
        left: 50%;
        justify-content: center;
    }

    .box-PORTFOLIO img {
    width: 100%;
    height: 100%;
    object-fit: fill; /* or contain */
    }

    .box-CONTATTI {
        font-family: 'AR BONNIE';
        font-size: 1.5rem;
        width: 75px;
        height: 32px;
        text-align: center;
        cursor: pointer;
        position: absolute;
        left: 80%;
        justify-content: center;
    }

    .box-CONTATTI img {
    width: 100%;
    height: 100%;
    object-fit: fill; /* or contain */
    }

    .big-title {
    font-size: 3.5rem;
    line-height: 1;
    }

    .medium-title {
    font-size: 1.5rem;
    line-height: 1;
    text-align: center;
    }

    .info{
    text-align: center;
    }

    .sub-container {
        grid-template-columns: 1fr;
        padding: 30px;
        justify-content: center;
        text-align: center;
    }

        .sub-containerINDEX {
        grid-template-columns: 1fr;
        padding: 30px;
        justify-content: center;
        text-align: center;
    }

        .sub-containerCONTATTI {
        grid-template-columns: 1fr;
        padding: 30px;
        justify-content: center;
        text-align: center;
    }

    .grid-row {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 20px;
    }

    .main-content {
        padding: 20px;
        justify-content: center;
    }

    .big-title {
        font-size: 1.8rem;
    }

    .map-container {
        height: 300px;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .info {
        text-align: center;
    }

    .infoIndex {
    text-align: justify;
    }

    .infoINDEX:hover {
    color: rgb(255, 255, 255);
    transform: scaleY(1.5);
    }

    .footer{
    text-align: center;
    background-image: linear-gradient(to bottom,#161616,#7f7f7f);
    padding: 20px;
    width: 100vw;
    bottom: 0;
    position: relative;
    height: fit-content;
    z-index: 1000;
    pointer-events: auto;
    }

    .foot {
        font-size: 3vw;
    }

    .language-selector-container {
        position: absolute;
        bottom: 25px;
        right: auto;
        top: auto;
        width: auto;
        text-align: center;
        background-color: transparent;
        padding: 10px 0;
        z-index: 1001;
    }

    .legend-box {
        position: absolute;
        right: 15px;
        top: 15px;
        background-color: rgba(0, 0, 0, 0.25);
        color: #ffffff;
        padding: 12px 15px;
        font-size: 12px;
        border-radius: 6px;
        z-index: 1000;
        min-width: auto;
        max-width: 90vw;
    }

    .legend-title {
        font-weight: bold;
        margin-bottom: 8px;
        font-size: 13px;
        border-bottom: 1px solid #ffffff;
        padding-bottom: 6px;
    }

    .legend-item {
        display: flex;
        align-items: center;
        margin-bottom: 8px;
        gap: 8px;
        font-size: 11px;
    }

    .legend-color {
        width: 12px;
        height: 12px;
        border-radius: 2px;
        flex-shrink: 0;
        border: 1px solid #ffffff;
    }

    .sub-containerPA {
    grid-template-columns: 1fr;
    padding: 30px;
    justify-content: center;
    text-align: center;
    display: grid;
    }

    #sub-colonna3PA {
        display: flex;
        width: 100%;
        height: 100%;
        background-color: #161616;
        color:rgb(255, 255, 255);
        box-sizing: border-box;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .info2PA{
    width: 100%;
    color: #afafaf;
    font-weight: bolder;
    height: 100%;
    }
}