/* --- Showcase Masonry Page Styles --- */

.showcase-hero {
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 120px 5% 4rem;
}

.showcase-hero h1 {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* --- Filter Buttons --- */
.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 4rem;
    padding: 0 5%;
}

.filter-btn {
    padding: 10px 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    border-radius: 50px;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: var(--text-dark);
}

/* --- TRUE MASONRY LAYOUT using column-count --- */
.masonry-grid {
    padding: 0 5% 5rem;
    column-count: 4; /* Default for standard desktop */
    column-gap: 1.5rem;
}

.grid-item {
    margin-bottom: 1.5rem;
    /* This is the magic property that prevents items from splitting across columns */
    break-inside: avoid;
    display: block;
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.4s ease, transform 0.4s ease, width 0.4s ease; /* Added width transition */
}

/* Hide and shrink items that are filtered out */
.grid-item.hidden {
    opacity: 0;
    transform: scale(0.9);
    width: 0; /* Animate width to 0 for reflow */
    margin-bottom: 0; /* Remove margin for hidden items */
    pointer-events: none;
}


.grid-item video {
    width: 100%;
    height: auto; /* Let the video's natural aspect ratio determine the height */
    border: none;
    border-radius: 15px;
    display: block; /* Removes any extra space below the video */
}

/* --- Responsive Column Control --- */
@media screen and (min-width: 1400px) {
    .masonry-grid {
        column-count: 5; /* Simplified for better aesthetics */
    }
}

@media screen and (max-width: 1199px) {
    .masonry-grid {
        column-count: 3;
    }
}

@media screen and (max-width: 767px) {
    .showcase-hero h1 {
        font-size: 2.5rem;
    }
    .masonry-grid {
        column-count: 2;
        column-gap: 1rem;
    }
    .grid-item {
        margin-bottom: 1rem;
    }
}