.portfolio-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: flex-start;
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
    flex: 1 0 calc(25% - 20px); /* Default for 4 columns, overridden by Elementor */
    max-width: calc(25% - 20px);
}

@media (max-width: 1024px) {
    .portfolio-item {
        flex: 1 0 calc(33.33% - 20px);
        max-width: calc(33.33% - 20px);
    }
}

@media (max-width: 767px) {
    .portfolio-item {
        flex: 1 0 calc(50% - 20px);
        max-width: calc(50% - 20px);
    }
}

@media (max-width: 480px) {
    .portfolio-item {
        flex: 1 0 100%;
        max-width: 100%;
    }
}

.portfolio-item:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.screenshot-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 400px; /* Default, overridden by Elementor control */
}

.screenshot-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease; /* For smooth start/stop */
    will-change: transform;
}

.portfolio-item h3 {
    margin: 10px 0 0;
    padding: 10px;
    text-align: center;
    font-size: 18px;
}

.portfolio-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.portfolio-filters li {
    cursor: pointer;
    margin: 5px 10px;
    padding: 5px 10px;
    transition: all 0.3s ease;
}

.portfolio-filters li.active {
    font-weight: bold;
}