/* ============================================================
   NAV3.CSS — Navbar + Hamburger Menu
   https://codepen.io/ainalem/pen/LJYRxz (ham animation)
   ============================================================ */


/* ── Variabili ────────────────────────────────────────────── */
:root {
    --nav-height:     70px;
    --nav-bg:         #fff;
    --nav-font-size:  18px;
    --nav-link-color: #111;
    --nav-hover-bg:   #fff;
    --nav-menu-bg:    rgba(255, 255, 255, 0.5);
    --logo-height:   55px;   /* ← aggiungi */
    --logo-margin:   8px;    /* ← aggiungi */
}


/* ── Header bar ───────────────────────────────────────────── */
.overlay {
    position:         absolute;
    z-index:          1;
    width:            100%;
    height:           var(--nav-height);
    background-color: var(--nav-bg);
    overflow: hidden;
}


/* ── Logo ─────────────────────────────────────────────────── */
.logo {
    width:  60%;
    height: 100%;
    float:  left;
}

.logo > a {
    display:         block;
    height:          100%;
    width:           100%;
    text-decoration: none;
}

.logo > a > img {
    width:       auto;
    height:      var(--logo-height);
    object-fit:  contain;
    float:       left;
    margin-top:  var(--logo-margin);
    padding-left: 7px;
}

.logo > a > h3 {
    float:       left;
    margin-left: 10px;
    height:      auto;
    line-height: 30px;
    font-size:   20px;
    text-align:  center;
}


/* ── Label (area cliccabile hamburger) ────────────────────── */
.overlay > label {
    cursor:   pointer;
    display:  block;
    position: relative;
    float:    right;
    width:    20%;
    height:   100%;
}

.overlay > label::before {
    content:  '';
    display:  block;
    position: relative;
    top:      7px;
}


/* ── Menu a tendina ───────────────────────────────────────── */
.verticalNav {
    color:            var(--nav-link-color);
    background-color: var(--nav-menu-bg);
    position:         relative;
    top:              -111px; /* nascosto sopra la viewport */
    font-size:        var(--nav-font-size);
    box-sizing:       border-box;
    transition:       top 600ms cubic-bezier(0.17, 0.04, 0.03, 0.94);
    text-align:       right;
    padding-bottom:   5px;
}

.verticalNav > a {
    display:         block;
    color:           var(--nav-link-color);
    text-decoration: none;
    padding:         5px 10px;
}

.verticalNav a:hover {
    background-color: var(--nav-hover-bg);
}


/* ── Checkbox toggle (hidden) ─────────────────────────────── */
#toggle {
    position:   absolute;
    visibility: hidden;
}

#toggle:checked ~ .verticalNav {
    top: var(--nav-height);
}

#toggle:checked ~ .main {
    margin-top: 100px;
}


/* ── Language switch (disabilitato) ──────────────────────── */
.lang_switch {
    display: none !important;
    margin:         20px;
    padding-bottom: 3px;
}

.lang_switch > a {
    padding:         3px 6px;
    text-decoration: none;
    font-weight:     bold;
    text-transform:  uppercase;
}


/* ── Hamburger SVG animation ──────────────────────────────── */
.ham {
    float:                    right;
    padding-top:              10px;
    margin-right:             17px;
    width:                    55px;
    cursor:                   pointer;
    -webkit-tap-highlight-color: transparent;
    transition:               transform 400ms;
    user-select:              none;
}

.hamRotate.active    { transform: rotate(45deg); }
.hamRotate180.active { transform: rotate(180deg); }

.line {
    fill:       none;
    transition: stroke-dasharray 400ms, stroke-dashoffset 400ms;
    stroke:        #000;
    stroke-width:  5.5;
    stroke-linecap: round;
}

.ham7 .top    { stroke-dasharray: 40 82; }
.ham7 .middle { stroke-dasharray: 40 111; }
.ham7 .bottom { stroke-dasharray: 40 161; }

.ham7.active .top    { stroke-dasharray: 17 82;  stroke-dashoffset: -62px; }
.ham7.active .middle { stroke-dashoffset: 23px; }
.ham7.active .bottom { stroke-dashoffset: -83px; }


/* ── Responsive ───────────────────────────────────────────── */
@media screen and (max-width: 767px) {

    :root {
        --logo-height: 41px;  /* dimensione logo su mobile */
        --logo-margin: 15px;  /* ricalibra verticale */
    }

    .ham {
        width:        40px;     /* dimensione dell icona hamburger */
        padding-top:  15px;
        margin-right: 3px;
    }

    .verticalNav {
        top: -91px; /* aggiusta in base al numero di voci */
    }
}