/* Filter Styles */

.projects-filters {
    text-align: center;
    margin-bottom: 40px;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.button-filter {
    --color-on-button: var(--color-on-surface-variant);
    --color-button: var(--color-surface-variant);
    --color-button-hover: var(--color-on-surface-variant);
    --color-button-on-hover: var(--color-surface-variant);
}

.button-filter.active {
    --color-on-button: var(--color-on-primary-container);
    --color-button: var(--color-primary-container);
    --color-button-hover: var(--color-on-primary-container);
    --color-button-on-hover: var(--color-primary-container);
}

/* Project Grid Styles */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    padding: 12px;
    margin: 0 auto;
}

.project-card {
    position: relative;
    background-color: var(--color-surface-container-lowest);
    border-radius: 12px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    -webkit-user-select: none;
    user-select: none;
}

.project-card.hidden {
    display: none;
}

.project-card input[type="checkbox"] {
    display: none;
}

.project-images {
    position: relative;
    width: 100%;
    padding-bottom: 75%;
    height: 0;
    overflow: hidden;
}

.project-images img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-comparison {
    width: 100%;
    height: 100%;
}

.image-comparison .before-image,
.image-comparison .after-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.5s ease;
}

.image-comparison .before-image {
    opacity: 1;
    z-index: 2;
}

.image-comparison .after-image {
    opacity: 0;
    z-index: 1;
}

.project-info {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-info h3 {
    margin-top: 0;
    margin-bottom: 12px;
}

.project-info .project-location {
    display: none;
}

.project-info .project-location,
.project-info .project-services {
    font-size: 12px;
    color: var(--color-surface-tint);
    margin-bottom: 6px;
}

.project-info .project-description {
    font-size: 12px;
    line-height: 1.5;
    flex-grow: 1;
    margin-bottom: 12px;
}

.project-info .button {
    display: inline-block;
    padding: 10px 15px;
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    text-align: center;
    margin-top: auto;
    transition: background-color 0.3s ease;
}

.project-info .button:hover {
    background-color: #45a049;
}

/* Responsive Styles */

@media (pointer: fine) {
    .project-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    }

    .project-card:hover .image-comparison .before-image {
        opacity: 0;
    }

    .project-card:hover .image-comparison .after-image {
        opacity: 1;
    }

    .project-card .project-info label {
        display: none;
    }
}

@media (pointer: coarse) {
    .project-card input[type="checkbox"]:checked~.image-comparison .before-image {
        opacity: 0;
    }

    .project-card input[type="checkbox"]:checked~.image-comparison .after-image {
        opacity: 1;
    }

    .project-card .project-info label {
        width: fit-content;
        background: rgba(from var(--color-tertiary-container) r g b / 0.4);
        color: var(--color-on-tertiary-container);
        margin: 0 0 12px auto;
        padding: 3px 6px;
        border-radius: 6px;
        font-size: 12px;
    }
}

@media screen and (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .project-card {
        flex-direction: column;
    }

    .project-images {
        padding-bottom: 60%;
    }

    .project-info {
        padding: 12px;
    }
}

@media screen and (max-width: 400px) {}