/**
 * Bloc Fest Pro - Stili per Widget Griglia Card (Cards Grid)
 * Estetica Dark Brutalist, Tipografia Neue Haas Unica Pro, Griglia Responsive & Micro-Animazioni
 *
 * @version 4.30.0
 */

/* ==========================================================================
   Contenitore Esterno Griglia (Wrapper)
   ========================================================================== */

.bloc-cards-grid-wrapper {
    display: block;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

/* ==========================================================================
   Griglia CSS Principale
   ========================================================================== */

.bloc-cards-grid {
    display: grid;
    width: 100%;
    box-sizing: border-box;
    /* Default: 3 colonne desktop, 2 tablet, 1 mobile */
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: stretch;
}

/* Modalità Auto-Fit / Minmax */
.bloc-cards-grid.is-autofit {
    grid-template-columns: repeat(auto-fill, minmax(var(--bloc-grid-card-min-width, 300px), 1fr));
}

/* ==========================================================================
   Singola Card nella Griglia
   ========================================================================== */

.bloc-cards-grid .bloc-cards-grid-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    width: 100%;
    min-height: 380px;
    border-radius: 24px;
    overflow: hidden;
    background-color: #141416;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.12);
    text-decoration: none;
    color: #ffffff;
    box-sizing: border-box;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.4s ease;
    cursor: default;
    isolation: isolate;
}

/* Se la card è un link intero (tag <a>) */
a.bloc-cards-grid-card {
    cursor: pointer;
}

/* ==========================================================================
   Effetto Hover & Elevazione
   ========================================================================== */

.bloc-cards-grid-wrapper.has-hover-zoom .bloc-cards-grid-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.65);
    border-color: rgba(255, 255, 255, 0.3);
}

.bloc-cards-grid-wrapper.has-hover-zoom .bloc-cards-grid-card:hover .bloc-card-bg-layer {
    transform: scale(1.06);
}

/* ==========================================================================
   Layer Immagine di Sfondo
   ========================================================================== */

.bloc-cards-grid .bloc-card-bg-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    z-index: 1;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
    pointer-events: none;
}

/* ==========================================================================
   Layer Overlay Gradiente Scuro (Massima Leggibilità)
   ========================================================================== */

.bloc-cards-grid .bloc-card-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.92) 0%,
        rgba(0, 0, 0, 0.55) 45%,
        rgba(0, 0, 0, 0.1) 80%,
        transparent 100%
    );
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.3s ease, background 0.3s ease;
}

/* ==========================================================================
   Badge / Tag Opzionale (Pill Frosted Glass)
   ========================================================================== */

.bloc-cards-grid .bloc-card-badge {
    position: absolute;
    z-index: 4;
    padding: 6px 14px;
    border-radius: 20px;
    font-family: 'Neue Haas Unica Pro', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    background-color: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    line-height: 1;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
}

/* Posizioni Badge */
.bloc-cards-grid .bloc-badge-pos-top-left     { top: 20px; left: 20px; }
.bloc-cards-grid .bloc-badge-pos-top-right    { top: 20px; right: 20px; }
.bloc-cards-grid .bloc-badge-pos-bottom-left  { bottom: 20px; left: 20px; }
.bloc-cards-grid .bloc-badge-pos-bottom-right { bottom: 20px; right: 20px; }

/* ==========================================================================
   Contenuto Testo Card (Sottotitolo, Titolo, Descrizione, CTA)
   ========================================================================== */

.bloc-cards-grid .bloc-card-content {
    position: relative;
    z-index: 3;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-sizing: border-box;
    width: 100%;
}

.bloc-cards-grid .bloc-card-subtitle {
    display: block;
    font-family: 'Neue Haas Unica Pro', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #a1a1aa;
    line-height: 1.2;
    margin: 0;
}

.bloc-cards-grid .bloc-card-title {
    font-family: 'Neue Haas Unica Pro', sans-serif;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: #ffffff;
    margin: 0;
    line-height: 1.1;
    transition: color 0.3s ease;
}

.bloc-cards-grid .bloc-card-description {
    font-family: 'Neue Haas Unica Pro', sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    color: #d1d5db;
    margin: 4px 0 0 0;
}

/* ==========================================================================
   Pulsante Call to Action (CTA)
   ========================================================================== */

.bloc-cards-grid .bloc-card-cta-wrap {
    margin-top: 10px;
    display: flex;
    align-items: center;
}

.bloc-cards-grid .bloc-card-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 20px;
    font-family: 'Neue Haas Unica Pro', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-decoration: none;
    color: #000000;
    background-color: #ffffff;
    border: 1px solid #ffffff;
    transition: all 0.3s ease;
    line-height: 1;
    white-space: nowrap;
}

/* Se la card è cliccabile come blocco e si passa sopra con il mouse */
a.bloc-cards-grid-card:hover .bloc-card-cta-btn,
.bloc-cards-grid-card:hover .bloc-card-cta-btn {
    background-color: #e4e4e7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

/* Varianti grafiche CTA */
.bloc-cards-grid .bloc-cta-style-pill {
    border-radius: 999px;
}

.bloc-cards-grid .bloc-cta-style-outline {
    background-color: transparent !important;
    color: #ffffff !important;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
}
.bloc-cards-grid-card:hover .bloc-cta-style-outline {
    border-color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.bloc-cards-grid .bloc-cta-style-glass {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
}
.bloc-cards-grid-card:hover .bloc-cta-style-glass {
    background-color: rgba(255, 255, 255, 0.25) !important;
}

/* ==========================================================================
   Responsive & Media Queries Fallback
   ========================================================================== */

@media (max-width: 1024px) {
    .bloc-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 767px) {
    .bloc-cards-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .bloc-cards-grid .bloc-cards-grid-card {
        min-height: 340px;
    }
    .bloc-cards-grid .bloc-card-content {
        padding: 20px;
    }
    .bloc-cards-grid .bloc-card-title {
        font-size: 22px;
    }
}
