.gallery-item {
    display: block;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow); 
    transition: var(--transition);
    height: 100%; 
}

.gallery-item:hover {
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.img-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    width: 100%;
    background-color: #ddd;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94); 
    display: block;
}

.gallery-item:hover img {
    transform: scale(1.15);
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 79, 148, 0.7), rgba(0, 0, 0, 0.8)); 
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(3px); 
    margin: 0;
    z-index: 2;
}

.gallery-item:hover .overlay {
    opacity: 1;
}

.overlay-content {
    text-align: center;
    color: var(--white);
    transform: translateY(30px); 
    transition: transform 0.4s ease;
    padding: 0 20px; 
}

.gallery-item:hover .overlay-content {
    transform: translateY(0); 
}

.overlay-content i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    display: block;
    color: var(--highlight-color); 
    background: rgba(255,255,255,0.9);
    width: 60px;
    height: 60px;
    line-height: 60px;
    border-radius: 50%;
    margin: 0 auto 15px auto;
}

.overlay-content span {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.95rem;
    letter-spacing: 1.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}


@media (max-width: 767px) {
    .gallery-item {
        border-bottom: 2px solid var(--bg-color); 
    }
}