.modern-gallery-latest {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px;
    background: linear-gradient(145deg, #f8fafc, #ffffff);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.modern-gallery-latest-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 250px);
    gap: 24px;
    margin-bottom: 30px;
}

.modern-gallery-main-image {
    grid-column: span 2;
    grid-row: span 2;
    position: relative;
    height: 100%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-gallery-side-image {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-gallery-main-image:hover,
.modern-gallery-side-image:hover {
    transform: translateY(-5px);
}

.modern-gallery-image {
    height: 100%;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.modern-gallery-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 60%, rgba(0, 0, 0, 0.6));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.modern-gallery-image:hover::before {
    opacity: 1;
}

.modern-gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-gallery-image:hover img {
    transform: scale(1.08);
}

.modern-gallery-view-more {
    text-align: center;
    margin-top: 40px;
}

.modern-gallery-view-more .button {
    display: inline-block;
    padding: 16px 36px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(145deg, #1e3a8a, #1e40af);
    border: none;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(30, 58, 138, 0.2);
    position: relative;
    overflow: hidden;
}

.modern-gallery-view-more .button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: 0.5s;
}

.modern-gallery-view-more .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 58, 138, 0.3);
}

.modern-gallery-view-more .button:hover::before {
    left: 100%;
}

/* Modal styles */
.modern-gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    padding: 40px;
    backdrop-filter: blur(8px);
}

.modern-gallery-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modern-gallery-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
}

.modern-gallery-modal-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modern-gallery-modal-caption {
    position: absolute;
    bottom: -40px;
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    padding: 15px;
    font-size: 16px;
    font-weight: 500;
}

.modern-gallery-modal-prev,
.modern-gallery-modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.modern-gallery-modal-prev:hover,
.modern-gallery-modal-next:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.modern-gallery-modal-prev {
    left: -80px;
}

.modern-gallery-modal-next {
    right: -80px;
}

.modern-gallery-modal-close {
    position: absolute;
    top: -50px;
    right: -50px;
    background: none;
    border: none;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    padding: 10px;
    transition: transform 0.3s ease;
}

.modern-gallery-modal-close:hover {
    transform: scale(1.1);
    color: #f3f4f6;
}

@media (max-width: 1024px) {
    .modern-gallery-latest-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        gap: 20px;
    }

    .modern-gallery-main-image {
        grid-column: span 2;
        grid-row: span 1;
        height: 400px;
    }

    .modern-gallery-side-image {
        height: 200px;
    }

    .modern-gallery-modal-prev {
        left: 20px;
    }

    .modern-gallery-modal-next {
        right: 20px;
    }
}

@media (max-width: 768px) {
    .modern-gallery-latest {
        padding: 20px;
    }

    .modern-gallery-latest-grid {
        gap: 15px;
    }

    .modern-gallery-main-image {
        height: 300px;
    }

    .modern-gallery-side-image {
        height: 150px;
    }

    .modern-gallery-view-more .button {
        padding: 14px 30px;
        font-size: 15px;
    }
}