/* =========================================================================
   GUG LIGURIA - VISTA SMARTPHONE
   Questo file viene caricato SOLO sotto i 768px di larghezza (vedi index.php:
   media="(max-width: 767.98px)"), quindi non puo' modificare il desktop
   ne' la modalita' "Sito desktop" del telefono.

   Struttura della vista:
   1. intestazione compatta (una riga)
   2. discipline FIN nascoste dietro un pulsante
   3. contenuto subito sotto, a tutta larghezza
   4. barra di navigazione fissa in basso: Home / Prossime / Campionati / Menu
   5. "Campionati" e "Menu" si aprono come pannello dal basso
   ========================================================================= */

:root {
    --wp-navy: #05072E;
    --wp-blue: #16365c;
    --wp-accent: #99ccff;
    --wp-tabbar-h: 58px;           /* altezza della barra in basso */
}

body {
    background-color: #f2f4f8 !important;
    /* spazio per non nascondere l'ultimo contenuto sotto la barra fissa */
    padding-bottom: calc(var(--wp-tabbar-h) + env(safe-area-inset-bottom, 0px)) !important;
}
body.wp-lock { overflow: hidden; }

/* -------------------------------------------------------------------------
   1. INTESTAZIONE COMPATTA
   ------------------------------------------------------------------------- */
.wp-hero {
    padding: 8px 0 !important;
    box-shadow: none !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.12) !important;
    background-color: var(--wp-navy) !important;
}
.wp-hero > div:last-child { display: none !important; }   /* sfumatura decorativa in basso */

.wp-hero .container {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 12px !important;
}
.wp-hero-logo {
    margin: 0 !important;
    filter: none !important;
    flex: 0 0 auto;
}
.wp-hero-logo img {
    max-height: 40px !important;
    width: auto !important;
    height: auto;
}
.wp-hero-title {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 1rem !important;
    letter-spacing: 1px !important;
    line-height: 1.15 !important;
    text-align: left !important;
}

/* -------------------------------------------------------------------------
   2. NAVBAR ORIGINALE: sui telefoni i 3 burger in alto sono sostituiti dalla barra in basso
   ------------------------------------------------------------------------- */
nav.navbar {
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    min-height: 0;
}
#navbarParent { padding: 0 !important; }
#navbarParent > .d-md-none { display: none !important; }
#burgerNormative,
#burgerCampionati { display: none !important; }

/* -------------------------------------------------------------------------
   3. DISCIPLINE FIN: nascoste, si aprono col pulsante
   ------------------------------------------------------------------------- */
.wp-fin-toggle {
    display: block;
    width: 100%;
    background: #ffffff;
    border: 0;
    border-bottom: 1px solid #e2e8f0;
    padding: 9px 14px;
    font: 600 13px Arial, sans-serif;
    color: var(--wp-blue);
    text-align: left;
    cursor: pointer;
}
.wp-fin-bar { display: none !important; margin-bottom: 0 !important; }
.wp-fin-bar.wp-fin-open { display: block !important; }

/* -------------------------------------------------------------------------
   4. CONTENUTO: subito sotto l'intestazione, a tutta larghezza
   ------------------------------------------------------------------------- */
.main-content-container {
    margin-top: 10px !important;
    margin-bottom: 14px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
}
.content-white-card {
    padding: 14px 10px !important;
    border-radius: 12px !important;
}
.content-white-card img { max-width: 100%; height: auto; }

/* -------------------------------------------------------------------------
   5. PANNELLI DAL BASSO: colonna "Campionati e normative" e "Menu"
   ------------------------------------------------------------------------- */
.td-sidebar-left,
#topNavbar {
    position: fixed !important;
    left: 0;
    right: 0;
    top: auto;
    bottom: calc(var(--wp-tabbar-h) + env(safe-area-inset-bottom, 0px));
    z-index: 1045;
    display: block !important;
    width: auto !important;
    max-width: none !important;
    max-height: 74vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #ffffff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.28);
    padding: 14px 16px 18px !important;
    margin: 0 !important;
    transform: translateY(110%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0s linear 0.25s;
}
.td-sidebar-left.wp-open,
#topNavbar.wp-open {
    transform: translateY(0);
    visibility: visible;
    transition: transform 0.25s ease, visibility 0s;
}
.td-sidebar-left::before,
#topNavbar::before {
    display: block;
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--wp-navy);
    padding-bottom: 8px;
    margin-bottom: 4px;
    border-bottom: 1px solid #e2e8f0;
}
.td-sidebar-left::before { content: "Campionati e normative"; }
#topNavbar::before { content: "Menu"; }

#wpBackdrop {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(5, 7, 46, 0.45);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}
#wpBackdrop.wp-open {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease;
}

/* -------------------------------------------------------------------------
   6. BARRA DI NAVIGAZIONE FISSA IN BASSO
   ------------------------------------------------------------------------- */
#wpTabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050;
    display: flex;
    height: calc(var(--wp-tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #ffffff;
    border-top: 1px solid #dfe5ee;
    box-shadow: 0 -2px 12px rgba(5, 7, 46, 0.10);
}
#wpTabbar .wp-tab {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: 0;
    border-top: 3px solid transparent;
    color: #475569;
    font: 600 11px/1.1 Arial, sans-serif;
    text-decoration: none;
    padding: 4px 2px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
#wpTabbar .wp-tab .wp-ico { font-size: 20px; line-height: 1; }
#wpTabbar .wp-tab.active,
#wpTabbar .wp-tab[aria-expanded="true"] {
    color: var(--wp-blue);
    border-top-color: var(--wp-blue);
}
