/*
 * Th Home Categories — homepage block with 4 category cards.
 *
 * Visual reference: a 4-up row of cards, each with a coloured 10px border,
 * the first/last card with rounded outer corners, an image on top and a
 * title below. Above the cards: a centered section heading (hidden on
 * mobile).
 *
 * Class names use the BEM-ish prefix .thhc__ — they are intentionally
 * decoupled from the inspiration source so the active theme can override
 * them without fighting third-party selectors.
 */

.thhc {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 72px 15px;
    background-color: #fff;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    overflow: hidden; /* clips cards that start translated below the section */
}

.thhc__inner {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* ---------- Section heading ---------- */

.thhc__head {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 0 0 48px;
}

.thhc__title {
    margin: 0;
    color: #2a1a46;
    font-size: 44px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
}

.thhc__desc {
    margin: 16px 0 0;
    color: #7c6d96;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.4;
    max-width: 720px;
}

/* ---------- Cards grid ---------- */

.thhc__grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
}

.thhc__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 0;
    min-width: 0;
    padding: 10px 8px 24px;
    background-color: #fff;
    border: 10px solid #ccc; /* overridden by .thhc__card--c{n} */
    box-sizing: border-box;
    text-decoration: none;
    color: inherit;
    animation: thhc-card-slide-up 1s ease-in-out both;
    transition: transform .3s ease, box-shadow .3s ease;
}

@keyframes thhc-card-slide-up {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .thhc__card {
        animation: none;
    }
}

.thhc__card:hover,
.thhc__card:focus {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(42, 26, 70, .12);
}

.thhc__card-image {
    display: block;
    width: 100%;
    max-width: 260px;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.thhc__card-title {
    margin: 16px 0 0;
    color: #2a1a46;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

/* ---------- Per-card colour + corners ---------- */

.thhc__card--c1 {
    border-color: #29b4d6; /* cyan */
    border-radius: 72px 0 0 72px;
}

.thhc__card--c2 {
    border-color: #e83892; /* pink */
}

.thhc__card--c3 {
    border-color: #3b2563; /* deep purple */
}

.thhc__card--c4 {
    border-color: #3eb449; /* green */
    border-radius: 0 72px 72px 0;
}

/* ---------- Tablet (≤1199px): 2 columns ---------- */

@media (max-width: 1199px) {
    .thhc__grid {
        flex-wrap: wrap;
    }

    .thhc__card {
        flex: 1 1 50%;
        max-width: 50%;
    }

    /* Reset rounded corners — they only make sense in single-row layout. */
    .thhc__card--c1,
    .thhc__card--c4 {
        border-radius: 0;
    }
}

/* ---------- Mobile (≤767px): heading hidden, single column ---------- */

@media (max-width: 767px) {
    .thhc {
        padding: 48px 15px;
    }

    .thhc__head {
        margin: 0 0 24px;
    }

    .thhc__card {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .thhc__title {
        font-size: 32px;
    }

    .thhc__desc {
        font-size: 18px;
    }
}
