.card {
    width: 280px; /* Define uma largura fixa */
    height: 200px; /* Define uma altura fixa */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    padding: 7px;
    border-radius: 10px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
}

.btn-equipes {
    background-color: #6b3f2f; 
    color: white;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    padding: 0.5rem;
    border-radius: 20px;
    transition: all 0.2s ease;
    margin: 0.5rem auto 0;
    font-weight: 500;
    width: auto;
    min-width: 200px;
    transform-origin: center;
}

.btn-equipes:hover {
    color: white;
}

.card:hover .btn-equipes {
    background-color: #5c8c64;
    transform: scale(1);
}

.page-title {
    color: #cd6129;
    font-size: 2.5rem;
    font-weight: 600;
    text-align: left;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 1rem;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.5px;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 3%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(to right, #cd6129, #5c8c64);
    border-radius: 2px;
}

.subprojetos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3.4rem;
    padding: 1.5rem;
}

.subprojetos-grid .card:first-child {
    grid-column: 1 / -1;
    width: 106%;
    max-width: 51%;
    margin: 0 auto;
}

.card {
    background: #fff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    width: 106%;
    margin: 0 auto;
}

.card:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 8px 15px rgba(205, 96, 41, 0.165);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #cd6129, #5c8c64);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.card:hover::before {
    transform: scaleX(1);
}

.card-title {
    color: #4a220d;
    font-size: 1.4rem;
    margin: 0;
    padding: 0.8rem 0.5rem 0.5rem;
    font-weight: 600;
    position: relative;
    letter-spacing: 0.5px;
    line-height: 1.3;
    transition: color 0.3s ease;
    white-space: normal;
    word-wrap: break-word;
    max-width: 100%;
    justify-content: space-between;
}

/* Style for the main title text */
.card-title .main-text {
    display: block;
}

.card:hover .card-title {
    color: #491e09;
}

.categorias-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    justify-content: center;
    width: 100%;
    min-height: 46px;
    align-items: center;
}

.badge-categoria {
    background-color: #f8f9fa;
    color: #5c8c64;
    padding: 0.5em 1em;
    border-radius: 20px;
    font-size: 0.9rem;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #5c8c64;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-align: center;
    height: 32px;
    font-weight: 500;
}

.badge-categoria:hover {
    background-color: #5c8c64;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* For cards with multiple badges */
.card:has(.badge-categoria:nth-child(2)) .badge-categoria {
    flex: 1;
    margin: auto;
}

/* For cards with a single badge */
.card:not(:has(.badge-categoria:nth-child(2))) .badge-categoria {
    width: 50%;
    margin-top: auto;
}

.card-content {
    padding: 0 1rem 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

@media (max-width: 992px) {
    .subprojetos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .subprojetos-grid {
        grid-template-columns: 1fr;
    }
    
    .card {
        max-width: 100%;
    }
}