/* =========================================================
   Homepage topic selector
   ========================================================= */

.homepage-topics {
    padding-block: 80px;
    background-color: #f5fbfa;
}

.homepage-topics__header {
    max-width: 720px;
    /* margin: 0 auto 44px; */
    /* text-align: center; */
}

.homepage-topics__eyebrow {
    margin: 0 0 10px;
    color: #007a74;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.homepage-topics__title {
    margin: 0;
    color: #344055;
    font-family: "Poppins", sans-serif;
    font-size: clamp(2rem, 4vw, 2.75rem);
    line-height: 1.15;
    text-align: left;
}

.homepage-topics__introduction {
    margin: 18px 0 0;
    color: #5c6679;
    font-size: 1.0625rem;
    line-height: 1.7;
}

.homepage-topics__breathing {
    margin-top: 80px;
}
/* Topic grid */

.homepage-topics__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

/* Individual topic card */

.homepage-topic-card {
    min-width: 0;
    background-color: #304631;
    border: 1px solid rgba(52, 64, 85, 0.12);
    /* border-radius: 16px; */
    box-shadow: 0 8px 20px rgba(52, 64, 85, 0.08);
    overflow: hidden;
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
}

.homepage-topic-card:hover {
    border-color: rgba(0, 122, 116, 0.35);
    box-shadow: 0 16px 34px rgba(52, 64, 85, 0.13);
    transform: translateY(-5px);
}

.homepage-topic-card__link {
    display: grid;
    place-items: center;
    min-height: 112px;
    padding: 18px;
    color: inherit;
    text-align: center;
    text-decoration: none;
}

.homepage-topic-card__link:focus-visible {
    outline: 3px solid #00ccff;
    outline-offset: -4px;
}

/* Icon holder */

.homepage-topic-card__icon {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    color: #007a74;
    background-color: rgba(67, 179, 174, 0.16);
    border-radius: 14px;
}

/*
 * Temporary visual symbol.
 * We will replace this with the proper topic icons next.
 */
.homepage-topic-card__icon::before {
    content: "#";
    font-family: "Poppins", sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
}

/* Card text */

.homepage-topic-card__content {
    display: block;
    min-width: 0;
}

.homepage-topic-card__title {
    display: block;
    /* color: #344055; */
    color: white;
    font-family: "Poppins", sans-serif;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
}

/* .homepage-topic-card__description {
    display: -webkit-box;
    margin-top: 8px;
    overflow: hidden;
    color: #687386;
    font-size: 0.9375rem;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
} */
.homepage-topic-card__description {
    display: -webkit-box;
    margin-top: 8px;
    overflow: hidden;
    color: #687386;
    font-size: 0.9375rem;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    -webkit-line-clamp: 2;
}
/* Direction arrow */

.homepage-topic-card__arrow {
    color: #007a74;
    font-size: 1.4rem;
    line-height: 1;
    transition: transform 180ms ease;
}

.homepage-topic-card:hover .homepage-topic-card__arrow {
    transform: translateX(5px);
}

/* =========================================================
   Tablet
   ========================================================= */

@media (max-width: 900px) {
    .homepage-topics {
        padding-block: 64px;
    }

    .homepage-topics__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }
}

/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 600px) {
    .homepage-topics {
        padding-block: 52px;
    }

    .homepage-topics__header {
        margin-bottom: 32px;
        text-align: center;
    }

    .homepage-topics__title {
        font-size: 1.6rem;
        text-align: center;
    }

    .homepage-topics__breathing {
        margin-top: 28px;
    }

    .homepage-topics__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .homepage-topic-card__link {
        min-height: 78px;
        padding: 12px 8px;
    }

    .homepage-topic-card__title {
        font-size: 0.82rem;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }
}

/* Respect reduced-motion preferences */

@media (prefers-reduced-motion: reduce) {
    .homepage-topic-card,
    .homepage-topic-card__arrow {
        transition: none;
    }
}
