/* Header Lapresse */

.bc-header--lapresse{
    .bc-header__middle{
        height: 120px !important;
    }
    .bc-header__bottom{
        height: 30px !important;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        & > div{
            gap: 15px !important;
        }
        .wp-block-navigation-item__label {
            font-weight: 400;
            letter-spacing: 1.3px;
        }
        li{
            height: 30px !important;
            &.bc-menu-magazine{
                a{
                    border: 1px solid #000;
                    border-radius: 30px;
                    padding: 0 10px !important;
                    display: block;
                    font-weight: 500;
                }
            }
        }
        a{
            font-size: 14px !important;
            text-transform: uppercase;
        }
        .bc-svg:has(#bc-slideover-nav__btn){
            display: flex;
            align-items: center;
            font-weight: bold;
            a{
                height: 24px;
            }
        }
    }
    .bc-header__top{
        font-weight: light;
        font-size: 14px;
        text-transform: capitalize;
        color: #fff;
    }
    .bc-header__bottom a{
        font-family: var(--wp--preset--font-family--heading);
    }
}

@media (max-width: 768px){
    .bc-header--lapresse{
        .bc-header__middle > .is-content-justification-center{
            justify-content: space-between !important;
        }
        .bc-header__middle{
            height: 60px !important;
            .wp-block-social-links {
                display: none !important;
            }
            .bc-svg:has(#bc-slideover-nav-mobile__btn){
                display: flex;
                align-items: center;
                font-weight: bold;
                a{
                    height: 24px;
                }
            }
        }
        .bc-header__top{
            .wp-block-social-links{
                display: none;
            }
        }
        .wp-block-site-logo.is-default-size img{
            width: 120px !important;
        }
    }
}

/* Slideover Nav */

.bc-slideover-nav{
    width: 100%;
    height: 100%;
    position: fixed;
    inset: 0;
    z-index: 9999999;
    overflow: auto;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
    &.bc-slideover-nav--active{
        visibility: visible;
        opacity: 1;
    }
    .bc-slideover-nav__head{
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 99999;
        height: 60px;
    }
    form.wp-block-search__button-outside{
        margin: 20px !important;
        input{
            border: none;
            background-color: #F7F7F7;
            border-radius: 4px;
        }
        button{
            border-radius: 4px;
        }
    }
    nav.wp-block-navigation{
        padding: 20px;
        margin-top: 0;
        ul.wp-block-navigation__container{
            align-items: flex-start;
            display: grid;
            grid-template-columns: 1fr;
            gap: 40px;
            li.wp-block-navigation-item{
                position: static;
                display: block;
                & > a{
                    font-family: var(--wp--preset--font-family--heading);
                    font-size: var(--wp--preset--font-size--x-large);
                    color: var(--wp--preset--color--primary);
                    text-transform: uppercase;
                    font-weight: 400;
                    white-space: nowrap;
                }
                .wp-block-navigation__submenu-icon{
                    display: none;
                    & + .wp-block-navigation-submenu{
                        margin-top: 20px;
                        a{
                            font-size: var(--wp--preset--font-size--large);
                            color: var(--wp--preset--color--primary);
                            text-transform: capitalize;
                            padding-left: 0;
                            font-weight: 300;
                        }
                    }
                }
                .wp-block-navigation-submenu{
                    height: auto;
                    min-width: auto;
                    opacity: 1;
                    /* overflow: visible; */
                    visibility: visible;
                    width: auto;
                    position: static;
                    background-color: #fff;
                    border: none;
                }
            }
        }
    }
    .wp-block-social-links{
        padding: 20px;
        a{
            border-radius: 50%;
            border: 1px solid rgba(0, 0, 0, 0.1) !important;
            width: 24px !important;
            height: 24px  !important;
            display: flex;
            align-items: center;
            justify-content: center;
            svg{
                width: 20px !important;
                height: 20px  !important;
                fill: var(--wp--preset--color--primary) !important;
            }
        }
    }
    .bc-slideover-nav__content{
        position: absolute;
        z-index: 999999;
        width: 390px;
        height: 100%;
        background-color: #fff;
        overflow-y: auto;
        transform: translateX(0); /* Nasconde il menu */
        transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
            .wp-block-site-logo.is-default-size img {
                width: 120px;
             }
    }
    .bc-slideover-nav__bg{
        position: absolute;
        inset: 0;
        z-index: 99999;
        background-color: rgba(0, 0, 0, 0.2);
        opacity: 0;
        transition: opacity 0.4s ease;
        cursor: pointer;
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
    }
    .bc-banner-slideover-nav {
        border-radius: 0px;
        p {
        font-family: 'Archivo Narrow';
        text-transform: uppercase;
        letter-spacing: 1.2px;
        font-weight: 100;
        font-size: 20px;    
        }
    }
}

.bc-slideover-nav:not(.bc-slideover-nav--active) .bc-slideover-nav__content {
    transform: translateX(-100%);
}

.bc-slideover-nav.bc-slideover-nav--active .bc-slideover-nav__bg {
    opacity: 1; /* Mostra lo sfondo */
}

@media (max-width: 448px){
    .bc-slideover-nav{
        .bc-slideover-nav__content{
            width: 90%;
        }
    }
}

@media (min-width: 768px){
    .bc-svg:has(#bc-slideover-nav-mobile__btn){
        display: none;
    }
}

.wp-block-social-links{
    a{
        border-radius: 50%;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        width: 24px !important;
        height: 24px  !important;
        display: flex;
        align-items: center;
        justify-content: center;
        svg{
            width: 20px !important;
            height: 20px  !important;
        }
    }
}

.bc-banner-slideover-nav{
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px 20px;
    margin: 20px !important;
    background-color: var(--wp--preset--color--primary);
    border-radius: 10px;
    p{
        color: #fff;
    }
    .bc-banner-button-slideover-nav{
        border: 1px solid #fff;
        display: flex;
        justify-content: center;
        align-items: center;
        height: 36px;
        width: 36px;
        border-radius: 0px;
        margin-left: auto;
    }
}

.is-layout-constrained .bc-banner-slideover-nav{
    margin: 20px !important;
}

/* Scrolled class */

@media (min-width: 768px){
    header.wp-block-template-part{
        position: static !important;
    }
}

.bc-header__bottom {
  position: relative; /* o static, a seconda del layout */
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 99999;
  background-color: #fff;
}

/* Solo quando scrolled: la barra diventa fixed e animata */
body.scrolled .bc-header__bottom {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

body.scrolled:has(> #wpadminbar) .bc-header__bottom{
    top: 30px;
}

/* Effetto entrata: parte da sopra */
body.scrolled .bc-header__bottom {
  animation: slideDown 0.3s ease forwards;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
