/**
 * [term_grid] shortcode
 * Linked term cards: brown title bar + term image.
 * Column count and gap come from CSS variables set by the shortcode.
 */

.term-grid {
    display: grid;
    grid-template-columns: repeat(var(--term-grid-columns, 3), minmax(0, 1fr));
    gap: var(--term-grid-gap, 30px);
    width: 100%;
}

.term-grid-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #b59460;
    background-color: #fff;
    color: inherit;
    text-decoration: none !important;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

a.term-grid-card:hover,
a.term-grid-card:focus-visible {
    transform: translateY(-4px);
    box-shadow: 8px 12px 40px 0 rgba(0, 0, 0, 0.18);
}

a.term-grid-card:focus-visible {
    outline: 2px solid #973921;
    outline-offset: 3px;
}

.term-grid-card__title {
    margin: 0 !important;
    padding: 12px 16px;
    background-color: #973921;
    color: #fff !important;
    font-family: "Interstate Condensed Bold", "Interstate Condensed", sans-serif !important;
    font-size: 26px !important;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.term-grid-card__image {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: #f8f6f3;
}

.term-grid-card__img,
.term-grid-card__placeholder {
    display: block;
    width: 100%;
    height: 100% !important;
    max-width: none;
}

.term-grid-card__img {
    object-fit: cover;
    transition: transform 0.5s ease;
}

a.term-grid-card:hover .term-grid-card__img {
    transform: scale(1.05);
}

.term-grid-notice {
    padding: 10px 14px;
    border-left: 4px solid #973921;
    background-color: #fbf8f4;
    font-size: 14px;
}

@media (max-width: 1024px) {
    .term-grid {
        grid-template-columns: repeat(var(--term-grid-columns-tablet, 2), minmax(0, 1fr));
    }

    .term-grid-card__title {
        font-size: 22px !important;
    }
}

@media (max-width: 767px) {
    .term-grid {
        grid-template-columns: repeat(var(--term-grid-columns-mobile, 1), minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .term-grid-card,
    .term-grid-card__img {
        transition: none;
    }

    a.term-grid-card:hover,
    a.term-grid-card:hover .term-grid-card__img {
        transform: none;
    }
}
