/* =========================================
   Shortcode: [gr_category_cards] (Refactored)
   ========================================= */

.gr-cat-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* Mobile: 2 columnas */
    gap: 15px;
    margin-bottom: 30px;
}

@media (min-width: 768px) {
    .gr-cat-cards-grid {
        grid-template-columns: repeat(3, 1fr);
        /* Tablet: 3 columnas */
        gap: 20px;
    }
}

@media (min-width: 1024px) {
    .gr-cat-cards-grid {
        grid-template-columns: repeat(4, 1fr);
        /* Desktop: 4 columnas */
        gap: 24px;
    }
}

/* 
 * CLEANER DOM STRUCTURE:
 * <a class="gr-cat-card" style="bg-image">
 *   <h3>Title</h3>
 * </a>
 */
.gr-cat-card {
    position: relative;
    display: flex;
    /* Flexbox to align content */
    flex-direction: column;
    justify-content: flex-end;
    /* Push title to bottom */

    background-color: #f0f0f0;
    background-size: cover;
    background-position: center;

    overflow: hidden;
    text-decoration: none;
    aspect-ratio: 1 / 1.1;
    /* Proporción ligeramente vertical */
    border-bottom: 5px solid #f39c12;
    /* Color amarillo/naranja */
    padding: 20px;
    /* Padding direct on the card */
    box-sizing: border-box;

    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Hover effects */
.gr-cat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.gr-cat-card:hover {
    /* Optional: Slight zoom effect on background if supported, 
       but since bg is on the element itself, we can't scale just the image easily without a wrapper or pseudo.
       We'll skip the zoom for now or use background-size transition if desired, but that's expensive.
       Let's stick to the lift effect which is clean. */
}

/* Gradient Overlay via Pseudo-element (to ensure text readability) */
.gr-cat-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
    pointer-events: none;
    /* Let clicks pass through just in case */
    z-index: 1;
    height: 60%;
    /* Only cover bottom part */
    top: auto;
    /* Stick to bottom */
    bottom: 0;
}

/* Title Styling */
.gr-cat-card__title {
    position: relative;
    z-index: 2;
    /* Choose z-index > 1 to sit on top of gradient */
    margin: 0;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Ajustes Mobile */
@media (max-width: 767px) {
    .gr-cat-cards-grid {
        gap: 10px;
    }

    .gr-cat-card {
        padding: 12px;
    }

    .gr-cat-card__title {
        font-size: 0.95rem;
    }
}