/**
 * HubBanner Public CSS
 * Responsive styles for banner display
 * v3.0.3
 */

/* ==================================
   STILI BASE BANNER
   ================================== */

.hubbanner-banner {
    max-width: 100%;
    overflow: hidden;
    text-align: center;
    margin: 0 auto;
    display: block;
}

.hubbanner-link {
    display: inline-block;
    max-width: 100%;
    text-decoration: none;
    border: none;
}

.hubbanner-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* ==================================
   BANNER GRANDI (728x90, 970x90)
   Desktop: mostrati normalmente
   ================================== */

.hubbanner-large {
    display: block;
    width: 100%;
}

/* ==================================
   BANNER MEDI (468x60)
   ================================== */

.hubbanner-medium {
    display: block;
    width: 100%;
}

/* ==================================
   BANNER PICCOLI (300x250, 336x280)
   ================================== */

.hubbanner-small {
    display: block;
    width: 100%;
    max-width: 336px; /* Limita su desktop */
}

/* ==================================
   RESPONSIVE: TABLET
   (da 481px a 768px)
   ================================== */

@media (max-width: 768px) {

    /* Banner medi: scala */
    .hubbanner-medium {
        max-width: 100%;
    }

    .hubbanner-medium img {
        width: 100%;
        height: auto;
    }

    /* Banner piccoli: mantieni dimensione originale se possibile */
    .hubbanner-small {
        max-width: 100%;
    }
}

/* ==================================
   RESPONSIVE: MOBILE + TABLET
   Banner LARGE (728x90 e simili)
   Scala proporzionalmente su tutti
   i dispositivi fino a 767px.
   Il selettore * copre qualsiasi
   elemento figlio iniettato via JS
   con larghezza fissa inline.
   ================================== */

@media (max-width: 767px) {

    .hubbanner-large,
    .hubbanner-large * {
        max-width: 100% !important;
        width: 100% !important;
        overflow: hidden;
        box-sizing: border-box;
    }

    .hubbanner-large img {
        height: auto !important;
        display: block !important;
    }
}

/* ==================================
   RESPONSIVE: MOBILE
   (fino a 480px)
   ================================== */

@media (max-width: 480px) {

    /* Banner medi: scala */
    .hubbanner-medium {
        max-width: 100%;
        width: 100%;
    }

    .hubbanner-medium img {
        width: 100%;
        height: auto;
    }

    /* Banner piccoli: centra e scala se necessario */
    .hubbanner-small {
        max-width: 100%;
        width: 100%;
    }

    .hubbanner-small img {
        max-width: 100%;
        height: auto;
    }
}

/* ==================================
   RESPONSIVE: MOBILE LANDSCAPE
   (orientamento orizzontale)
   ================================== */

@media (max-width: 767px) and (orientation: landscape) {

    /* Banner grandi: scala proporzionalmente */
    .hubbanner-large {
        max-width: 100% !important;
    }

    .hubbanner-large img,
    .hubbanner-large .hubbanner-image {
        width: 100% !important;
        height: auto !important;
    }
}

/* ==================================
   UTILITIES
   ================================== */

/* Previeni overflow del container */
.hubbanner-banner * {
    max-width: 100%;
}

/* Assicura che i link non abbiano stili strani */
.hubbanner-link:hover,
.hubbanner-link:focus,
.hubbanner-link:active {
    text-decoration: none;
    outline: none;
}

/* Previeni flickering durante il caricamento */
.hubbanner-image {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}
