/* HV Blog Filter - Custom Styles v4.8 */
/* Priority: 9999 - loaded AFTER Elementor */

/* ============================================
   BADGE CATÉGORIE - OVERRIDE ABSOLU
   Spécificité maximale pour override Elementor
   ============================================ */

/* RÈGLE UNIVERSELLE - Tous les badges du blog */
body.blog .elementor-posts .elementor-post__card .elementor-post__badge,
body.category .elementor-posts .elementor-post__card .elementor-post__badge,
body.archive .elementor-posts .elementor-post__card .elementor-post__badge,
body.page .elementor-posts .elementor-post__card .elementor-post__badge,
.elementor-widget-posts .elementor-posts .elementor-post__card .elementor-post__badge {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    display: inline-block !important;
}

/* Sidebar Featured (Article à la Une) - padding 18px */
.elementor-element-sidebar_featured .elementor-post__card .elementor-post__badge,
[data-id="sidebar_featured"] .elementor-post__card .elementor-post__badge {
    margin: 15px 18px 0 18px !important;
}

/* Posts Grid (Derniers articles) - padding 20px */
.elementor-element-posts_grid .elementor-post__card .elementor-post__badge,
[data-id="posts_grid"] .elementor-post__card .elementor-post__badge {
    margin: 15px 20px 0 20px !important;
}

/* ============================================

/* Force les images à remplir le conteneur thumbnail qui a un padding-bottom pour le ratio */
.elementor-posts--skin-cards .elementor-post__card .elementor-post__thumbnail {
    position: relative !important;
    overflow: hidden !important;
}

.elementor-posts--skin-cards .elementor-post__card .elementor-post__thumbnail img {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(1.01) !important;
    width: calc(100% + 1px) !important;
    height: auto !important;
    min-height: 100% !important;
    object-fit: cover !important;
}

/* ============================================
   BADGE CATÉGORIE - Positionnement entre photo et titre
   Override les styles Elementor avec sélecteurs IDENTIQUES aux pages
   ============================================ */

/* PAGE FR (3493) - posts_grid */
.elementor-3493 .elementor-element.elementor-element-posts_grid .elementor-post__card .elementor-post__badge {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    display: inline-block !important;
    margin: 15px 20px 0 20px !important;
}

/* PAGE FR (3493) - sidebar_featured */
.elementor-3493 .elementor-element.elementor-element-sidebar_featured .elementor-post__card .elementor-post__badge {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    display: inline-block !important;
    margin: 15px 18px 0 18px !important;
}

/* PAGE EN (3471) - posts_grid */
.elementor-3471 .elementor-element.elementor-element-posts_grid .elementor-post__card .elementor-post__badge {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    display: inline-block !important;
    margin: 15px 20px 0 20px !important;
}

/* PAGE EN (3471) - sidebar_featured */
.elementor-3471 .elementor-element.elementor-element-sidebar_featured .elementor-post__card .elementor-post__badge {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    display: inline-block !important;
    margin: 15px 18px 0 18px !important;
}

/* PAGE DE (3495) - posts_grid */
.elementor-3495 .elementor-element.elementor-element-posts_grid .elementor-post__card .elementor-post__badge {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    display: inline-block !important;
    margin: 15px 20px 0 20px !important;
}

/* PAGE DE (3495) - sidebar_featured */
.elementor-3495 .elementor-element.elementor-element-sidebar_featured .elementor-post__card .elementor-post__badge {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    display: inline-block !important;
    margin: 15px 18px 0 18px !important;
}

/* Fallback pour contenu AJAX (hors contexte Elementor page) */
.elementor-posts--skin-cards .elementor-post__card .elementor-post__badge {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    display: inline-block !important;
    margin: 15px 20px 0 20px !important;
}

/* ============================================
   PAGINATION STYLES
   ============================================ */
.elementor-pagination {
    margin-top: 60px !important;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-family: 'Manrope', sans-serif !important;
}

.elementor-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    font-family: 'Manrope', sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #64748B;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.elementor-pagination .page-numbers:hover {
    background: #3A4F62;
    border-color: #3A4F62;
    color: #FFFFFF;
}

.elementor-pagination .page-numbers.current {
    background: #3A4F62;
    border-color: #3A4F62;
    color: #FFFFFF;
    font-weight: 600 !important;
}

.elementor-pagination .page-numbers.prev,
.elementor-pagination .page-numbers.next {
    padding: 0 16px;
    font-weight: 500;
}

.elementor-pagination .page-numbers.dots {
    background: transparent;
    border: none;
    color: #94A3B8;
}

/* ============================================
   ARTICLE COUNTER BADGE
   ============================================ */
.hv-article-counter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #F1F5F9;
    border-radius: 20px;
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #64748B;
    margin-left: 12px;
}

.hv-article-counter svg {
    width: 14px;
    height: 14px;
    fill: #94A3B8;
}

.hv-article-counter .count {
    font-weight: 600;
    color: #3A4F62;
}

/* ============================================
   STICKY SIDEBAR
   ============================================ */
.hv-sticky-sidebar {
    position: sticky !important;
    top: 100px !important;
    align-self: flex-start !important;
}

/* Parent section needs flex display */
[data-id="main_content"] > .elementor-container {
    display: flex !important;
    align-items: flex-start !important;
}

/* Ensure proper flex behavior */
[data-id="main_content"] .elementor-column {
    display: flex;
    flex-direction: column;
}

/* Right column sticky - NO SCROLL */
[data-id="main_content"] .elementor-column:last-child {
    position: sticky !important;
    top: 100px !important;
    align-self: flex-start !important;
}

/* Also target by column width class */
[data-id="main_content"] .elementor-col-30,
[data-id="main_content"] .elementor-col-25 {
    position: sticky !important;
    top: 100px !important;
    align-self: flex-start !important;
}

/* ============================================
   FEATURED ARTICLE SIDEBAR CARD
   ============================================ */
.hv-sticky-sidebar .elementor-posts-container {
    display: block !important;
}

.hv-sticky-sidebar .elementor-post {
    margin-bottom: 0 !important;
}

.hv-sticky-sidebar .elementor-post__card {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.hv-sticky-sidebar .elementor-post__thumbnail {
    border-radius: 12px 12px 0 0;
}

.hv-sticky-sidebar .elementor-post__title {
    font-size: 16px !important;
    line-height: 1.4 !important;
}

.hv-sticky-sidebar .elementor-post__excerpt {
    font-size: 13px !important;
    color: #64748B !important;
    line-height: 1.5 !important;
}

/* ============================================
   POST CARD META WITH LIKES
   ============================================ */
.elementor-post__meta-data {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.hv-card-likes {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #94A3B8;
    font-size: 12px;
    font-family: 'Manrope', sans-serif;
    margin-left: auto;
}

.hv-card-likes svg {
    width: 14px;
    height: 14px;
    fill: #EF4444;
}

.hv-card-likes .likes-count {
    font-weight: 500;
}

/* ============================================
   CATEGORY HEADER WITH COUNTER
   ============================================ */
.hv-category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.hv-category-title {
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #3A4F62;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Active category link style adjustment */
.hv-menu-category a[style*="font-weight: 600"] + .hv-article-counter,
.hv-menu-category a.active + .hv-article-counter {
    background: #E0F2FE;
    color: #0284C7;
}

.hv-menu-category a[style*="font-weight: 600"] + .hv-article-counter .count,
.hv-menu-category a.active + .hv-article-counter .count {
    color: #0369A1;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 1024px) {
    #main_content .elementor-column:last-child {
        position: relative !important;
        top: 0 !important;
        max-height: none;
    }
    
    .hv-sticky-sidebar {
        position: relative !important;
        top: 0 !important;
    }
}
