/*
Theme Name: ItaliaWP3 Child Theme
Theme URI: http://italiawp.borisamico.it
Author: Boris Amico
Author URI: http://borisamico.it
Description: Tema child di ItaliaWP2 utilizzabile per la customizzazione.
Version: 1.0.0
License: GNU AFFERO GENERAL PUBLIC LICENSE v3 or later
License URI: https://www.gnu.org/licenses/agpl-3.0.en.html
Template: italiawp3
Text Domain: italiawp3-child
*/

/* ==========================================================================
   1. TIPOGRAFIA E MENU PRINCIPALE
   ========================================================================== */
#menu-principale {
    font-size: 16px;
    font-weight: 400 !important;}

.navbar .navbar-collapsable .navbar-nav li.nav-item a.nav-link, 
.navbar .navbar-collapsable .navbar-nav li.nav-item button.nav-link {
    padding: 10px 6px 10px 6px !important; }

h1	{font-size: 140% !important; font-weight:600 !important;}
h2 	{font-size: 130% !important; font-weight:600 !important;}
h3 	{font-size: 110% !important; text-transform:uppercase; font-weight:600 !important;}
h5 	{font-size: 95% !important;}

.navbar .dropdown-menu .menu-item {min-width: 170px !important; padding:0px;}
#sub_nav #menu-principale .dropdown-menu a.dropdown-item {
    font-size: 16px !important;
}
.table_plugin th {background:#0066cc !important}

/* ==========================================================================
   2. LOGO ADSP (DIMENSIONI E LAYOUT)
   ========================================================================== */
.comune {
    display: flex !important;
    align-items: center !important;
    min-height: 90px !important;
    flex-wrap: wrap !important;
}

.header .logoimg {
    max-width: 100% !important;
    width: auto !important;
    display: inline-block !important;
}

.comune img.custom-logo,
.header img.custom-logo,
.logoimg img {
    max-width: 410px !important; /* Dimensione massima su Desktop */
    max-height: 85px !important;  /* Altezza massima limitata */
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
}

/* Nasconde il testo del titolo affiancato se il logo include già la scritta */
.header .logotxt {
    display: none !important;
}

/* Regolazione per dispositivi mobili (Smartphone/Tablet) */
@media (max-width: 768px) {
    .comune img.custom-logo,
    .header img.custom-logo,
    .logoimg img {
        max-width: 280px !important; 
        max-height: 60px !important;
    }
}


/* ==========================================================================
   3. HEADER SCORREVOLE (RIMOSSO EFFETTO STICKY/FISSO)
   ========================================================================== */
.container.header,
.header-tablet,
#mainheader,
.preheader {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    float: none !important;
}

.is-sticky #mainheader,
.sticky-wrapper,
.sticky-wrapper.is-sticky,
.sticky-wrapper.is-sticky .container.header,
.sticky-wrapper.is-sticky #sub_nav,
.fixed-top {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    box-shadow: none !important;
}

#sub_nav {
    position: relative !important;
    height: auto !important;
    clear: both !important;
}



/* ============================================
   MENU PRINCIPALE - SFONDO BIANCO AL CLICK
   ============================================ */

/* Elimina il bordo nero */
#sub_nav #menu-principale > li > a.nav-link:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Sfondo arancione quando il menu è selezionato */
#sub_nav #menu-principale > li > a.nav-link:focus,
#sub_nav #menu-principale > li > a.nav-link[aria-expanded="true"] {
    background-color: #FFFFFF !important;
    color: #000000 !important;
}

/* Evidenziazione durante il passaggio del mouse */
#sub_nav #menu-principale > li > a.nav-link:hover {
    background-color: #FFFFFF !important;
    color: #000000 !important;
}

/* Mantiene visibile il focus per la tastiera */
#sub_nav #menu-principale > li > a.nav-link:focus-visible {
    outline: 2px solid #ffffff !important;
    outline-offset: -2px !important;
}

/* Transizione morbida */
#sub_nav #menu-principale > li > a.nav-link {
    transition: background-color 0.2s ease,
                color 0.2s ease;
}

/* ==========================================================================
   4. COLORI, NOTIFICHE E BOTTONI HOMEPAGE
   ========================================================================== */
.u-background-compl, 
.has-colore-complementare-background-color, 
#mainheader .btn-cerca:hover, 
#sezione-notifica {
    background-color: #fff !important;
}

.bottoni-homepage a::after,
.bottoni-homepage a::before,
.bottoni-homepage a svg,
.bottoni-homepage a .external-link-icon,
.bottoni-homepage a [class*="icon"] {
    display: none !important;
    content: none !important;
}
#home-novita	{padding:26px 0 !important}

/* ==========================================================================
   5. GESTIONE IMMAGINI (CARD NEWS E ARTICOLI)
   ========================================================================== */
/* Immagini nelle card delle news */
.card .card-img-top,  
.card img {
    width: 100% !important;
    height: 200px !important; 
    object-fit: cover !important;
    object-position: top center !important; 
}

/* Immagini del singolo articolo */
.single-post article img,
.single article img,
.post-thumbnail img,
.entry-content img.wp-post-image,
.articolo-immagine img {
    height: auto !important;
    max-height: 500px !important;
    width: auto !important;
    max-width: 100% !important;
    object-fit: contain !important;
    object-position: top center !important; 
    display: block !important;
    margin: 0 auto !important;
}

#footer h2,
#footer .Footer-blockTitle,
#footer .footer-colonne h2 {
    font-size: 1.15rem !important; /* Puoi regolarlo a piacimento (es. 1rem o 1.2rem) */
    line-height: 1.4 !important;
}

/* 	===============================
	INIZIO STILE BOTTONI HOME PAGE
	=========================== */
/* Menu homepage: nessuna immagine, nessuna tabella. */
.adsp-menu-home {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto 25px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}
.adsp-menu-home,
.adsp-menu-home * { box-sizing: border-box; }
.adsp-menu-home__row {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    column-gap: 3px;
    min-width: 1020px;
    width: 100%;
    height: 105px;
}
.adsp-menu-home__row a.adsp-menu-home__button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    width: 100%;
    height: 105px;
    padding: 3px;
    margin: 0;
    background-color: var(--bg);
    color: var(--fg) !important;
    text-align: center;
    text-decoration: none !important;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    line-height: 1.3;
    transition: filter .15s ease;
}
.adsp-menu-home__row a.adsp-menu-home__button:hover {
    filter: brightness(.91);
}
.adsp-menu-home__row a.adsp-menu-home__button:focus-visible {
    outline: 3px solid #111;
    outline-offset: -3px;
}
.adsp-menu-home__title {
    display: block;
    margin: 0 0 2px;
    font-size: 215x;
    font-weight: 600;
    line-height: 1.1;
    color: inherit !important;
}
.adsp-menu-home__description {
    display: block;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.4;
    color: inherit !important;
}
/* I primi tre riquadri hanno testi allineati a destra nell'originale. */
.adsp-menu-home__row a.adsp-menu-home__sua,
.adsp-menu-home__row a.adsp-menu-home__gaia,
.adsp-menu-home__row a.adsp-menu-home__shipinfo {
    align-items: flex-end;
    text-align: right;
    padding-right: 12px;
}
.adsp-menu-home__sua { --bg:#062d55; --fg:#fff; }
.adsp-menu-home__gaia { --bg:#07519b; --fg:#fff; }
.adsp-menu-home__shipinfo { --bg:#408fdb; --fg:#fff; }
.adsp-menu-home__crociere { --bg:#bdd9f1; --fg:#000; }
.adsp-menu-home__diritti { --bg:#ffce00; --fg:#000; }
.adsp-menu-home__fornitori { --bg:#ffab5c; --fg:#000; }
.adsp-menu-home__bandi { --bg:#fa4240; --fg:#fff; }

/* Profilo a freccia del riquadro BANDI E GARE */
.adsp-menu-home__row a.adsp-menu-home__bandi {
    padding-right: 15px;
    clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 50%, calc(100% - 13px) 100%, 0 100%);
}
/* I due riquadri finali occupano un'unica colonna */
.adsp-menu-home__end {
    display: grid;
    grid-template-rows: 56px 56px;
    gap: 3px;
    height: 115px;
    min-width: 0;
}
.adsp-menu-home__row .adsp-menu-home__end a.adsp-menu-home__button {
    --bg: #fa4240;
    --fg: #fff;
    height: 56px;
    padding: 3px 2px 3px 12px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.15;
    /* intaglio che riprende la grafica originale */
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 10px 50%);
}
.adsp-menu-home__row .adsp-menu-home__end a.adsp-menu-home__modulistica {
    /* Elimina icone generate con ::before e ::after */
.adsp-menu-home .adsp-menu-home__row a.adsp-menu-home__button::before,
.adsp-menu-home .adsp-menu-home__row a.adsp-menu-home__button::after {
    display: none !important;
    content: none !important;
    background: none !important;
}

/* Elimina icone SVG e icone aggiunte dal tema */
.adsp-menu-home a.adsp-menu-home__button svg,
.adsp-menu-home a.adsp-menu-home__button .external-link-icon,
.adsp-menu-home a.adsp-menu-home__button [class*="icon"] {
    display: none !important;
}

/* Elimina eventuali icone come immagini di sfondo */
.adsp-menu-home .adsp-menu-home__row a.adsp-menu-home__button {
    background-image: none !important;
}font-size: 17px;
}
/* Elimina icone generate con ::before e ::after */
.adsp-menu-home .adsp-menu-home__row a.adsp-menu-home__button::before,
.adsp-menu-home .adsp-menu-home__row a.adsp-menu-home__button::after {
    display: none !important;
    content: none !important;
    background: none !important;
}

/* Elimina icone SVG e icone aggiunte dal tema */
.adsp-menu-home a.adsp-menu-home__button svg,
.adsp-menu-home a.adsp-menu-home__button .external-link-icon,
.adsp-menu-home a.adsp-menu-home__button [class*="icon"] {
    display: none !important;
}

/* Elimina eventuali icone come immagini di sfondo */
.adsp-menu-home .adsp-menu-home__row a.adsp-menu-home__button {
    background-image: none !important;
}
/* Tutti i pulsanti, compresi i due finali */
.adsp-menu-home .adsp-menu-home__row a.adsp-menu-home__button,
.adsp-menu-home .adsp-menu-home__end a.adsp-menu-home__button {
    text-align: right !important;
    align-items: flex-end !important;
}

/* Titoli e descrizioni allineati a destra */
.adsp-menu-home .adsp-menu-home__row a.adsp-menu-home__button .adsp-menu-home__title,
.adsp-menu-home .adsp-menu-home__row a.adsp-menu-home__button .adsp-menu-home__description {
    display: block !important;
    width: 100% !important;
    text-align: right !important;
}

/* Margine destro uniforme sui primi 7 pulsanti */
.adsp-menu-home .adsp-menu-home__row > a.adsp-menu-home__button {
    padding-right: 12px !important;
}

/* Mantiene lo spazio per la freccia BANDI E GARE */
.adsp-menu-home .adsp-menu-home__row > a.adsp-menu-home__bandi {
    padding-right: 17px !important;
}

/* Mantiene lo spazio per l'intaglio dei due pulsanti finali */
.adsp-menu-home .adsp-menu-home__end a.adsp-menu-home__button {
    padding-right: 5px !important;
}

/* Primi 7 pulsanti */
.adsp-menu-home__row > a.adsp-menu-home__button {
    justify-content: flex-start !important;
    padding-top: 7px !important;
}

/* Ultimi 2 pulsanti: Procedure e Modulistica */
.adsp-menu-home__end a.adsp-menu-home__button {
    justify-content: flex-start !important;
    padding-top: 5px !important;
}

/* ============================================
   BOTTONI HOMEPAGE RESPONSIVE
   ============================================ */

/* Tablet */
@media (max-width: 1100px) {

    .adsp-menu-home {
        overflow-x: visible !important;
        overflow-y: visible !important;
    }

    .adsp-menu-home__row {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        min-width: 0 !important;
        height: auto !important;
        gap: 3px !important;
    }

    /* Elimina la freccia sporgente di Bandi e Gare */
    .adsp-menu-home__row a.adsp-menu-home__bandi {
        clip-path: none !important;
    }

    /* Mantiene i due pulsanti finali sovrapposti */
    .adsp-menu-home__end {
        height: 115px;
    }
}

/* Smartphone */
@media (max-width: 600px) {

    .adsp-menu-home__row {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .adsp-menu-home__row > a.adsp-menu-home__button {
        padding-right: 12px !important;
    }

    .adsp-menu-home__title {
        font-size: 19px !important;
    }

    .adsp-menu-home__description {
        font-size: 14px !important;
    }
}

/* ============================================
   IFRAME GAIA - RESPONSIVE
   ============================================ */

/* DESKTOP */
.gaia-iframe-container {
    width: 100%;
    max-width: none;
    margin: 0 auto 15px;
}

.gaia-iframe-container iframe {
    display: block;
    width: 100%;
    height: 210px;
    border: 0;
}

/* TABLET */
@media (max-width: 1100px) {
    .gaia-iframe-container iframe {
        height: 260px;
    }
}

/* SMARTPHONE */
@media (max-width: 600px) {
    .gaia-iframe-container iframe {
        height: 350px;
    }
}