/*
Desktop Animations CSS - Fade Effects Only
Smooth fade animations and image loading for desktop
Theme: Russell Publishing Child Theme
Author: Supersonic Playground
Copyright 2024, © Russell Publishing
*/

/* Desktop Media Query - 1024px and above */
@media screen and (min-width: 1024px) {
  
  /* Content fade animations for tab switching - NO STYLING CHANGES */
  .tab-content {
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
  }
  
  .tab-content:not(.active) {
    opacity: 0;
    transform: translateY(20px);
  }
  
  .tab-content.active {
    opacity: 1;
    transform: translateY(0);
  }
  
  /* Smooth image loading fade effect - NO STYLING CHANGES */
  .image img {
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                filter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, filter;
  }
  
  .image img:not(.loaded) {
    opacity: 1;
    filter: blur(0px);
  }
  
  .image img.loaded {
    opacity: 1;
    filter: blur(0);
  }
  
  /* Scroll-triggered fade animations - NO STYLING CHANGES */
  .fade-in-on-scroll {
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
  }
  
  .fade-in-on-scroll:not(.visible) {
    opacity: 0;
    transform: translateY(30px);
  }
  
  .fade-in-on-scroll.visible,
  .visible {
    opacity: 1;
    transform: translateY(0);
  }
  
  /* Ensure initial content is visible immediately */
  .news-listing:not(.fade-in-on-scroll),
  .featured-post:not(.fade-in-on-scroll),
  .topic-card:not(.fade-in-on-scroll),
  .section-heading:not(.fade-in-on-scroll),
  .outer-container:not(.fade-in-on-scroll) {
    opacity: 1;
    transform: translateY(0);
  }
  
  /* Loading spinner for images - NO STYLING CHANGES */
  .image-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top: 2px solid #007AFF;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: desktopSpin 1s linear infinite;
    z-index: 10;
  }
  
  .image-loading.loaded::before {
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
  }
  
  @keyframes desktopSpin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
  }
  
  /* Subtle fade-in micro-animation */
  @keyframes subtleFadeIn {
    0% {
      opacity: 0;
      transform: translateY(8px);
    }
    100% {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* Performance optimizations */
  .optimized-element {
    backface-visibility: hidden;
    perspective: 1000px;
    transform: translate3d(0, 0, 0);
  }
  
  /* Reduce motion for users who prefer it */
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }
}