/* ==================== GALLERY SECTION ==================== */
.portfolio-gallery {
    padding: 4rem 0 6rem;
    background: var(--primary-white);
    min-height: 50vh;
}

/* Masonry Grid Layout */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* Gallery Item */
.gallery-item {
    opacity: 1;
    transform: scale(1);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
    position: absolute;
    visibility: hidden;
}

.gallery-item:nth-child(3n + 1) {
    grid-row: span 2;
}

.gallery-item:nth-child(5n + 2) {
    grid-row: span 1;
}

/* Gallery Card */
.gallery-card {
    position: relative;
    height: 100%;
    background: var(--primary-white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-subtle);
    border: 1px solid var(--border-light);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-magenta-strong);
    border-color: var(--magenta);
}

/* Image Wrapper */
.gallery-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 280px;
    overflow: hidden;
}

.gallery-item:nth-child(3n + 1) .gallery-image-wrapper {
    min-height: 580px;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-card:hover .gallery-image {
    transform: scale(1.08);
}

/* Gallery Overlay */
.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            transparent 0%,
            transparent 40%,
            rgba(0, 0, 0, 0.8) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 2rem;
}

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

/* Gallery Actions */
.gallery-actions {
    /* display and gap now handled by Bootstrap classes */
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.gallery-card:hover .gallery-actions {
    transform: translateY(0);
}

.gallery-action-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: var(--primary-white);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-action-btn:hover {
    background: var(--gradient-magenta);
    border-color: var(--magenta);
    transform: scale(1.1);
    box-shadow: var(--shadow-magenta);
}

/* Gallery Info */
.gallery-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.85) 0%,
            rgba(0, 0, 0, 0.6) 50%,
            transparent 100%);
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.gallery-card:hover .gallery-info {
    transform: translateY(0);
}

.gallery-category-tag {
    display: inline-block;
    background: var(--gradient-magenta);
    color: var(--text-on-magenta);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.gallery-title {
    color: var(--primary-white);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.gallery-description {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
}

/* No Results */
.no-results {
    /* text-align and padding now handled by Bootstrap classes */
    color: var(--text-secondary);
}

.no-results i {
    font-size: 4rem;
    color: var(--border-light);
    margin-bottom: 1.5rem;
}

.no-results h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.no-results p {
    font-size: 1rem;
    opacity: 0.7;
}

/* ==================== CTA SECTION ==================== */
.portfolio-cta {
    padding: 5rem 0;
    background: linear-gradient(135deg, var(--dark-charcoal) 0%, #1a1a2e 100%);
}

.cta-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    flex-wrap: wrap;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    backdrop-filter: blur(20px);
}

.cta-content {
    flex: 1;
    min-width: 300px;
}

.cta-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-white);
    margin-bottom: 0.75rem;
}

.cta-text {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    line-height: 1.6;
}

.cta-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.cta-actions .btn {
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.cta-actions .btn-outline {
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--primary-white);
    background: transparent;
}

.cta-actions .btn-outline:hover {
    border-color: var(--primary-white);
    background: rgba(255, 255, 255, 0.1);
}

.cta-actions .btn-primary {
    background: var(--gradient-magenta);
    color: var(--primary-white);
    border: none;
    box-shadow: 0 8px 30px rgba(255, 0, 162, 0.4);
}

.cta-actions .btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 40px rgba(255, 0, 162, 0.5);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .gallery-item:nth-child(3n + 1) {
        grid-row: span 1;
    }

    .gallery-item:nth-child(3n + 1) .gallery-image-wrapper {
        min-height: 280px;
    }
}

@media (max-width: 768px) {
    .portfolio-gallery {
        padding: 3rem 0 4rem;
    }

    .gallery-image-wrapper {
        min-height: 220px;
    }

    .gallery-action-btn {
        width: 48px;
        height: 48px;
        font-size: 1rem;
    }

    .cta-wrapper {
        flex-direction: column;
        text-align: center;
        padding: 2rem;
    }

    .cta-title {
        font-size: 1.5rem;
    }

    .cta-actions {
        justify-content: center;
        width: 100%;
    }

    .cta-actions .btn {
        flex: 1;
        min-width: 140px;
    }
}

@media (max-width: 576px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 0.5rem;
    }

    .gallery-image-wrapper {
        min-height: 260px;
    }

    /* Always show info on mobile - no hover needed */
    .gallery-info {
        padding: 1rem;
        transform: translateY(0);
        opacity: 1;
    }
    
    .gallery-overlay {
        opacity: 1;
        background: linear-gradient(180deg,
            transparent 0%,
            transparent 50%,
            rgba(0, 0, 0, 0.85) 100%);
    }
    
    .gallery-actions {
        transform: translateY(0);
    }

    .gallery-title {
        font-size: 1.1rem;
    }
    
    .gallery-description {
        font-size: 0.85rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .gallery-action-btn {
        width: 44px;
        height: 44px;
        font-size: 0.95rem;
    }
}

/* Extra small devices (320px and below) */
@media (max-width: 320px) {
    .gallery-grid {
        padding: 0 0.25rem;
        gap: 0.75rem;
    }
    
    .gallery-image-wrapper {
        min-height: 220px;
    }
    
    .gallery-info {
        padding: 0.75rem;
    }
    
    .gallery-title {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }
    
    .gallery-description {
        font-size: 0.8rem;
        -webkit-line-clamp: 1;
    }
    
    .gallery-category-tag {
        font-size: 0.65rem;
        padding: 0.2rem 0.6rem;
        margin-bottom: 0.5rem;
    }
    
    .gallery-action-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-item {
    animation: fadeInUp 0.6s ease forwards;
}

.gallery-item:nth-child(1) {
    animation-delay: 0.05s;
}

.gallery-item:nth-child(2) {
    animation-delay: 0.1s;
}

.gallery-item:nth-child(3) {
    animation-delay: 0.15s;
}

.gallery-item:nth-child(4) {
    animation-delay: 0.2s;
}

.gallery-item:nth-child(5) {
    animation-delay: 0.25s;
}

.gallery-item:nth-child(6) {
    animation-delay: 0.3s;
}

.gallery-item:nth-child(7) {
    animation-delay: 0.35s;
}

.gallery-item:nth-child(8) {
    animation-delay: 0.4s;
}

.gallery-item:nth-child(n+9) {
    animation-delay: 0.45s;
}