* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    height: 100vh;
    display: grid;
    place-items: center;
    background-color: #f4f4f4;
}

.gallery-set {
    display: flex;
    justify-content: space-around;
    width: 100%;
    flex-wrap: wrap;
    gap: 40px;
}

/* 📌 Common gallery styling */
.gallery {
    position: relative;
    width: 760px;
    height: 305px;
}

/* 📷 Ensuring images fit without overflow */
.gallery .item {
    position: absolute;
    width: 175px;
    height: 150px;
    overflow: hidden;
    transition: transform 0.9s, width 0.9s, height 0.9s;
}

.gallery .item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures images don't stretch */
    border-radius: 8px;
}

/* 🎭 First Image Takes Focus */
.gallery div[data-pos="0"] {
    width: 500px;
    height: inherit;
    z-index: 10;
}

/* 🚀 Positioning Logic */
.gallery div[data-pos="0"] { transform: translate(0, 0); }
.gallery div[data-pos="1"] { transform: translate(520px, 0); }
.gallery div[data-pos="2"] { transform: translate(705px, 0); }
.gallery div[data-pos="3"] { transform: translate(520px, 155px); }
.gallery div[data-pos="4"] { transform: translate(705px, 155px); }

/* 📱 Responsive Design */
@media (max-width: 800px) {
    .gallery {
        width: 405px;
        height: 660px;
    }

    .gallery .item {
        width: 180px;
        height: 140px;
    }

    .gallery div[data-pos="0"] {
        width: 100%;
        height: 350px;
    }

    div[data-pos="1"] { transform: translate(0, 355px); }
    div[data-pos="2"] { transform: translate(205px, 355px); }
    div[data-pos="3"] { transform: translate(0, 510px); }
    div[data-pos="4"] { transform: translate(205px, 510px); }
}
