/* Hub d'une catégorie mère : fiches de sous-catégories */

.cat-hub {
    margin: 0 0 2rem;
}

.cat-hub__hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 28px;
    align-items: center;
    margin: 0 0 28px;
}

.cat-hub__hero--text {
    grid-template-columns: minmax(0, 1fr);
}

#content .cat-hub h1 {
    margin: 0;
    padding: 0;
    border: none;
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.2;
    color: #0f172a;
}

.cat-hub__lead {
    margin: 10px 0 0;
    max-width: 62ch;
    font-size: 15px;
    line-height: 1.55;
    color: #475569;
}

.cat-hub__hero-media {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: auto;
    height: auto;
    background: none;
    border: none;
}

.cat-hub__hero-media img {
    display: block;
    width: auto;
    max-width: 180px;
    max-height: 150px;
    object-fit: contain;
}

.cat-hub__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.cat-hub__bar-text {
    margin: 0;
    font-size: 14px;
    color: #64748b;
}

.cat-hub__pill {
    flex: 0 0 auto;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid #a5f3fc;
    background: #ecfeff;
    color: #0e7490;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.cat-hub__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    gap: 16px;
}

#content a.cat-hub__card {
    display: flex;
    flex-direction: column;
    align-self: stretch;
    height: auto;
    min-height: 0;
    position: relative;
    z-index: 0;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    box-shadow: none;
    transition: border-color 0.2s ease;
}

#content a.cat-hub__card:hover {
    border-color: #21bdd0;
    color: inherit;
    text-decoration: none;
    transform: none;
    box-shadow: none;
}

#content a.cat-hub__card:focus-visible {
    outline: 2px solid #0e7490;
    outline-offset: 3px;
}

.cat-hub__brand {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 92px;
    height: 32px;
    padding: 4px 10px;
    border: 1px solid #21bdd0;
    border-radius: 999px;
    background: #fff;
    box-sizing: border-box;
}

.cat-hub__brand img {
    display: block;
    width: auto;
    max-width: 72px;
    height: 18px;
    max-height: 18px;
    object-fit: contain;
}

.cat-hub__media {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 140px;
    margin: 0 0 12px;
    padding: 0;
    background: none;
    border: none;
    overflow: hidden;
}

.cat-hub__media img {
    display: block;
    width: auto;
    max-width: 100%;
    height: 140px;
    max-height: 140px;
    object-fit: contain;
}

.cat-hub__media--empty {
    color: #94a3b8;
    font-size: 2rem;
    font-weight: 700;
}

#content .cat-hub h2.cat-hub__title {
    display: block;
    margin: 0 0 6px;
    padding: 0;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    color: #0f172a;
}

.cat-hub__desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.45;
    color: #64748b;
}

.cat-hub__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
}

.cat-hub__count {
    display: block;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    transition: color 0.2s ease;
}

.cat-hub__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    margin: 0;
    padding: 5px 12px;
    border: 1px solid #21bdd0;
    border-radius: 999px;
    background: transparent;
    color: #0e7490;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease;
}

#content a.cat-hub__card:hover .cat-hub__count,
#content a.cat-hub__card:focus-visible .cat-hub__count {
    color: #21bdd0;
}

#content a.cat-hub__card:hover .cat-hub__cta {
    background: #21bdd0;
    border-color: #21bdd0;
    color: #fff;
}

.cat-hub--eco .cat-hub__pill {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

#content a.cat-hub--eco .cat-hub__card:hover,
.cat-hub--eco a.cat-hub__card:hover {
    border-color: #22c55e;
}

.cat-hub--eco .cat-hub__brand {
    border-color: #16a34a;
}

.cat-hub--eco .cat-hub__cta {
    border-color: #16a34a;
    color: #166534;
}

.cat-hub--eco a.cat-hub__card:hover .cat-hub__count,
.cat-hub--eco a.cat-hub__card:focus-visible .cat-hub__count {
    color: #16a34a;
}

.cat-hub--eco a.cat-hub__card:hover .cat-hub__cta {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}

@media (max-width: 1024px) {
    .cat-hub__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .cat-hub__hero {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .cat-hub__hero-media {
        justify-content: flex-start;
    }

    .cat-hub__hero-media img {
        max-width: 140px;
        max-height: 120px;
    }

    #content .cat-hub h1 {
        font-size: 1.45rem;
    }

    .cat-hub__bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .cat-hub__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}
