/* ============================================================
   Article filter chips — categories (AND) + states (OR)
   Used by /articles via ArticlePresenter::renderFilterButtons().
   Companion JS: assets/js/article-filters.js
   ============================================================ */

.article-filters {
    width: 100%;
    margin-bottom: 0.75rem;
}

.article-filters__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem 1rem;
    align-items: center;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

/* ---------- State filter toggle (visually distinct from category chips) ---------- */
.state-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px 7px 14px;
    border: 1px dashed var(--color-rov-text-muted-light, #b3a890);
    background: rgba(255, 250, 240, 0.6);
    color: var(--color-rov-dark-gray, #2d3748);
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    transition: all 0.18s ease;
    margin-left: auto; /* push right when there's room in the row */
    border-radius: 0;  /* match rectangular chip language */
    font-family: inherit;
}
.state-filter-toggle:hover {
    border-color: var(--color-rov-green, #00754a);
    background: var(--color-rov-cream-alt, #e6f4ee);
    color: var(--color-rov-green, #00754a);
}
.state-filter-toggle__preview {
    font-weight: 600;
    color: var(--color-rov-green, #00754a);
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.state-filter-toggle__preview:empty {
    display: none;
}
.state-filter-toggle__chevron {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 117, 74, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease;
    color: var(--color-rov-green, #00754a);
    font-size: 11px;
    flex-shrink: 0;
}
.state-filter-toggle.is-open .state-filter-toggle__chevron {
    transform: rotate(180deg);
}

/* ---------- Clear states button ---------- */
.state-filter-clear {
    display: none;
    align-items: center;
    gap: 4px;
    color: var(--color-rov-text-muted-light, #718096);
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-size: 0.75rem;
    padding: 6px 8px;
    border-radius: 4px;
    transition: all 0.15s ease;
    font-family: inherit;
}
.state-filter-clear:hover {
    color: var(--color-rov-green, #00754a);
    background: var(--color-rov-cream-alt, #e6f4ee);
}
.state-filter-clear.is-visible {
    display: inline-flex;
}

/* ---------- Tray (transparent — relies on page bg + white cards for contrast) ---------- */
.state-filter-tray {
    overflow: hidden;
    max-height: 0;
    margin-top: 0;
    transition: max-height 0.3s ease, margin-top 0.3s ease, padding 0.3s ease, opacity 0.2s ease;
    opacity: 0;
    background: transparent;
    padding: 0 4px;
}
.state-filter-tray.is-open {
    max-height: 360px;
    margin-top: 14px;
    padding: 4px;
    opacity: 1;
}

.state-filter-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
}
@media (max-width: 768px) {
    .state-filter-grid { grid-template-columns: repeat(4, 1fr); }
}

.state-filter-card {
    background: #fff;
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 8px 4px 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    user-select: none;
    font: inherit;
    font-family: inherit;
    width: 100%;
}
.state-filter-card:hover {
    border-color: rgba(0, 117, 74, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 117, 74, 0.18);
}
.state-filter-card img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    margin: 0 auto 4px;
    display: block;
    opacity: 0.85;
}
.state-filter-card__label {
    font-size: 0.625rem;
    line-height: 1.2;
    font-weight: 600;
    color: var(--color-rov-dark-gray, #2d3748);
    letter-spacing: 0.01em;
}
.state-filter-card.is-active {
    border-color: var(--color-rov-green, #00754a);
    background: var(--color-rov-cream-alt, #e6f4ee);
}
.state-filter-card.is-active .state-filter-card__label {
    color: var(--color-rov-green, #00754a);
}

/* ---------- Disabled state — applied dynamically when selecting a chip
   would result in zero matching articles given the rest of the filter set ---------- */
.filter-btn.is-disabled,
.state-filter-card.is-disabled {
    opacity: 0.32;
    cursor: not-allowed;
    pointer-events: none;
}
.filter-btn.is-disabled:hover,
.state-filter-card.is-disabled:hover {
    transform: none;
    box-shadow: none;
}
