/* Gallery Page Styles */

/* Page Banner */
.page-banner {
    position: relative;
    height: 300px;
    background: linear-gradient(to right, #004A99, #0066CC, #FF8C00);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    margin-top: 80px;
}

.page-banner .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.page-banner .container {
    position: relative;
    z-index: 2;
}

.page-banner h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.page-banner p {
    font-size: 1.2rem;
    font-weight: 300;
}

/* Gallery Grid */
.gallery {
    padding: 80px 0;
    background-color: var(--light-color);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    height: 300px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    background-color: white;
    transform-origin: center center;
    cursor: pointer;
}

.gallery-item a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s;
}

.gallery-item:hover img {
    transform: scale(1.05);
    transform-origin: center center; /* Ensure image scales from center */
}

.gallery-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    transform: translateY(0);
    transition: transform 0.3s ease;
    z-index: 2; /* Add z-index to ensure info stays above the image */
}

.gallery-item:hover .gallery-info {
    transform: translateY(0); /* Change from -10px to 0 to prevent gap */
    bottom: 0; /* Ensure it stays at the bottom */
}

.gallery-info h3 {
    margin-bottom: 5px;
    font-size: 1.3rem;
}

.gallery-info p {
    margin-bottom: 10px;
    font-size: 0.95rem;
    opacity: 0.9;
}

.view-project {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--secondary-color);
    padding-bottom: 2px;
    border-bottom: 1px solid var(--secondary-color);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease 0.1s;
    cursor: pointer; /* Add cursor pointer to indicate it's clickable */
    margin-bottom: 0; /* Prevent any margin at the bottom */
    position: relative; /* Add position to control the animation better */
    bottom: 0; /* Ensure it stays at the bottom */
}

.gallery-item:hover .view-project {
    opacity: 1;
    transform: translateY(0);
}

/* Add a hover effect for the view-project button */
.view-project:hover {
    color: white;
    border-bottom-color: white;
}

/* Special styling for touch devices */
.gallery-item.touch-device .view-project {
    opacity: 1;
    transform: translateY(0);
}

/* CTA Section */
.cta-section {
    padding: 80px 0;
    background-color: var(--primary-color);
    color: white;
    text-align: center;
}

.cta-content h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.cta-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.cta-content .btn {
    background-color: white;
    color: var(--primary-color);
    border: 2px solid white;
    padding: 15px 40px;
    font-size: 1.1rem;
}

.cta-content .btn:hover {
    background-color: transparent;
    color: white;
}

/* Lightbox customization */
.lb-data .lb-caption {
    font-size: 1rem;
    font-weight: 400;
}

.lb-data .lb-details {
    width: 90%;
    text-align: center;
}

/* Custom Modal Styles */
.gallery-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: background-color 0.3s ease;
}

.gallery-modal.active {
    background-color: rgba(0, 0, 0, 0.95);
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.gallery-modal.active .modal-content {
    opacity: 1;
    transform: scale(1);
}

.modal-image {
    display: block;
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.close-modal {
    position: fixed;
    top: 30px;
    right: 40px;
    color: white;
    font-size: 45px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10001;
    width: 45px;
    height: 45px;
    line-height: 40px;
    text-align: center;
    opacity: 0.8;
}

.close-modal:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.modal-caption {
    margin-top: 20px;
    color: white;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* Responsive modal adjustments */
@media screen and (max-width: 768px) {
    .modal-content {
        max-width: 95%;
    }
    
    .modal-image {
        max-height: 75vh;
    }
    
    .close-modal {
        top: 20px;
        right: 20px;
        font-size: 35px;
        width: 35px;
        height: 35px;
        line-height: 30px;
        opacity: 1;
        z-index: 10001;
    }
    
    .modal-caption {
        font-size: 1rem;
    }
}

/* Responsive Styles */
@media screen and (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .page-banner h1 {
        font-size: 2.5rem;
    }
}

@media screen and (max-width: 768px) {
    .page-banner {
        height: 250px;
        margin-top: 70px;
    }
    
    .page-banner h1 {
        font-size: 2rem;
    }
    
    .page-banner p {
        font-size: 1.1rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .cta-content h2 {
        font-size: 2rem;
    }
    
    .gallery {
        padding: 60px 0;
    }
}

@media screen and (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-item {
        height: 250px;
    }
    
    .page-banner {
        height: 200px;
        margin-top: 60px;
    }
    
    .page-banner h1 {
        font-size: 1.8rem;
    }
    
    .page-banner p {
        font-size: 1rem;
    }
    
    .cta-content h2 {
        font-size: 1.7rem;
    }
    
    .cta-content p {
        font-size: 1rem;
    }
    
    .cta-content .btn {
        padding: 12px 30px;
        font-size: 1rem;
    }
    
    .gallery {
        padding: 40px 0;
    }
}