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

body {
    background-color: #ffffff;
    font-family: system-ui, -apple-system, 'Inter', sans-serif;
    color: #1a2a1f;
}

/* CONTAINER */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* HERO */
.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 2rem;
    font-weight: 500;
}

.accent {
    width: 60px;
    height: 2px;
    background: #2e7d32;
    margin: 10px auto;
}

.hero p {
    color: #5c6e5a;
}

/* GRID */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    align-items: stretch;
}

/* CARD */
.card {
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
    border: 1px solid #edf2e9;
    transition: 0.3s;
    background: #ffffff;
    height: 100%;
    min-height: 380px;
}

.card:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 30px rgba(46, 125, 50, 0.15);
}

/* IMAGE */
.card-image {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    flex-shrink: 0;
    background-color: #ffffff; /* Sfondo BIANCO */
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image img {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    display: block;
    transition: 0.4s;
}

.card:hover img {
    transform: scale(1.02);
}

/* OVERLAY */
.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(46, 125, 50, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: 0.3s;
    border-radius: 20px;
}

.card-overlay span {
    color: white;
    font-size: 0.9rem;
    background: rgba(255,255,255,0.15);
    padding: 0.4rem 1rem;
    border-radius: 30px;
    backdrop-filter: blur(4px);
    transform: translateY(10px);
    opacity: 0;
    transition: 0.3s;
}

.card:hover .card-overlay {
    opacity: 1;
}

.card:hover .card-overlay span {
    transform: translateY(0);
    opacity: 1;
}

/* CAPTION */
.card-caption {
    padding: 1rem;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #ffffff;
}

.card-caption span {
    font-size: 0.7rem;
    background: #f1f8ef;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 0.5rem;
    color: #2c5e2a;
}

.card-caption p {
    font-size: 0.8rem;
    color: #5c6e5a;
    margin-top: 5px;
}

/* FOOTER */
.footer {
    margin-top: 3rem;
    text-align: center;
    font-size: 0.8rem;
    color: #7e8e7b;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
    }
    
    .hero h1 {
        font-size: 1.6rem;
    }
    
    .card-grid {
        gap: 1.2rem;
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
    
    .card-image {
        height: 180px;
    }
    
    .card {
        min-height: 320px;
    }
    
    .card-caption {
        padding: 0.8rem;
    }
}

/* Effetto focus */
.card:focus-visible {
    outline: 3px solid #2e7d32;
    outline-offset: 2px;
    transform: scale(1.01);
}