/* Equal tracks keep every catalog card the same size across all rows. */
#projects-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: 1fr;
    gap: 1.5rem;
    margin: 0;
}

#projects-grid > .column {
    width: auto;
    min-width: 0;
    padding: 0;
}

#projects-grid .card {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-bottom: 0;
    border-top-width: 6px;
    border-top-style: solid;
    overflow: hidden;
}

#projects-grid .card:not(.project-quality-card) {
    border-top-color: transparent;
}

#projects-grid .card-image {
    flex-shrink: 0;
    background-color: #f6f4f0;
}

#projects-grid .card-image img {
    object-fit: cover;
}

#projects-grid .card-content {
    flex: 1;
    overflow-wrap: anywhere;
}

@media (min-width: 769px) {
    #projects-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    #projects-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Apply the keyword palette to the full card, including empty image areas. */
#projects-grid .project-quality-card {
    border-top-width: 6px;
    border-top-style: solid;
    overflow: hidden;
}

.project-quality-label {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    margin-bottom: 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

#projects-grid .project-quality-card {
    color: #111;
}

#projects-grid .project-quality-card.air_pollution_bg_primary {
    color: var(--air_pollution_foreground);
}

#projects-grid .project-quality-card .card-image {
    background-color: inherit;
}

#projects-grid .project-quality-card .title,
#projects-grid .project-quality-card .title a {
    color: inherit;
}

#projects-grid .project-quality-card .title a:hover {
    text-decoration: underline;
}
