/* ============================================================
   style.css – IDENTITÀ VISIVA 2026 · GROUNDBREAKING
   Verde istriano · Tricolore · Azzurro
   Ispirato ai grandi portali nordamericani
   Tendenze: glassmorphism, morphing, micro-interazioni, dark mode
   ============================================================ */

/* ----- IMPORTAZIONE FONT VARIABILE ----- */
@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300..800&display=swap');

/* ----- VARIABILI GLOBALI (tema chiaro) ----- */
:root {
    /* Colori brand */
    --verde-istria: #1f6e4a;
    --verde-istria-chiaro: #3b8c6f;
    --verde-istria-scuro: #155338;
    --verde-tricolore: #009246;
    --bianco: #ffffff;
    --rosso-tricolore: #ce2b37;
    --azzurro: #3b8c9e;
    --azzurro-chiaro: #5ba8b8;

    /* Neutri */
    --text-dark: #1e2b2f;
    --text-muted: #4a5f66;
    --text-light: #7a9299;
    --bg-light: #f4f9f6;
    --bg-white: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.72);
    --border-light: rgba(31, 110, 74, 0.10);

    /* Ombre */
    --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.10);
    --shadow-glow: 0 0 40px rgba(31, 110, 74, 0.15);
    --shadow-glow-azzurro: 0 0 40px rgba(59, 140, 158, 0.20);

    /* Radius */
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-xl: 40px;
    --radius-btn: 60px;
    --radius-full: 9999px;

    /* Transizioni */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-slow: 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Font */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.55);
    --glass-border: rgba(255, 255, 255, 0.25);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);

    /* Gradienti animati */
    --gradient-hero: linear-gradient(145deg, #eaf3ef 0%, #dce9e2 100%);
    --gradient-brand: linear-gradient(135deg, var(--verde-istria), var(--azzurro));
    --gradient-warm: linear-gradient(135deg, #fef9f0, #f4f0ea);
    --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.3));
    --gradient-neon: linear-gradient(135deg, #ce2b37, #ff6b6b, #ce2b37);
    --gradient-aurora: linear-gradient(135deg, #1f6e4a, #3b8c9e, #ce2b37, #1f6e4a);
    --gradient-radial-glow: radial-gradient(circle at 50% 50%, rgba(31, 110, 74, 0.15), transparent 70%);

    /* Noise texture (data-uri) */
    --noise: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");

    /* Nuove variabili per effetti groundbreaking */
    --glow-color: rgba(31, 110, 74, 0.25);
    --neon-shadow: 0 0 20px rgba(206, 43, 55, 0.3), 0 0 60px rgba(206, 43, 55, 0.1);
    --parallax-speed: 0.2;
    --tilt-depth: 800px;
}

/* ----- TEMA SCURO (attivabile via classe .dark-mode) ----- */
[data-theme="dark"] {
    --bg-light: #111a1a;
    --bg-white: #1a2626;
    --bg-card: rgba(26, 38, 38, 0.80);
    --text-dark: #eaf0ee;
    --text-muted: #9ab0ae;
    --text-light: #6d8785;
    --border-light: rgba(255, 255, 255, 0.06);
    --glass-bg: rgba(26, 38, 38, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(31, 110, 74, 0.25);
    --gradient-hero: linear-gradient(145deg, #0f1e1a 0%, #1a2e28 100%);
    --gradient-warm: linear-gradient(135deg, #1a1a16, #141e1c);
    --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    --noise: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.06'/%3E%3C/svg%3E");
    --glow-color: rgba(31, 110, 74, 0.40);
    --neon-shadow: 0 0 20px rgba(206, 43, 55, 0.4), 0 0 60px rgba(206, 43, 55, 0.2);
}

[data-theme="dark"] .blog-card .tag {
    background: rgba(59, 140, 158, 0.20);
    color: var(--azzurro-chiaro);
}

[data-theme="dark"] .event-item {
    background: var(--bg-white);
    border-left-color: var(--rosso-tricolore);
}

[data-theme="dark"] .risorsa-card,
[data-theme="dark"] .sub-section-card,
[data-theme="dark"] .card,
[data-theme="dark"] .newsletter-box {
    background: var(--bg-card);
    border-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .newsletter-box .newsletter-form input {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.10);
    color: var(--text-dark);
}

[data-theme="dark"] .newsletter-box .newsletter-form input::placeholder {
    color: var(--text-light);
}

[data-theme="dark"] footer {
    background: #0c1515;
}

[data-theme="dark"] .hero-badge {
    background: var(--bg-card);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-dark);
}

[data-theme="dark"] .event-item .event-cta {
    background: rgba(255, 255, 255, 0.06);
    color: var(--azzurro-chiaro);
}

[data-theme="dark"] .event-item .event-cta:hover {
    background: var(--verde-istria);
    color: white;
}

[data-theme="dark"] .section-label {
    background: rgba(59, 140, 158, 0.18);
}

/* ----- RESET & BASE ----- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    transition: background 0.4s ease, color 0.4s ease;
    position: relative;
    overflow-x: hidden;
}

/* ----- NOISE TEXTURE OVERLAY ----- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background: var(--noise);
    opacity: 0.5;
    mix-blend-mode: overlay;
}

/* ----- SCROLLBAR PERSONALIZZATA ----- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--verde-istria);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--verde-istria-chiaro);
}

/* ----- SELEZIONE TESTO ----- */
::selection {
    background: var(--verde-istria);
    color: white;
}

/* ----- CONTAINER ----- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ----- TIPOGRAFIA DINAMICA ----- */
.section-label {
    display: inline-block;
    font-size: clamp(0.65rem, 1vw, 0.75rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--azzurro);
    background: rgba(59, 140, 158, 0.10);
    padding: 6px 18px;
    border-radius: var(--radius-full);
    margin-bottom: 12px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(59, 140, 158, 0.08);
    transition: var(--transition-base);
}

.section-label:hover {
    transform: scale(1.02);
    background: rgba(59, 140, 158, 0.18);
}

.section-title {
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 12px;
    position: relative;
    display: inline-block;
}

.section-title .highlight {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 4s ease-in-out infinite alternate;
}

/* Effetto testo rivelatore (clip-path animato) */
.section-title.reveal-text {
    clip-path: inset(0 0 0 0);
    animation: none;
}

.section-title.reveal-text.visible {
    animation: textReveal 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes textReveal {
    0% {
        clip-path: inset(0 100% 0 0);
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        clip-path: inset(0 0 0 0);
        opacity: 1;
        transform: translateX(0);
    }
}

.section-sub {
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    color: var(--text-muted);
    max-width: 640px;
    margin-bottom: 32px;
    line-height: 1.7;
}

.text-center {
    text-align: center;
}

/* ----- HEADER GLASSMORPHISM CON EFFETTO SCROLL ----- */
header {
    background: var(--glass-bg);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

header.scrolled {
    box-shadow: var(--shadow-md);
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(1.6);
}

.nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 12px 0;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    letter-spacing: -0.5px;
    color: var(--verde-istria);
    transition: var(--transition-base);
    text-decoration: none;
}

.logo:hover {
    transform: scale(1.02) rotate(-0.5deg);
}

.logo i {
    font-size: clamp(1.6rem, 2.5vw, 2.2rem);
    color: var(--rosso-tricolore);
    transition: var(--transition-base);
}

.logo:hover i {
    transform: rotate(-12deg) scale(1.15);
}

.logo .logo-text {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 4s ease-in-out infinite alternate;
}

.nav-links {
    display: flex;
    gap: 28px;
    font-weight: 500;
    font-size: 0.9rem;
    align-items: center;
}

.nav-links a {
    position: relative;
    padding: 6px 0;
    transition: var(--transition-base);
    color: var(--text-dark);
    text-decoration: none;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2.5px;
    background: var(--gradient-brand);
    border-radius: var(--radius-full);
    transition: var(--transition-base);
    transform: translateX(-50%);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a:hover {
    color: var(--verde-istria);
}

/* Toggle tema scuro con effetto */
.theme-toggle {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition-spring);
    color: var(--text-dark);
    backdrop-filter: blur(4px);
    position: relative;
    overflow: hidden;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--gradient-brand);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.theme-toggle:hover {
    transform: rotate(30deg) scale(1.08);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.theme-toggle:hover::before {
    opacity: 0.08;
}

.theme-toggle:active {
    transform: rotate(0deg) scale(0.92);
}

.menu-toggle {
    display: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--verde-istria);
    transition: var(--transition-base);
    background: none;
    border: none;
    padding: 4px;
}

.menu-toggle:hover {
    transform: scale(1.1);
}

/* ----- HERO – GROUNDBREAKING: PARALLAX, MORPHING, GLOW MOUSE-FOLLOW ----- */
.hero {
    background: var(--gradient-hero);
    padding: 80px 0 96px;
    border-radius: 0 0 56px 56px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
    transition: background 0.6s ease;
    isolation: isolate;
    perspective: 1200px;
}

/* Sfondo con gradiente animato che segue il mouse (via JS) */
.hero .mouse-glow {
    position: absolute;
    inset: -100px;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), var(--glow-color) 0%, transparent 60%);
    transition: background 0.1s ease;
    mix-blend-mode: overlay;
    opacity: 0.7;
}

.hero .blob {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform, border-radius;
    z-index: 0;
    filter: blur(60px);
    opacity: 0.6;
}

.hero .blob-1 {
    width: 600px;
    height: 600px;
    top: -20%;
    right: -10%;
    background: radial-gradient(circle, rgba(31, 110, 74, 0.12) 0%, transparent 70%);
    animation: blobFloat1 18s ease-in-out infinite alternate;
}

.hero .blob-2 {
    width: 400px;
    height: 400px;
    bottom: -30%;
    left: -8%;
    background: radial-gradient(circle, rgba(59, 140, 158, 0.12) 0%, transparent 70%);
    animation: blobFloat2 22s ease-in-out infinite alternate;
}

.hero .blob-3 {
    width: 250px;
    height: 250px;
    top: 40%;
    left: 50%;
    background: radial-gradient(circle, rgba(206, 43, 55, 0.08) 0%, transparent 70%);
    animation: blobFloat3 26s ease-in-out infinite alternate;
}

/* Blob morphing avanzato */
@keyframes blobFloat1 {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        border-radius: 40% 60% 50% 50% / 50% 40% 60% 50%;
    }
    50% {
        transform: translate(-40px, 30px) scale(1.12) rotate(8deg);
        border-radius: 50% 40% 60% 40% / 40% 50% 50% 60%;
    }
    100% {
        transform: translate(30px, -40px) scale(0.92) rotate(-6deg);
        border-radius: 60% 50% 40% 50% / 50% 60% 40% 50%;
    }
}

@keyframes blobFloat2 {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        border-radius: 50% 60% 40% 50% / 60% 40% 50% 40%;
    }
    50% {
        transform: translate(50px, -30px) scale(1.15) rotate(-8deg);
        border-radius: 40% 50% 60% 40% / 50% 60% 40% 50%;
    }
    100% {
        transform: translate(-30px, 40px) scale(0.88) rotate(6deg);
        border-radius: 60% 40% 50% 50% / 40% 50% 60% 40%;
    }
}

@keyframes blobFloat3 {
    0% {
        transform: translate(0, 0) scale(1);
        border-radius: 50% 40% 60% 40% / 60% 50% 40% 50%;
    }
    100% {
        transform: translate(-60px, -30px) scale(1.25);
        border-radius: 40% 60% 40% 60% / 40% 60% 50% 50%;
    }
}

/* Particelle con traiettorie complesse */
.hero .particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.hero .particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--verde-istria);
    border-radius: 50%;
    opacity: 0.15;
    animation: particleDrift 25s linear infinite;
}

.hero .particle:nth-child(1) {
    left: 10%;
    top: 20%;
    animation-duration: 22s;
    animation-delay: 0s;
}
.hero .particle:nth-child(2) {
    left: 25%;
    top: 70%;
    animation-duration: 28s;
    animation-delay: 2s;
    width: 8px;
    height: 8px;
    opacity: 0.10;
}
.hero .particle:nth-child(3) {
    left: 60%;
    top: 15%;
    animation-duration: 20s;
    animation-delay: 4s;
    width: 4px;
    height: 4px;
}
.hero .particle:nth-child(4) {
    left: 80%;
    top: 60%;
    animation-duration: 26s;
    animation-delay: 1s;
    width: 10px;
    height: 10px;
    opacity: 0.08;
}
.hero .particle:nth-child(5) {
    left: 45%;
    top: 85%;
    animation-duration: 24s;
    animation-delay: 3s;
    width: 5px;
    height: 5px;
}
.hero .particle:nth-child(6) {
    left: 70%;
    top: 30%;
    animation-duration: 30s;
    animation-delay: 5s;
    width: 7px;
    height: 7px;
    opacity: 0.12;
}
.hero .particle:nth-child(7) {
    left: 15%;
    top: 45%;
    animation-duration: 18s;
    animation-delay: 7s;
    width: 3px;
    height: 3px;
    opacity: 0.18;
}

@keyframes particleDrift {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.15;
    }
    25% {
        transform: translate(40px, -80px) scale(1.4);
        opacity: 0.25;
    }
    50% {
        transform: translate(-30px, -160px) scale(0.7);
        opacity: 0.10;
    }
    75% {
        transform: translate(70px, -220px) scale(1.6);
        opacity: 0.20;
    }
    100% {
        transform: translate(0, -300px) scale(1);
        opacity: 0.05;
    }
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transform: translateZ(0);
}

.hero h1 {
    font-size: clamp(2.8rem, 6.5vw, 4.6rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.05;
    margin-bottom: 20px;
}

.hero h1 .gradient-text {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 6s ease-in-out infinite alternate;
}

.hero h1 .outline-text {
    color: transparent;
    -webkit-text-stroke: 2px var(--verde-istria);
    text-stroke: 2px var(--verde-istria);
    font-weight: 700;
}

.hero p {
    max-width: 640px;
    font-size: clamp(1rem, 1.4vw, 1.25rem);
    color: var(--text-muted);
    margin-bottom: 32px;
    line-height: 1.7;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 14px 36px;
    border-radius: var(--radius-btn);
    box-shadow: var(--shadow-md);
    font-weight: 500;
    color: var(--verde-istria);
    border: 1px solid var(--glass-border);
    transition: var(--transition-spring);
    position: relative;
    overflow: hidden;
}

.hero-badge::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-brand);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.hero-badge:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.hero-badge:hover::before {
    opacity: 0.05;
}

.hero-badge .badge-dot {
    width: 8px;
    height: 8px;
    background: var(--verde-istria);
    border-radius: 50%;
    animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.8);
        opacity: 0.3;
    }
}

/* ----- SEZIONI CON CLIP-PATH ANIMATO ----- */
.section {
    padding: 56px 0 32px;
    position: relative;
}

.section-alt {
    background: var(--bg-white);
    border-radius: 48px 48px 0 0;
    padding: 64px 0 68px;
    margin-top: 16px;
    transition: background 0.4s ease;
    position: relative;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

/* Divisori con clip-path e animazione */
.section-divider {
    width: 100%;
    height: 80px;
    background: var(--bg-white);
    clip-path: ellipse(70% 100% at 50% 100%);
    margin-bottom: -1px;
    transition: background 0.4s ease;
    position: relative;
}

.section-divider.wave {
    clip-path: path('M0,40 Q120,0 240,40 T480,40 T720,40 T960,40 L1200,40 L1200,80 L0,80 Z');
    animation: waveDivider 8s ease-in-out infinite alternate;
}

@keyframes waveDivider {
    0% {
        clip-path: path('M0,40 Q120,0 240,40 T480,40 T720,40 T960,40 L1200,40 L1200,80 L0,80 Z');
    }
    50% {
        clip-path: path('M0,40 Q120,80 240,40 T480,40 T720,40 T960,40 L1200,40 L1200,80 L0,80 Z');
    }
    100% {
        clip-path: path('M0,40 Q120,20 240,40 T480,40 T720,40 T960,40 L1200,40 L1200,80 L0,80 Z');
    }
}

/* ----- CARD CON 3D TILT AVANZATO E GLOW BORDO ----- */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm), var(--glass-shadow);
    border: 1px solid var(--glass-border);
    transition: var(--transition-spring);
    overflow: hidden;
    position: relative;
    transform-style: preserve-3d;
    perspective: 800px;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: var(--gradient-glass);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.4;
}

.card:hover {
    transform: translateY(-10px) scale(1.02) rotateX(2deg) rotateY(1deg);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: rgba(31, 110, 74, 0.20);
}

/* Glow animato al bordo */
.card::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: var(--gradient-brand);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.6s ease;
    filter: blur(16px);
    background-size: 200% 200%;
    animation: gradientShift 4s ease-in-out infinite alternate;
}

.card:hover::after {
    opacity: 0.20;
}

/* Tilt 3D per card (effetto al passaggio del mouse, via JS o CSS puro con `@property`?) */
.card.tilt {
    transition: transform 0.2s ease;
    will-change: transform;
}

/* ----- BLOG GRID (masonry-like) ----- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 32px;
}

.blog-card .card-img {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.6rem;
    color: white;
    position: relative;
    overflow: hidden;
    background: var(--gradient-brand);
    background-size: 200% 200%;
    animation: gradientShift 4s ease-in-out infinite alternate;
}

.blog-card .card-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.25), transparent 60%);
}

.blog-card .card-img i {
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
    transition: var(--transition-spring);
}

.blog-card:hover .card-img i {
    transform: scale(1.15) rotate(-6deg);
}

.blog-card .card-body {
    padding: 24px 26px 28px;
    position: relative;
}

.blog-card .tag {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: rgba(31, 110, 74, 0.08);
    color: var(--verde-istria);
    padding: 4px 16px;
    border-radius: var(--radius-full);
    margin-bottom: 14px;
    border: 1px solid rgba(31, 110, 74, 0.06);
    transition: var(--transition-fast);
}

.blog-card:hover .tag {
    background: var(--verde-istria);
    color: white;
    transform: scale(1.02);
}

.blog-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.3;
    transition: var(--transition-fast);
}

.blog-card:hover h3 {
    color: var(--verde-istria);
}

.blog-card p {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 18px;
    line-height: 1.6;
}

.blog-card .meta {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 0.78rem;
    color: var(--text-light);
    border-top: 1px solid var(--border-light);
    padding-top: 16px;
}

.blog-card .meta i {
    margin-right: 4px;
    color: var(--azzurro);
}

.blog-card .meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ----- EVENTI – con bordo animato e hover scale ----- */
.events-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.event-item {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-md);
    padding: 20px 30px;
    box-shadow: var(--shadow-sm);
    border-left: 5px solid var(--rosso-tricolore);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: var(--transition-spring);
    border: 1px solid var(--border-light);
    border-left-width: 5px;
    position: relative;
    overflow: hidden;
}

.event-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-brand);
    opacity: 0;
    transition: opacity 0.5s ease;
    border-radius: inherit;
}

.event-item:hover::before {
    opacity: 0.04;
}

.event-item:hover {
    transform: translateX(8px) scale(1.01);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    border-color: rgba(31, 110, 74, 0.20);
}

.event-item .event-info {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.event-item .event-date {
    background: var(--verde-istria);
    color: white;
    border-radius: var(--radius-sm);
    padding: 6px 18px;
    font-weight: 600;
    font-size: 0.8rem;
    text-align: center;
    min-width: 70px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}

.event-item:hover .event-date {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.event-item .event-date .day {
    font-size: 1.5rem;
    display: block;
    line-height: 1.1;
    font-weight: 700;
}

.event-item .event-date .month {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.event-item h4 {
    font-weight: 600;
    font-size: 1.05rem;
    transition: var(--transition-fast);
}

.event-item:hover h4 {
    color: var(--verde-istria);
}

.event-item .event-location {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.event-item .event-location i {
    color: var(--azzurro);
}

.event-item .event-cta {
    background: rgba(31, 110, 74, 0.06);
    padding: 8px 24px;
    border-radius: var(--radius-btn);
    font-weight: 500;
    font-size: 0.82rem;
    color: var(--verde-istria);
    transition: var(--transition-spring);
    border: 1px solid transparent;
    position: relative;
    z-index: 1;
}

.event-item .event-cta:hover {
    background: var(--verde-istria);
    color: white;
    transform: scale(1.06);
    box-shadow: var(--shadow-md);
}

/* ----- RISORSE – con hover glow e icona animata ----- */
.risorse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 28px;
}

.risorsa-card {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-lg);
    padding: 32px 20px 28px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--glass-border);
    transition: var(--transition-spring);
    position: relative;
    overflow: hidden;
}

.risorsa-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-brand);
    opacity: 0;
    transition: opacity 0.5s ease;
    border-radius: inherit;
}

.risorsa-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.risorsa-card:hover::after {
    opacity: 0.05;
}

.risorsa-card i {
    font-size: 2.6rem;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 14px;
    display: inline-block;
    transition: var(--transition-spring);
}

.risorsa-card:hover i {
    transform: scale(1.15) rotate(-6deg);
}

.risorsa-card h4 {
    font-weight: 600;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

.risorsa-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.risorsa-card a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    color: var(--verde-istria);
    transition: var(--transition-spring);
    position: relative;
    z-index: 1;
    text-decoration: none;
}

.risorsa-card a::after {
    content: '→';
    transition: var(--transition-spring);
}

.risorsa-card a:hover {
    gap: 14px;
    color: var(--verde-istria-chiaro);
}

.risorsa-card a:hover::after {
    transform: translateX(6px);
}

/* ----- SOTTOSEZIONI (link pagine) ----- */
.sub-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 28px;
}

.sub-section-card {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-lg);
    padding: 36px 20px 32px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--glass-border);
    transition: var(--transition-spring);
    border-top: 4px solid var(--verde-istria);
    position: relative;
    overflow: hidden;
}

.sub-section-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-brand);
    opacity: 0;
    transition: opacity 0.5s ease;
    border-radius: inherit;
}

.sub-section-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.sub-section-card:hover::before {
    opacity: 0.05;
}

.sub-section-card i {
    font-size: 3rem;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 14px;
    display: inline-block;
    transition: var(--transition-spring);
}

.sub-section-card:hover i {
    transform: scale(1.12) rotate(-4deg);
}

.sub-section-card h4 {
    font-weight: 600;
    font-size: 1.1rem;
    position: relative;
    z-index: 1;
}

.sub-section-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: 10px 0 18px;
    position: relative;
    z-index: 1;
}

.sub-section-card .btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 28px;
    border: 2px solid var(--verde-istria);
    border-radius: var(--radius-btn);
    font-weight: 600;
    color: var(--verde-istria);
    transition: var(--transition-spring);
    position: relative;
    z-index: 1;
    font-size: 0.85rem;
    text-decoration: none;
}

.sub-section-card .btn-outline:hover {
    background: var(--verde-istria);
    color: white;
    transform: scale(1.04);
    box-shadow: var(--shadow-md);
    gap: 14px;
}

/* ----- NEWSLETTER – con effetto vetro e glow pulsante ----- */
.newsletter-box {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(1.3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    padding: 44px 52px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    border: 1px solid var(--glass-border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    position: relative;
    overflow: hidden;
}

.newsletter-box::before {
    content: '';
    position: absolute;
    inset: -50%;
    background: radial-gradient(circle at 30% 50%, rgba(31, 110, 74, 0.06), transparent 60%);
    animation: newsletterGlow 10s ease-in-out infinite alternate;
}

@keyframes newsletterGlow {
    0% {
        transform: translate(-10%, -10%) scale(1);
    }
    100% {
        transform: translate(10%, 10%) scale(1.1);
    }
}

.newsletter-box .newsletter-text {
    position: relative;
    z-index: 1;
}

.newsletter-box .newsletter-text h3 {
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    font-weight: 700;
}

.newsletter-box .newsletter-text h3 .highlight {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.newsletter-box .newsletter-text p {
    color: var(--text-muted);
    margin-top: 4px;
}

.newsletter-box .newsletter-form {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    justify-content: flex-end;
}

.newsletter-box .newsletter-form input {
    padding: 14px 24px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-btn);
    font-family: var(--font);
    font-size: 0.95rem;
    min-width: 220px;
    outline: none;
    transition: var(--transition-spring);
    background: var(--bg-white);
    color: var(--text-dark);
    flex: 1 1 180px;
}

.newsletter-box .newsletter-form input:focus {
    border-color: var(--verde-istria);
    box-shadow: 0 0 0 4px rgba(31, 110, 74, 0.10), var(--shadow-glow);
    transform: scale(1.02);
}

.newsletter-box .newsletter-form button {
    background: var(--gradient-brand);
    color: white;
    border: none;
    padding: 14px 34px;
    border-radius: var(--radius-btn);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-spring);
    font-family: var(--font);
    background-size: 200% 200%;
    animation: gradientShift 4s ease-in-out infinite alternate;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(31, 110, 74, 0.2);
}

.newsletter-box .newsletter-form button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.newsletter-box .newsletter-form button:hover {
    transform: scale(1.05) translateY(-3px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.newsletter-box .newsletter-form button:hover::before {
    opacity: 1;
}

.newsletter-box .newsletter-form button:active {
    transform: scale(0.94);
}

/* ----- FOOTER – con gradienti e micro-interazioni ----- */
footer {
    background: #1e2b2f;
    color: #d0dcdb;
    padding: 56px 0 36px;
    border-radius: 48px 48px 0 0;
    margin-top: 32px;
    position: relative;
    overflow: hidden;
    transition: background 0.4s ease;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-brand);
    background-size: 200% 200%;
    animation: gradientShift 4s ease-in-out infinite alternate;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 40px;
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
}

.footer-col h5 {
    color: white;
    font-weight: 600;
    margin-bottom: 18px;
    font-size: 1rem;
    letter-spacing: -0.3px;
    position: relative;
    display: inline-block;
}

.footer-col h5::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 28px;
    height: 2px;
    background: var(--verde-istria-chiaro);
    border-radius: var(--radius-full);
    transition: var(--transition-base);
}

.footer-col:hover h5::after {
    width: 48px;
}

.footer-col p,
.footer-col a {
    font-size: 0.88rem;
    line-height: 1.9;
    color: #b6c8c7;
    transition: var(--transition-fast);
}

.footer-col a {
    display: inline-block;
    position: relative;
    text-decoration: none;
}

.footer-col a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: white;
    transition: var(--transition-spring);
}

.footer-col a:hover::after {
    width: 100%;
}

.footer-col a:hover {
    color: white;
}

.footer-col .socials {
    display: flex;
    gap: 16px;
    font-size: 1.5rem;
    margin-top: 12px;
}

.footer-col .socials a {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: var(--transition-spring);
    color: #b6c8c7;
    text-decoration: none;
}

.footer-col .socials a:hover {
    background: var(--rosso-tricolore);
    color: white;
    transform: translateY(-6px) scale(1.08);
    box-shadow: 0 8px 24px rgba(206, 43, 55, 0.25);
    border-color: var(--rosso-tricolore);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 24px;
    text-align: center;
    font-size: 0.82rem;
    color: #8ba09e;
    position: relative;
    z-index: 1;
}

/* ----- PULSANTI PRIMARI – con effetto ripple e neon glow ----- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--gradient-brand);
    color: white;
    padding: 14px 36px;
    border-radius: var(--radius-btn);
    font-weight: 600;
    transition: var(--transition-spring);
    border: none;
    cursor: pointer;
    font-family: var(--font);
    font-size: 0.95rem;
    background-size: 200% 200%;
    animation: gradientShift 5s ease-in-out infinite alternate;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(31, 110, 74, 0.2);
    text-decoration: none;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.btn-primary:hover {
    transform: translateY(-6px) scale(1.04);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:active {
    transform: scale(0.94);
}

.btn-primary.neon {
    box-shadow: 0 0 20px rgba(31, 110, 74, 0.3), 0 0 60px rgba(31, 110, 74, 0.1);
}

.btn-primary.neon:hover {
    box-shadow: 0 0 30px rgba(31, 110, 74, 0.5), 0 0 80px rgba(31, 110, 74, 0.2);
}

/* Ripple effect (via JS opzionale, ma qui CSS puro) */
.btn-primary .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: rippleAnim 0.6s linear;
    pointer-events: none;
}

@keyframes rippleAnim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ----- ANIMAZIONI DI SCROLL (reveal) con effetto più dinamico ----- */
.reveal {
    opacity: 0;
    transform: translateY(40px) scale(0.96);
    transition: opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
        transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.reveal-delay-1 {
    transition-delay: 0.08s;
}
.reveal-delay-2 {
    transition-delay: 0.16s;
}
.reveal-delay-3 {
    transition-delay: 0.24s;
}
.reveal-delay-4 {
    transition-delay: 0.32s;
}
.reveal-delay-5 {
    transition-delay: 0.40s;
}
.reveal-delay-6 {
    transition-delay: 0.48s;
}

/* Reveal con rotazione e prospettiva */
.reveal-rotate {
    opacity: 0;
    transform: perspective(600px) rotateX(10deg) translateY(30px) scale(0.95);
    transition: opacity 0.9s cubic-bezier(0.34, 1.56, 0.64, 1),
        transform 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reveal-rotate.visible {
    opacity: 1;
    transform: perspective(600px) rotateX(0deg) translateY(0) scale(1);
}

/* ----- MARQUEE (annuncio scorrevole) con effetto pausa hover ----- */
.marquee {
    background: var(--verde-istria);
    color: white;
    padding: 8px 0;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: background 0.4s ease;
}

.marquee-content {
    display: inline-block;
    animation: marqueeScroll 30s linear infinite;
    padding-left: 100%;
    transition: animation-play-state 0.2s ease;
}

.marquee:hover .marquee-content {
    animation-play-state: paused;
}

.marquee-content span {
    display: inline-block;
    padding: 0 40px;
}

.marquee-content i {
    margin: 0 8px;
    opacity: 0.6;
}

@keyframes marqueeScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* ----- CURSORE PERSONALIZZATO AVANZATO (solo desktop) ----- */
@media (pointer: fine) {
    .custom-cursor {
        cursor: none;
    }

    .cursor-dot {
        position: fixed;
        width: 8px;
        height: 8px;
        background: var(--verde-istria);
        border-radius: 50%;
        pointer-events: none;
        z-index: 99999;
        transform: translate(-50%, -50%);
        transition: width 0.2s, height 0.2s, background 0.2s, opacity 0.2s;
        mix-blend-mode: difference;
    }

    .cursor-ring {
        position: fixed;
        width: 40px;
        height: 40px;
        border: 1.5px solid var(--verde-istria);
        border-radius: 50%;
        pointer-events: none;
        z-index: 99998;
        transform: translate(-50%, -50%);
        transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
            height 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
            border-color 0.3s ease, background 0.3s ease, opacity 0.3s ease;
        opacity: 0.5;
        will-change: transform, width, height;
    }

    .cursor-ring.hover {
        width: 72px;
        height: 72px;
        border-color: var(--rosso-tricolore);
        background: rgba(206, 43, 55, 0.08);
        opacity: 0.9;
    }

    .cursor-dot.hover {
        width: 14px;
        height: 14px;
        background: var(--rosso-tricolore);
        opacity: 0.8;
    }

    /* Nascondo il cursore predefinito solo se .custom-cursor è attivo */
    .custom-cursor * {
        cursor: none !important;
    }
}

/* ----- RESPONSIVE 2026 – mobile-first migliorato ----- */
@media (max-width: 992px) {
    .hero {
        padding: 60px 0 72px;
        border-radius: 0 0 40px 40px;
    }

    .hero .blob-1 {
        width: 400px;
        height: 400px;
    }
    .hero .blob-2 {
        width: 280px;
        height: 280px;
    }
    .newsletter-box {
        padding: 32px 28px;
        flex-direction: column;
        align-items: stretch;
    }
    .newsletter-box .newsletter-form {
        justify-content: center;
    }
    .newsletter-box .newsletter-form input {
        min-width: 160px;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 20px 0 12px;
        gap: 14px;
        border-top: 1px solid var(--border-light);
        margin-top: 8px;
    }

    .nav-links.open {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }

    .nav-links .theme-toggle {
        align-self: flex-start;
    }

    .hero {
        padding: 44px 0 56px;
        border-radius: 0 0 32px 32px;
    }

    .hero .blob-1 {
        width: 280px;
        height: 280px;
        top: -10%;
        right: -20%;
    }
    .hero .blob-2 {
        width: 200px;
        height: 200px;
        bottom: -20%;
        left: -15%;
    }
    .hero .blob-3 {
        display: none;
    }

    .hero h1 {
        font-size: clamp(1.8rem, 5.5vw, 2.4rem);
    }

    .section-title {
        font-size: clamp(1.5rem, 4vw, 2rem);
    }

    .event-item {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 18px 20px;
    }

    .event-item .event-info {
        gap: 14px;
    }

    .newsletter-box {
        padding: 28px 20px;
        flex-direction: column;
        align-items: stretch;
        border-radius: var(--radius-md);
    }

    .newsletter-box .newsletter-form {
        flex-direction: column;
        align-items: stretch;
    }

    .newsletter-box .newsletter-form input {
        min-width: auto;
        width: 100%;
        text-align: center;
    }

    .newsletter-box .newsletter-form button {
        width: 100%;
        justify-content: center;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .risorse-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .sub-section-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }

    .section-alt {
        border-radius: 32px 32px 0 0;
        padding: 40px 0 44px;
    }

    footer {
        border-radius: 32px 32px 0 0;
        padding: 40px 0 28px;
    }

    .hero-badge {
        padding: 10px 24px;
        font-size: 0.9rem;
    }

    .section-divider.wave {
        height: 40px;
        animation-duration: 6s;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero {
        padding: 32px 0 40px;
        border-radius: 0 0 24px 24px;
    }

    .hero .blob-1 {
        width: 200px;
        height: 200px;
    }
    .hero .blob-2 {
        width: 150px;
        height: 150px;
    }

    .hero h1 {
        font-size: clamp(1.5rem, 6vw, 1.9rem);
    }

    .hero p {
        font-size: 0.95rem;
    }

    .hero-badge {
        padding: 8px 18px;
        font-size: 0.8rem;
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .section-sub {
        font-size: 0.95rem;
    }

    .blog-card .card-img {
        height: 150px;
        font-size: 2.8rem;
    }

    .risorse-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .sub-section-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .risorsa-card {
        padding: 20px 12px 18px;
    }

    .risorsa-card i {
        font-size: 2rem;
    }

    .sub-section-card {
        padding: 24px 16px 20px;
    }

    .sub-section-card i {
        font-size: 2.4rem;
    }

    .event-item {
        padding: 14px 16px;
    }

    .event-item .event-date {
        min-width: 60px;
        padding: 4px 12px;
        font-size: 0.7rem;
    }

    .event-item .event-date .day {
        font-size: 1.2rem;
    }

    .event-item h4 {
        font-size: 0.95rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .newsletter-box {
        padding: 20px 16px;
    }

    .newsletter-box .newsletter-text h3 {
        font-size: 1.1rem;
    }

    .section-alt {
        border-radius: 24px 24px 0 0;
        padding: 32px 0 36px;
    }

    footer {
        border-radius: 24px 24px 0 0;
        padding: 32px 0 24px;
    }

    .btn-primary {
        padding: 12px 24px;
        font-size: 0.85rem;
    }

    .sub-section-card .btn-outline {
        padding: 6px 20px;
        font-size: 0.8rem;
    }

    .event-item .event-cta {
        padding: 6px 16px;
        font-size: 0.75rem;
        align-self: center;
    }

    /* Disabilita cursore personalizzato su mobile */
    .custom-cursor,
    .cursor-dot,
    .cursor-ring {
        display: none !important;
    }

    .marquee {
        font-size: 0.7rem;
        padding: 6px 0;
    }

    .section-divider.wave {
        height: 30px;
        animation-duration: 4s;
    }
}

/* ----- UTILITY PER ACCESSIBILITÀ E PREFERENZE ----- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .hero .blob,
    .hero .particle,
    .marquee-content,
    .section-divider.wave {
        animation: none !important;
    }

    .reveal,
    .reveal-rotate {
        opacity: 1 !important;
        transform: none !important;
    }
}

@media (prefers-color-scheme: dark) {
    /* Se non c'è una classe .dark-mode esplicita, applichiamo il tema scuro automaticamente */
    :root:not([data-theme="light"]) {
        --bg-light: #111a1a;
        --bg-white: #1a2626;
        --bg-card: rgba(26, 38, 38, 0.80);
        --text-dark: #eaf0ee;
        --text-muted: #9ab0ae;
        --text-light: #6d8785;
        --border-light: rgba(255, 255, 255, 0.06);
        --glass-bg: rgba(26, 38, 38, 0.65);
        --glass-border: rgba(255, 255, 255, 0.08);
        --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
        --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.5);
        --shadow-glow: 0 0 40px rgba(31, 110, 74, 0.25);
        --gradient-hero: linear-gradient(145deg, #0f1e1a 0%, #1a2e28 100%);
        --gradient-warm: linear-gradient(135deg, #1a1a16, #141e1c);
        --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
        --glow-color: rgba(31, 110, 74, 0.40);
        --neon-shadow: 0 0 20px rgba(206, 43, 55, 0.4), 0 0 60px rgba(206, 43, 55, 0.2);
    }

    :root:not([data-theme="light"]) .blog-card .tag {
        background: rgba(59, 140, 158, 0.20);
        color: var(--azzurro-chiaro);
    }

    :root:not([data-theme="light"]) .event-item {
        background: var(--bg-white);
    }

    :root:not([data-theme="light"]) .risorsa-card,
    :root:not([data-theme="light"]) .sub-section-card,
    :root:not([data-theme="light"]) .card,
    :root:not([data-theme="light"]) .newsletter-box {
        background: var(--bg-card);
        border-color: rgba(255, 255, 255, 0.05);
    }

    :root:not([data-theme="light"]) .newsletter-box .newsletter-form input {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(255, 255, 255, 0.10);
        color: var(--text-dark);
    }

    :root:not([data-theme="light"]) .newsletter-box .newsletter-form input::placeholder {
        color: var(--text-light);
    }

    :root:not([data-theme="light"]) footer {
        background: #0c1515;
    }

    :root:not([data-theme="light"]) .hero-badge {
        background: var(--bg-card);
        border-color: rgba(255, 255, 255, 0.08);
        color: var(--text-dark);
    }

    :root:not([data-theme="light"]) .event-item .event-cta {
        background: rgba(255, 255, 255, 0.06);
        color: var(--azzurro-chiaro);
    }

    :root:not([data-theme="light"]) .event-item .event-cta:hover {
        background: var(--verde-istria);
        color: white;
    }

    :root:not([data-theme="light"]) .section-label {
        background: rgba(59, 140, 158, 0.18);
    }

    :root:not([data-theme="light"]) .section-divider {
        background: var(--bg-white);
    }

    :root:not([data-theme="light"]) .section-divider.wave {
        background: var(--bg-white);
    }
}

/* ----- AGGIUNTA PER LOGO IMMAGINE ----- */
.logo img {
    height: 40px;
    width: auto;
    vertical-align: middle;
    margin-right: 10px;
    transition: var(--transition-spring);
}

.logo:hover img {
    transform: scale(1.05) rotate(-3deg);
}

/* ============================================================
   MAPPA E POPUP – Italiani in Istria
   Stili per la mappa interattiva, filtri, legenda e popup.
   Compatibile con tema chiaro/scuro.
   ============================================================ */

/* ----- Contenitore mappa ----- */
#mapContainer {
    height: 500px;
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    overflow: hidden;
    background: var(--bg-light);
    transition: background 0.4s ease, border-color 0.4s ease;
}

/* ----- Popup personalizzato ----- */
.popup-content h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--verde-istria);
    margin-bottom: 4px;
    transition: color 0.3s ease;
}

.popup-content p {
    margin: 4px 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-dark);
}

.popup-content a {
    color: var(--azzurro);
    text-decoration: underline;
    transition: var(--transition-fast);
}

.popup-content a:hover {
    color: var(--verde-istria);
}

.popup-content i {
    width: 18px;
    color: var(--verde-istria);
}

/* Override per i popup Leaflet (tema chiaro) */
.leaflet-popup-content-wrapper {
    border-radius: var(--radius-sm) !important;
    box-shadow: var(--shadow-md) !important;
    background: var(--bg-white) !important;
    color: var(--text-dark) !important;
}

.leaflet-popup-tip {
    background: var(--bg-white) !important;
}

.leaflet-popup-content {
    min-width: 200px;
    max-width: 300px;
}

/* ----- Legenda ----- */
.legend {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
    font-size: 0.85rem;
    line-height: 1.6;
    transition: background 0.4s ease, border-color 0.4s ease;
}

.legend h4 {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.legend-item .color-box {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    flex-shrink: 0;
}

.legend-item span {
    color: var(--text-muted);
}

/* ----- Filtri con icone e conteggi ----- */
#filterContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 4px 0;
    overflow-x: auto;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-btn);
    background: var(--glass-bg);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-spring);
    font-family: var(--font);
    white-space: nowrap;
}

.filter-btn i {
    font-size: 1rem;
    transition: var(--transition-fast);
}

.filter-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-sm);
}

.filter-btn.active {
    background: var(--verde-istria);
    color: white;
    border-color: var(--verde-istria);
    box-shadow: var(--shadow-sm);
}

.filter-btn .badge-count {
    display: inline-block;
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-full);
    padding: 0 8px;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.6;
    margin-left: 2px;
}

.filter-btn.active .badge-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Scrolling orizzontale su mobile */
@media (max-width: 768px) {
    #filterContainer {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
        scrollbar-width: none;
    }
    #filterContainer::-webkit-scrollbar {
        display: none;
    }
    .filter-btn {
        flex-shrink: 0;
        padding: 6px 14px;
        font-size: 0.75rem;
    }
}

/* ----- Controllo geolocalizzazione (Leaflet override) ----- */
.leaflet-control-geoloc a {
    background: white !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    transition: var(--transition-fast);
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    font-size: 1.2rem;
    color: var(--verde-istria) !important;
}

.leaflet-control-geoloc a:hover {
    background: var(--bg-light) !important;
    transform: scale(1.05);
}

/* ----- TEMA SCURO (data-theme="dark") ----- */
[data-theme="dark"] .popup-content h3 {
    color: var(--azzurro-chiaro);
}

[data-theme="dark"] .popup-content p {
    color: var(--text-dark);
}

[data-theme="dark"] .popup-content i {
    color: var(--azzurro-chiaro);
}

[data-theme="dark"] .leaflet-popup-content-wrapper {
    background: var(--bg-card) !important;
    color: var(--text-dark) !important;
    backdrop-filter: blur(8px);
}

[data-theme="dark"] .leaflet-popup-tip {
    background: var(--bg-card) !important;
}

[data-theme="dark"] .leaflet-control-geoloc a {
    background: var(--bg-card) !important;
    color: var(--text-dark) !important;
}

[data-theme="dark"] .leaflet-control-geoloc a:hover {
    background: var(--bg-light) !important;
}

[data-theme="dark"] .legend {
    background: var(--bg-card) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .legend h4 {
    color: var(--text-dark);
}

[data-theme="dark"] .legend-item span {
    color: var(--text-muted);
}

[data-theme="dark"] .filter-btn {
    background: var(--bg-card);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

[data-theme="dark"] .filter-btn.active {
    background: var(--verde-istria);
    color: white;
    border-color: var(--verde-istria);
}

[data-theme="dark"] .filter-btn:not(.active):hover {
    border-color: var(--verde-istria-chiaro);
    color: var(--verde-istria-chiaro);
}

[data-theme="dark"] .filter-btn .badge-count {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .filter-btn.active .badge-count {
    background: rgba(255, 255, 255, 0.2);
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
    #mapContainer {
        height: 380px;
        border-radius: var(--radius-md);
    }

    .legend {
        font-size: 0.75rem;
        padding: 8px 12px;
    }

    .popup-content h3 {
        font-size: 1rem;
    }

    .popup-content p {
        font-size: 0.8rem;
    }

    .leaflet-popup-content {
        min-width: 160px;
    }
}

@media (max-width: 480px) {
    #mapContainer {
        height: 300px;
    }

    /* Nascondi legenda su mobile per non ingombrare */
    .legend {
        display: none;
    }

    .filter-btn {
        padding: 4px 10px;
        font-size: 0.7rem;
    }

    .filter-btn i {
        font-size: 0.8rem;
    }

    .filter-btn .badge-count {
        font-size: 0.6rem;
        padding: 0 6px;
    }
}

/* ----- Messaggio di caricamento / errore ----- */
.loading-msg,
.error-msg {
    font-family: var(--font);
    font-size: 0.9rem;
    pointer-events: none;
}

.loading-msg i {
    margin-right: 6px;
}

.error-msg code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}