/*
Theme Name: CIA Agricoltori Italiani
Theme URI: https://example.com
Author: Your Name
Author URI: https://example.com
Description: Tema WordPress ispirato al sito CIA - Agricoltori Italiani
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cia-theme
*/

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --cia-green: #2d7a3e;
    --cia-green-dark: #1e5a2e;
    --cia-green-light: #4a9d5a;
    --cia-yellow: #e8b923;
    --text-dark: #333;
    --text-light: #666;
    --border-color: #e0e0e0;
    --bg-light: #f8f8f8;
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === HEADER === */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 30px;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 70px;
}

.site-logo a {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
}

.site-logo img {
    height: 50px !important;
    width: auto !important;
}


/* Menu Toggle */
.menu-toggle {
    background: none;
    border: 2px solid var(--text-dark);
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.3s ease;
}

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

.menu-toggle:hover {
    border-color: var(--cia-green);
}

.menu-toggle:hover span {
    background: var(--cia-green);
}

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

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

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

/* Navigation */
.main-navigation {
    background: #fff;
    border-top: 1px solid var(--border-color);
}

.nav-menu {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    display: block;
    padding: 15px 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    color: var(--text-dark);
}

.nav-menu a:hover,
.nav-menu a:focus {
    color: var(--cia-green);
    background: rgba(45, 122, 62, 0.05);
}

.nav-menu li.current-menu-item a {
    color: var(--cia-green);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 300px;
    height: 100vh;
    background: #fff;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transition: left 0.3s ease;
    z-index: 2000;
    overflow-y: auto;
}

.mobile-menu.active {
    left: 0;
}

.mobile-menu-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-dark);
}

.mobile-nav-menu {
    list-style: none;
    padding: 0;
}

.mobile-nav-menu li {
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav-menu a {
    display: block;
    padding: 15px 20px;
    color: var(--text-dark);
    font-weight: 500;
}

.mobile-nav-menu a:hover {
    background: var(--bg-light);
    color: var(--cia-green);
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    z-index: 1500;
}

.menu-overlay.active {
    display: block;
}

/* === HERO SLIDER === */
.hero-slider {
    position: relative;
    height: 500px;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease;
}

.hero-slide.active {
    opacity: 1;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: left;
    color: #fff;
    max-width: 800px;
    padding: 40px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    z-index: 2;
}

.hero-content h2 {
    font-size: 36px;
    margin-bottom: 15px;
    line-height: 1.2;
}

.hero-content p {
    font-size: 16px;
    margin-bottom: 25px;
    line-height: 1.5;
}

.btn-hero {
    display: inline-block;
    padding: 12px 30px;
    background: var(--cia-green);
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.btn-hero:hover {
    background: var(--cia-green-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(45, 122, 62, 0.3);
}

.slider-nav {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 3;
}

.slider-dot {
    width: 40px;
    height: 3px;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-dot.active {
    background: #fff;
}

/* === PROMO CARDS === */
.promo-section {
    padding: 60px 0;
    background: var(--bg-light);
}

.promo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.promo-card {
    background: #fff;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.promo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.promo-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.promo-card-content {
    padding: 20px;
}

/* === NEWS SECTION === */
.news-section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    font-size: 32px;
    color: var(--cia-green);
    margin-bottom: 50px;
    font-weight: 700;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.news-card {
    background: #fff;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.news-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-card:hover .news-image img {
    transform: scale(1.05);
}

.news-content {
    padding: 25px;
}

.news-meta {
    font-size: 12px;
    color: var(--text-light);
    text-transform: uppercase;
    margin-bottom: 10px;
}

.news-title {
    font-size: 20px;
    margin-bottom: 15px;
    line-height: 1.3;
    color: var(--text-dark);
}

.news-category {
    display: inline-block;
    padding: 5px 12px;
    background: var(--bg-light);
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    border-radius: 3px;
    margin-top: 10px;
}

/* === FOOTER === */
.site-footer {
    background: var(--cia-green-dark);
    color: #fff;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-widget h3 {
    margin-bottom: 15px;
    font-size: 18px;
}

.footer-widget ul {
    list-style: none;
}

.footer-widget ul li {
    margin-bottom: 10px;
}

.footer-widget a:hover {
    color: var(--cia-yellow);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 14px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .hero-content h2 {
        font-size: 24px;
    }
    
    .hero-content p {
        font-size: 14px;
    }
    
    .hero-slider {
        height: 400px;
    }
    
    .news-grid,
    .promo-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) {
    .menu-toggle {
        display: none;
    }
    
    .mobile-menu {
        display: none;
    }
}

/* ========================================
   MOBILE MENU FIX - AGGIUNTO MANUALMENTE
   ======================================== */

.mobile-menu {
    position: fixed !important;
    top: 0 !important;
    left: -100% !important;
    width: 320px !important;
    height: 100vh !important;
    background: #fff !important;
    z-index: 999999 !important;
    transition: left 0.3s ease !important;
    overflow-y: auto !important;
    box-shadow: 2px 0 10px rgba(0,0,0,0.3) !important;
}

.mobile-menu.active {
    left: 0 !important;
}

.mobile-menu-header {
    padding: 20px !important;
    border-bottom: 1px solid #e0e0e0 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.close-menu {
    width: 40px !important;
    height: 40px !important;
    border: 2px solid #333 !important;
    background: transparent !important;
    cursor: pointer !important;
    font-size: 24px !important;
    border-radius: 3px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.mobile-nav-menu {
    list-style: none !important;
    padding: 20px !important;
}

.mobile-nav-menu li {
    border-bottom: 1px solid #e0e0e0 !important;
}

.mobile-nav-menu li a {
    display: block !important;
    padding: 15px 0 !important;
    font-size: 16px !important;
    color: #333 !important;
    text-decoration: none !important;
}

.mobile-nav-menu li a:hover {
    color: #2d7738 !important;
}

/* Menu hamburger sempre visibile */
.menu-toggle {
    width: 50px !important;
    height: 50px !important;
    border: 2px solid #333 !important;
    background: transparent !important;
    cursor: pointer !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 5px !important;
    border-radius: 3px !important;
}

.menu-toggle span {
    width: 25px !important;
    height: 2px !important;
    background: #333 !important;
    display: block !important;
    transition: 0.3s !important;
}

.menu-toggle:hover {
    background: #f0f0f0 !important;
}

/* Overlay sfondo quando menu aperto */
.mobile-menu-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    z-index: 999998 !important; /* Sotto il menu ma sopra tutto il resto */
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
}

body.mobile-menu-open .mobile-menu-overlay {
    opacity: 1 !important;
    visibility: visible !important;
}
/* ========================================
   PERSONALIZZAZIONI TEMA CIA
   ======================================== */

/* === SLIDER === */
section.hero-slider-dual {
    overflow: visible !important;
}

section.hero-slider-dual .slider-wrapper {
    padding: 0 120px !important;
}

section.hero-slider-dual .slides-container {
    gap: 50px !important;
}

/* Frecce slider ai margini della pagina */
section.hero-slider-dual .slider-nav {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 9999 !important;
}

section.hero-slider-dual .slider-nav.prev-dual {
    left: 20px !important;
    right: auto !important;
}

section.hero-slider-dual .slider-nav.next-dual {
    right: 20px !important;
    left: auto !important;
}
/* === HEADER === */
.menu-toggle {
    width: 50px !important;
    height: 50px !important;
    border: 2px solid #333 !important;
    background: transparent !important;
    cursor: pointer !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 5px !important;
    border-radius: 3px !important;
    transition: background 0.2s !important;
}

.menu-toggle span {
    width: 25px !important;
    height: 2px !important;
    background: #333 !important;
    display: block !important;
    transition: 0.3s !important;
}

.menu-toggle:hover {
    background: #f0f0f0 !important;
}

.site-logo img {
    height: 70px !important;
    width: auto !important;
}

.site-logo a div span {
    color: #333 !important;
}

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

/* === MOBILE MENU === */
.mobile-menu {
    z-index: 999999 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.mobile-menu.active {
    left: 0 !important;
}

.mobile-menu * {
    pointer-events: auto !important;
}

.mobile-nav-menu {
    pointer-events: auto !important;
    list-style: none !important;
    padding: 20px !important;
}

.mobile-nav-menu li {
    pointer-events: auto !important;
    border-bottom: 1px solid #e0e0e0 !important;
}

.mobile-nav-menu a {
    pointer-events: auto !important;
    cursor: pointer !important;
    display: block !important;
    padding: 15px 0 !important;
    font-size: 16px !important;
    color: #333 !important;
    text-decoration: none !important;
    position: relative !important;
    z-index: 1 !important;
}

.mobile-nav-menu a:hover {
    color: #2d7738 !important;
}

/* Overlay scuro quando menu aperto */
body.menu-open::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999998;
    pointer-events: none;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* === SPAZIATURA === */
.promo-section {
    padding: 20px 30px !important;
}

.news-section {
    padding: 30px 30px !important;
}

.section-title {
    margin-bottom: 30px !important;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    section.hero-slider-dual .slider-wrapper {
        padding: 0 70px !important;
    }
    
    section.hero-slider-dual .slides-container {
        gap: 0px !important; /* Nessun gap su mobile */
    }    
    .slide-dual {
        min-width: 100% !important;
        max-width: 100% !important;
    }
    .site-logo img {
        height: 60px !important;
    }
    
    .menu-toggle {
        width: 45px !important;
        height: 45px !important;
    }
}

@media (max-width: 480px) {
    section.hero-slider-dual .slider-wrapper {
        padding: 0 60px !important;
    }
    
    .site-logo img {
        height: 50px !important;
    }
}

/* ==== MENU CIA STILE CIA.IT ==== */
.cia-main-menu {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    position: relative;
    z-index: 999;
}

.cia-menu-container {
    max-width: 1400px;
    margin: 0 auto;
}

.cia-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cia-menu-item {
    border-bottom: 1px solid #e0e0e0;
}

.cia-menu-item:last-child {
    border-bottom: none;
}

.cia-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 30px;
    cursor: pointer;
    transition: background 0.2s;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.cia-menu-header:hover {
    background: #f8f8f8;
}

.cia-menu-header.is-link {
    text-decoration: none;
    color: #333;
}

.cia-menu-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.cia-menu-title.green {
    color: #2d7a3e;
}

.cia-menu-icon {
    color: #2d7a3e;
    font-size: 20px;
    transition: transform 0.3s;
    display: inline-block;
    font-weight: bold;
}

.cia-menu-icon.rotated {
    transform: rotate(180deg);
}

.cia-submenu {
    display: none;
    background: #fafafa;
    padding: 10px 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.cia-submenu.active {
    display: block;
    max-height: 1000px;
}

.cia-submenu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0;
    padding: 0 30px;
}

.cia-submenu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    text-decoration: none;
    color: #555;
    transition: all 0.2s;
    border-bottom: 1px solid #e8e8e8;
}

.cia-submenu-item:hover {
    background: white;
    color: #2d7a3e;
    padding-left: 25px;
}

.cia-submenu-item span {
    font-size: 14px;
}

.cia-submenu-arrow {
    color: #2d7a3e;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .cia-submenu-grid {
        grid-template-columns: 1fr;
    }
    
    .cia-menu-header {
        padding: 15px 20px;
    }
}

/* ==== MENU MOBILE CIA CON DROPDOWN ==== */

.mobile-nav-menu {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.mobile-nav-menu > li {
    border-bottom: 1px solid #e0e0e0 !important;
}

.mobile-menu-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 16px;
    color: #333;
    font-family: inherit;
    transition: background 0.2s;
}

.mobile-menu-item-header:hover,
.mobile-menu-item-header:focus {
    background: #f5f5f5;
}

.mobile-menu-item-header.has-dropdown {
    font-weight: 600;
}

.mobile-menu-item-header.green {
    color: #2d7a3e;
    font-weight: 600;
}

.mobile-menu-icon {
    color: #2d7a3e;
    font-size: 18px;
    transition: transform 0.3s;
    font-weight: bold;
}

.mobile-menu-icon.rotated {
    transform: rotate(180deg);
}

/* Sottomenu mobile */
.mobile-submenu {
    max-height: 0;
    overflow: hidden;
    background: #f8f8f8;
    transition: max-height 0.3s ease;
}

.mobile-submenu.active {
    max-height: 800px;
}

.mobile-submenu a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px 12px 35px;
    font-size: 14px;
    color: #555;
    text-decoration: none;
    border-bottom: 1px solid #e8e8e8;
    transition: all 0.2s;
}

.mobile-submenu a:hover {
    background: white;
    color: #2d7a3e;
    padding-left: 40px;
}

.mobile-submenu-arrow {
    color: #2d7a3e;
    font-size: 14px;
}

/* Link semplici (senza dropdown) */
.mobile-nav-menu > li > a {
    display: block;
    padding: 15px 20px;
    color: #333;
    font-size: 16px;
    text-decoration: none;
    transition: background 0.2s;
}

.mobile-nav-menu > li > a:hover {
    background: #f5f5f5;
}

.mobile-nav-menu > li > a.green {
    color: #2d7a3e;
    font-weight: 600;
}

/* === HASHTAG MENU STILE CIA.IT === */
.hashtag-menu {
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    padding: 12px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.hashtag-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 11px;
    font-family: Arial, sans-serif;
}

.hashtag-link {
    font-size: 11px;
    font-weight: 700;
    color: #333;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: color 0.3s;
    padding: 2px 0;
}

.hashtag-link:hover {
    color: #2d7a3e;
    text-decoration: underline;
}

.hashtag-separator {
    color: #333;
    font-weight: 400;
    font-size: 11px;
    padding: 0 5px;
}

/* Responsive */
@media (max-width: 968px) {
    .hashtag-menu {
        padding: 10px 0;
    }
    
    .hashtag-nav {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding: 0 20px;
        gap: 6px;
    }
    
    .hashtag-link,
    .hashtag-separator {
        font-size: 10px;
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    .hashtag-menu {
        display: none; /* Nascondi su mobile come fa CIA.it */
    }
}
