/* Your existing CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Source Sans 3', sans-serif ;   
    font-size: 16px;
    font-weight: 600;
    color: #59607d;
    cursor: pointer;
    text-decoration: none;
    position: relative;
    transition: all 0.6s;
}
.nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}
.nav a {
    text-decoration: none;
    color: #666;
    font-size: 14px;
    padding: 5px 10px;
    border-radius: 15px;
    transition: all 0.3s ease;
}
.nav a:hover {
    background-color: #f0f0f0;
    color: #333;
}
.nav a.active {
    background-color: #333;
    color: white;
}
.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 1400px;
    margin: 20px auto; /* Add margin-top to create space */
}
.gallery-item {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.5s ease 0.2s;
    animation: slideIn 0.8s ease-out forwards;
    opacity: 0;
    width: 100%; /* Ensure it takes full width */
    height: 100%; /* Ensure it takes full height */
}
.gallery-item.large {
    grid-column: span 2;
    grid-row: span 2;
}
.image-container {
    position: relative;
    width: 100%; /* Full width of .gallery-item */
    height: 100%; /* Full height of .gallery-item */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}
.covert {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%; /* Full width of .image-container */
    height: 100%; /* Full height of .image-container */
    object-fit: cover; /* Cover the entire container */
    border-radius: 20px; /* Match the gallery item's border radius */
    opacity: 0; /* Hidden by default */
    transition: opacity 0.3s ease;
}
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay p {
    padding-top: 5px;
    font-family: "Open Sans", sans-serif;
    font-size: 16px;
    line-height: 26px;
    font-weight: 300;
    color: #fff;
    margin: 16px 0;
}
.gallery-item:hover .covert,
.gallery-item:hover .overlay {
    opacity: 1; /* Show on hover */
}
@keyframes slideIn {
    0% {
        opacity: 0;
        transform: translateX(-100%) translateY(-100%);
    }
    100% {
        opacity: 1;
        transform: translateX(0) translateY(0);
    }
}
@media (max-width: 1200px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    .gallery-item.large {
        grid-column: span 1;
    }
}
@media (max-width: 768px) {
    .gallery {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .image-container {
        padding: 30px;
    }
    .nav {
        justify-content: center;
    }
    .nav a {
        font-size: 13px;
        padding: 4px 8px;
    }
}
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    .image-container {
        padding: 20px;
    }
}