.card-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: -15px;
}

.card-wrapper {
    padding: 15px;
    display: flex;
    justify-content: center;
    transition: width 0.3s ease, max-width 0.3s ease;
}

.card {
    width: 100%;
    max-width: 13rem;
    height: 16rem;
    border: none;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease-in-out, height 0.3s ease, max-width 0.3s ease;
    margin: 0 auto;
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: height 0.3s ease;
}

.card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.31);
    z-index: 1;
    transition: background 0.3s ease;
}

.card-body {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    color: white;
    text-align: center;
    padding: 10px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    transition: padding 0.3s ease;
}

.card-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin-top: 10px;
    transition: font-size 0.3s ease;
}

.btn-custom {
    background-color: #B3E5E9;
    color: #000;
    font-weight: 600;
    border: none;
    padding: 10px 20px;
    margin-bottom: 20px;
    transition: background-color 0.3s ease, color 0.3s ease, padding 0.3s ease, font-size 0.3s ease;
}

.btn-custom:hover {
    background-color: #0056b3;
}

.btn-custom:hover {
    background-color: #0056b3;
    color: #FFF;
}

.card:hover {
    transform: scale(1.03);
}

@media (max-width: 576px) {
    .card-wrapper {
        width: 50%;  /* 2 kartu per baris pada layar <576px */
        max-width: 12rem;
    }

    .card {
        height: 12rem;
        max-width: 12rem;
    }

    .card-title {
        font-size: 1rem;
    }

    .btn-custom {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .card {
        height: 15rem;
    }
}