body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f4f4f4;
    margin: 0;
}

.gallery {
    width: 90%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 📌 Base Item Styling */
.item {
    background: white;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.5s ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* 📌 Image - Small by Default */
.item img {
    width: 180px;
    height: auto;
    border-radius: 10px;
    transition: all 0.5s ease-in-out, transform 0.5s ease-in-out;
    transform: translateX(0);
}

/* 📌 Description - Initially Hidden */
.item .description {
    display: none;
    padding: 10px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* 📌 Expanded State */
.item.expanded {
    flex-direction: row;
    align-items: center;
    padding: 15px;
}

/* 📌 Image - Moves Left and Expands */
.item.expanded img {
    width: 40%;
    transform: translateX(-20%);
}

/* 📌 Description Becomes Visible */
.item.expanded .description {
    display: block;
    width: 60%;
    opacity: 1;
}

/* 📌 Smooth Height Expansion */
.item.expanded {
    height: auto;
}

/* 📌 Mobile Optimization */
@media (max-width: 768px) {
    .item {
        flex-direction: column;
        text-align: center;
    }

    .item.expanded {
        flex-direction: column;
    }

    .item.expanded img {
        width: 100%;
        transform: translateX(0);
    }

    .item.expanded .description {
        width: 100%;
    }
}
