/* ===== Home categories section ===== */
.home-cats-area {
    --hc-surface: #ffffff;
    --hc-border: rgba(16, 12, 40, 0.08);
    --hc-text: #1f1d2b;
    --hc-muted: #6b6880;
    --hc-accent: var(--color-primary, #49108b);
}

body.active-dark-mode .home-cats-area {
    --hc-surface: #1d1d24;
    --hc-border: rgba(255, 255, 255, 0.08);
    --hc-text: #f3f3f6;
    --hc-muted: #a3a1b3;
    --hc-accent: #a98bf5;
}

/* ----- Heading (matches the latest links section) ----- */
.home-cats-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 24px;
    margin-bottom: 28px;
}

.home-cats-area .home-cats-title {
    margin: 0 0 6px;
    color: var(--hc-text);
    font-size: 28px;
    font-weight: 800;
}

.home-cats-subtitle {
    margin: 0;
    color: var(--hc-muted);
    font-size: 15px;
}

.home-cats-area .home-cats-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid var(--hc-border);
    border-radius: 999px;
    color: var(--hc-accent);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.home-cats-all:hover,
.home-cats-all:focus-visible {
    border-color: var(--hc-accent);
    background: color-mix(in srgb, var(--hc-accent) 8%, transparent);
}

.home-cats-all i {
    transition: transform 0.2s ease;
}

.home-cats-all:hover i {
    transform: translateX(-4px);
}

/* ----- Cards ----- */
.home-cats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-cats-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0;
    padding: 16px 18px;
    border: 1px solid var(--hc-border);
    border-radius: 18px;
    background: var(--hc-surface);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.home-cats-card:hover,
.home-cats-card:focus-within {
    border-color: color-mix(in srgb, var(--hc-accent) 45%, transparent);
    box-shadow: 0 12px 28px rgba(16, 12, 40, 0.08);
    transform: translateY(-2px);
}

.home-cats-logo {
    display: grid;
    flex: none;
    place-items: center;
    width: 56px;
    height: 56px;
    padding: 6px;
    border-radius: 16px;
    background: color-mix(in srgb, var(--hc-accent) 8%, var(--hc-surface));
}

.home-cats-logo img {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    object-fit: contain;
}

.home-cats-body {
    flex: 1;
    min-width: 0;
}

.home-cats-area .home-cats-name {
    margin: 0 0 2px;
    overflow: hidden;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.6;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-cats-area .home-cats-name a {
    color: var(--hc-text);
}

/* Whole card is clickable */
.home-cats-area .home-cats-name a::after {
    position: absolute;
    inset: 0;
    border-radius: 18px;
    content: '';
}

.home-cats-area .home-cats-name a:focus-visible {
    outline: none;
}

.home-cats-card:has(a:focus-visible) {
    outline: 2px solid var(--hc-accent);
    outline-offset: 2px;
}

.home-cats-meta {
    color: var(--hc-muted);
    font-size: 13px;
}

.home-cats-go {
    flex: none;
    color: var(--hc-muted);
    transition: color 0.2s ease, transform 0.2s ease;
}

.home-cats-card:hover .home-cats-go {
    color: var(--hc-accent);
    transform: translateX(-4px);
}

/* Tablet: two columns */
@media (max-width: 991px) {
    .home-cats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Phone: one swipeable row, so the section stays short */
@media (max-width: 575px) {
    .home-cats-head {
        margin-bottom: 18px;
    }

    .home-cats-area .home-cats-title {
        font-size: 24px;
    }

    .home-cats-grid {
        display: flex;
        gap: 12px;
        margin: 0 -15px;
        padding: 4px 15px 10px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .home-cats-grid::-webkit-scrollbar {
        display: none;
    }

    .home-cats-card {
        flex: 0 0 72%;
        scroll-snap-align: start;
    }

    .home-cats-card:hover,
    .home-cats-card:focus-within {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-cats-card,
    .home-cats-go,
    .home-cats-all i {
        transition: none;
    }
}
