.nr_case_history_grid{
    display:grid;
    grid-template-columns:repeat(4, 1fr);
    gap:3px;                /* spazio tra box */
    margin:0 0 75px 0;
    transition: opacity .18s ease;
}
.nr_case_history_grid.loading{
    opacity:.2;              /* 80% opacizzato */
    pointer-events:none;     /* evita click mentre carica */
}
.nr_case_history_grid > .vca_page_box{
    width:100%;
    min-width:0;
}


/* =====================================================
   FILTER WRAPPER
===================================================== */

.nr_case_filter{
    display:flex;
    flex-wrap:wrap;
    gap:22px;
    margin-bottom:28px;
    align-items: center;
}

/* =====================================================
   PARENT ITEMS
===================================================== */
.nr_case_filter  .filter-label {
    /* margin-right: 10px; */
    /* display: inline-block; */
    font-size: 13px;
    line-height: 15px;
}

.nr_case_filter .filter-group{
    position:relative;
}

.nr_case_filter .filter-parent{
    display:inline-block;
    font-weight:600;
    text-decoration:none;
    padding:8px 14px;
    border:1px solid #ddd;
    background:#fff;
    transition:.15s;
}

.nr_case_filter .filter-parent:hover{
    background:#eee;
}

.nr_case_filter .filter-parent.active{
    background:#1f7a33;
    color:#fff;
    border-color:#1f7a33;
}
.nr_case_filter .filter-parent  {
    display: inline-block;
    padding: 8px 20px;
    border: 1px solid #1f7a33;
    border-radius: 999px;
    color: #1f7a33;
    background-color: #fff;
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    letter-spacing: 0;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
    text-decoration: none !important;
}


/* =====================================================
   COUNT BADGE
===================================================== */

.nr_case_filter .term-count {
    opacity: .6;
    font-size: 13px;
    margin-left: 0;
}


/* =====================================================
   CHILD DROPDOWN
===================================================== */

.nr_case_filter .filter-children{
    position:absolute;
    top:100%;
    left:0;

    display:flex;
    flex-wrap:wrap;
    flex-direction: column;
    gap:8px;

    min-width:220px;

    background:#fff;
    padding:12px;
    border:1px solid #ddd;
    box-shadow:0 10px 22px rgba(0,0,0,.12);

    opacity:0;
    visibility:hidden;
    transform:translateY(8px);
    transition:.18s ease;

    z-index:999;
}


/* show on hover */
.nr_case_filter .filter-group:hover .filter-children{
    opacity:1;
    visibility:visible;
    transform:none;
}


/* keep open if active child present */
.nr_case_filter .filter-group:has(.filter-child.active:not([data-term="all"])) .filter-children{
/*.nr_case_filter .filter-group:has(.filter-child.active) .filter-children{*/
    opacity:1;
    visibility:visible;
    transform:none;
}


/* =====================================================
   CHILD LINKS
===================================================== */
.nr_case_filter .filter-child {
    display: inline-block;
    text-decoration: none;
    padding: 6px 12px;
    background: #fff;
    font-size: 13px;
    transition: .15s;
    line-height: 18px;
}

.nr_case_filter .filter-child:hover{
    background:#f3f3f3;
}

.nr_case_filter .filter-child.active {
    background: #007c33;
    color: #fff;
    border-color: #007c33;
    border-radius: 18px;
}

/* apertura via JS */
.nr_case_filter .filter-group.open .filter-children{
    opacity:1;
    visibility:visible;
    transform:none;
}

@media (max-width:1300px){
    .nr_case_history_grid{
        grid-template-columns:repeat(3, 1fr);
    }
}

@media (max-width:1100px){
    .nr_case_history_grid{
        grid-template-columns:repeat(2, 1fr);
    }
    .nr_case_filter{
        gap:12px;
    }
    .nr_case_filter .filter-children{
        position:static;
        opacity:1;
        visibility:visible;
        transform:none;
        box-shadow:none;
        border:none;
        padding:6px 0 0;
        min-width:auto;
    }

}

@media (max-width:700px){
    .nr_case_history_grid{
        grid-template-columns:1fr;
    }
}
