/**
 * Cascade finale pour le module Collections (thème : voir css/poke-hub/poke-hub-late-overrides.css).
 * Chargé sans dépendre du lot front plugin — utile quand poke_hub_load_default_plugin_front_css = false.
 * Le bloc Pokémon GO (copy-paste) est stylé dans le thème : parts/13-collections-front.css.
 */

.pokehub-collections-wrap.me5rine-lab-dashboard {
    color: var(--me5rine-lab-text, #11161E);
    min-height: auto;
    font-size: 15px;
    line-height: 1.5;
}

@media screen and (min-width: 783px) {
    .pokehub-collections-wrap.me5rine-lab-dashboard {
        border-left: none;
    }
}

ul.pokehub-collections-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: var(--me5rine-lab-spacing-lg, 1.25rem);
}

@media (max-width: 900px) {
    ul.pokehub-collections-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    ul.pokehub-collections-grid {
        grid-template-columns: 1fr !important;
    }
}

.pokehub-collections-grid > li.me5rine-lab-card:hover {
    transform: none;
}

/* Section avancée : tout sauf <summary> masqué si fermé (plus robuste que cibler seulement .inner) */
.pokehub-collections-advanced.me5rine-lab-form-block:not([open]) > :not(summary) {
    display: none !important;
}

.pokehub-collections-advanced.me5rine-lab-form-block[open] > :not(summary) {
    display: block !important;
}

.pokehub-collections-advanced-summary {
    list-style: none;
}

.pokehub-collections-advanced-summary::-webkit-details-marker {
    display: none;
}

/*
 * Bloc recherche Pokémon GO (copy-paste) : styles dans le thème
 * css/poke-hub/parts/13-collections-front.css (section « Recherche in-game Pokémon GO »).
 */

/* Filtre « afficher dans la grille » (JS) — display plutôt que l’attribut hidden (compat navigateurs / thèmes) */
.pokehub-collection-tile.pokehub-tile--filtered-out {
    display: none !important;
}
.pokehub-collection-generation-block.pokehub-generation--all-filtered {
    display: none !important;
}

/* Bloc nom : groupe centré, ♀/♂ collé au nom, sous-titre forme (ex. Gigamax) */
.pokehub-collection-tile-line--name {
    display: flex;
    justify-content: center;
    width: 100%;
    min-width: 0;
}
.pokehub-collection-tile-name-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.12rem;
    width: 100%;
    max-width: 100%;
    min-height: 2.65em;
    text-align: center;
}
.pokehub-collection-tile-name-row {
    display: inline-flex;
    max-width: 100%;
    align-items: flex-start;
    justify-content: center;
    gap: 0.2em;
    vertical-align: top;
}
.pokehub-collection-tile-name-row .pokehub-collection-tile-name {
    margin-top: 0;
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    text-overflow: ellipsis;
    text-align: center;
    word-break: break-word;
    overflow-wrap: anywhere;
    min-width: 0;
}
.pokehub-collection-tile-name-row:has(.pokehub-collection-tile-gender) .pokehub-collection-tile-name {
    max-width: calc(100% - 0.85em);
}
.pokehub-collection-tile-gender {
    flex-shrink: 0;
    font-size: 1.05em;
    line-height: 1.15;
    margin: 0;
}
.pokehub-collection-tile-form-line {
    display: block;
    width: 100%;
    max-width: 100%;
    font-size: 0.72rem;
    line-height: 1.2;
    font-weight: 600;
    color: var(--me5rine-lab-text-muted, #5c6570);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
