/**
 * Subcategory thumbnail row.
 *
 * The row scrolls horizontally rather than wrapping, so the page keeps its rhythm whatever the
 * number of subcategories. The scrollbar is the native one, themed and kept always visible, so it
 * shows up as soon as the content overflows and it needs no script.
 */

.pct {
    --pct-tile: 9rem;
    --pct-gap: 1.25rem;
    margin: 0 0 var(--spacing, 1rem);
}

.pct__list {
    display: flex;
    gap: var(--pct-gap);
    margin: 0;
    padding: 0.2rem 0 1rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
}

/*
 * Blink and WebKit draw an overlay bar that fades out, and on macOS it never shows at rest.
 * Styling the parts turns it back into a classic bar, always drawn and taking its own space.
 */
.pct__list::-webkit-scrollbar {
    height: 0.45rem;
}

.pct__list::-webkit-scrollbar-track {
    border-radius: 999px;
    background: var(--color-lightgrey, #f2f2f2);
}

.pct__list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: var(--color-primary, #1227be);
}

/* Firefox, which has no scrollbar parts: the standard properties are the only lever there. */
@supports not selector(::-webkit-scrollbar) {
    .pct__list {
        scrollbar-width: thin;
        scrollbar-color: var(--color-primary, #1227be) var(--color-lightgrey, #f2f2f2);
    }
}

.pct__item {
    flex: 0 0 auto;
}

.pct__item::before {
    content: none;
}

.pct__tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    width: var(--pct-tile);
    color: inherit;
    text-decoration: none;
}

/* A square frame: cover images are often wide banners and have to be cropped. */
.pct__frame {
    display: block;
    width: var(--pct-tile);
    height: var(--pct-tile);
    overflow: hidden;
    border-radius: 1.25rem;
    background: var(--color-lightgrey, #f2f2f2);
    box-shadow: 0 0.4rem 1.1rem rgba(var(--color-primary-rgb, 45, 48, 65), 0.1);
    transition: transform 0.2s;
}

.pct__frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pct__tile:hover .pct__frame {
    transform: translateY(-3px);
}

.pct__label {
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.3;
    text-align: center;
    overflow-wrap: anywhere;
}

.pct__tile:hover .pct__label {
    color: var(--color-primary);
}

@media (max-width: 47.9375rem) {
    .pct {
        --pct-tile: 7rem;
        --pct-gap: 0.9rem;
    }

    .pct__label {
        font-size: 0.85rem;
    }
}
