/* ==========================================================================
   PERCORSI COMPACT CUSTOM CARD GRID (4 Columns)
   ========================================================================== */

.percorsi-grid-container {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 20px;
    padding-bottom: 20px;
    box-sizing: border-box;
}

.percorsi-no-results {
    text-align: center;
    color: #666;
    font-size: 1.1rem;
    padding: 40px 0;
}

/* --- Card Setup --- */
.percorso-card-v2 {
    width: 100%;
    box-sizing: border-box;
}

.percorso-card-link-wrapper {
    display: block;
    text-decoration: none !important;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.percorso-card-link-wrapper:hover {
    transform: translateY(-5px);
}

.percorso-card-container {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 2.85; /* Beautiful portrait profile matching image_4b1364.jpg */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 0px; /* Sharp clean layouts matching the design systems setup */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* --- Top-Left Boolean Badges Window --- */
.percorso-top-badges {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 4;
    display: flex;
    gap: 10px;
}

.percorso-icon-badge {
    width: 44px;
    height: 44px;
    background-color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a7c59; /* Forest green icons setup */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.percorso-svg-icon {
    width: 22px;
    height: 22px;
}

/* --- Core UI Text Gradient Layer --- */
.percorso-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 55%,
        rgba(0, 0, 0, 0.45) 75%,
        rgba(0, 0, 0, 0.85) 100%
    );
}

/* --- Card Content Wrapper --- */
.percorso-card-content {
    position: relative;
    z-index: 3;
    padding: 24px;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

/* Title Setup */
.percorso-title {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff !important;
    margin: 0 0 4px 0;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Metadata Text Rows */
.percorso-meta-rows {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 12px;
}

.percorso-meta-line {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* Green Custom Pill Taxonomy Badge */
.percorso-pill-badge {
    display: inline-block;
    background-color: #467e4e; /* Matte dynamic green matching screenshot exactly */
    color: #ffffff !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 18px;
    border-radius: 20px;
    text-transform: capitalize;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   RESPONSIVE LAYOUT TRACKS
   ========================================================================== */

@media (max-width: 1200px) {
    .percorsi-grid-container {
        grid-template-columns: repeat(3, minmax(0, 1fr)); /* 3 columns */
    }
}

@media (max-width: 991px) {
    .percorsi-grid-container {
        grid-template-columns: repeat(2, minmax(0, 1fr)); /* 2 columns */
        gap: 20px;
    }
}

@media (max-width: 600px) {
    .percorsi-grid-container {
        grid-template-columns: 1fr; /* Single Column Mobile */
        gap: 16px;
        padding: 15px;
    }

    .percorso-card-container {
        aspect-ratio: 16 / 11; /* Wide profile optimization for single-column mobile viewports */
    }

    .percorso-title {
        font-size: 1.5rem;
    }
}