/* ============================================
   GALLERY STANDALONE - With Montserrat & Be Vietnam Pro
   ============================================ */

/* Import fonts from Google */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;800&family=Be+Vietnam+Pro:wght@400;500;700&display=swap');

/* Gallery container */
.gallery-section {
    background: #ffffff;
    padding: 6rem 0;
}

.gallery-section .container {
    max-width: 1280px;
    padding: 0 1.5rem;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .gallery-section .container {
        padding: 0 2.5rem;
    }
}

/* Typography - matching original */
.gallery-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 28px;
    line-height: 1.2;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .gallery-title {
        font-size: 32px;
    }
}

.gallery-subtitle {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.6;
    color: #4a4455;
}

.gallery-tag {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.gallery-item-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 18px;
    line-height: 1.2;
}

/* Masonry layout */
.gallery-masonry {
    column-count: 1;
    column-gap: 1.5rem;
}

@media (min-width: 640px) {
    .gallery-masonry {
        column-count: 2;
    }
}

@media (min-width: 1024px) {
    .gallery-masonry {
        column-count: 3;
    }
}

.gallery-masonry-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
}

/* Gallery card styles - matching original */
.gallery-card {
    position: relative;
    border-radius: 2rem;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
    cursor: pointer;
}

.gallery-card:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.gallery-card img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.7s ease;
}

.gallery-card:hover img {
    transform: scale(1.1);
}

/* Overlay on hover - using tertiary color (#007184) as in your example */
.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 113, 132, 0.8), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
}

@media (max-width: 768px) {
    .gallery-overlay {
        padding: 1.5rem;
    }
}

.gallery-card:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay .tag {
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 12px;
    line-height: 1;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.gallery-overlay .title {
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 18px;
    line-height: 1.2;
}

/* Different overlay colors per category (optional) */
.gallery-card[data-category="branding"] .gallery-overlay {
    background: linear-gradient(to top, rgba(99, 14, 212, 0.8), transparent);
}

.gallery-card[data-category="web"] .gallery-overlay {
    background: linear-gradient(to top, rgba(0, 113, 132, 0.8), transparent);
}

/* Filter buttons */
.gallery-filters-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.5rem;
    background: #f2f3ff;
    border-radius: 9999px;
    border: 1px solid #ccc3d8;
}

.gallery-filter-btn {
    padding: 0.5rem 1.5rem;
    border-radius: 9999px;
    border: none;
    background: transparent;
    color: #4a4455;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: all 0.2s ease;
    cursor: pointer;
}

.gallery-filter-btn.active {
    background: #630ed4;
    color: white;
}

.gallery-filter-btn:hover:not(.active) {
    background: rgba(99, 14, 212, 0.1);
}

/* Lightbox */
.gallery-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    cursor: pointer;
}

.gallery-lightbox.active {
    display: flex;
}

.gallery-lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.gallery-lightbox .close-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    border: none;
    color: white;
    font-size: 2rem;
    padding: 0.5rem 1rem;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
    line-height: 1;
}

.gallery-lightbox .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive */
@media (max-width: 640px) {
    .gallery-filters-wrapper {
        border-radius: 1.5rem;
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .gallery-filter-btn {
        padding: 0.4rem 1rem;
        font-size: 12px;
    }
    
    .gallery-overlay {
        padding: 1.5rem;
    }
    
    .gallery-overlay .title {
        font-size: 16px;
    }
    
    .gallery-title {
        font-size: 24px;
    }
}

@media (min-width: 641px) and (max-width: 1023px) {
    .gallery-filters-wrapper {
        justify-content: center;
    }
}

/* Layout helpers */
.gallery-header {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 4rem;
    gap: 2rem;
}

@media (min-width: 768px) {
    .gallery-header {
        flex-direction: row;
        align-items: flex-end;
    }
}

.gallery-header-left {
    flex: 1;
}

.gallery-header-right {
    flex-shrink: 0;
}

/* Animation for filter */
.gallery-masonry-item {
    transition: opacity 0.3s ease, transform 0.3s ease;
}