/* ========================================
   GALLERY PAGE STYLES
   Modern Masonry Layout with Responsive Design
   ======================================== */

/* Gallery Hero Section */
.gallery-hero {
    padding: 6rem 0 3rem;
    background: linear-gradient(135deg, var(--light-color) 0%, var(--white) 100%);
    text-align: center;
}

.gallery-hero h1 {
    font-size: 3.5rem;
    color: var(--dark-color);
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease-out;
}

.gallery-intro {
    font-size: 1.2rem;
    color: var(--gray);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.8;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

/* Gallery Section */
.gallery-section {
    padding: 4rem 0;
    background-color: var(--white);
}

.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Masonry Gallery Layout */
.masonry-gallery {
    column-count: 3;
    column-gap: 1.5rem;
    margin: 0 auto;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background-color: var(--light-gray);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeIn 0.6s ease-out backwards;
}

/* Stagger animation for gallery items */
.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.15s; }
.gallery-item:nth-child(3) { animation-delay: 0.2s; }
.gallery-item:nth-child(4) { animation-delay: 0.25s; }
.gallery-item:nth-child(5) { animation-delay: 0.3s; }
.gallery-item:nth-child(6) { animation-delay: 0.35s; }
.gallery-item:nth-child(7) { animation-delay: 0.4s; }
.gallery-item:nth-child(8) { animation-delay: 0.45s; }
.gallery-item:nth-child(9) { animation-delay: 0.5s; }
.gallery-item:nth-child(10) { animation-delay: 0.55s; }
.gallery-item:nth-child(11) { animation-delay: 0.6s; }
.gallery-item:nth-child(12) { animation-delay: 0.65s; }
.gallery-item:nth-child(13) { animation-delay: 0.7s; }

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Gallery Overlay */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(58, 124, 165, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.overlay-content {
    color: var(--white);
    text-align: center;
}

.overlay-content i {
    font-size: 3rem;
    transition: transform 0.3s ease;
}

.gallery-item:hover .overlay-content i {
    transform: scale(1.2);
}

/* Lightbox Modal */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
    animation: zoomIn 0.3s ease;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid var(--white);
    color: var(--white);
    font-size: 2.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 10001;
}

.lightbox-close:hover {
    background: var(--white);
    color: var(--dark-color);
    transform: rotate(90deg);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid var(--white);
    color: var(--white);
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.lightbox-prev {
    left: 2rem;
}

.lightbox-next {
    right: 2rem;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--white);
    color: var(--dark-color);
    transform: translateY(-50%) scale(1.1);
}

/* Gallery CTA Section */
.gallery-cta {
    padding: 5rem 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    text-align: center;
    color: var(--white);
}

.gallery-cta h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--white);
}

.gallery-cta p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    background-color: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--white);
}

.btn-large:hover {
    background-color: transparent;
    color: var(--white);
    border-color: var(--white);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablet Landscape (1024px and below) */
@media (max-width: 1024px) {
    .masonry-gallery {
        column-count: 2;
        column-gap: 1.25rem;
    }
    
    .gallery-item {
        margin-bottom: 1.25rem;
    }
    
    .gallery-hero h1 {
        font-size: 3rem;
    }
    
    .gallery-intro {
        font-size: 1.1rem;
    }
}

/* Tablet Portrait (768px and below) */
@media (max-width: 768px) {
    .gallery-hero {
        padding: 4rem 0 2rem;
    }
    
    .gallery-hero h1 {
        font-size: 2.5rem;
    }
    
    .gallery-intro {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    .gallery-container {
        padding: 0 1rem;
    }
    
    .masonry-gallery {
        column-count: 2;
        column-gap: 1rem;
    }
    
    .gallery-item {
        margin-bottom: 1rem;
        border-radius: 6px;
    }
    
    .overlay-content i {
        font-size: 2.5rem;
    }
    
    .lightbox-close {
        top: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
        font-size: 2rem;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    .lightbox-prev {
        left: 1rem;
    }
    
    .lightbox-next {
        right: 1rem;
    }
    
    .gallery-cta h2 {
        font-size: 2rem;
    }
    
    .gallery-cta p {
        font-size: 1rem;
    }
}

/* Mobile (576px and below) */
@media (max-width: 576px) {
    .gallery-hero {
        padding: 3rem 0 1.5rem;
    }
    
    .gallery-hero h1 {
        font-size: 2rem;
    }
    
    .gallery-intro {
        font-size: 0.95rem;
    }
    
    .gallery-section {
        padding: 2rem 0;
    }
    
    .masonry-gallery {
        column-count: 1;
        column-gap: 0;
    }
    
    .gallery-item {
        margin-bottom: 1rem;
        border-radius: 4px;
    }
    
    .overlay-content i {
        font-size: 2rem;
    }
    
    .lightbox-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 40px;
        height: 40px;
        font-size: 1.8rem;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .lightbox-prev {
        left: 0.5rem;
    }
    
    .lightbox-next {
        right: 0.5rem;
    }
    
    .lightbox-content {
        max-width: 95%;
        max-height: 85%;
    }
    
    .gallery-cta {
        padding: 3rem 0;
    }
    
    .gallery-cta h2 {
        font-size: 1.75rem;
    }
    
    .gallery-cta p {
        font-size: 0.95rem;
        padding: 0 1rem;
    }
    
    .btn-large {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
}

/* Small Mobile (400px and below) */
@media (max-width: 400px) {
    .gallery-hero h1 {
        font-size: 1.75rem;
    }
    
    .gallery-intro {
        font-size: 0.9rem;
    }
    
    .gallery-cta h2 {
        font-size: 1.5rem;
    }
}

/* Active navigation link styling */
.nav-links a.active {
    color: var(--accent-color);
}

.nav-links a.active::after {
    width: 100%;
}
