/* --header-- */
.header-top {
    position: relative;
    z-index: 1;
}

.logo {
    position: relative;
    z-index: 1;
}

.header-tools {
    z-index: 1000 !important;
}

/* --Switch-- */
.switch {
    align-items: center;
    position: relative;
    top: 0;
    width: 62px !important;
    height: 24px !important;
    border-radius: 0;
    padding: 0;
    float: left
}

.switch:before {
    content: "";
    height: 1px;
    width: 15px;
    right: -5px;
    bottom: 12px;
    z-index: 0;
    position: absolute;
    background-color: #666
}

.headerdefault-wrapper .switch {
    margin-left: 0;
    float: right
}

.switchtext1 {
    position: absolute;
    left: 0;
    top: 0;
    color: red;
    z-index: 1
}

.switch__input,
.switch__label {
    position: absolute;
    left: 0;
    bottom: 3px
}

.switch__input {
    margin: 0;
    padding: 0;
    opacity: 0;
    height: 0;
    width: 0;
    pointer-events: none
}

.switch__input:checked+.switch__label+.switch__marker {
    left: 30px
}

.switch__input:checked+.switch__label+.switch__marker:after {
    font-family: 'Material Icons Outlined';
    content: "\f036";
    display: block;
    border: none;
    position: absolute;
    bottom: 2px;
    left: 0;
    color: #fff;
    font-weight: 400;
    font-size: 18px;
    line-height: 1em
}

.switch__label {
    width: 100%;
    height: 100%;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    z-index: 1;
    -webkit-transition: all 500ms ease;
    -moz-transition: all 500ms ease;
    transition: all 500ms ease
}

.switch__label:before {
    font-family: 'Material Icons Outlined';
    content: "\e518";
    display: block;
    border: none;
    position: absolute;
    bottom: 1px;
    left: 0;
    color: #999;
    font-weight: 400;
    font-size: 18px;
    line-height: 1em;
    cursor: pointer
}

.switch__label:hover:before {
    color: #fff
}

.switch__label:after {
    font-family: 'Material Icons Outlined';
    content: "\f036";
    position: absolute;
    bottom: 1px;
    left: 30px;
    color: #000;
    font-weight: 400;
    font-size: 18px;
    line-height: 1em;
    cursor: pointer;
    -webkit-transition: all 500ms ease;
    -moz-transition: all 500ms ease;
    transition: all 500ms ease
}

.switch__label:hover:after {
    color: #ccc
}

.switch__marker {
    position: relative;
    background-color: transparent;
    width: 30px;
    height: 22px;
    z-index: 2;
    left: 0;
    bottom: 0;
    -webkit-transition: all 500ms ease;
    -moz-transition: all 500ms ease;
    transition: all 500ms ease
}

.switch__marker:before {
    font-family: 'Material Icons Outlined';
    content: "\e518";
    display: block;
    border: none;
    position: absolute;
    bottom: 2px;
    left: 0;
    color: #999;
    font-weight: 400;
    font-size: 18px;
    line-height: 1em;
    -webkit-transition: all 500ms ease;
    -moz-transition: all 500ms ease;
    transition: all 500ms ease
}

.dark .switch__marker:before {
    left: 0;
    color: #111
}

/***** Menù laterale *****/
.open-menu {
    z-index: 9
}

.open-menu.btn-customized {
    box-shadow: none;
    position: relative;
    float: left;
    width: 25px
}

.open-menu.btn-customized:before {
    font-family: 'Material Icons Outlined';
    content: "\e0bc";
    position: absolute;
    top: -3px;
    left: 0;
    color: #666;
    font-weight: 400;
    font-size: 18px;
    line-height: 1em
}

/***** Menù laterale Sidebar *****/
.menu-sidebar {
    width: 350px;
    height: 100vh;
    max-width: 100%;
    position: fixed;
    top: 0;
    left: -355px;
    z-index: 999;
    background: #fff;
    color: #181818;
    transition: all 700ms ease;
    text-align: left;
    overflow: auto
}

.menu-sidebar.active {
    left: 0
}

.dismiss {
    width: 30px;
    height: 30px;
    position: absolute;
    right: 10px;
    top: 15px;
    margin: 0 -2px 0 0;
    transition: all .3s;
    text-align: center;
    cursor: pointer
}

.dismiss:before {
    font-family: 'Material Icons Outlined';
    content: "\e5cd";
    border: none;
    position: absolute;
    top: 7px;
    left: 10px;
    color: #000;
    font-weight: 600;
    font-size: 16px;
    line-height: 1em
}

.menu-sidebar .logo {
    padding: 20px 85px 20px 30px
}

.sidebar1-insidewrapper {
    width: 100%;
    float: left;
    padding: 20px 40px
}

.menu-sidebar a[data-toggle="collapse"] {
    position: relative
}

.menu-sidebar .dropdown-toggle::after {
    display: block;
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%)
}

.menu-sidebar .to-top {
    padding: 20px;
    text-align: center
}

.menu-sidebar .dark-light-buttons {
    padding: 10px 20px 30px;
    text-align: center
}

/*Transizione per apertura pagina*/
.fade-in {
    opacity: 0;
    animation: fade-in 1s forwards;
}

@keyframes fade-in {
    to {
        opacity: 1;
    }
}

/***** Overlay *****/
.overlay {
    display: none;
    position: fixed !important;
    width: 100%;
    height: 100%;
    background: #000000b3 !important;
    z-index: 998;
    opacity: 0;
    transition: all .5s ease-in-out
}

.overlay.active {
    display: block;
    opacity: .5;
    left: 0
}

/*Tema scuro*/
body.dark {
    background: #181818;
    color: silver
}

.dark a {
    color: #fff
}

.dark a:hover {
    color: #999
}

.dark h1,
.dark h2,
.dark h3,
.dark h4,
.dark h5,
.dark h6 {
    color: #fff !important
}

.dark hr {
    background-color: #333
}

.dark .menu-sidebar,
.dark .menu-sidebar .logo,
.dark:nth-child(even)>ul>li.active>a {
    background-color: #222
}

/* --- Homepage Layout Restructure Fixes (Antigravity Mobile) --- */
.entry-meta.meta-2 {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
}

.entry-meta.meta-2 .meta-author,
.entry-meta.meta-2 .meta-right {
    display: flex !important;
    align-items: center !important;
}

.entry-meta.meta-2 .meta-author,
.entry-meta.meta-2 .author-name {
    color: #000 !important;
    font-weight: 600;
}

.dark .entry-meta.meta-2 .meta-author,
.dark .entry-meta.meta-2 .author-name {
    color: #fff !important;
}

.comment-info {
    color: #000 !important;
}

.dark .comment-info {
    color: #fff !important;
}

.banner-placeholder span {
    color: #000 !important;
    font-weight: 700 !important;
}

/* Mobile Refinements: Video Badge Alignment */
.video-badge-below {
    padding-left: 18px !important;
}

.text-center .video-badge-below {
    padding-left: 0 !important;
}

/* Refinement: Reduced Video Badge Indentation (Mobile) */
.video-badge-below {
    padding-left: 10px !important;
}

.text-center .video-badge-below {
    padding-left: 0 !important;
}

/* =====================================================
   MOBILE: Chiudi ricerca
   ===================================================== */

.search-mobile-close {
    display: none; /* nascosto su desktop */
}

@media (max-width: 767px) {
    .search-mobile-close {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: calc(24px + env(safe-area-inset-bottom, 0px));
        left: 50%;
        transform: translateX(-50%);
        z-index: 9999;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: rgba(0, 0, 0, 0.75);
        border: 1px solid rgba(255, 255, 255, 0.25);
        color: #fff;
        cursor: pointer;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s;
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
    }

    /* Visibile solo quando il pannello è aperto */
    body.open-search-form .search-mobile-close {
        opacity: 1;
        pointer-events: auto;
    }

    .search-mobile-close:active {
        background: rgba(0, 0, 0, 0.95);
    }
}

/* =====================================================
   MOBILE: Tema scuro forzato — rimozioni UI
   ===================================================== */

/* Nascondi il selettore tema (inutile: mobile è sempre dark) */
@media (max-width: 767px) {
    .theme-switch-3state,
    .desktop-switcher {
        display: none !important;
    }

    /* Nascondi i social dalla sidebar mobile (sono già nel footer) */
    .sidebar-social-mobile {
        display: none !important;
    }

    /* Nascondi bottone Argomenti/Approfondimenti (off-canvas toggle) */
    .off-canvas-toggle-cover {
        display: none !important;
    }

    /* Hamburger SlickNav: sfondo nero/trasparente (default è bianco rgb(255,255,255)) */
    .slicknav_btn {
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    /* Dropdown menu SlickNav: tema scuro */
    .slicknav_nav,
    .dark .slicknav_menu,
    .dark .slicknav_nav {
        background: #181818 !important;
    }

    .slicknav_nav a,
    .slicknav_nav .slicknav_row {
        color: #fff !important;
    }

    .slicknav_nav a:hover {
        color: #dca73a !important;
        background: transparent !important;
    }
}

/* =====================================================
   MOBILE LOOP: Divisori e Allineamento Testo
   Solo visualizzazione mobile (max-width: 767px)
   ===================================================== */
@media (max-width: 767px) {

    /* 1. Rimuovi linee divisorie verticali (come pseudo-elementi :: after) */
    .vertical-divider > [class*="col-"]:nth-child(n + 2)::after {
        display: none;
    }

    /* 2. Rimuovi linee divisorie orizzontali tra gruppi di post nei loop */
    .loop-grid    .horizontal-divider,
    .loop-grid-2  .horizontal-divider,
    .loop-grid-3  .horizontal-divider,
    .loop-grid-4  .horizontal-divider,
    .the-world    .horizontal-divider,
    .editor-picked .horizontal-divider,
    .recent-new   .horizontal-divider,
    .video-news   .horizontal-divider,
    .latest-post  .horizontal-divider {
        display: none;
    }

    /* 3. Separatore sottile tra i singoli articoli nei loop */
    .loop-grid    article,
    .loop-grid-2  article,
    .loop-grid-3  article,
    .loop-grid-4  article,
    .the-world    article,
    .editor-picked article,
    .recent-new   article,
    .video-news   article,
    .latest-post  article {
        border-bottom: 1px solid #e8e8e8;
        padding-bottom: 20px;
        margin-bottom: 20px;
    }

    .dark .loop-grid    article,
    .dark .loop-grid-2  article,
    .dark .loop-grid-3  article,
    .dark .loop-grid-4  article,
    .dark .the-world    article,
    .dark .editor-picked article,
    .dark .recent-new   article,
    .dark .video-news   article,
    .dark .latest-post  article {
        border-bottom-color: rgba(255, 255, 255, 0.12);
    }

    /* 4. Allinea a sinistra il testo centrato nei loop */
    .loop-grid    .text-center,
    .loop-grid-2  .text-center,
    .loop-grid-3  .text-center,
    .loop-grid-4  .text-center,
    .the-world    .text-center,
    .editor-picked .text-center,
    .recent-new   .text-center,
    .video-news   .text-center,
    .latest-post  .text-center {
        text-align: left !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* 5. Riallinea a sinistra l'ornamento wave sotto i titoli */
    .loop-grid-3  .first-post .post-title::after,
    .loop-grid-4  .first-post .post-title::after,
    .the-world    .divider-wave::after,
    .recent-new   .divider-wave::after,
    .video-news   .divider-wave::after,
    .editor-picked .divider-wave::after {
        left: 0;
        transform: none;
    }

}