/* Search visibility stays independent of existing category/tag filters. */
[data-card-item][data-search-hidden],
[data-card-no-results][hidden] {
    display: none !important;
}

/* Keep closed disclosures hidden even if their content uses display:flex. */
[data-card-tags]:not([open]) > :not(summary) {
    display: none !important;
}

[data-overflow-title] {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

[data-overflow-title] > [data-overflow-text] {
    display: block;
    width: max-content;
    min-width: 100%;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-overflow-title][data-overflowing]:is(:hover, :focus-within) {
    text-overflow: clip;
}

[data-overflow-title][data-overflowing]:is(:hover, :focus-within) > [data-overflow-text] {
    max-width: none;
    overflow: visible;
    animation: card-collection-title-scroll var(--overflow-duration, 4s) linear 0.5s infinite alternate;
}

@keyframes card-collection-title-scroll {
    0%, 10% { transform: translateX(0); }
    90%, 100% { transform: translateX(var(--overflow-distance)); }
}

@media (prefers-reduced-motion: reduce) {
    [data-overflow-title][data-overflowing]:is(:hover, :focus-within) > [data-overflow-text] {
        animation: none;
    }
}
