/* =====================================
   Enhanced Animations CSS – optimized & accessible
===================================== */

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    .animate-section,
    .section-animate-child {
        transition: opacity 0.3s ease;
        transform: none !important;
    }
}

/* Main section animations */
.animate-section {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
    backface-visibility: hidden;
}

.section-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Child elements animations */
.section-animate-child {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
    backface-visibility: hidden;
}

.slide-up {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Micro-interactions for cards and buttons */
.sub-article {
    transition: transform 0.2s ease, box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.sub-article:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.sub-article:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Button hover effects */
.btn,
.article-btn,
#load-more-button {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover,
.article-btn:hover,
#load-more-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.btn:active,
.article-btn:active,
#load-more-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    /* Reduce animation intensity on mobile for better performance */
    .sub-article:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }

    .btn:hover,
    .article-btn:hover,
    #load-more-button:hover {
        transform: none;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
}
