/* ============================================
   GALERIA MASONRY
   ============================================ */

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    background: #f5f5f5;
    aspect-ratio: auto;
    height: 300px;
}

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

.portfolio-item:hover img {
    transform: scale(1.08);
}

.portfolio-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.8) 100%);
    padding: 20px;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.portfolio-overlay h3 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    color: #FF69B4;
}

.portfolio-overlay p {
    margin: 0;
    font-size: 0.9rem;
    color: #e0e0e0;
}

/* ============================================
   LIGHTBOX MODAL
   ============================================ */

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100dvw;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    overflow: hidden;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

.lightbox-info {
    width: 100%;
    color: white;
    text-align: center;
    padding: 20px 0;
    font-size: 1rem;
}

.lightbox-info h3 {
    margin: 0 0 5px 0;
    color: #FF69B4;
}

.lightbox-info p {
    margin: 0;
    color: #ccc;
    font-size: 0.9rem;
}

/* Controles */
.lightbox-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.lightbox-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

.lightbox-prev, .lightbox-next {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.3s ease;
}

.lightbox-prev:hover, .lightbox-next:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    color: white;
    font-size: 0.9rem;
}

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

/* Ver mais button */
.portfolio-show-more {
    display: none;
    width: 100%;
    margin-top: 16px;
    padding: 14px;
    background: none;
    border: 2px solid #FF69B4;
    border-radius: 8px;
    color: #FF69B4;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.portfolio-show-more:hover {
    background: #FF69B4;
    color: white;
}

@media (max-width: 768px) {
    .portfolio-show-more {
        display: block;
    }

    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .portfolio-item {
        height: 200px;
    }

    .portfolio-grid:not(.expanded) .portfolio-item:nth-child(n+13) {
        display: none;
    }

    .lightbox-content {
        width: 100%;
        max-height: 100vh;
        padding: 0;
    }

    .lightbox-image {
        max-height: 75vh;
        max-width: 100%;
        border-radius: 4px;
    }

    .lightbox-controls {
        top: 10px;
        right: 10px;
    }

    .lightbox-close,
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .lightbox-nav {
        padding: 0 8px;
    }
}
