/*
Theme Name: Casatese Theme
Description: Tema personalizzato per USD Casatese Merate
Version: 1.0.0
*/

/* ==========================================================================
   RESET E BASE
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #ffffff;
}

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


/* TERZO LIVELLO MENU */
.main-navigation ul ul ul {
    position: absolute;
    top: 0;
    left: 100%;
    margin-left: 8px;
    background: white;
    min-width: 220px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-15px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.main-navigation ul ul li:hover > ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Link terzo livello */
.main-navigation ul ul ul a {
    padding: 12px 20px;
    color: #374151;
    font-size: 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.main-navigation ul ul ul a:hover {
    background: #f8fafc;
    color: #1e40af;
    padding-left: 25px;
}

/* ==========================================================================
   TIMELINE CALCISTICA PERSONALIZZATA
   ========================================================================== */

/* Stili base timeline calcio */
.wp-block-uagb-timeline {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
    padding: 2rem !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
}

/* EVENTI GOL - Verde brillante */
.timeline-gol .uagb-timeline__heading {
    background: linear-gradient(45deg, #10b981, #059669) !important;
    color: white !important;
    padding: 10px 15px !important;
    border-radius: 8px !important;
    font-weight: bold !important;
}

.timeline-gol .uagb-timeline__icon {
    background: #10b981 !important;
    color: white !important;
    border: 3px solid #059669 !important;
}

.timeline-gol .uagb-timeline__icon::before {
    content: "⚽" !important;
    font-size: 16px !important;
}

/* CARTELLINI GIALLI - Giallo brillante */
.timeline-giallo .uagb-timeline__heading {
    background: linear-gradient(45deg, #fbbf24, #f59e0b) !important;
    color: #1f2937 !important;
    padding: 10px 15px !important;
    border-radius: 8px !important;
    font-weight: bold !important;
}

.timeline-giallo .uagb-timeline__icon {
    background: #fbbf24 !important;
    color: #1f2937 !important;
    border: 3px solid #f59e0b !important;
}

.timeline-giallo .uagb-timeline__icon::before {
    content: "🟨" !important;
    font-size: 16px !important;
}

/* CARTELLINI ROSSI - Rosso intenso */
.timeline-rosso .uagb-timeline__heading {
    background: linear-gradient(45deg, #dc2626, #b91c1c) !important;
    color: white !important;
    padding: 10px 15px !important;
    border-radius: 8px !important;
    font-weight: bold !important;
}

.timeline-rosso .uagb-timeline__icon {
    background: #dc2626 !important;
    color: white !important;
    border: 3px solid #b91c1c !important;
}

.timeline-rosso .uagb-timeline__icon::before {
    content: "🟥" !important;
    font-size: 16px !important;
}

/* SOSTITUZIONI - Blu calcio */
.timeline-sostituzione .uagb-timeline__heading {
    background: linear-gradient(45deg, #1e40af, #1d4ed8) !important;
    color: white !important;
    padding: 10px 15px !important;
    border-radius: 8px !important;
    font-weight: bold !important;
}

.timeline-sostituzione .uagb-timeline__icon {
    background: #1e40af !important;
    color: white !important;
    border: 3px solid #1d4ed8 !important;
}

.timeline-sostituzione .uagb-timeline__icon::before {
    content: "🔄" !important;
    font-size: 16px !important;
}

/* FINE TEMPO - Grigio elegante */
.timeline-tempo .uagb-timeline__heading {
    background: linear-gradient(45deg, #6b7280, #4b5563) !important;
    color: white !important;
    padding: 10px 15px !important;
    border-radius: 8px !important;
    font-weight: bold !important;
}

.timeline-tempo .uagb-timeline__icon {
    background: #6b7280 !important;
    color: white !important;
    border: 3px solid #4b5563 !important;
}

.timeline-tempo .uagb-timeline__icon::before {
    content: "⏱️" !important;
    font-size: 16px !important;
}

/* OCCASIONI - Arancione */
.timeline-occasione .uagb-timeline__heading {
    background: linear-gradient(45deg, #f97316, #ea580c) !important;
    color: white !important;
    padding: 10px 15px !important;
    border-radius: 8px !important;
    font-weight: bold !important;
}

.timeline-occasione .uagb-timeline__icon {
    background: #f97316 !important;
    color: white !important;
    border: 3px solid #ea580c !important;
}

.timeline-occasione .uagb-timeline__icon::before {
    content: "💫" !important;
    font-size: 16px !important;
}

/* Miglioramenti generali */
.uagb-timeline__heading {
    font-size: 1.1rem !important;
    margin-bottom: 8px !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2) !important;
}

.uagb-timeline__content {
    background: rgba(255,255,255,0.9) !important;
    padding: 15px !important;
    border-radius: 8px !important;
    border-left: 4px solid #dc2626 !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
}

.uagb-timeline__date-new {
    background: #1e40af !important;
    color: white !important;
    font-weight: bold !important;
    padding: 5px 10px !important;
    border-radius: 15px !important;
    font-size: 0.9rem !important;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.site-header {
    background: #ffffff !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
    position: fixed !important;
    top: 0 !important;
    width: 100% !important;
    z-index: 1000 !important;
}

.header-container {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0 20px !important;
    height: 80px !important;
    max-width: 1400px !important;  /* CAMBIATO: da 1200px a 1400px */
    margin: 0 auto !important;
}


.site-logo {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.site-logo img {
    height: 65px !important;
    width: auto !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.main-navigation {
    display: flex;
    align-items: center;
}

.main-navigation ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}


.main-navigation li {
    margin: 0 15px;  /* CAMBIATO: da 20px a 15px per più compattezza */
}

.main-navigation a {
    text-decoration: none;
    color: #333333;
    font-weight: 600;
    font-size: 15px;  /* CAMBIATO: da 16px a 15px */
    padding: 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.4px;  /* CAMBIATO: da 0.5px a 0.4px */
    transition: color 0.3s ease;
    white-space: nowrap;  /* AGGIUNTO: evita l'a capo delle voci */
}

.main-navigation a:hover {
    color: #1e40af;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 2px 0;
    transition: 0.3s;
}

/* AGGIUNGI QUESTE REGOLE RESPONSIVE */
@media (max-width: 1300px) {
    .main-navigation li {
        margin: 0 12px;
    }
    
    .main-navigation a {
        font-size: 14px;
        letter-spacing: 0.3px;
    }
}

@media (max-width: 1150px) {
    .main-navigation li {
        margin: 0 8px;
    }
    
    .main-navigation a {
        font-size: 13px;
        letter-spacing: 0.2px;
    }
}

/* ==========================================================================
   HERO SLIDER - ELIMINATO L'HEADER BLU E AGGIUNTO OVERLAY
   ========================================================================== */

.hero-slider {
    height: 80vh;
    position: relative;
    overflow: hidden;
    /* margin-top: 80px; /* Solo lo spazio per il menu */
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease-in-out;
}

.slide.active {
    opacity: 1;
    visibility: visible;
}

.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.4) 0%, rgba(59, 130, 246, 0.3) 100%);
}

.slide-content {
    position: absolute;
    bottom: 80px;
    left: 80px;
    color: white;
    z-index: 2;
    max-width: 600px;
}

.slide-content h2 {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    line-height: 1.1;
}

.slide-content p {
    font-size: 1.4rem;
    font-weight: 300;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
    margin-bottom: 30px;
}

.slide-cta {
    display: inline-block;
    background: linear-gradient(45deg, #dc2626, #ef4444);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(220, 38, 38, 0.4);
}

.slide-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.6);
    color: white;
}

/* ==========================================================================
   SINGLE ARTICLE - HERO IMAGE SENZA HEADER BLU
   ========================================================================== */

.single-article {
    margin-top: 1px; /* Solo lo spazio per il menu */
}

/* HERO SECTION PER ARTICOLI SINGOLI */
.article-hero {
    position: relative;
    width: 100%;
    min-height: 80vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
}

.article-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  /*  background: linear-gradient(135deg, rgba(30, 64, 175, 0.6) 0%, rgba(59, 130, 246, 0.4) 100%);*/
    z-index: 1;
}

.article-hero-content {
    position: relative;
    z-index: 2;
    color: white;
    max-width: 800px;
    padding: 0 60px;
    margin-left: 60px;
}

.article-hero-content .article-title {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    line-height: 1.1;
    color: white;
}

.article-hero-content .article-meta {
    display: flex !important;
    gap: 30px !important;
    align-items: center !important;
    font-size: 1.2rem !important;
    margin-bottom: 20px !important;
    flex-wrap: wrap !important;
}

.article-hero-content .article-date {
    color: rgba(255,255,255,0.95);
    font-weight: 500;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

.article-hero-content .article-category {
    background: rgba(220, 38, 38, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    text-shadow: none;
    box-shadow: 0 3px 10px rgba(220, 38, 38, 0.3);
}

.article-hero-content .article-excerpt {
    font-size: 1.3rem;
    font-weight: 300;
    line-height: 1.6;
    color: rgba(255,255,255,0.95);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
    max-width: 600px;
}

/* FALLBACK PER ARTICOLI SENZA IMMAGINE HERO */
.article-header {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    padding: 100px 0 60px;
    text-align: center;
    margin-top: 80px;
}

.article-header .article-title {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 20px;
    line-height: 1.2;
    color: white;
}

.article-header .article-meta {
    display: flex !important;
    justify-content: center !important;
    gap: 20px !important;
    align-items: center !important;
    font-size: 1.1rem !important;
}

.article-header .article-category {
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
}

.article-featured-image {
    width: 100%;
    height: 500px;
    overflow: hidden;
}

.article-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-content {
    padding: 60px 0;
}

.content-wrapper {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.8;
}

.content-wrapper h2,
.content-wrapper h3,
.content-wrapper h4 {
    color: #1e40af;
    margin: 30px 0 15px;
}

.content-wrapper p {
    margin-bottom: 20px;
}

/* ==========================================================================
   NAVIGATION MENU - DESIGN PROFESSIONALE CALCIO
   ========================================================================== */

.main-navigation {
   display: flex;
   align-items: center;
   position: relative;
}

.main-navigation .primary-menu {
   display: flex;
   list-style: none;
   margin: 0;
   padding: 0;
   align-items: center;
}

.main-navigation li {
   position: relative;
   margin: 0;
}

/* LINK PRINCIPALI */
.main-navigation > ul > li > a {
   display: flex;
   align-items: center;
   padding: 15px 18px;
   text-decoration: none;
   color: #333333;
   font-weight: 600;
   font-size: 15px;
   text-transform: uppercase;
   letter-spacing: 0.5px;
   transition: all 0.3s ease;
   position: relative;
   border-radius: 8px;
   margin: 0 2px;
}

/* HOVER EFFECT PRINCIPALE */
.main-navigation > ul > li > a:hover,
.main-navigation > ul > li.current-menu-item > a {
   background: linear-gradient(135deg, #dc2626, #b91c1c);
   color: white;
   transform: translateY(-2px);
   box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* INDICATORE DROPDOWN */
.main-navigation .menu-item-has-children > a::after {
   content: '';
   display: inline-block;
   width: 0;
   height: 0;
   margin-left: 8px;
   border-left: 4px solid transparent;
   border-right: 4px solid transparent;
   border-top: 4px solid currentColor;
   transition: transform 0.3s ease;
}

.main-navigation .menu-item-has-children:hover > a::after {
   transform: rotate(180deg);
}

/* SOTTOMENU SECONDO LIVELLO */
.main-navigation ul ul {
   position: absolute;
   top: 100%;
   left: 0;
   background: white;
   min-width: 220px;
   border-radius: 12px;
   box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
   border: 1px solid rgba(0, 0, 0, 0.05);
   opacity: 0;
   visibility: hidden;
   transform: translateY(-15px);
   transition: all 0.3s ease;
   z-index: 1000;
   padding: 8px 0;
   flex-direction: column;
}

.main-navigation li:hover > ul {
   opacity: 1;
   visibility: visible;
   transform: translateY(0);
}

/* LINK SOTTOMENU */
.main-navigation ul ul li {
   width: 100%;
   margin: 0;
   position: relative;
}

.main-navigation ul ul a {
   display: flex;
   align-items: center;
   padding: 12px 20px;
   color: #374151;
   font-size: 14px;
   font-weight: 500;
   text-transform: none;
   letter-spacing: 0;
   border-bottom: 1px solid rgba(0, 0, 0, 0.05);
   transition: all 0.3s ease;
}

.main-navigation ul ul li:last-child a {
   border-bottom: none;
}

.main-navigation ul ul a:hover {
   background: #f8fafc;
   color: #1e40af;
   padding-left: 25px;
}

/* SOTTOMENU TERZO LIVELLO - VERSIONE STABILE */
.main-navigation ul ul ul {
   position: absolute;
   top: 0;
   left: 100%;
   margin-left: 2px !important;
   background: white;
   min-width: 220px;
   border-radius: 12px;
   box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
   border: 1px solid rgba(0, 0, 0, 0.05);
   opacity: 0;
   visibility: hidden;
   transform: translateY(-15px);
   transition: all 0.5s ease;
   z-index: 1001;
   padding: 8px 0;
}

/* AREA INVISIBILE CHE COLLEGA I DUE MENU */
.main-navigation ul ul li.menu-item-has-children::before {
   content: '';
   position: absolute;
   top: 0;
   right: -10px;
   width: 12px;
   height: 100%;
   background: transparent;
   z-index: 1000;
}

/* MANTIENE IL MENU APERTO CON RITARDO */
.main-navigation ul ul li:hover > ul {
   opacity: 1;
   visibility: visible;
   transform: translateY(0);
   transition-delay: 0.2s;
}

/* MANTIENE IL MENU APERTO QUANDO SI PASSA SOPRA IL TERZO LIVELLO */
.main-navigation ul ul ul:hover {
   opacity: 1;
   visibility: visible;
   transform: translateY(0);
}

/* RITARDA LA CHIUSURA DEL MENU */
.main-navigation ul ul li:not(:hover) > ul {
   transition-delay: 0.3s;
}

/* MOBILE */
@media (max-width: 768px) {
   .main-navigation ul ul {
       position: static;
       opacity: 1;
       visibility: visible;
       transform: none;
       box-shadow: none;
       border: none;
       background: #f8fafc;
       margin: 0;
       padding: 0;
       border-radius: 0;
       max-height: 0;
       overflow: hidden;
       transition: max-height 0.3s ease;
   }
   
   .main-navigation .menu-item-has-children.mobile-open > ul {
       max-height: 300px;
   }
   
   .main-navigation ul ul a {
       padding: 15px 40px;
       border-bottom: 1px solid #e2e8f0;
   }
   
   .main-navigation ul ul ul {
       position: static !important;
       margin-left: 0 !important;
       background: #f1f5f9 !important;
       border-left: 4px solid #dc2626 !important;
   }
   
   .main-navigation ul ul ul a {
       padding-left: 60px;
   }
   
   /* Rimuove area invisibile su mobile */
   .main-navigation ul ul li.menu-item-has-children::before {
       display: none;
   }
}
/* ==========================================================================
   HEADER STICKY EFFECTS
   ========================================================================== */

.site-header.scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
}

.site-header.scrolled .site-logo img {
    height: 55px !important;
    transition: height 0.3s ease;
}

.site-header.scrolled .main-navigation > ul > li > a {
    padding: 12px 18px;
}

/* ==========================================================================
   ACCESSIBILITY IMPROVEMENTS
   ========================================================================== */

.main-navigation a:focus {
    outline: 2px solid #1e40af;
    outline-offset: 2px;
    background: #f0f8ff;
}

.main-navigation .menu-item-has-children > a[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

/* Screen reader text */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    color: #21759b;
    display: block;
    font-size: 14px;
    font-weight: bold;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* ==========================================================================
   MENU ANIMATIONS
   ========================================================================== */

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-navigation ul ul {
    animation: slideInDown 0.3s ease-out;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    }
    50% {
        box-shadow: 0 6px 20px rgba(220, 38, 38, 0.5);
    }
}

.main-navigation > ul > li.current-menu-item > a {
    animation: pulseGlow 2s infinite;
}

/* ==========================================================================
   MAIN CONTENT
   ========================================================================== */

.main-content {
    padding: 0; /* Rimosso il padding per eliminare lo spazio */
}

.section-title {
    text-align: center;
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 60px;
    color: #1e40af;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ==========================================================================
   HOMEPAGE ARTICLES - QUALITÀ PREMIUM
   ========================================================================== */

.homepage-articles-section {
    background: #f8fafc !important;
    padding: 80px 0 !important; /* Aggiunto padding top per compensare */
    width: calc(100vw - 20px) !important;
    margin-left: calc(-50vw + 50% + 10px) !important;
    position: relative !important;
}

.homepage-articles-section .container {
    max-width: none !important;
    padding: 0 !important;
    width: 100% !important;
}

.homepage-articles-section .related-title {
    text-align: center !important;
    font-size: 2.5rem !important;
    font-weight: 700 !important;
    color: #dc2626 !important;
    margin: 0 auto 60px auto !important;
    text-transform: uppercase !important;
    max-width: 1200px !important;
    padding: 0 20px !important;
}

.homepage-articles-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 0 !important;
    width: 100% !important;
    margin: 0 !important;
}

/* HOMEPAGE CARDS - QUALITÀ PREMIUM */
.homepage-article-card {
    background: #dc2626 !important;
    color: white !important;
    overflow: hidden !important;
    border-right: 1px solid #b91c1c !important;
    min-height: 650px !important;
    max-height: 650px !important;
    display: flex !important;
    flex-direction: column !important;
    transition: background 0.3s ease !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.homepage-article-card:last-child {
    border-right: none !important;
}

.homepage-article-card:hover {
    background: #b91c1c !important;
}

/* IMMAGINI HOMEPAGE - QUALITÀ PREMIUM E PIÙ ALTE */
.homepage-article-card .related-card-image {
    width: 100% !important;
    height: 380px !important;
    position: relative !important;
    overflow: hidden !important;
    border-radius: 0 !important;
    background: #b91c1c !important;
}

.homepage-article-card .related-card-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    transition: transform 0.3s ease !important;
    
    /* QUALITÀ PREMIUM */
    image-rendering: -webkit-optimize-contrast !important;
    image-rendering: crisp-edges !important;
    image-rendering: optimizeQuality !important;
    
    /* MIGLIORAMENTI VISIVI */
    filter: contrast(1.02) saturate(1.05) brightness(1.02) !important;
    
    /* ANTI-ALIASING */
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

.homepage-article-card:hover .related-card-image img {
    transform: scale(1.08) !important;
    filter: contrast(1.05) saturate(1.1) brightness(1.05) !important;
}

/* CONTENUTO HOMEPAGE */
.homepage-article-card .related-card-content {
    padding: 25px 20px !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    color: white !important;
    height: 270px !important;
}

.homepage-article-card .related-card-meta {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 15px !important;
}

.homepage-article-card .related-date {
    color: rgba(255,255,255,0.9) !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
}

.homepage-article-card .related-category {
    background: rgba(255,255,255,0.25) !important;
    color: white !important;
    padding: 6px 12px !important
    border-radius: 12px !important;
   font-size: 0.85rem !important;
   font-weight: 600 !important;
}

.homepage-article-card .related-card-title {
   font-size: 1.4rem !important;
   font-weight: 700 !important;
   margin-bottom: 15px !important;
   line-height: 1.3 !important;
   overflow: hidden !important;
   display: -webkit-box !important;
   -webkit-line-clamp: 3 !important;
   -webkit-box-orient: vertical !important;
   text-overflow: ellipsis !important;
}

.homepage-article-card .related-card-title a {
   color: white !important;
   text-decoration: none !important;
}

.homepage-article-card .related-card-title a:hover {
   color: #fef2f2 !important;
}

.homepage-article-card .related-card-excerpt {
   color: rgba(255,255,255,0.95) !important;
   font-size: 1rem !important;
   line-height: 1.5 !important;
   margin-bottom: 20px !important;
   flex: 1 !important;
   overflow: hidden !important;
   display: -webkit-box !important;
   -webkit-line-clamp: 4 !important;
   -webkit-box-orient: vertical !important;
   text-overflow: ellipsis !important;
}

.homepage-article-card .related-read-more {
   background: rgba(255,255,255,0.2) !important;
   color: white !important;
   padding: 10px 18px !important;
   border-radius: 20px !important;
   text-decoration: none !important;
   font-weight: 600 !important;
   font-size: 0.9rem !important;
   text-transform: uppercase !important;
   align-self: flex-start !important;
   transition: all 0.3s ease !important;
   margin-top: auto !important;
}

.homepage-article-card .related-read-more:hover {
   background: rgba(255,255,255,0.3) !important;
   color: white !important;
   transform: translateY(-1px) !important;
}

/* PLACEHOLDER per immagini mancanti */
.no-image-placeholder {
   width: 100%;
   height: 100%;
   background: rgba(255,255,255,0.1);
   display: flex;
   align-items: center;
   justify-content: center;
   color: rgba(255,255,255,0.5);
   font-size: 3rem;
}

/* ==========================================================================
  GALLERY SLIDER ORIZZONTALE
  ========================================================================== */

.article-gallery-slider,
.wordpress-gallery-slider {
   background: #f8fafc;
   padding: 60px 0;
   margin: 40px 0;
}

.gallery-title {
   text-align: center;
   font-size: 2.5rem;
   font-weight: 700;
   color: #dc2626;
   margin-bottom: 40px;
   text-transform: uppercase;
}

.gallery-swiper,
.wordpress-gallery-swiper {
   max-width: 1000px;
   margin: 0 auto;
   position: relative;
   padding: 0 50px;
}

.gallery-swiper .swiper-slide,
.wordpress-gallery-swiper .swiper-slide {
   width: 300px;
   height: 250px;
}

.gallery-slide-item {
   width: 100%;
   height: 100%;
   border-radius: 12px;
   overflow: hidden;
   box-shadow: 0 5px 15px rgba(0,0,0,0.1);
   cursor: pointer;
   transition: transform 0.3s ease;
}

.gallery-slide-item:hover {
   transform: scale(1.05);
}

.gallery-image {
   width: 100%;
   height: 100%;
   object-fit: cover;
}

/* Swiper Navigation */
.gallery-swiper .swiper-button-next,
.gallery-swiper .swiper-button-prev,
.wordpress-gallery-swiper .swiper-button-next,
.wordpress-gallery-swiper .swiper-button-prev {
   color: #dc2626;
   background: white;
   width: 40px;
   height: 40px;
   border-radius: 50%;
   box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.gallery-swiper .swiper-button-next:after,
.gallery-swiper .swiper-button-prev:after,
.wordpress-gallery-swiper .swiper-button-next:after,
.wordpress-gallery-swiper .swiper-button-prev:after {
   font-size: 16px;
   font-weight: 900;
}

.gallery-swiper .swiper-pagination-bullet,
.wordpress-gallery-swiper .swiper-pagination-bullet {
   background: #dc2626;
   opacity: 0.5;
}

.gallery-swiper .swiper-pagination-bullet-active,
.wordpress-gallery-swiper .swiper-pagination-bullet-active {
   opacity: 1;
}

/* ==========================================================================
  LIGHTBOX
  ========================================================================== */

.gallery-lightbox {
   display: none;
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   background: rgba(0,0,0,0.9);
   z-index: 10000;
   cursor: pointer;
}

.lightbox-close {
   position: absolute;
   top: 20px;
   right: 30px;
   color: white;
   font-size: 40px;
   font-weight: bold;
   cursor: pointer;
   z-index: 10001;
}

.lightbox-image {
   position: absolute;
   top: 50%;
   left: 50%;
   transform: translate(-50%, -50%);
   max-width: 90%;
   max-height: 90%;
   object-fit: contain;
}

/* ==========================================================================
  SOCIAL SHARING
  ========================================================================== */

.article-sharing {
   background: #1e293b;
   padding: 30px 0;
   text-align: center;
}

.social-share {
   display: flex;
   justify-content: center;
   align-items: center;
   gap: 20px;
   flex-wrap: wrap;
}

.share-label {
   color: white;
   font-weight: 600;
   font-size: 1.1rem;
}

.social-share a {
   display: inline-flex;
   align-items: center;
   gap: 8px;
   padding: 12px 20px;
   border-radius: 25px;
   text-decoration: none;
   font-weight: 600;
   transition: all 0.3s ease;
   color: white;
}

.share-facebook {
   background: #1877f2;
}

.share-facebook:hover {
   background: #166fe5;
   color: white;
}

.share-twitter {
   background: #1da1f2;
}

.share-twitter:hover {
   background: #1a91da;
   color: white;
}

.share-whatsapp {
   background: #25d366;
}

.share-whatsapp:hover {
   background: #22c55e;
   color: white;
}

/* ==========================================================================
  ARTICOLI CORRELATI
  ========================================================================== */

.related-articles-section {
   background: #f8fafc;
   padding: 80px 0;
}

.related-title {
   text-align: center;
   font-size: 2.5rem;
   font-weight: 700;
   color: #dc2626;
   margin-bottom: 50px;
   text-transform: uppercase;
}

.related-articles-grid {
   display: grid;
   grid-template-columns: repeat(4, 1fr);
   gap: 30px;
}

.related-card {
   background: #dc2626;
   border-radius: 12px;
   overflow: hidden;
   box-shadow: 0 5px 15px rgba(220, 38, 38, 0.2);
   transition: all 0.3s ease;
   min-height: 400px;
   display: flex;
   flex-direction: column;
}

.related-card:hover {
   transform: translateY(-5px);
   box-shadow: 0 10px 25px rgba(220, 38, 38, 0.3);
}

.related-card-image {
   width: 100%;
   height: 200px;
   position: relative;
   overflow: hidden;
}

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

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

.related-card-content {
   padding: 25px;
   flex: 1;
   display: flex;
   flex-direction: column;
   color: white;
}

.related-card-meta {
   display: flex;
   justify-content: space-between;
   align-items: center;
   margin-bottom: 15px;
}

.related-date {
   color: rgba(255,255,255,0.8);
   font-size: 0.9rem;
}

.related-category {
   background: rgba(255,255,255,0.2);
   padding: 4px 10px;
   border-radius: 12px;
   font-size: 0.8rem;
   font-weight: 600;
}

.related-card-title {
   font-size: 1.2rem;
   font-weight: 700;
   margin-bottom: 15px;
   line-height: 1.3;
}

.related-card-title a {
   color: white;
   text-decoration: none;
   transition: color 0.3s ease;
}

.related-card-title a:hover {
   color: #fef2f2;
}

.related-card-excerpt {
   color: rgba(255,255,255,0.9);
   font-size: 0.95rem;
   line-height: 1.5;
   margin-bottom: 20px;
   flex: 1;
}

.related-read-more {
   background: rgba(255,255,255,0.15);
   color: white;
   padding: 10px 20px;
   border-radius: 20px;
   text-decoration: none;
   font-weight: 600;
   font-size: 0.9rem;
   text-transform: uppercase;
   align-self: flex-start;
   transition: all 0.3s ease;
}

.related-read-more:hover {
   background: rgba(255,255,255,0.25);
   color: white;
}

/* ==========================================================================
  SPONSORS
  ========================================================================== */

.sponsors-section {
   background: #f8fafc !important;
   padding: 40px 0 !important;
   width: 100% !important;
   margin: 0 auto !important;
   text-align: center !important;
}

.sponsors-title {
   font-size: 2.5rem;
   font-weight: 700;
   color: #dc2626;
   margin-bottom: 20px;
   text-align: center;
   text-transform: uppercase;
}

.sponsors-subtitle {
   text-align: center;
   font-size: 1.2rem;
   color: #64748b;
   margin-bottom: 50px;
}

.sponsors-grid {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
   gap: 30px;
   max-width: 1000px;
   margin: 0 auto;
}

.sponsor-item {
   background: white;
   padding: 30px;
   border-radius: 12px;
   box-shadow: 0 4px 15px rgba(0,0,0,0.1);
   transition: transform 0.3s ease;
   height: 150px;
   display: flex;
   align-items: center;
   justify-content: center;
}

.sponsor-item:hover {
   transform: translateY(-5px);
}

.sponsor-logo {
   display: flex;
   align-items: center;
   justify-content: center;
   width: 100%;
   height: 100%;
   text-decoration: none;
}

.sponsor-logo img {
   max-width: 100%;
   max-height: 80px;
   object-fit: contain;
}

.sponsor-logo span {
   font-weight: 600;
   color: #1e40af;
   text-align: center;
}

/* ==========================================================================
  FOOTER
  ========================================================================== */

.site-footer {
   background: #1e293b !important;
   color: #ffffff !important;
   padding: 60px 0 30px !important;
   width: 100vw !important;
   margin-left: calc(-50vw + 50%) !important;
   position: relative !important;
}

.site-footer .container {
   width: 100% !important;
   max-width: 1200px !important;
   margin: 0 auto !important;
   padding: 0 20px !important;
}

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

.footer-section h3 {
   color: #ffffff;
   margin-bottom: 15px;
   font-weight: 700;
}

.footer-section p,
.footer-section a {
   color: #cbd5e1;
   text-decoration: none;
   line-height: 1.6;
}

.footer-section a:hover {
   color: #ffffff;
}

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

.footer-section ul li {
   margin-bottom: 8px;
}

.footer-bottom {
   text-align: center;
   padding-top: 20px;
   border-top: 1px solid rgba(255,255,255,0.1);
   color: #94a3b8;
}

/* ==========================================================================
  ARTICLES GRID ARCHIVE
  ========================================================================== */

.articles-grid-archive {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
   gap: 40px;
   margin-bottom: 60px;
}

.articles-grid-archive .article-card {
   background: #ffffff;
   color: #333;
   border: 1px solid #e2e8f0;
   border-radius: 15px;
   box-shadow: 0 5px 15px rgba(0,0,0,0.1);
   min-height: auto;
}

.articles-grid-archive .article-card:hover {
   background: #ffffff;
   transform: translateY(-5px);
   box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* ==========================================================================
  PAGINAZIONE
  ========================================================================== */

.pagination {
   display: flex;
   justify-content: center;
   margin-top: 60px;
}

.pagination .page-numbers {
   display: inline-block;
   padding: 10px 15px;
   margin: 0 5px;
   background: #f8fafc;
   border: 1px solid #e2e8f0;
   border-radius: 5px;
   text-decoration: none;
   color: #334155;
   transition: all 0.3s ease;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
   background: #1e40af;
   color: white;
   border-color: #1e40af;
}

/* ==========================================================================
  FORZA VISIBILITÀ IMMAGINI
  ========================================================================== */

img {
   display: block !important;
   visibility: visible !important;
   opacity: 1 !important;
}

img[loading="lazy"] {
   opacity: 1 !important;
   visibility: visible !important;
}

.wp-post-image {
   display: block !important;
   visibility: visible !important;
   opacity: 1 !important;
}

/* ==========================================================================
  RESPONSIVE DESIGN
  ========================================================================== */

/* 3 COLONNE */
@media (max-width: 1400px) {
   .homepage-articles-grid {
       grid-template-columns: repeat(3, 1fr) !important;
   }
}

/* 2 COLONNE */
@media (max-width: 1200px) {
   .homepage-articles-grid {
       grid-template-columns: repeat(2, 1fr) !important;
   }
   
   .homepage-article-card:nth-child(odd) {
       border-right: 1px solid #b91c1c !important;
   }
   
   .homepage-article-card:nth-child(even) {
       border-right: none !important;
   }
   
   .related-articles-grid {
       grid-template-columns: repeat(3, 1fr);
   }
}

@media (max-width: 992px) {
   .related-articles-grid {
       grid-template-columns: repeat(2, 1fr);
   }
}

/* MOBILE */
@media (max-width: 768px) {
   .mobile-menu-toggle {
       display: flex;
   }
   
   .main-navigation ul {
       display: none;
   }
   
   .hero-slider {
       height: 60vh;
       margin-top: 80px; /* Solo lo spazio del menu */
   }
   
   .slide-content {
       bottom: 40px;
       left: 30px;
       right: 30px;
   }
   
   .slide-content h2 {
       font-size: 2.5rem;
   }
   
   /* ARTICLE HERO MOBILE */
   .article-hero {
       min-height: 60vh;
   }
   
   .article-hero-content {
       padding: 0 30px;
       margin-left: 30px;
   }
   
   .article-hero-content .article-title {
       font-size: 2.5rem;
   }
   
   .article-hero-content .article-meta {
       flex-direction: column;
       align-items: flex-start;
       gap: 15px;
   }
   
   .article-hero-content .article-excerpt {
       font-size: 1.1rem;
   }
   
   .homepage-articles-section {
       width: 100% !important;
       margin-left: 0 !important;
       padding: 80px 15px 0 !important; /* Aggiunto padding top */
   }
   
   .homepage-articles-grid {
       grid-template-columns: 1fr !important;
   }
   
   .homepage-article-card {
       border-right: none !important;
       border-bottom: 1px solid #b91c1c !important;
       min-height: 500px !important;
       max-height: 550px !important;
   }
   
   .homepage-article-card:last-child {
       border-bottom: none !important;
   }
   
   .homepage-article-card .related-card-image {
       height: 250px !important;
   }
   
   .homepage-article-card .related-card-content {
       height: auto !important;
       min-height: 250px !important;
       padding: 20px 15px !important;
   }
   
   .sponsors-grid {
       grid-template-columns: repeat(2, 1fr);
       gap: 20px;
   }
  
   .footer-content {
       grid-template-columns: 1fr;
       text-align: center;
   }
  
   .site-footer {
       width: 100% !important;
       margin-left: 0 !important;
   }
  
   /* SINGLE ARTICLE RESPONSIVE */
   .article-header .article-title {
       font-size: 2.2rem;
       padding: 0 20px;
   }
  
   .article-header .article-meta {
       flex-direction: column;
       gap: 10px;
   }
  
   .article-featured-image {
       height: 300px;
   }
  
   .related-articles-grid {
       grid-template-columns: 1fr;
       gap: 20px;
   }
  
   .gallery-swiper,
   .wordpress-gallery-swiper {
       padding: 0 20px;
   }
  
   .social-share {
       flex-direction: column;
       gap: 15px;
   }
  
   .social-share a {
       width: 200px;
       justify-content: center;
   }
}

/* MOBILE PICCOLO */
@media (max-width: 480px) {
   .sponsors-grid {
       grid-template-columns: 1fr;
   }
   
   .homepage-article-card {
       min-height: 450px !important;
       max-height: 500px !important;
   }
   
   .homepage-article-card .related-card-image {
       height: 220px !important;
   }
   
   .homepage-article-card .related-card-content {
       height: auto !important;
       min-height: 220px !important;
       padding: 18px 12px !important;
   }
   
   .homepage-article-card .related-card-title {
       font-size: 1.2rem !important;
       -webkit-line-clamp: 2 !important;
       max-height: 3.2rem !important;
   }
   
   .homepage-article-card .related-card-excerpt {
       font-size: 0.9rem !important;
       -webkit-line-clamp: 3 !important;
   }
   
   .section-title,
   .related-title {
       font-size: 2rem;
       padding: 0 20px;
   }
   
   .gallery-title {
       font-size: 2rem;
   }
   
   .lightbox-close {
       font-size: 30px;
       right: 20px;
   }
   
   /* ARTICLE HERO MOBILE PICCOLO */
   .article-hero-content {
       padding: 0 20px;
       margin-left: 20px;
   }
   
   .article-hero-content .article-title {
       font-size: 2rem;
   }
   
   .article-hero-content .article-excerpt {
       font-size: 1rem;
   }
}

/* ==========================================================================
  LEGACY ARTICLES SUPPORT - COMPATIBILITÀ VECCHIO CODICE
  ========================================================================== */

.articles-section {
   padding: 80px 0 0 !important; /* Aggiunto padding top per compensare */
   margin-bottom: 0 !important;
   width: calc(100vw - 20px) !important;
   margin-left: calc(-50vw + 50% + 10px) !important;
   position: relative !important;
}

.articles-section .container {
   max-width: none !important;
   padding: 0 !important;
   width: 100% !important;
}

.articles-section .section-title {
   max-width: 1200px !important;
   margin: 0 auto 60px auto !important;
   padding: 0 20px !important;
}

.articles-grid {
   display: grid !important;
   grid-template-columns: repeat(4, 1fr) !important;
   gap: 0 !important;
   width: 100% !important;
   margin: 0 !important;
}

.article-card {
   background: #dc2626 !important;
   color: white !important;
   overflow: hidden !important;
   border-right: 1px solid #b91c1c !important;
   min-height: 650px !important;
   max-height: 650px !important;
   display: flex !important;
   flex-direction: column !important;
   transition: background 0.3s ease !important;
}

.article-card:last-child {
   border-right: none !important;
}

.article-card:hover {
   background: #b91c1c !important;
}

.article-image {
   width: 100% !important;
   height: 380px !important;
   position: relative !important;
   overflow: hidden !important;
   display: block !important;
   background: #b91c1c !important;
}

.article-image img {
   width: 100% !important;
   height: 100% !important;
   object-fit: cover !important;
   object-position: center !important;
   display: block !important;
   visibility: visible !important;
   opacity: 1 !important;
   transition: transform 0.3s ease !important;
   image-rendering: -webkit-optimize-contrast !important;
   image-rendering: crisp-edges !important;
   image-rendering: optimizeQuality !important;
   filter: contrast(1.02) saturate(1.05) brightness(1.02) !important;
   -webkit-font-smoothing: antialiased !important;
   -moz-osx-font-smoothing: grayscale !important;
}

.article-card:hover .article-image img {
   transform: scale(1.08) !important;
   filter: contrast(1.05) saturate(1.1) brightness(1.05) !important;
}

.article-image-placeholder {
   width: 100%;
   height: 100%;
   background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
   display: flex;
   align-items: center;
   justify-content: center;
   color: rgba(255,255,255,0.4);
   font-size: 3rem;
}

.article-content {
   padding: 25px 20px !important;
   flex: 1 !important;
   display: flex !important;
   flex-direction: column !important;
   height: 270px !important;
   overflow: visible !important;
}

.article-meta {
   display: flex !important;
   justify-content: space-between !important;
   align-items: center !important;
   margin-bottom: 15px !important;
   flex-shrink: 0 !important;
}

.article-date {
   color: rgba(255,255,255,0.9) !important;
   font-size: 0.95rem !important;
   font-weight: 500 !important;
}

.article-category {
   background: rgba(255,255,255,0.25) !important;
   color: white !important;
   padding: 6px 12px !important;
   border-radius: 12px !important;
   font-size: 0.85rem !important;
   font-weight: 600 !important;
}

.article-title {
   font-size: 1.4rem !important;
   font-weight: 700 !important;
   margin-bottom: 15px !important;
   color: white !important;
   line-height: 1.3 !important;
   height: auto !important;
   overflow: hidden !important;
   display: -webkit-box !important;
   -webkit-line-clamp: 3 !important;
   -webkit-box-orient: vertical !important;
   text-overflow: ellipsis !important;
}

.article-title a {
   color: white !important;
   text-decoration: none !important;
}

.article-title a:hover {
   color: #fef2f2 !important;
}

.article-excerpt {
   color: rgba(255,255,255,0.95) !important;
   font-size: 1rem !important;
   line-height: 1.5 !important;
   margin-bottom: 20px !important;
   flex: 1 !important;
   overflow: hidden !important;
   display: -webkit-box !important;
   -webkit-line-clamp: 4 !important;
   -webkit-box-orient: vertical !important;
   text-overflow: ellipsis !important;
}

.read-more {
   background: rgba(255,255,255,0.2) !important;
   color: white !important;
   padding: 10px 18px !important;
   border-radius: 20px !important;
   text-decoration: none !important;
   font-weight: 600 !important;
   font-size: 0.9rem !important;
   text-transform: uppercase !important;
   align-self: flex-start !important;
   transition: all 0.3s ease !important;
   margin-top: auto !important;
   flex-shrink: 0 !important;
}

.read-more:hover {
   background: rgba(255,255,255,0.3) !important;
   color: white !important;
   transform: translateY(-1px) !important;
}

/* LEGACY RESPONSIVE */
@media (max-width: 1400px) {
   .articles-grid {
       grid-template-columns: repeat(3, 1fr) !important;
   }
}

@media (max-width: 1200px) {
   .articles-grid {
       grid-template-columns: repeat(2, 1fr) !important;
   }
   
   .article-card:nth-child(odd) {
       border-right: 1px solid #b91c1c !important;
   }
   
   .article-card:nth-child(even) {
       border-right: none !important;
   }
}

@media (max-width: 768px) {
   .articles-section {
       width: 100% !important;
       margin-left: 0 !important;
       padding: 80px 15px 0 !important; /* Aggiunto padding top */
   }
   
   .articles-grid {
       grid-template-columns: 1fr !important;
   }
   
   .article-card {
       border-right: none !important;
       border-bottom: 1px solid #b91c1c !important;
       min-height: 500px !important;
       max-height: 550px !important;
   }
   
   .article-card:last-child {
       border-bottom: none !important;
   }
   
   .article-image {
       height: 250px !important;
   }
   
   .article-content {
       height: auto !important;
       min-height: 250px !important;
       padding: 20px 15px !important;
   }
}

@media (max-width: 480px) {
   .article-card {
       min-height: 450px !important;
       max-height: 500px !important;
   }
   
   .article-image {
       height: 220px !important;
   }
   
   .article-content {
       height: auto !important;
       min-height: 220px !important;
       padding: 18px 12px !important;
   }
}
/* ==========================================================================
 PERFORMANCE E OTTIMIZZAZIONI
 ========================================================================== */

html {
  scroll-behavior: smooth;
}

*:focus {
  outline: 2px solid #1e40af;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
  }
  
  .gallery-slide-item:hover,
  .related-card:hover,
  .homepage-article-card:hover .related-card-image img {
      transform: none;
  }
}

/* ==========================================================================
 BROWSER COMPATIBILITY
 ========================================================================== */

@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  .homepage-articles-grid {
      display: -ms-grid;
  }
}

@supports (-webkit-appearance: none) {
  .gallery-slide-item,
  .homepage-article-card .related-card-image img {
      -webkit-transform: translateZ(0);
  }
}

@supports not (display: grid) {
  .homepage-articles-grid {
      display: flex;
      flex-wrap: wrap;
  }
  
  .homepage-article-card {
      flex: 1 1 300px;
      margin: 10px;
  }
  
  .related-articles-grid {
      display: flex;
      flex-wrap: wrap;
  }
  
  .related-card {
      flex: 1 1 250px;
      margin: 15px;
  }
}

/* ==========================================================================
 UTILITIES
 ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #1e40af;
  color: white;
  padding: 8px;
  text-decoration: none;
  transition: top 0.3s;
  z-index: 10001;
}

.skip-link:focus {
  top: 6px;
}

.loading {
  opacity: 0.7;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #1e40af;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.error {
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 12px;
  border-radius: 6px;
  margin: 10px 0;
}

.success {
  color: #059669;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 12px;
  border-radius: 6px;
  margin: 10px 0;
}

/* ==========================================================================
 CUSTOM SCROLLBAR
 ========================================================================== */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

html {
  scrollbar-width: thin;
  scrollbar-color: #c1c1c1 #f1f1f1;
}

/* ==========================================================================
 ANIMATIONS
 ========================================================================== */

@keyframes fadeIn {
  from {
      opacity: 0;
      transform: translateY(20px);
  }
  to {
      opacity: 1;
      transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
      opacity: 0;
      transform: translateX(-30px);
  }
  to {
      opacity: 1;
      transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
      opacity: 0;
      transform: translateX(30px);
  }
  to {
      opacity: 1;
      transform: translateX(0);
  }
}

/* ==========================================================================
 PROGRESSIVE ENHANCEMENT
 ========================================================================== */

.no-js .gallery-swiper {
  overflow-x: auto;
  padding: 20px;
}

.no-js .swiper-wrapper {
  display: flex;
  gap: 20px;
}

.no-js .swiper-button-next,
.no-js .swiper-button-prev,
.no-js .swiper-pagination {
  display: none;
}

.js .gallery-static {
  display: none;
}

/* ==========================================================================
 PRINT STYLES
 ========================================================================== */

@media print {
  .site-header,
  .site-footer,
  .article-sharing,
  .related-articles-section,
  .gallery-swiper,
  .wordpress-gallery-swiper,
  .homepage-articles-section {
      display: none !important;
  }
  
  .article-content {
      padding: 0;
  }
  
  .content-wrapper {
      max-width: none;
      font-size: 12pt;
      line-height: 1.4;
  }
  
  .article-featured-image {
      height: auto;
      max-height: 300px;
  }
  
  body {
      background: white;
      color: black;
  }
  
  a {
      text-decoration: underline;
      color: black;
  }
  
  .article-header {
      background: white !important;
      color: black !important;
      padding: 20px 0;
  }
  
  .article-header .article-title {
      color: black !important;
      font-size: 24pt;
  }
  
  .article-hero {
      background: white !important;
      color: black !important;
      padding: 20px 0;
      min-height: auto !important;
  }
  
  .article-hero::before {
      display: none !important;
  }
  
  .article-hero-content {
      position: static !important;
      color: black !important;
      margin-left: 0 !important;
      padding: 0 !important;
  }
  
  .article-hero-content .article-title {
      color: black !important;
      text-shadow: none !important;
      font-size: 24pt !important;
  }
  
  .article-hero-content .article-meta {
      color: black !important;
  }
  
  .article-hero-content .article-date {
      color: black !important;
      text-shadow: none !important;
  }
  
  .article-hero-content .article-category {
      background: #f0f0f0 !important;
      color: black !important;
      box-shadow: none !important;
  }
  
  .article-hero-content .article-excerpt {
      color: black !important;
      text-shadow: none !important;
  }
}

/* ==========================================================================
 MIGLIORAMENTI SPECIFICI PER ARTICOLI HERO
 ========================================================================== */

/* Assicurati che l'immagine hero copra tutto lo spazio disponibile */
.article-hero {
   background-attachment: fixed; /* Effetto parallax su desktop */
}

@media (max-width: 768px) {
   .article-hero {
       background-attachment: scroll; /* Rimuovi parallax su mobile per performance */
   }
}

/* Miglioramento della leggibilità del testo */
.article-hero-content .article-title,
.article-hero-content .article-meta,
.article-hero-content .article-excerpt {
   text-rendering: optimizeLegibility;
   -webkit-font-smoothing: antialiased;
   -moz-osx-font-smoothing: grayscale;
}

/* Animazione di entrata per il contenuto hero */
@keyframes heroContentFadeIn {
   from {
       opacity: 0;
       transform: translateY(30px);
   }
   to {
       opacity: 1;
       transform: translateY(0);
   }
}

.article-hero-content {
   animation: heroContentFadeIn 1s ease-out;
}

/* Miglioramento contrasto per accessibilità */
/*.article-hero::before {
   background: linear-gradient(
       135deg, 
       rgba(30, 64, 175, 0.7) 0%, 
       rgba(59, 130, 246, 0.5) 100%
   ); */
}

/* Supporto per immagini WebP con fallback */
.article-hero.webp {
   background-image: url('fallback.jpg');
}

.webp .article-hero.webp {
   background-image: url('image.webp');
}

/* Focus states migliorati per accessibilità */
.article-hero-content a:focus {
   outline: 3px solid #fbbf24;
   outline-offset: 2px;
   background: rgba(251, 191, 36, 0.1);
}

/* ==========================================================================
 FINE CSS COMPLETO E AGGIORNATO
 ========================================================================== */

/*
* ✅ ELIMINATO: Header blu e padding tra menu e contenuto
* ✅ AGGIUNTO: Hero section per articoli singoli con immagine a schermo intero
* ✅ AGGIUNTO: Overlay personalizzabile per articoli singoli
* ✅ AGGIUNTO: Titolo, data e categoria in sovraimpressione
* ✅ RESPONSIVE: Design ottimizzato per tutti i dispositivi
* ✅ ACCESSIBILITÀ: Migliorato contrasto e leggibilità
* ✅ PERFORMANCE: Ottimizzazioni per velocità di caricamento
* ✅ COMPATIBILITY: Supporto cross-browser completo
* ✅ LEGACY: Compatibilità con codice esistente mantenuta
* ✅ PRINT: Stili di stampa ottimizzati
*/