.sarmila-main-gallery{
    background-color: #f8fafc;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    /* min-height: 100vh; */
 /* border: 1px solid red; */
}

/* ==========================================
   2. Grid Layout (Desktop Setup)
   ========================================== */
.sarmila-gallery-container {
    display: grid;
    /* width: 100%; */
    max-width: 1100px;
    gap: 16px;
    /* Defines a 4-column structure */
    grid-template-columns: repeat(4, 1fr);
    /* Sets standard explicit row heights */
    grid-template-rows: 160px 140px 160px;
}

/* Base style for all standard gallery slots */
.sarmila-gallery-item {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    position:relative;
    cursor:pointer;
    transition:.5s ease;
}

.sarmila-gallery-item img, 
.sarmila-gallery-sub-item img {
    width: 100%;
    height: 100%;
    /* object-fit: cover; */
    display: block;
    background-size: cover;
     transition:.6s;
}
/* ............................................................ */


/* Dark Overlay */
 .sarmila-gallery-item .ser-befo::before{
    content:"";
    position:absolute;
    width: 100%;
    height: 50%;
    bottom: 0;
     transition: all 0.9s ease-in-out;
   
}
.sarmila-gallery-sub-item .ser-befo::before{
   content:"";
    position:absolute;
    width: 100%;
    height: 50%;
    bottom: 0;
     transition: all 0.9s ease-in-out; 
}


.sarmila-gallery-item:hover .ser-befo::before{
  
    background: linear-gradient(
    to top,
    rgba(0, 12, 12, 1) 0%,
    rgba(2, 20, 20, 0.95) 20%,
    rgba(4, 35, 35, 0.80) 40%,
    rgba(6, 50, 50, 0.55) 60%,
    rgba(8, 65, 65, 0.25) 80%,
    rgba(8, 65, 65, 0.08) 92%,
    rgba(8, 65, 65, 0) 100%
);

}
.sarmila-gallery-sub-item:hover .ser-befo::before{
  
    background: linear-gradient(
    to top,
    rgba(0, 12, 12, 1) 0%,
    rgba(2, 20, 20, 0.95) 20%,
    rgba(4, 35, 35, 0.80) 40%,
    rgba(6, 50, 50, 0.55) 60%,
    rgba(8, 65, 65, 0.25) 80%,
    rgba(8, 65, 65, 0.08) 92%,
    rgba(8, 65, 65, 0) 100%
);

}


/* Arrow */
.ser-befo .arrow-btn{
    width:60px;
    height:60px;
    border-radius:50%;
    background:#fff;
    position:absolute;
    top:50%;
    left:50%;
    transform:translate(-50%,-50%);
    display:flex;
    justify-content:center;
    align-items:center;
    font-size:40px;
    color:#123d3d;
    opacity:0;
    transition:.5s;
    border-bottom:4px solid #d8ff2f;
   
}

/* Active State */

.sarmila-gallery-item:hover .arrow-btn{
    opacity:1;


}
.sarmila-gallery-sub-item:hover .arrow-btn{
     opacity:1;
}

/* Hover */
.sarmila-gallery-item:hover{
    transform:translateY(-12px);
}

.sarmila-gallery-item:hover img{
    transform:scale(1.08);
}

.sarmila-gallery-item:hover .arrow-btn{
    transform:translate(-50%,-50%) rotate(45deg);
}

.sarmila-gallery-sub-item:hover{
    transform:translateY(-12px);
}

.sarmila-gallery-sub-item:hover img{
    transform:scale(1.08);
}

.sarmila-gallery-sub-item:hover .arrow-btn{
    transform:translate(-50%,-50%) rotate(45deg);
}

/* ==========================================
   3. Precise Item Placements
   ========================================== */
.item-burger {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
}

.item-model {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
}

.item-food {
    grid-column: 1 / 3;
    grid-row: 2 / 4;
}

.item-tall {
    grid-column: 3 / 4;
    grid-row: 1 / 4;
}

.item-van {
    grid-column: 4 / 5;
    grid-row: 1 / 3;
}

/* Bottom Right Flex Split Row */
.sarmila-gallery-item-split {
    grid-column: 4 / 5;
    grid-row: 3 / 4;
    display: flex;
    gap: 16px;
}

/* Sub-items inside the split block take exactly 50% width */
.sarmila-gallery-sub-item {
    flex: 1;
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}



/* Blue Plus Tag Branding */
.item-more {
    background: linear-gradient(135deg, #2e5bfa, #123bc6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.more-overlay {
    color: #ffffff;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* ==========================================
   4. Responsive Breakpoints
   ========================================== */

/* Tablets & Small Laptops (under 950px) */
@media (max-width: 950px) {
    .sarmila-gallery-container {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        gap: 14px;
    }

    /* Reset strict positioning so items stack naturally */
    .sarmila-gallery-item {
        grid-column: auto !important;
        grid-row: auto !important;
        height: 240px;
    }

    /* Special behavior to maintain asymmetry nicely on tablet */
    .item-food {
        grid-column: span 2 !important;
        height: 300px;
    }

    .item-tall {
        grid-row: span 2 !important;
        height: 494px; /* Matches height of two items stacked + gap */
    }

    .sarmila-gallery-item-split {
        grid-column: auto !important;
        grid-row: auto !important;
        height: 240px;
        gap: 14px;
    }
}

/* Mobile Phones (under 550px) */
@media (max-width: 550px) {
    .sarmila-gallery-container {
        grid-template-columns: 1fr; /* Fallback to standard vertical stack */
        gap: 12px;
        padding: 10px;
    }

    .sarmila-gallery-item, 
    .item-food, 
    .item-tall {
        grid-column: auto !important;
        grid-row: auto !important;
        height: 220px !important;
    }

    .sarmila-gallery-item-split {
        height: 140px;
        gap: 12px;
    }
    
    .more-overlay {
        font-size: 1.4rem;
    }
}