/*
 Theme Name: Divi Child
 Theme URI: https://www.elegantthemes.com/gallery/divi/
 Description: Divi Child Theme – compatibile con Divi 5
 Author: Elegant Themes
 Author URI: https://www.elegantthemes.com
 Template: Divi
 Version: 1.1.0
*/

/* =Theme customization starts here
------------------------------------------------------- */

/* ========================================
   SKIPLINK
======================================== */

.c-skiplink {
    position: fixed;
    top: 0;
    left: -9999px;
    z-index: 9999;
    padding: .75rem 1.25rem;
    background: #bc4e90;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.c-skiplink:focus {
    left: 0;
}

/* ========================================
   BASE MENU ACCESSIBILE
======================================== */

.c-nav {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between!important;
}

/* Logo */
.c-nav__logo {
    margin-right: 1rem;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.c-nav__logo img {
    height: 50px;
    width: auto;
    min-width: 0;
    vertical-align: middle;
}

/* Lista top-level */
.c-nav__menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: nowrap;
}

/* Items */
.c-nav__item {
    position: relative;
}

/* Link top-level e toggle */
.c-nav__link,
.c-nav__toggle {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 0.55rem;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 400;
    font-size: 0.8125rem;
    letter-spacing: 0.03em;
    white-space: nowrap;
    color: #2b1f22;
    border: none;
    background: none;
    cursor: pointer;
    transition: color .2s;
}

.c-nav__link:hover,
.c-nav__link:focus,
.c-nav__toggle:hover,
.c-nav__toggle:focus {
    color: #bc4e90;
}

/* Link nei sottomenu */
.c-nav__sublink {
    display: block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 400;
    color: #2b1f22;
    transition: color .2s;
}

.c-nav__sublink:hover,
.c-nav__sublink:focus {
    color: #bc4e90;
}

/* Elemento attivo */
.c-nav__item.current-menu-item > .c-nav__link,
.c-nav__item.current-menu-item > .c-nav__sublink,
.c-nav__item.current-menu-ancestor > .c-nav__link {
    color: #2b1f22;
    text-decoration: underline;
    text-decoration-color: #bc4e90;
    text-underline-offset: 4px;
    text-decoration-thickness: 2px;
}

/* Focus visibile (WCAG 2.4.7) — contrasto AA garantito su ogni fondo */
*:focus-visible {
    outline: 3px solid #962c76;
    outline-offset: 2px;
    box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.9);
    border-radius: 2px;
}

/* Submenu */
.c-nav__submenu {
    position: absolute;
    left: 0;
    top: 100%;
    min-width: 280px;
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    background: #fff;
    border: 1px solid #ddd;
    display: none;
    z-index: 9990;
}

/* Sub-submenu */
.c-nav__submenu--level-2 {
    left: 100%;
    top: 0;
    min-width: 260px;
}

/* Apertura submenu quando il LI ha .is-open */
.c-nav__item.is-open > .c-nav__submenu {
    display: block;
}

/* ========================================
   RIMOZIONE ARTEFATTI DIVI 5
======================================== */

.c-nav .menu-item:before,
.c-nav .menu-item-has-children:before,
.c-nav .et_pb_menu__menu li:before,
.c-nav li::marker {
    display: none !important;
    content: none !important;
}

.c-nav li {
    outline: none;
}

/* ========================================
   BURGER
======================================== */

.c-nav__burger {
    display: none;
    border: none;
    background: none;
    cursor: pointer;
    padding: 8px;
}

.c-nav__burger-line {
    width: 22px;
    height: 2px;
    background: #2b1f22;
    display: block;
    margin: 5px 0;
    transition: transform .25s ease, opacity .25s ease;
}

/* burger → X */
.c-nav__burger.is-open .c-nav__burger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.c-nav__burger.is-open .c-nav__burger-line:nth-child(2) {
    opacity: 0;
}

.c-nav__burger.is-open .c-nav__burger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ========================================
   CARET (freccia ▼ / ▲)
======================================== */

.c-nav__toggle .c-nav__caret::before {
    content: "▼";
    font-size: 0.7em;
    margin-left: 6px;
}

.c-nav__item.is-open > .c-nav__toggle .c-nav__caret::before,
.c-nav__item.is-open > .c-nav__sublink.c-nav__toggle .c-nav__caret::before {
    content: "▲";
}

/* ========================================
   RESPONSIVE (TABLET / MOBILE)
======================================== */

@media (max-width: 1100px) {

    .c-nav {
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .c-nav__logo {
        margin-right: 0;
        max-width: 200px;
    }

    .c-nav__logo img {
        max-height: 40px;
        max-width: 200px;
    }

    .c-nav__burger {
        display: block;
        margin-left: auto;
    }

    .c-nav__menu {
        flex-direction: column;
        width: 100%;
        margin-top: 1rem;
        display: none;
    }

    .c-nav__menu.is-open {
        display: flex;
    }

    .c-nav__item {
        width: 100%;
    }

    .c-nav__submenu {
        position: static;
        border: none;
        width: 100% !important;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .c-nav__submenu--level-2 {
        padding-left: 1.5rem;
        left: auto;
        top: auto;
    }

    .c-nav__container {
        min-width: 100%;
    }

    .c-nav__submenu--level-2 li {
        margin-left: 15px!important;
    }
}

@media (min-width: 1101px) {
    .c-nav__burger {
        display: none;
    }
}

/* Safety: niente bullet di lista */
.c-nav ul,
.c-nav li {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ========================================
   NASCONDI MENU DIVI 5 DOVE SI USA IL MENU CUSTOM
======================================== */

/*
body.page-id-25590 #top-menu-nav,
body.page-id-25590 .et_mobile_nav_menu,
body.page-id-25590 .et-db-Header,
body.page-id-25590 [data-et-vb-component="divi/header-menu"] {
    display: none !important;
}
*/
