/* ==========================================================================
   CPCG - Layout Grid (style-grid.css)
   ========================================================================== */

/* Contenitore Griglia */
.cpcg-grid.cpcg-layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    width: 100%;
    box-sizing: border-box;
}

/* Card Singola */
.cpcg-layout-grid .cpcg-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    min-height: 380px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cpcg-layout-grid .cpcg-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Sfondo Immagine e Overlay */
.cpcg-layout-grid .cpcg-image-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.cpcg-layout-grid .cpcg-image-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.cpcg-layout-grid .cpcg-card:hover .cpcg-image-background img {
    transform: scale(1.05);
}

.cpcg-layout-grid .cpcg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.85) 100%);
    z-index: 2;
}

/* Contenuto Card (Titolo + Link) */
.cpcg-layout-grid .cpcg-card-body {
    position: relative;
    z-index: 3;
    padding: 24px;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cpcg-layout-grid .cpcg-title {
    font-family: 'Sofia Sans', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.25;
}

.cpcg-layout-grid .cpcg-link {
    font-family: 'Sofia Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    opacity: 0.9;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.cpcg-layout-grid .cpcg-card:hover .cpcg-link {
    opacity: 1;
    transform: translateX(4px);
}

/* Breakpoint Mobile */
@media (max-width: 600px) {
    .cpcg-grid.cpcg-layout-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .cpcg-layout-grid .cpcg-card {
        min-height: 300px;
    }
}
/* CTA text inside the card (now a <p> since the whole card is a link) */
.cpcg-layout-grid .cpcg-cta {
    font-family: 'Sofia Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    opacity: 0.9;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.cpcg-layout-grid .cpcg-card:hover .cpcg-cta {
    opacity: 1;
    transform: translateX(4px);
}
