/* ========================================
   LAYOUT BASE - VERTICAL HEADER
   ======================================== */
/* league-spartan-100 - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'League Spartan';
  font-style: normal;
  font-weight: 100;
  src: url('../fonts/league-spartan/league-spartan-v15-latin-100.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* league-spartan-200 - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'League Spartan';
  font-style: normal;
  font-weight: 200;
  src: url('../fonts/league-spartan/league-spartan-v15-latin-200.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* league-spartan-300 - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'League Spartan';
  font-style: normal;
  font-weight: 300;
  src: url('../fonts/league-spartan/league-spartan-v15-latin-300.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* league-spartan-regular - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'League Spartan';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/league-spartan/league-spartan-v15-latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* league-spartan-500 - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'League Spartan';
  font-style: normal;
  font-weight: 500;
  src: url('../fonts/league-spartan/league-spartan-v15-latin-500.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* league-spartan-600 - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'League Spartan';
  font-style: normal;
  font-weight: 600;
  src: url('../fonts/league-spartan/league-spartan-v15-latin-600.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* league-spartan-700 - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'League Spartan';
  font-style: normal;
  font-weight: 700;
  src: url('../fonts/league-spartan/league-spartan-v15-latin-700.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* league-spartan-800 - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'League Spartan';
  font-style: normal;
  font-weight: 800;
  src: url('../fonts/league-spartan/league-spartan-v15-latin-800.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* league-spartan-900 - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'League Spartan';
  font-style: normal;
  font-weight: 900;
  src: url('../fonts/league-spartan/league-spartan-v15-latin-900.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
:root {
    --header-width: 350px;
    --header-bg: #ffffff;
    --header-text: #1a1a2e;
    --content-bg: #ffffff; 
    --font-heading: 'League Spartan', sans-serif;
    --font-body: 'Red Hat Display', sans-serif;
    --transition-speed: 0.3s;

    --primary-color: #14465f;
    --secondary-color: #357a8a;
    --accent-color: #b1005e;
    --cta-color: #faf02d;
}

/* Reset base */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}
 
/* ========================================
   VERTICAL HEADER LAYOUT (Desktop)
   ======================================== */

.has-vertical-header .site-wrapper {
    display: flex;
    min-height: 100vh;
}

.has-vertical-header #site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--header-width);
    height: 100vh;
    background: var(--header-bg);
    color: var(--header-text);
    z-index: 1000;
    overflow-y: hidden;
    overflow-x: hidden;
    transition: transform var(--transition-speed) ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

.has-vertical-header .header-inner {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 40px 30px;
    overflow: hidden;
}

.has-vertical-header .content-wrapper {
    margin-left: var(--header-width);
    width: calc(100% - var(--header-width));
    min-height: 100vh;
    background: var(--content-bg);
    overflow-y: auto;
    overflow-x: hidden;
}

/* ========================================
   HORIZONTAL HEADER LAYOUT (Archives/Singles)
   ======================================== */

.has-horizontal-header .site-wrapper {
    display: block;
}

.has-horizontal-header #site-header {
    position: sticky;
    top: 0;
    width: 100%;
    background: var(--header-bg);
    color: var(--header-text);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.has-horizontal-header .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 40px;
    max-width: 1400px;
    margin: 0 auto;
}
.has-horizontal-header .site-header .header-inner {
    max-width: 100% !important;
}
.has-horizontal-header .content-wrapper {
    width: 100%;
    min-height: calc(100vh - 80px);
}

/* ========================================
   LOGO / BRANDING
   ======================================== */

.site-branding {
    margin-bottom: 40px;
}

.has-horizontal-header .site-branding {
    margin-bottom: 0;
}

.site-branding a {
    display: inline-block;
    text-decoration: none;
}

.site-branding img {
    max-width: 250px;
    height: auto;
    display: block;
}

.has-horizontal-header .site-branding img {
    max-width: 250px;
}

.site-logo-text h1 {
    font-family: 'League Spartan', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: var(--header-text);
    margin: 0;
    line-height: 1.2;
}

.custom-logo-link {
    display: inline-block;
}
 
/* ========================================
   NAVIGATION MENU - VERTICAL
   ======================================== */

.has-vertical-header .main-navigation {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    justify-content: start;
    align-items: end;
    display: flex;
}

.has-vertical-header #menu-primario {
    list-style: none;
    margin: 0;
    padding: 0;
}

.has-vertical-header #menu-primario > li {
    margin-bottom: 5px;
}
 
.has-vertical-header #menu-primario > li > a {
    display: block;
    padding: 5px 0px;
    color: var(--header-text);
    text-decoration: none;
    font-family: 'League Spartan', sans-serif;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 0px;
    transition: color 0.3s ease; /* animiamo solo il colore del testo qui */
    position: relative;
}

/* configurazione della linea (stato iniziale invisibile) */
.has-vertical-header #menu-primario > li > a:after {
    content: "";
    position: absolute;
    bottom: 0px;
    left: 0;
    width: 0%; /* parte da 0 larghezza */
    height: 1px; /* spessore della linea */
    background-color: var(--header-text);
    transition: width 0.3s ease-in-out; /* eccolo: l'effetto animato */
}

/* stato all'hover e per la pagina attiva */
.has-vertical-header #menu-primario > li > a:hover:after,
.has-vertical-header #menu-primario > li.current-menu-item > a:after,
.has-vertical-header #menu-primario > li.current_page_item > a:after {
    width: 100%; /* si espande fino alla fine */
}

/* Submenu verticale */
.has-vertical-header #menu-primario .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0 0 0 20px;
    display: none;
}

.has-vertical-header #menu-primario li:hover > .sub-menu {
    display: block;
}

.has-vertical-header #menu-primario .sub-menu li a {
    display: block;
    padding: 10px 15px;
    color: rgba(26, 26, 46, 0.7);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.has-vertical-header #menu-primario .sub-menu li a:hover {
    color: #1a1a2e;
    padding-left: 20px;
}

/* ========================================
   NAVIGATION MENU - HORIZONTAL
   ======================================== */

.has-horizontal-header .main-navigation {
    display: flex;
}

.has-horizontal-header #menu-primario {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 5px;
}

.has-horizontal-header #menu-primario > li > a {
    display: block;
    padding: 12px 10px;
    color: #7A7A7A;
    text-decoration: none;
    font-family: 'League Spartan', sans-serif;
    font-size: 18px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease-in-out;
}

.has-horizontal-header #menu-primario > li > a:hover,
.has-horizontal-header #menu-primario > li.current-menu-item > a,
.has-horizontal-header #menu-primario > li.current_page_item > a {
    color: #000;
}

/* Submenu orizzontale */
.has-horizontal-header #menu-primario .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--header-text);
    list-style: none;
    margin: 0;
    padding: 10px 0;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.has-horizontal-header #menu-primario li {
    position: relative;
}

.has-horizontal-header #menu-primario li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.has-horizontal-header #menu-primario .sub-menu li a {
    display: block;
    padding: 10px 20px;
    color: var(--header-text);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.has-horizontal-header #menu-primario .sub-menu li a:hover {
    background: #f0f0f1;
}
 
/* ========================================
   MOBILE MENU TOGGLE
   ======================================== */

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 1001;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--header-text);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ========================================
   RESPONSIVE - TABLET
   ======================================== */
@media (min-width:1200px) {
    .has-horizontal-header .site-header:not(.dynamic-header) {
        max-width: 100% !important;
    }

}
@media (max-width: 1024px) {
    :root {
        --header-width: 280px;
    }
    
    .has-vertical-header .header-inner {
        padding: 30px 20px;
    }
    
    .has-vertical-header #menu-primario > li > a {
        font-size: 15px;
        padding: 12px 15px;
    }
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */

@media (max-width: 768px) {
    
    /* Forza header orizzontale su mobile */
    .has-vertical-header .site-wrapper {
        display: block;
    }
    
    .has-vertical-header #site-header,
    .has-horizontal-header #site-header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: auto;
        min-height: 70px;
    }
    
    .has-vertical-header .header-inner,
    .has-horizontal-header .header-inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        min-height: 70px;
        height: auto;
        overflow: visible;
    }
    
    .has-vertical-header .content-wrapper,
    .has-horizontal-header .content-wrapper {
        margin-left: 0;
        width: 100%;
        padding-top: 70px;
    }
    
    /* Logo mobile */
    .site-branding {
        margin-bottom: 0;
        align-items: center;
        display: flex;
    }
    
    .site-branding img {
        max-width: 200px; 
            
    }
    
    /* Mobile menu toggle visible */
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Navigation mobile */
    .main-navigation {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        height: calc(100vh - 70px);
        background: var(--header-bg);
        transform: translateX(-100%);
        transition: transform var(--transition-speed) ease;
        overflow-y: auto;
        padding: 20px;
    }
    
    .main-navigation.active {
        transform: translateX(0);
    }
    
    #menu-primario {
        flex-direction: column;
        gap: 0 !important;
    }
    
    #menu-primario > li {
        margin-bottom: 0;
        border-bottom: 1px solid #e0e0e0;
    }
    
    #menu-primario > li > a {
        padding: 15px 20px;
        font-size: 16px;
    }
    
    #menu-primario .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: transparent;
        padding: 0 0 0 20px;
    }
    
    /* Header footer nascosto su mobile */
    .header-footer {
        display: none;
    }
    
    /* Previeni scroll quando menu aperto */
    body.menu-open {
        overflow: hidden;
    }
}

/* ========================================
   ELEMENTOR COMPATIBILITY
   ======================================== */

.has-vertical-header .elementor-section-wrap,
.has-horizontal-header .elementor-section-wrap {
    width: 100%;
}

.elementor-location-header {
    display: none !important;
}

.elementor-location-footer {
    width: 100%;
}

/* ========================================
   ADMIN BAR FIX
   ======================================== */

/* Fix per admin bar - sidebar rimane fixed e non scrollabile */
body.admin-bar.has-vertical-header #site-header {
    top: 32px;
    height: calc(100vh - 32px);
    overflow: hidden;
}

body.admin-bar.has-vertical-header .header-inner {
    height: calc(100vh - 32px);
    overflow: hidden;
}

body.admin-bar.has-vertical-header .content-wrapper {
    min-height: calc(100vh - 32px);
}

body.admin-bar.has-horizontal-header #site-header {
    top: 32px;
}

/* Mobile admin bar - CORRETTO */
@media screen and (max-width: 782px) {
    /* Header orizzontale su mobile con admin bar */
    body.admin-bar.has-vertical-header #site-header,
    body.admin-bar.has-horizontal-header #site-header {
        top: 46px;
        height: auto;
        min-height: 70px;
    }
    
    body.admin-bar.has-vertical-header .header-inner,
    body.admin-bar.has-horizontal-header .header-inner {
        height: auto;
        min-height: 70px;
        overflow: visible;
    }
    
    body.admin-bar.has-vertical-header .content-wrapper,
    body.admin-bar.has-horizontal-header .content-wrapper {
        padding-top: calc(70px + 46px); /* Header height + admin bar */
        min-height: calc(100vh - 46px);
    }
    
    /* Menu mobile con admin bar */
    body.admin-bar .main-navigation {
        top: calc(70px + 46px); /* Header + admin bar */
        height: calc(100vh - 70px - 46px);
    }
}

/* Desktop admin bar con horizontal header */
body.admin-bar.has-horizontal-header .content-wrapper {
    min-height: calc(100vh - 32px);
}

/* Assicurati che il contenuto inizi sotto l'admin bar */
body.admin-bar .content-wrapper {
    position: relative;
}

/* ========================================
   HIDING HELLO ELEMENTOR DEFAULT HEADER
   ======================================== */

.site-header.site-header--default,
.hello-header,
header.site-header:not(#site-header) {
    display: none !important;
}

/* ========================================
   CONTENT PADDING/SPACING
   ======================================== */

.content-wrapper {
    padding: 0; 
}

.has-vertical-header .content-wrapper > .elementor {
    width: 100%;
}

.has-horizontal-header .content-wrapper > .elementor {
    width: 100%;
}

/* ========================================
   SCROLL BEHAVIOR - SOLO PER IL MENU
   ======================================== */

.has-vertical-header .main-navigation::-webkit-scrollbar {
    width: 4px;
}

.has-vertical-header .main-navigation::-webkit-scrollbar-track {
    background: transparent;
}

.has-vertical-header .main-navigation::-webkit-scrollbar-thumb {
    background: rgba(26, 26, 46, 0.2);
    border-radius: 2px;
}

.has-vertical-header .main-navigation::-webkit-scrollbar-thumb:hover {
    background: rgba(26, 26, 46, 0.3);
}

::-webkit-scrollbar {
    width: 7px
}

::-webkit-scrollbar-thumb {
    background: #1D1D1B;
    border-width: 0;
    border-style: solid;
    border-color: #1D1D1B
}

::-webkit-scrollbar-track {
    border-width: 1px;
    border-style: none;
    border-color: #1D1D1B
}
