.article-card {
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    transform: translateY(60px);
}
.article-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}
.article-card:hover .article-image {
    transform: scale(1.1);
}
.article-card:hover .article-overlay {
    opacity: 0.5;
}
.article-card:hover .article-content h3 {
    transform: translateY(-10px);
}
.article-card .article-content h3 {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.article-card .article-overlay {
    transition: opacity 0.4s ease;
}
.article-card.hidden {
    display: none;
}
.articles-section {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.articles-section.visible {
    opacity: 1;
    transform: translateY(0);
}
.tag-filter {
    cursor: pointer;
    background: transparent;
    border: 2px solid rgba(0,0,0,0.15);
    color: rgba(0,0,0,0.6);
    padding: 12px 24px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
}
.tag-filter:hover {
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.3);
    color: #000;
}
.tag-filter.active {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}
.article-image {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.hero-title-modern {
    position: relative;
}
.hero-text-hover {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-block;
}
.hero-text-hover:hover {
    transform: translateY(-10px) scale(1.05);
    letter-spacing: 0.05em;
}
.hero-photo-container {
    z-index: 10;
    animation: fadeIn 1s ease-out 0.8s forwards;
    opacity: 0;
    cursor: pointer;
}
.hero-photo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    filter: grayscale(100%);
    transition: opacity 0.2s ease-in-out, filter 0.4s ease;
}
.hero-photo.active {
    opacity: 1;
}
.hero-photo-container:hover .hero-photo {
    filter: grayscale(0%);
}
.hero-line {
    opacity: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero-line:nth-child(1) {
    animation-delay: 0.2s;
}
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
.hero-line-icon {
    opacity: 0;
    animation: fadeInScale 1s ease-out 0.1s forwards;
}
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scaleX(0);
    }
    to {
        opacity: 1;
        transform: scaleX(1);
    }
}
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
html {
    scroll-behavior: smooth;
}
body {
    overflow-x: hidden;
}
section {
    min-height: 100vh;
}
.articles-section {
    min-height: auto;
    height: auto;
}
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.scroll-indicator span {
    font-size: 10px;
    letter-spacing: 3px;
    color: white;
    opacity: 0.7;
}
.scroll-line {
    width: 1px;
    height: 60px;
    background: rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}
.scroll-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    animation: scrollLine 2s ease-in-out infinite;
}
@keyframes scrollLine {
    0% { transform: translateY(-100%); }
    50% { transform: translateY(0); }
    100% { transform: translateY(100%); }
}
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
    display: flex;
    flex-direction: column;
}
.page-transition.active {
    transform: translateX(0);
}
.page-transition .preview-header {
    background: linear-gradient(135deg, #991b1b 0%, #dc2626 50%, #ef4444 100%);
    padding: 5rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.page-transition .preview-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(30px);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
}
.page-transition .preview-meta {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.8);
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
}
.page-transition .preview-content {
    flex: 1;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}
.page-transition .preview-loader {
    width: 50px;
    height: 50px;
    border: 3px solid #f3f4f6;
    border-top-color: #dc2626;
    border-radius: 50%;
    opacity: 0;
    animation: spin 1s linear infinite, fadeIn 0.4s ease-out 0.6s forwards;
}
.page-transition .preview-text {
    font-size: 0.75rem;
    color: #9ca3af;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeIn 0.4s ease-out 0.7s forwards;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes fadeIn {
    to {
        opacity: 1;
    }
}
@keyframes logoPulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    25% {
        transform: scale(1.2) rotate(5deg);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.3) rotate(0deg);
        opacity: 0.7;
    }
    75% {
        transform: scale(1.2) rotate(-5deg);
        opacity: 0.9;
    }
}

/* Featured Carousel Styling */
.featured-carousel-item {
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.featured-carousel-item:hover img {
    transform: scale(1.05);
}

#featuredPrev,
#featuredNext {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

#featuredPrev:hover,
#featuredNext:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 10px 30px rgba(220, 38, 38, 0.4);
}

#featuredPrev:active,
#featuredNext:active {
    transform: translateY(-50%) scale(0.95);
}

.featured-dot {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.featured-dot:hover {
    transform: scale(1.5);
}

.featured-dot.bg-red-600 {
    width: 1.5rem;
    border-radius: 0.5rem;
}

/* Animation d'entrée pour le carrousel */
@keyframes fadeInCarousel {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.featured-carousel-item {
    animation: fadeInCarousel 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Animation lettre par lettre pour DERNIÈRES PUBLICATIONS */
.letter-animate {
    display: inline-block;
    opacity: 0;
    transform: translateY(50px) rotate(-5deg);
    transition: none;
}

.publications-title.active .letter-animate {
    animation: letterPop 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes letterPop {
    0% {
        opacity: 0;
        transform: translateY(50px) rotate(-5deg) scale(0.8);
    }
    50% {
        transform: translateY(-10px) rotate(2deg) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotate(0deg) scale(1);
    }
}

/* Délai progressif pour chaque lettre */
.publications-title.active .letter-animate:nth-child(1) { animation-delay: 0s; }
.publications-title.active .letter-animate:nth-child(2) { animation-delay: 0.03s; }
.publications-title.active .letter-animate:nth-child(3) { animation-delay: 0.06s; }
.publications-title.active .letter-animate:nth-child(4) { animation-delay: 0.09s; }
.publications-title.active .letter-animate:nth-child(5) { animation-delay: 0.12s; }
.publications-title.active .letter-animate:nth-child(6) { animation-delay: 0.15s; }
.publications-title.active .letter-animate:nth-child(7) { animation-delay: 0.18s; }
.publications-title.active .letter-animate:nth-child(8) { animation-delay: 0.21s; }
.publications-title.active .letter-animate:nth-child(9) { animation-delay: 0.24s; }
.publications-title.active .letter-animate:nth-child(10) { animation-delay: 0.27s; }
.publications-title.active .letter-animate:nth-child(11) { animation-delay: 0.30s; }
.publications-title.active .letter-animate:nth-child(12) { animation-delay: 0.33s; }
.publications-title.active .letter-animate:nth-child(13) { animation-delay: 0.36s; }
.publications-title.active .letter-animate:nth-child(14) { animation-delay: 0.39s; }
.publications-title.active .letter-animate:nth-child(15) { animation-delay: 0.42s; }
.publications-title.active .letter-animate:nth-child(16) { animation-delay: 0.45s; }
.publications-title.active .letter-animate:nth-child(17) { animation-delay: 0.48s; }
.publications-title.active .letter-animate:nth-child(18) { animation-delay: 0.51s; }
.publications-title.active .letter-animate:nth-child(19) { animation-delay: 0.54s; }
.publications-title.active .letter-animate:nth-child(20) { animation-delay: 0.57s; }
.publications-title.active .letter-animate:nth-child(21) { animation-delay: 0.60s; }

/* Hide scrollbar for horizontal scroll */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Smooth scroll behavior */
#articlesScrollContainer {
    scroll-snap-type: x proximity;
}

.article-card {
    scroll-snap-align: start;
}

/* Scroll buttons visibility */
#scrollLeft.visible,
#scrollRight.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Default: Horizontal scroll for desktop */
#articlesScrollContainer {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    overflow-x: auto;
    overflow-y: hidden;
}

#articlesGrid {
    flex-direction: row;
    gap: 2rem;
}

#articlesGrid .article-card {
    flex: 0 0 auto;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    width: 450px;
    height: 600px;
}

#articlesGrid .article-card:hover {
    transform: scale(1.02) translateY(-5px);
}

/* Mobile: TikTok-style vertical scroll */
@media (max-width: 767px) {
    #articlesScrollContainer {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        height: 100vh !important;
        scroll-snap-type: y mandatory;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10;
    }
    
    #articlesGrid {
        flex-direction: column !important;
        gap: 0 !important;
        min-height: 100vh;
    }
    
    #articlesGrid .article-card {
        width: 100% !important;
        height: 100vh !important;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        flex-shrink: 0;
    }
    
    #articlesGrid .article-card a {
        border-radius: 0 !important;
    }
    
    #articlesGrid .article-card:hover {
        transform: none !important;
    }
    
    /* Hide scroll buttons on mobile */
    #scrollLeft,
    #scrollRight {
        display: none !important;
    }
    
    /* Hide scrollbar on mobile */
    #articlesScrollContainer::-webkit-scrollbar {
        display: none;
    }
    
    #articlesScrollContainer {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
}

/* Lazy loading images */
.lazy-image {
    transition: opacity 0.5s ease-in-out;
}

.lazy-image.loaded {
    opacity: 1 !important;
}

/* Placeholder for unloaded images */
.article-card a {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

/* Virtual scrolling - cards not visible have reduced rendering */
.article-card:not(.visible) {
    content-visibility: auto;
    contain: layout style paint;
}

.article-card.visible {
    content-visibility: visible;
}

/* Mobile TikTok-style enhancements */
@media (max-width: 767px) {
    .articles-section {
        padding: 0 !important;
    }
    
    .articles-section .max-w-\[1800px\] {
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    /* Make article content more prominent on mobile */
    .article-card .article-content {
        padding: 2rem 1.5rem !important;
    }
    
    .article-card .article-content h3 {
        font-size: 1.75rem !important;
        line-height: 1.2 !important;
    }
    
    .article-card .article-content p {
        font-size: 0.875rem !important;
    }
    
    /* Smooth scroll on mobile */
    #articlesScrollContainer {
        -webkit-overflow-scrolling: touch;
    }
}

/* Smooth scrollbar */
#articlesScrollContainer::-webkit-scrollbar {
    display: none;
}

#articlesScrollContainer {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Translation Badges - Style moderne et élégant */
.translation-badge {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.9) 100%);
    backdrop-filter: blur(12px);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.translation-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.translation-badge:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.25), 0 4px 8px rgba(0, 0, 0, 0.15);
    border-color: rgba(220, 38, 38, 0.3);
}

.translation-badge:hover::before {
    left: 100%;
}

.translation-badge-flag {
    font-size: 18px;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.translation-badge-flag img {
    width: 22px;
    height: 16px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.translation-badge-code {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #374151;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.translation-badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    z-index: 20;
}

/* Animation d'apparition des badges */
@keyframes badgeFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.translation-badge {
    animation: badgeFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.translation-badge:nth-child(1) { animation-delay: 0.1s; }
.translation-badge:nth-child(2) { animation-delay: 0.15s; }
.translation-badge:nth-child(3) { animation-delay: 0.2s; }
.translation-badge:nth-child(4) { animation-delay: 0.25s; }
.translation-badge:nth-child(5) { animation-delay: 0.3s; }

/* Responsive adjustments */
@media (max-width: 767px) {
    .translation-badge {
        padding: 5px 8px;
        gap: 5px;
    }
    
    .translation-badge-flag {
        font-size: 16px;
    }
    
    .translation-badge-flag img {
        width: 20px;
        height: 14px;
    }
    
    .translation-badge-code {
        font-size: 10px;
    }
}
