/*
Theme Name: SiteOrigin Corp Child
Template: siteorigin-corp
Version: 1.0
*/

/* Import Font Serif Elegante per i Titoli e Sans-serif pulito per i Menu */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* ==================================================
   1. VARIABILI E COLORI TERRAVIVA
   ================================================== */
:root {
    --tv-green-dark: #1b382b;   /* Verde Foresta Header */
    --tv-footer-bg: #12261d;     /* Verde Scuro Footer */
    --tv-sand: #e6cb9d;         /* Sabbia / Crema */
    --tv-orange: #e06d28;       /* Arancione d'accento */
    --tv-orange-hover: #c95c1c; /* Arancione scurito per hover */
    --tv-text-light: #f9f9f6;   /* Bianco caldo */
    --tv-text-dark: #1b261e;
    
    --tv-font-heading: 'DM Serif Display', Georgia, serif;
    --tv-font-body: 'Plus Jakarta Sans', sans-serif;
}

/* ==================================================
   2. FIX LAYOUT FULL-WIDTH SITEORIGIN
   ================================================== */

/* Espande il contenitore principale a tutto schermo */
#content .corp-container {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
}

/* Rimuove spazi vuoti attorno al contenuto della pagina */
.site-content,
#content,
.site-main {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

/* ==================================================
   3. HEADER TERRAVIVA - DESKTOP LAYOUT
   ================================================== */

#masthead.site-header {
    background-color: var(--tv-green-dark) !important;
    border-bottom: none;
    font-family: var(--tv-font-body);
}

.terraviva-header-inner {
    position: relative;
    width: 100%;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0 10px;
}

/* Menu Desktop Container */
.terraviva-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.terraviva-nav-left {
    margin-right: auto;
}

.terraviva-nav-right {
    margin-left: auto;
}

/* Gestione Liste Menu Nativi WP in Header */
.terraviva-nav ul {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 20px !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.terraviva-nav ul li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* Stile Base dei Link Header (Navigazione Custom e WP) */
.terraviva-nav a,
.terraviva-nav ul li a {
    color: var(--tv-text-light) !important;
    text-decoration: none !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    white-space: nowrap;
    transition: all 0.2s ease;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent; /* Rimosso !important per consentire lo stato attivo */
}

.terraviva-nav a:hover,
.terraviva-nav ul li a:hover {
    color: var(--tv-sand) !important;
}

/* Brand Principale (TerraViva) */
.terraviva-site-title {
    font-family: var(--tv-font-heading);
    font-size: 34px;
    font-weight: 400;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    color: var(--tv-text-light);
    letter-spacing: 0.5px;
    margin: 0 10px;
}

.terraviva-site-title:hover {
    color: var(--tv-sand);
}

/* Aziende Partner (DiscoveryWay & Cascina Falchera) */
.terraviva-company {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    color: var(--tv-sand);
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.85;
    transition: opacity 0.3s;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    
    /* ALLINEAMENTO VERTICALE CORRETTO */
    align-self: center !important;
    margin-top: 10px; /* Bilancia la linea di base rispetto al font serif grande */
}

.terraviva-company:hover {
    opacity: 1;
}

.terraviva-company-left {
    margin-right: 25px;
}

.terraviva-company-right {
    margin-left: 25px;
}

/* Bottoni CTA Contatti nell'Header
.terraviva-nav-right a[href*="/contatti/"],
.terraviva-nav-right ul li:last-child a {
    background-color: var(--tv-orange) !important;
    color: var(--tv-text-light) !important;
    padding: 8px 22px !important;
    border-radius: 30px !important;
    font-weight: 700 !important;
    border-bottom: none !important;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.terraviva-nav-right a[href*="/contatti/"]:hover,
.terraviva-nav-right ul li:last-child a:hover {
    background-color: var(--tv-orange-hover) !important;
    transform: translateY(-2px);
    opacity: 1;
} */

/* ==================================================
   4. EVIDENZIAZIONE STATI ATTIVI (SOTTOLINEATURA)
   ================================================== */

/* Menu Desktop: Copre tutte le varianti di link attivi (WP + JS) */
.terraviva-nav ul li.current-menu-item a,
.terraviva-nav ul li.current_page_item a,
.terraviva-nav ul li.current-menu-ancestor a,
.terraviva-nav a.active,
.terraviva-nav ul li a.active {
    color: var(--tv-sand) !important;
    font-weight: 700 !important;
    border-bottom: 2px solid var(--tv-orange) !important;
    padding-bottom: 4px !important;
}

/* Aziende Partner Attive (DiscoveryWay / Cascina Falchera) */
.terraviva-company.active {
    color: var(--tv-text-light) !important;
    opacity: 1 !important;
    border-bottom: 2px solid var(--tv-sand) !important;
    padding-bottom: 4px !important;
}

/* Reset del bordo per il pulsante Contatti quando è attivo
.terraviva-nav-right a[href*="/contatti/"],
.terraviva-nav-right ul li:last-child a,
.terraviva-nav-right a[href*="/contatti/"].active,
.terraviva-nav-right ul li:last-child.current-menu-item a,
.terraviva-nav-right ul li:last-child a.active {
    border-bottom: none !important;
}

.terraviva-nav-right a[href*="/contatti/"].active,
.terraviva-nav-right ul li:last-child.current-menu-item a,
.terraviva-nav-right ul li:last-child a.active {
    background-color: var(--tv-orange-hover) !important;
    box-shadow: 0 0 10px rgba(224, 109, 40, 0.5);
} */

/* ==================================================
   5. HEADER TERRAVIVA - MOBILE (< 992px)
   ================================================== */

.terraviva-mobile-menu {
    display: none;
}

@media (max-width: 992px) {

    .terraviva-header-inner {
        min-height: 70px;
        padding: 10px 15px;
        justify-content: space-between;
    }

    .terraviva-nav,
    .terraviva-company {
        display: none !important;
    }

    .terraviva-site-title {
        font-size: 26px;
        margin: 0;
    }

    .terraviva-mobile-menu {
        display: block;
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 9999;
    }

    .terraviva-mobile-menu summary {
        list-style: none;
        cursor: pointer;
        width: 35px;
        height: 35px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .terraviva-mobile-menu summary::-webkit-details-marker {
        display: none;
    }

    .hamburger {
        width: 25px;
        height: 18px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .hamburger span {
        display: block;
        width: 100%;
        height: 2px;
        background: var(--tv-text-light);
        border-radius: 2px;
        transition: all 0.2s ease;
    }

    .terraviva-mobile-nav {
        position: absolute;
        top: 45px;
        right: -15px;
        width: 260px;
        background: var(--tv-green-dark);
        border: 1px solid rgba(230, 203, 157, 0.2);
        border-radius: 0 0 16px 16px;
        padding: 15px 0;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        display: flex;
        flex-direction: column;
        z-index: 10000;
    }

    .terraviva-mobile-nav a {
        display: block;
        padding: 12px 24px;
        text-decoration: none;
        color: var(--tv-text-light);
        font-size: 16px;
        font-weight: 500;
        transition: background 0.2s;
        border-bottom: none !important;
    }

    .terraviva-mobile-nav a:hover {
        background: rgba(255, 255, 255, 0.05);
        color: var(--tv-sand);
    }

    .terraviva-mobile-nav a[href*="/contatti/"] {
        color: var(--tv-orange) !important;
        font-weight: 700;
        background: transparent !important;
    }

    /* Stato attivo Menu Mobile */
    .terraviva-mobile-nav a.active,
    .terraviva-mobile-nav .current-menu-item > a {
        color: var(--tv-sand) !important;
        font-weight: 700 !important;
        background: rgba(230, 203, 157, 0.1) !important;
        border-left: 4px solid var(--tv-orange) !important;
        padding-left: 20px !important;
    }
}

/* ==================================================
   6. GLOBAL FOOTER TERRAVIVA
   ================================================== */

#colophon.terraviva-custom-footer,
footer.terraviva-custom-footer {
    background-color: var(--tv-footer-bg) !important;
    padding: 60px 5% 30px 5% !important;
    color: var(--tv-text-light) !important;
    display: block !important;
    clear: both !important;
    border-top: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.terraviva-footer-inner {
    max-width: 1200px !important;
    margin: 0 auto !important;
    width: 100% !important;
}

.terraviva-custom-footer .tv-footer-grid {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 40px !important;
    margin-bottom: 40px !important;
    width: 100% !important;
    max-width: 1200px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.terraviva-custom-footer .tv-footer-col {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
}

.terraviva-custom-footer .tv-footer-col:nth-child(1) { flex: 1.5 !important; }
.terraviva-custom-footer .tv-footer-col:nth-child(2) { flex: 1 !important; }
.terraviva-custom-footer .tv-footer-col:nth-child(3) { flex: 1 !important; }

/* Tipografia Footer */
.terraviva-custom-footer .tv-footer-brand,
.terraviva-custom-footer h3 {
    color: var(--tv-text-light) !important;
    font-family: var(--tv-font-heading) !important;
    font-size: 32px !important;
    margin: 0 0 6px 0 !important;
}

.terraviva-custom-footer .tv-footer-tagline {
    color: var(--tv-sand) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    margin-bottom: 12px !important;
}

.terraviva-custom-footer h4 {
    color: var(--tv-sand) !important;
    font-family: var(--tv-font-heading) !important;
    font-size: 20px !important;
    margin: 0 0 16px 0 !important;
}

.terraviva-custom-footer p,
.terraviva-custom-footer span {
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    margin-bottom: 12px !important;
}

/* Link di Navigazione Footer */
.tv-footer-nav ul.tv-footer-links,
.terraviva-custom-footer ul.tv-footer-links {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tv-footer-nav ul.tv-footer-links li,
.terraviva-custom-footer ul.tv-footer-links li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.tv-footer-nav ul.tv-footer-links li a,
.terraviva-custom-footer ul.tv-footer-links a {
    color: rgba(255, 255, 255, 0.75) !important;
    text-decoration: none !important;
    font-size: 14px !important;
    transition: color 0.2s ease !important;
    border-bottom: none !important;
}

.tv-footer-nav ul.tv-footer-links li a:hover,
.terraviva-custom-footer ul.tv-footer-links a:hover {
    color: var(--tv-orange) !important;
}

/* Evidenzia il link attivo nel Footer */
.tv-footer-nav ul.tv-footer-links li.current-menu-item > a,
.tv-footer-nav ul.tv-footer-links li.current_page_item > a,
.tv-footer-nav ul.tv-footer-links li.current-menu-ancestor > a,
.home .tv-footer-nav ul.tv-footer-links li.menu-item-home > a {
    color: #e67e22 !important;
    font-weight: 600 !important;
}

/* Pulsante CTA nel Footer */
.terraviva-custom-footer a.tv-btn,
.terraviva-custom-footer .tv-btn-orange {
    display: inline-block !important;
    background-color: var(--tv-orange) !important;
    color: #ffffff !important;
    padding: 12px 24px !important;
    border-radius: 30px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    text-decoration: none !important;
    margin-top: 10px !important;
    box-shadow: 0 4px 12px rgba(224, 109, 40, 0.3) !important;
    transition: all 0.2s ease !important;
    border-bottom: none !important;
}

.terraviva-custom-footer a.tv-btn:hover,
.terraviva-custom-footer .tv-btn-orange:hover {
    background-color: var(--tv-orange-hover) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 15px rgba(224, 109, 40, 0.4) !important;
    color: #ffffff !important;
}

/* Barra Copyright In Basso */
.terraviva-custom-footer .tv-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
    padding-top: 20px !important;
    text-align: center !important;
}

.terraviva-custom-footer .tv-footer-bottom p {
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 13px !important;
    margin: 0 !important;
}

/* Responsive Footer Mobile */
@media (max-width: 992px) {
    .terraviva-custom-footer .tv-footer-grid {
        flex-direction: column !important;
        gap: 30px !important;
    }
}