/* ===========================================================================
   HUB PAGE — /tous-les-sujets/ (FR) et /en/all-subjects/ (EN)
   Extrait de functions.php (echos <style> inline) vers un fichier externe
   mis en cache navigateur, chargé uniquement sur les pages concernées.
   =========================================================================== */

/* --- Masquage du breadcrumb / H1 natif du thème (un seul H1 dans le DOM) --- */
body.page-id-28378 .bb-breadcrumbs,
body.page-id-28378 .breadcrumbs,
body.page-id-28378 nav.bb-breadcrumb,
body.page-id-28378 .bb-page-header,
body.page-id-32614 .bb-breadcrumbs,
body.page-id-32614 .breadcrumbs,
body.page-id-32614 nav.bb-breadcrumb,
body.page-id-32614 .bb-page-header {
    display: none !important;
}
body.page-id-28378 .page-title,
body.page-id-28378 .entry-title,
body.page-id-28378 h1.bb-title,
body.page-id-28378 .bb-single-title,
body.page-id-32614 .page-title,
body.page-id-32614 .entry-title,
body.page-id-32614 h1.bb-title,
body.page-id-32614 .bb-single-title {
    display: none !important;
}

/* --- Fond quadrillé néon --- */
body.page-id-28378,
body.page-id-32614,
body.page-all-subjects {
    background-color: #020205 !important;
    background-image:
        linear-gradient(90deg, rgba(0, 242, 255, 0.05) 1px, transparent 1px),
        linear-gradient(rgba(0, 242, 255, 0.01) 1px, transparent 1px) !important;
    background-size: 50px 50px !important;
    background-attachment: fixed !important;
}

    /* ── Visually hidden (accessible aux lecteurs d'écran) ── */
    .sr-only {
        position: absolute;
        width: 1px; height: 1px;
        padding: 0; margin: -1px;
        overflow: hidden;
        clip: rect(0,0,0,0);
        white-space: nowrap;
        border: 0;
    }

    /* ── Alignement de la barre d'outils (recherche, langue, tri, vue, surprise) ── */
    .toolbar-wrapper {
        display: flex !important;
        flex-wrap: wrap;
        align-items: center !important;
        gap: 12px;
    }
    .toolbar-wrapper .search-container,
    .toolbar-wrapper .view-group {
        display: flex !important;
        align-items: center !important;
        gap: 8px;
        margin: 0;
    }
    .toolbar-wrapper #subjectSearch,
    .toolbar-wrapper .view-btn,
    .toolbar-wrapper .label {
        height: 40px;
        box-sizing: border-box;
        display: inline-flex;
        align-items: center;
        line-height: 1;
        margin: 0;
        vertical-align: middle;
    }

    /* ── Cartes "Tendance de la semaine" ── */
    .subject-card.is-trending {
        position: relative;
        border-color: rgba(255, 100, 20, 0.7) !important;
        box-shadow: 0 0 0 1px rgba(255, 100, 20, 0.4), 0 0 18px rgba(255, 80, 0, 0.18) !important;
        background: rgba(255, 80, 0, 0.06) !important;
    }
    .subject-card.is-trending:hover {
        border-color: rgba(255, 120, 30, 0.95) !important;
        box-shadow: 0 0 0 1.5px rgba(255, 100, 20, 0.7), 0 0 28px rgba(255, 80, 0, 0.28) !important;
    }
    .trending-badge{
    position:absolute;
    top:6px;
    right:7px;
    font-size:0.75rem;      /* légèrement agrandi */
    line-height:1.3;        /* au lieu de 1 — laisse de la place au glyphe */
    padding:3px 6px;        /* un poil plus généreux */
    display:inline-flex;    /* centre proprement l'emoji verticalement */
    align-items:center;
    justify-content:center;
    background:rgba(255,70,0,0.85);
    color:#fff;
    border-radius:4px;
    font-weight:700;
    letter-spacing:0.2px;
    pointer-events:none;
    z-index:2;
    white-space:nowrap;
}
    /* Vue dense : badge adapté */
    .subjects-grid.view-mode-dense .subject-card.is-trending {
        border-color: rgba(255, 100, 20, 0.6) !important;
        box-shadow: none !important;
        background: rgba(255, 80, 0, 0.07) !important;
    }
    .subjects-grid.view-mode-dense .trending-badge {
        position: static;
        font-size: 0.58rem;
        padding: 1px 4px;
        border-radius: 3px;
        background: rgba(255, 70, 0, 0.75);
    }

    /* ── Barre de filtre par activité ── */
    .activity-toolbar {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
        margin: 10px 0 24px;
        padding: 10px 14px;
        background: rgba(255,255,255,0.03);
        border: 1px solid rgba(255,255,255,0.07);
        border-radius: 6px;
    }
    .activity-filter-btn {
        padding: 5px 14px;
        background: transparent;
        border: 1px solid rgba(255,255,255,0.15);
        color: rgba(255,255,255,0.5);
        font-size: 0.8rem;
        font-weight: 600;
        border-radius: 20px;
        cursor: pointer;
        transition: all 0.2s;
        white-space: nowrap;
    }
    .activity-filter-btn:hover { border-color: rgba(255,255,255,0.4); color: #fff; }
    .activity-filter-btn.active {
        background: rgba(255,255,255,0.1);
        border-color: rgba(255,255,255,0.4);
        color: #fff;
    }
    .activity-btn-new.active   { background: rgba(0,220,100,0.15);  border-color: #00dc64; color: #00dc64; }
    .activity-btn-new:hover    { border-color: #00dc64; color: #00dc64; }
    .activity-btn-recent.active{ background: rgba(255,190,0,0.15);  border-color: #ffbe00; color: #ffbe00; }
    .activity-btn-recent:hover { border-color: #ffbe00; color: #ffbe00; }
    .activity-btn-old.active   { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.3); color: rgba(255,255,255,0.6); }

    /* ── Badges "X nouveaux / X récents" dans les headers de groupe ── */
    .group-badge {
        display: inline-flex;
        align-items: center;
        gap: 3px;
        padding: 3px 10px;
        border-radius: 20px;
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.3px;
        text-transform: none;
        vertical-align: middle;
        margin-left: 8px;
        cursor: default;
        white-space: nowrap;
    }
    .badge-new-count {
        background: rgba(0,220,100,0.15);
        border: 1px solid rgba(0,220,100,0.5);
        color: #00dc64;
        animation: pulse-new 2.5s ease-in-out infinite;
    }
    .badge-recent-count {
        background: rgba(255,190,0,0.12);
        border: 1px solid rgba(255,190,0,0.4);
        color: #ffbe00;
    }
    @keyframes pulse-new {
        0%, 100% { box-shadow: 0 0 0 0 rgba(0,220,100,0); }
        50%       { box-shadow: 0 0 8px 3px rgba(0,220,100,0.2); }
    }

    /* ── Bouton Surprends-moi ── */
    .toolbar-wrapper .surprise-group {
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
    }
    .btn-surprise {
        background: linear-gradient(135deg, rgba(111,0,255,0.55), rgba(0,242,255,0.35)) !important;
        background-clip: border-box !important;
        border-radius: 999px !important;
        overflow: hidden;
        border: none !important;
        box-shadow: 0 0 0 1px rgba(192,132,252,0.35) !important;
        color: #fff !important;
        font-weight: 700 !important;
        letter-spacing: 0.3px;
        transition: all 0.25s !important;
    }
    .btn-surprise:hover {
        background: linear-gradient(135deg, rgba(111,0,255,0.75), rgba(0,242,255,0.5)) !important;
        box-shadow: 0 0 18px rgba(111,0,255,0.35) !important;
        color: #fff !important;
        transform: translateY(-1px);
    }

    /* ── Overlay Surprends-moi ── */
    #surprise-overlay {
        position: fixed;
        inset: 0;
        z-index: 99999;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .surprise-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,0.75);
        backdrop-filter: blur(6px);
        animation: surprise-fade-in 0.2s ease;
    }
    .surprise-modal {
        position: relative;
        background: rgba(12,12,18,0.97);
        border: 1px solid rgba(111,0,255,0.4);
        border-radius: 16px;
        padding: 44px 40px 36px;
        width: min(420px, 92vw);
        text-align: center;
        box-shadow: 0 0 60px rgba(111,0,255,0.25), 0 0 0 1px rgba(255,255,255,0.05);
        animation: surprise-slide-up 0.3s cubic-bezier(0.34,1.56,0.64,1);
    }
    .surprise-dice {
        font-size: 3rem;
        display: block;
        margin-bottom: 12px;
        animation: surprise-spin 0.4s ease infinite alternate;
    }
    .surprise-label {
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 2px;
        color: rgba(255,255,255,0.35);
        margin: 0 0 16px;
    }
    .surprise-slot {
        font-size: 1.4rem;
        font-weight: 700;
        color: #c084fc;
        min-height: 2rem;
        transition: opacity 0.05s;
        margin-bottom: 8px;
    }
    /* Card révélée */
    .surprise-card-reveal {
        animation: none;
    }
    .surprise-card-in {
        animation: surprise-card-pop 0.45s cubic-bezier(0.34,1.56,0.64,1) forwards;
    }
    .surprise-name {
        font-size: 1.9rem;
        font-weight: 900;
        color: #fff;
        line-height: 1.2;
        margin-bottom: 12px;
        text-shadow: 0 0 30px rgba(192,132,252,0.5);
    }
    .surprise-meta {
        display: flex;
        justify-content: center;
        gap: 14px;
        margin-bottom: 24px;
        font-size: 0.82rem;
    }
    .surprise-activity { color: rgba(255,255,255,0.5); }
    .surprise-count    { color: rgba(255,255,255,0.35); }
    .surprise-cta {
        display: inline-block;
        padding: 11px 32px;
        background: linear-gradient(135deg, rgba(111,0,255,0.6), rgba(0,242,255,0.3));
        border: 1px solid rgba(111,0,255,0.6);
        border-radius: 8px;
        color: #fff;
        font-size: 0.95rem;
        font-weight: 700;
        text-decoration: none;
        transition: all 0.2s;
        letter-spacing: 0.3px;
    }
    .surprise-cta:hover {
        background: linear-gradient(135deg, rgba(111,0,255,0.8), rgba(0,242,255,0.45));
        box-shadow: 0 0 20px rgba(111,0,255,0.4);
        transform: translateY(-1px);
        color: #fff;
        text-decoration: none;
    }
    .surprise-again {
        display: block;
        margin: 14px auto 0;
        background: transparent;
        border: none;
        color: rgba(255,255,255,0.3);
        font-size: 0.82rem;
        cursor: pointer;
        transition: color 0.2s;
        padding: 4px 8px;
    }
    .surprise-again:hover { color: #c084fc; }
    .surprise-close {
        position: absolute;
        top: 14px; right: 16px;
        background: transparent;
        border: none;
        color: rgba(255,255,255,0.25);
        font-size: 1.1rem;
        cursor: pointer;
        transition: color 0.15s;
        line-height: 1;
        padding: 4px 6px;
    }
    .surprise-close:hover { color: rgba(255,255,255,0.7); }

    @keyframes surprise-fade-in  { from { opacity: 0; } to { opacity: 1; } }
    @keyframes surprise-slide-up { from { opacity: 0; transform: translateY(24px) scale(0.96); } to { opacity: 1; transform: none; } }
    @keyframes surprise-spin      { from { transform: rotate(-12deg); } to { transform: rotate(12deg); } }
    @keyframes surprise-card-pop  { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: scale(1); } }
    /* ── Header style annuaire ── */
    .ia-tax-header {
        text-align: center;
        margin-bottom: 50px;
        padding: 50px 30px 40px;
        background: rgba(20,20,25,0.85);
        border: 1px solid rgba(0,242,255,0.2);
        border-radius: 8px;
        position: relative;
        overflow: hidden;
    }
    .ia-tax-header::before {
        content: '';
        position: absolute;
        top: 0; left: 0; right: 0;
        height: 3px;
        background: linear-gradient(90deg, transparent, #00f2ff, transparent);
    }
    .ia-tax-breadcrumb {
        font-size: 0.75rem;
        color: rgba(255,255,255,0.35);
        text-transform: uppercase;
        letter-spacing: 2px;
        margin-bottom: 20px;
    }
    .ia-tax-breadcrumb a      { color: #00f2ff; text-decoration: none; }
    .ia-tax-breadcrumb a:hover { opacity: 0.7; }
    .ia-tax-breadcrumb span   { margin: 0 8px; }
    .ia-tax-title {
        font-size: clamp(2rem, 5vw, 3.5rem);
        font-weight: 900;
        color: #fff;
        text-transform: uppercase;
        letter-spacing: -1px;
        margin: 0 0 15px;
        text-shadow: 0 0 40px rgba(0,242,255,0.5);
    }
    .ia-tax-desc {
        color: rgba(255,255,255,0.55);
        font-size: 1rem;
        line-height: 1.7;
        max-width: 650px;
        margin: 0 auto;
    }
    /* ── Description de groupe ── */
    .group-description {
        color: rgba(255,255,255,0.5);
        font-size: 0.85rem;
        margin: 5px 0 15px 0;
        font-style: italic;
        line-height: 1.5;
    }
    /* ── Âge du dernier article dans les tendances ── */
    .trend-age {
        font-size: 0.65rem;
        opacity: 0.45;
        margin-left: 6px;
        white-space: nowrap;
    }
    /* ── Bouton Voir plus ── */
    .btn-show-more-others {
        display: block;
        margin: 20px auto 0;
        padding: 10px 30px;
        background: transparent;
        border: 1px solid rgba(0,242,255,0.4);
        color: #00f2ff;
        font-size: 0.85rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1px;
        cursor: pointer;
        transition: all 0.3s;
    }
    .btn-show-more-others:hover {
        background: #00f2ff;
        color: #000;
        box-shadow: 0 0 15px rgba(0,242,255,0.4);
    }

    /* ── Vue dense ── */
    .subjects-grid.view-mode-dense {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 8px;
        padding: 10px 0;
    }
    .subjects-grid.view-mode-dense .subject-card {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 4px 10px;
        background: rgba(255,255,255,0.04);
        border: 1px solid rgba(255,255,255,0.08);
        border-radius: 4px;
        font-size: 0.82rem;
        color: rgba(255,255,255,0.75);
        text-decoration: none;
        white-space: nowrap;
        transition: background 0.15s, border-color 0.15s, color 0.15s;
        min-height: 0;
        height: auto;
        width: auto;
        min-width: 0;
    }
    .subjects-grid.view-mode-dense .subject-card:hover {
        background: rgba(0,242,255,0.08);
        border-color: rgba(0,242,255,0.35);
        color: #fff;
    }
    /* Masquer tout sauf le dot et le nom en mode dense */
    .subjects-grid.view-mode-dense .card-bg,
    .subjects-grid.view-mode-dense .tooltip-box,
    .subjects-grid.view-mode-dense .subject-count,
    .subjects-grid.view-mode-dense .fav-btn {
        display: none !important;
    }
    .subjects-grid.view-mode-dense .card-content {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        background: none;
        padding: 0;
    }
    .subjects-grid.view-mode-dense .activity-dot,
    .subjects-grid.view-mode-dense .badge-new {
        flex-shrink: 0;
    }
    .subjects-grid.view-mode-dense .badge-new {
        font-size: 0.6rem;
        padding: 1px 4px;
    }
    .subjects-grid.view-mode-dense .activity-dot {
        width: 6px;
        height: 6px;
    }
    </style>

    <style>
    /* ============================================================
       TYPOGRAPHIE AUGMENTÉE — pages "tous-les-sujets" & "all-subjects"
       Ciblé via .ia-tax-header (présent uniquement dans le shortcode hub)
       pour ne pas affecter le reste du site.
       ============================================================ */

    /* ── H1 principal ── */
    .ia-tax-title {
        font-size: clamp(2.6rem, 6vw, 4.2rem) !important;
    }

    /* ── Sous-titre header ── */
    .ia-tax-desc {
        font-size: 1.15rem !important;
        line-height: 1.8 !important;
    }

    /* ── Breadcrumb ── */
    .ia-tax-breadcrumb {
        font-size: 0.875rem !important;
    }

    /* ── Stats box ── */
    .stat-number {
        font-size: 2rem !important;
    }
    .stat-label {
        font-size: 0.85rem !important;
    }

    /* ── Tendances : titre H2 ── */
    .trending-section h2 {
        font-size: 1.4rem !important;
    }

    /* ── Tendances : cards ── */
    .trend-rank {
        font-size: 1rem !important;
    }
    .trend-name {
        font-size: 1rem !important;
    }
    .trend-age {
        font-size: 0.75rem !important;
    }

    /* ── Titres de groupes H3 ── */
    .category-group .group-header h3 {
        font-size: 1.25rem !important;
    }
    .group-count {
        font-size: 1rem !important;
    }

    /* ── Description de groupe ── */
    .group-description {
        font-size: 0.95rem !important;
    }

    /* ── Cards sujets : nom + compteur ── */
    .subject-name {
        font-size: 1rem !important;
    }
    .subject-count {
        font-size: 0.85rem !important;
    }

    /* ── Badge NEW + dots ── */
    .badge-new {
        font-size: 0.7rem !important;
    }

    /* ── Tooltip ── */
    .tt-status {
        font-size: 0.85rem !important;
    }
    .tt-related {
        font-size: 0.82rem !important;
    }

    /* ── Barre d'outils (recherche, tri, A-Z) ── */
    #subjectSearch {
        font-size: 1rem !important;
    }
    .view-btn,
    .az-btn,
    .sort-btn {
        font-size: 0.85rem !important;
    }
    .toolbar-wrapper .label {
        font-size: 0.85rem !important;
    }

    /* ── Bouton "Voir plus" ── */
    .btn-show-more-others {
        font-size: 0.95rem !important;
    }

    /* ── Compteur de résultats ── */
    #search-counter {
        font-size: 0.82rem !important;
    }

    /* ── Pagination JS ── */
    .hub-pagination {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        margin: 18px 0 28px;
        flex-wrap: wrap;
    }
    .pag-btn {
        min-width: 34px;
        height: 34px;
        padding: 0 8px;
        background: transparent;
        border: 1px solid rgba(255,255,255,0.12);
        color: rgba(255,255,255,0.5);
        font-size: 0.85rem;
        font-weight: 600;
        border-radius: 6px;
        cursor: pointer;
        transition: background 0.15s, border-color 0.15s, color 0.15s;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .pag-btn:hover:not(:disabled) {
        background: rgba(0,242,255,0.08);
        border-color: rgba(0,242,255,0.35);
        color: #fff;
    }
    .pag-btn.pag-active {
        background: rgba(0,242,255,0.15);
        border-color: #00f2ff;
        color: #00f2ff;
        cursor: default;
    }
    .pag-btn:disabled {
        opacity: 0.25;
        cursor: default;
    }
    .pag-prev, .pag-next {
        font-size: 1.1rem;
        font-weight: 400;
    }
    .pag-ellipsis {
        color: rgba(255,255,255,0.25);
        font-size: 0.9rem;
        padding: 0 2px;
        user-select: none;
    }

/* --- Tags "à un seul article" : liste compacte (voir section 1c PHP) --- */
.others-singleton-label {
    width: 100%;
    margin: 14px 0 6px;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.35);
    font-style: italic;
}
.others-singleton-list {
    width: 100%;
    font-size: 0.85rem;
    line-height: 1.8;
    color: rgba(255,255,255,0.55);
}
.others-singleton-link {
    color: rgba(0,242,255,0.65);
    text-decoration: none;
    border-bottom: 1px dotted rgba(0,242,255,0.3);
}
.others-singleton-link:hover {
    color: #00f2ff;
    border-bottom-color: #00f2ff;
}
