/* Grid Container */
.bento-grid-1724 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 250px;
    gap: 20px;
    width: 100%;
}

/* Responsive Grid Base - Managed mostly by Elementor selectors, but safe fallback */
@media (max-width: 1024px) {
    .bento-grid-1724 {
        /* grid-template-columns: repeat(2, 1fr); Handled via Elementor Responsive Control */
    }
}
@media (max-width: 767px) {
    .bento-grid-1724 {
        /* grid-template-columns: 1fr; Handled via Elementor Responsive Control */
    }
}

/* Bento Item Base */
.bento-item-1724 {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    text-decoration: none !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: #f5f5f5; /* fallback */
    cursor: default;
    
    /* Default grid placement if spans aren't set */
    grid-column: span 1;
    grid-row: span 1;
}
a.bento-item-1724 {
    cursor: pointer;
}

/* Background Image Layer */
.bento-item-bg-1724 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.5s ease, filter 0.5s ease;
    z-index: 1;
}

/* Overlay Layer */
.bento-item-overlay-1724 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0) 100%);
    transition: background 0.3s ease, opacity 0.3s ease;
    z-index: 2;
}

/* Content Layer */
.bento-item-content-1724 {
    position: relative;
    z-index: 3;
    width: 100%;
    height: 100%;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* default bottom align */
    align-items: flex-start;
}

/* Badge */
.bento-item-badge-1724 {
    align-self: flex-start;
    margin-bottom: auto; /* Pushes it to the top when content is flex-end (bottom) */
    background-color: #ff0000;
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
}

/* Badge alignment when content is top-aligned */
.bento-item-content-1724[style*="justify-content: flex-start"] .bento-item-badge-1724 {
    margin-bottom: 15px;
}

/* Badge alignment when content is center-aligned */
.bento-item-content-1724[style*="justify-content: center"] .bento-item-badge-1724 {
    position: absolute;
    top: 30px;
    left: 30px;
    margin-bottom: 0;
}

/* Text Wrapper */
.bento-item-text-wrapper-1724 {
    width: 100%;
    transition: transform 0.3s ease;
}

/* Typography */
.bento-item-title-1724 {
    color: #ffffff;
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.bento-item-subtitle-1724 {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* --- Hover Animations --- */

/* Zoom In Effect */
.hover-anim-zoom-in .bento-item-1724:hover .bento-item-bg-1724 {
    transform: scale(1.08);
}

/* Zoom Out Effect */
.hover-anim-zoom-out .bento-item-bg-1724 {
    transform: scale(1.1);
}
.hover-anim-zoom-out .bento-item-1724:hover .bento-item-bg-1724 {
    transform: scale(1);
}

/* Text Lift effect on hover (enhancement from new code) */
.bento-item-1724:hover .bento-item-text-wrapper-1724 {
    transform: translateY(-5px);
}