/* FORCE MOBILE RESPONSIVE - HIGHEST PRIORITY */

@media screen and (max-width: 1023px) {
  html body .home-grid {
    display: block !important;
    grid-template-columns: 1fr !important;
  }

  html body .editor-layout-grid {
    display: block !important;
    grid-template-columns: 1fr !important;
  }

  html body .editor-main-column,
  html body .editor-side-column {
    width: 100% !important;
    display: block !important;
  }

  html body .editor-side-column {
    display: flex !important;
    flex-direction: column !important;
  }
}

/* Mobile Slider Optimization */
@media screen and (max-width: 767px) {
  /* Show and optimize slider for mobile */
  html body .featured-slider-section {
    display: block !important;
    margin: 0 0.75rem 1.5rem 0.75rem !important;
    padding: 0 !important;
  }

  html body .featured-slider-container {
    position: relative !important;
    height: auto !important;
    min-height: 300px !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  }

  html body .featured-slider {
    position: relative !important;
    height: auto !important;
    touch-action: pan-y pinch-zoom !important;
  }

  html body .slide {
    position: relative !important;
    display: block !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: none !important;
    min-height: 350px !important;
    height: 350px !important;
    opacity: 1 !important;
    transform: none !important;
    left: auto !important;
    top: auto !important;
  }

  html body .slide:not(.active) {
    display: none !important;
  }

  html body .slide.active {
    display: block !important;
    opacity: 1 !important;
    transform: none !important;
  }

  html body .slide-image {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    height: 100% !important;
    width: 100% !important;
    z-index: 1 !important;
  }

  html body .slide-image img {
    object-fit: cover !important;
    height: 100% !important;
    width: 100% !important;
  }

  html body .slide-overlay {
    display: block !important;
    position: absolute !important;
    inset: 0 !important;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.8) 100%) !important;
    z-index: 2 !important;
  }

  html body .slide-content {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    background: transparent !important;
    padding: 1.25rem !important;
    width: 100% !important;
    max-width: 100% !important;
    z-index: 3 !important;
    height: auto !important;
  }

  html body .slide-title {
    font-size: 1.15rem !important;
    line-height: 1.3 !important;
    margin-bottom: 0.5rem !important;
    margin-top: 0 !important;
  }

  html body .slide-title a {
    color: #fff !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
  }

  html body .slide-excerpt {
    font-size: 0.8rem !important;
    line-height: 1.4 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    color: rgba(255, 255, 255, 0.95) !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5) !important;
    margin-bottom: 0.75rem !important;
  }

  html body .slide-meta {
    margin-bottom: 0.5rem !important;
    font-size: 0.75rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
  }

  html body .slide-category {
    padding: 0.3rem 0.6rem !important;
    font-size: 0.7rem !important;
    border-radius: 12px !important;
  }

  html body .slide-date {
    font-size: 0.7rem !important;
    color: rgba(255, 255, 255, 0.9) !important;
  }

  html body .slide-actions {
    display: flex !important;
    flex-direction: row !important;
    gap: 0.75rem !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  html body .slide-read-more {
    font-size: 0.8rem !important;
    padding: 0.45rem 0.9rem !important;
    background: rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 20px !important;
    color: #fff !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
  }

  html body .slide-stats {
    font-size: 0.7rem !important;
    gap: 0.75rem !important;
    color: rgba(255, 255, 255, 0.9) !important;
    display: flex !important;
  }

  html body .slide-stats span {
    display: flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
  }

  /* Slider Navigation Buttons - Hide on mobile */
  html body .slider-nav {
    display: none !important;
  }

  html body .slider-btn {
    display: none !important;
  }

  /* Slider Dots */
  html body .slider-dots {
    position: absolute !important;
    bottom: 1rem !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    gap: 0.5rem !important;
    z-index: 10 !important;
  }

  html body .slider-dot {
    width: 8px !important;
    height: 8px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.5) !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
  }

  html body .slider-dot.active {
    background: #fff !important;
    width: 24px !important;
    border-radius: 4px !important;
  }
}

@media screen and (max-width: 480px) {
  html body .featured-slider-container {
    min-height: 300px !important;
  }

  html body .slide {
    min-height: 300px !important;
    height: 300px !important;
  }

  html body .slide-content {
    padding: 1rem !important;
  }

  html body .slide-title {
    font-size: 1rem !important;
  }

  html body .slide-excerpt {
    font-size: 0.75rem !important;
    -webkit-line-clamp: 2 !important;
    margin-bottom: 0.5rem !important;
  }

  html body .slide-meta {
    font-size: 0.7rem !important;
  }

  html body .slide-category {
    font-size: 0.65rem !important;
    padding: 0.25rem 0.5rem !important;
  }

  html body .slide-read-more {
    font-size: 0.75rem !important;
    padding: 0.4rem 0.8rem !important;
  }

  html body .slide-stats {
    font-size: 0.65rem !important;
  }



  html body .slider-dots {
    bottom: 0.75rem !important;
    gap: 0.4rem !important;
  }

  html body .slider-dot {
    width: 6px !important;
    height: 6px !important;
  }

  html body .slider-dot.active {
    width: 20px !important;
  }
}


/* Dark Mode Slider */
@media screen and (max-width: 767px) {
  html[data-theme="dark"] body .featured-slider-container {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
  }

  html[data-theme="dark"] body .slider-btn {
    background: rgba(45, 55, 72, 0.6) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
  }

  html[data-theme="dark"] body .slider-btn:hover {
    background: rgba(45, 55, 72, 0.8) !important;
  }
}


/* ============================================
   SCROLL ANIMATIONS - FADE & SLIDE IN
   ============================================ */

/* Initial state - hidden */
.editor-choice-section,
.category-tabs-section,
.hero-post,
.sidebar-widget,
.editor-featured-card,
.editor-side-card,
.category-post-card,
.recent-post-item {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Animated state - visible */
.editor-choice-section.animate-in,
.category-tabs-section.animate-in,
.hero-post.animate-in,
.sidebar-widget.animate-in,
.editor-featured-card.animate-in,
.editor-side-card.animate-in,
.category-post-card.animate-in,
.recent-post-item.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation delays */
.editor-side-card:nth-child(1) { transition-delay: 0.1s; }
.editor-side-card:nth-child(2) { transition-delay: 0.2s; }
.editor-side-card:nth-child(3) { transition-delay: 0.3s; }
.editor-side-card:nth-child(4) { transition-delay: 0.4s; }

.category-post-card:nth-child(1) { transition-delay: 0.1s; }
.category-post-card:nth-child(2) { transition-delay: 0.2s; }
.category-post-card:nth-child(3) { transition-delay: 0.3s; }
.category-post-card:nth-child(4) { transition-delay: 0.4s; }

.sidebar-widget:nth-child(1) { transition-delay: 0.1s; }
.sidebar-widget:nth-child(2) { transition-delay: 0.2s; }
.sidebar-widget:nth-child(3) { transition-delay: 0.3s; }
.sidebar-widget:nth-child(4) { transition-delay: 0.4s; }
.sidebar-widget:nth-child(5) { transition-delay: 0.5s; }

.recent-post-item:nth-child(1) { transition-delay: 0.05s; }
.recent-post-item:nth-child(2) { transition-delay: 0.1s; }
.recent-post-item:nth-child(3) { transition-delay: 0.15s; }
.recent-post-item:nth-child(4) { transition-delay: 0.2s; }

/* Fade in animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide from left */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide from right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale in */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Apply different animations to different sections */
.editor-choice-section.animate-in {
  animation: fadeInUp 0.6s ease-out forwards;
}

.category-tabs-section.animate-in {
  animation: fadeInUp 0.6s ease-out forwards;
}

.hero-post.animate-in {
  animation: scaleIn 0.6s ease-out forwards;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .editor-choice-section,
  .category-tabs-section,
  .hero-post,
  .sidebar-widget,
  .editor-featured-card,
  .editor-side-card,
  .category-post-card,
  .recent-post-item {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
}
