/**
 * Grid Cards Styles
 * 
 * @package Clayutility
 * @version 1.0
 */

/* ===== Grid Cards ===== */
.grid-cards {
    padding: 22px 0;
}

.grid-cards__wrapper {
    padding: 0;
}

.grid-cards__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-black);
    margin-bottom: 1.5rem;
    text-align: center;
}

.grid-cards__list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.grid-cards__item > .card__link-wrapper {
    display: block;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.grid-cards__item > .card__link-wrapper * {
    text-decoration: none;
}

.grid-cards .card {
    background: var(--color-white);
    padding: 18px;
    height: 100%;
    display: grid;
    align-content: start;
    gap: 10px;
    border-radius: 30px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.grid-cards .card:hover,
.grid-cards__item > .card__link-wrapper:hover .card {
    transform: translateY(-2px);
    background: var(--color-blue);
    color: var(--color-white);
}

.grid-cards .card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.grid-cards .card__icon img {
    max-width: 80px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.grid-cards .card__title {
    margin: 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-black);
    text-align: center;
    transition: color 0.2s ease;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.grid-cards .card__desc {
    color: var(--color-gray-600);
    margin: 0 0 .3rem;
    text-align: center;
    transition: color 0.2s ease;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.grid-cards .card__link {
    font-weight: 600;
    color: var(--color-blue);
    text-decoration: none;
    transition: color 0.2s ease;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.grid-cards .card__link:hover {
    color: var(--color-magenta);
}

.grid-cards .card:hover .card__title,
.grid-cards .card:hover .card__desc,
.grid-cards .card:hover .card__link,
.grid-cards__item > .card__link-wrapper:hover .card .card__title,
.grid-cards__item > .card__link-wrapper:hover .card .card__desc,
.grid-cards__item > .card__link-wrapper:hover .card .card__link {
    color: var(--color-white);
}

/* Responsive Grid Cards */
@media (max-width: 1366px) {
    .grid-cards__list {
        gap: 12px;
    }
}

@media (max-width: 1100px) {
    .grid-cards__list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 680px) {
    .grid-cards__list {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    /* Center last element when odd (left alone) */
    .grid-cards__item:last-child:nth-child(odd) {
        grid-column: 1 / -1;
        justify-self: center;
        max-width: calc(50% - 5px); /* Width of one column minus half the gap */
    }
}

@media (max-width: 480px) {
    .grid-cards__list {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    /* On mobile, items always occupy 100% width, regardless of whether it's odd or last */
    .grid-cards__item:last-child:nth-child(odd) {
        grid-column: 1;
        justify-self: stretch;
        max-width: 100%;
    }
}