/*
*   Mariscos Cabo Seafood - Gallery Page Styles
*/

/* Page Hero */
.page-hero {
    position: relative;
    height: 50vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    overflow: hidden;
    margin-top: 80px;
}

.page-hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 var(--spacing-md);
}

.page-hero-content .subtitle {
    font-size: 0.9rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.page-hero-content h1 {
    font-size: 3.5rem;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.page-hero-content p {
    font-size: 1.25rem;
    opacity: 0.9;
}

/* Gallery Filter */
.gallery-filter-section {
    background: var(--bg-light);
    padding: var(--spacing-md) 0;
    position: sticky;
    top: 80px;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    background: white;
    color: var(--text-color);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Gallery Masonry Grid */
.gallery-masonry {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    grid-auto-flow: dense;
}

.gallery-item {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1;
    min-height: 250px;
    background-color: #f0f0f0;
    display: block; /* Ensure items are visible by default */
}

.gallery-item.tall {
    grid-row: span 2;
    aspect-ratio: auto;
    min-height: 500px;
}

.gallery-item.wide {
    grid-column: span 2;
    aspect-ratio: 2/1;
    min-height: 250px;
}

.gallery-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item .gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 60%);
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-info {
    color: white;
}

.gallery-info h3 {
    font-size: 1.25rem;
    color: white;
    margin-bottom: 0.25rem;
}

.gallery-info p {
    font-size: 0.9rem;
    opacity: 0.8;
    margin: 0;
}

/* Instagram CTA */
.instagram-cta {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.instagram-cta h2 {
    color: white;
    margin-bottom: 1rem;
}

.instagram-cta p {
    opacity: 0.9;
    margin-bottom: var(--spacing-md);
}

.instagram-cta .btn i {
    margin-right: 0.5rem;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--border-radius);
}

.lightbox-caption {
    text-align: center;
    color: white;
    padding: 1rem;
}

.lightbox-caption h3 {
    color: white;
    margin-bottom: 0.25rem;
}

.lightbox-caption p {
    opacity: 0.8;
    margin: 0;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--primary-color);
}

.lightbox-close {
    top: 20px;
    right: 20px;
    font-size: 2rem;
}

.lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

/* Responsive */
@media (max-width: 991.98px) {
    .page-hero-content h1 {
        font-size: 2.5rem;
    }
    
    .gallery-item.wide {
        grid-column: span 1;
        aspect-ratio: 1;
    }
}

@media (max-width: 767.98px) {
    .page-hero {
        height: 40vh;
        min-height: 300px;
        margin-top: 60px;
    }
    
    .page-hero-content h1 {
        font-size: 2rem;
    }
    
    .gallery-filter-section {
        top: 60px;
        padding: 0.75rem 0;
    }
    
    .gallery-masonry {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .gallery-item {
        min-height: 150px;
    }
    
    .gallery-item.tall,
    .gallery-item.wide {
        grid-row: span 1;
        grid-column: span 1;
        aspect-ratio: 1;
        min-height: 150px;
    }
    
    .gallery-item img {
        display: block;
        width: 100%;
        height: 100%;
        min-height: 150px;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

