/* =========================================================
    Shared pills widget styles
    Works for:
    - category widget output: .nfp-cat-pills
    - generic widget output:  .nfp-pills
   ========================================================= */

/* Wrapper */
.nfp-pills,
.nfp-cat-pills {
    margin-top: 32px !important;
    position: relative;
    display: block;
    width: 100%;
}

/* H2 title */
.nfp-pills__title,
.nfp-cat-pills__title {
    margin: 0 0 10px 0;
    font-size: 18px;
    line-height: 1.2;
}

/* -----------------------------------------
    The Slider (Viewport)
   ----------------------------------------- */
.nfp-pills__viewport,
.nfp-cat-pills__viewport {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    display: block;
    width: 100%;
    
    /* Smooth native scrolling */
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    overscroll-behavior-x: contain;
    
    /* Snap-to-pill effect */
    scroll-snap-type: x mandatory;
    
    /* Visual cleanup */
    scrollbar-width: none; /* Firefox */
    padding-bottom: 4px; 
}

/* Hide scrollbars for Chrome/Safari/Edge */
.nfp-pills__viewport::-webkit-scrollbar,
.nfp-cat-pills__viewport::-webkit-scrollbar {
    display: none;
}

/* -----------------------------------------
    The List (Flexbox Row)
   ----------------------------------------- */
.nfp-pills__list,
.nfp-cat-pills__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    
    /* Force horizontal row on mobile */
    flex-wrap: nowrap;
    width: max-content; 
    gap: 10px;
}

/* -----------------------------------------
    The Items (Pills)
   ----------------------------------------- */
.nfp-pills__item,
.nfp-cat-pills__item {
    /* Critical: Prevent pills from shrinking */
    flex: 0 0 auto;
    scroll-snap-align: start;
}

.nfp-pills__pill,
.nfp-cat-pills__pill {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    background: var(--nfp-pill-bg, #111111);
    transition: transform 0.1s ease;
}

.nfp-pills__link,
.nfp-cat-pills__link {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--nfp-pill-text, #ffffff);
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
}

.nfp-pills__link:hover,
.nfp-cat-pills__link:hover {
    text-decoration: underline;
}

/* -----------------------------------------
    Desktop Behavior (Optional)
    On large screens, we let them wrap normally 
    instead of sliding.
   ----------------------------------------- */
@media (min-width: 1024px) {
    .nfp-pills__list,
    .nfp-cat-pills__list {
        flex-wrap: wrap;
        width: 100%;
    }
    
    .nfp-pills__viewport,
    .nfp-cat-pills__viewport {
        overflow-x: visible;
    }
}

/* -----------------------------------------
    Navigation Buttons (Hidden in CSS-only)
   ----------------------------------------- */
.nfp-pills__nav,
.nfp-cat-pills__nav {
    display: none !important;
}

/* Mobile font tweaks */
@media (max-width: 480px) {
    .nfp-pills__link,
    .nfp-cat-pills__link {
        padding: 9px 12px;
        font-size: 13px;
    }
}