/* ============================================
   COMPLETE MOBILE RESPONSIVE FIX
   Priority: Load AFTER modern-style.css
   ============================================ */

/* Base adjustments for all screens */
.home-content {
  padding: 2rem 0 !important;
}

.home-grid {
  max-width: 1400px !important;
  margin: 0 auto !important;
  padding: 0 1rem !important;
  gap: 2rem !important;
}

/* Large Desktop (1400px+) */
@media (min-width: 1400px) {
  .home-grid {
    padding: 0 2rem !important;
  }
}

/* Desktop to Tablet (1024px - 1399px) */
@media (max-width: 1399px) {
  .home-grid {
    grid-template-columns: 2fr 1fr !important;
    gap: 1.5rem !important;
  }
}

/* Tablet (768px - 1023px) */
@media (max-width: 1023px) {
  .home-content {
    padding: 1.5rem 0 !important;
  }

  .home-grid {
    grid-template-columns: 1fr !important;
    padding: 0 1rem !important;
    gap: 2rem !important;
  }

  /* Editor's Choice */
  .editor-choice-section {
    padding: 1.5rem !important;
    margin-bottom: 2rem !important;
  }

  .editor-layout-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .editor-side-column {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }

  .editor-featured-image {
    height: 280px !important;
  }

  /* Category Tabs */
  .category-tabs-section {
    padding: 1.5rem !important;
  }

  .category-posts-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }

  /* Hero Post */
  .hero-post {
    grid-template-columns: 1fr !important;
    min-height: auto !important;
  }

  .hero-post-image {
    height: 300px !important;
  }

  /* Sidebar */
  .right-sidebar {
    gap: 1.5rem !important;
  }
}

/* Mobile (481px - 767px) */
@media (max-width: 767px) {
  .home-content {
    padding: 1rem 0 !important;
  }

  .home-grid {
    padding: 0 0.75rem !important;
    gap: 1.5rem !important;
  }

  /* Hide slider on mobile */
  .featured-slider-section {
    display: none !important;
  }

  /* Editor's Choice */
  .editor-choice-section {
    padding: 1rem !important;
    margin-bottom: 1.5rem !important;
    border-radius: 12px !important;
  }

  .editor-section-title {
    font-size: 1.4rem !important;
  }

  .editor-section-wave svg {
    width: 50px !important;
    height: 8px !important;
  }

  .editor-featured-image {
    height: 200px !important;
  }

  .editor-featured-body {
    padding: 1rem !important;
  }

  .editor-title {
    font-size: 1.15rem !important;
    line-height: 1.4 !important;
  }

  .editor-excerpt {
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
  }

  .editor-meta {
    font-size: 0.8rem !important;
  }

  .editor-side-column {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  .editor-side-card {
    display: flex !important;
    flex-direction: row !important;
    padding: 0.75rem !important;
  }

  .editor-side-thumb {
    width: 90px !important;
    height: 75px !important;
    flex-shrink: 0 !important;
  }

  .editor-side-content {
    flex: 1 !important;
    padding-left: 0.75rem !important;
  }

  .editor-side-title {
    font-size: 0.9rem !important;
    line-height: 1.3 !important;
  }

  .editor-side-date {
    font-size: 0.75rem !important;
  }

  /* Category Tabs */
  .category-tabs-section {
    padding: 1rem !important;
    margin-bottom: 1.5rem !important;
    border-radius: 12px !important;
  }

  .category-tabs-section .section-header h3 {
    font-size: 1.4rem !important;
  }

  .category-tabs-section .section-header p {
    font-size: 0.85rem !important;
  }

  .category-tabs-nav {
    gap: 0.5rem !important;
    margin-bottom: 1.5rem !important;
  }

  .category-tab-btn {
    padding: 0.5rem 0.85rem !important;
    font-size: 0.85rem !important;
    white-space: nowrap !important;
  }

  .tab-count {
    min-width: 22px !important;
    height: 22px !important;
    font-size: 0.75rem !important;
  }

  .category-posts-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .category-post-card {
    border-radius: 10px !important;
  }

  .category-post-image {
    height: 180px !important;
  }

  .category-post-content {
    padding: 1rem !important;
  }

  .category-post-content h5 {
    font-size: 1rem !important;
  }

  .category-post-meta {
    font-size: 0.75rem !important;
  }

  .category-post-excerpt {
    font-size: 0.85rem !important;
    line-height: 1.5 !important;
  }

  .read-more-link {
    font-size: 0.85rem !important;
  }

  /* Hero Post */
  .hero-post {
    border-radius: 12px !important;
  }

  .hero-post-image {
    height: 220px !important;
  }

  .hero-post-content {
    padding: 1.25rem !important;
  }

  .hero-post h2 {
    font-size: 1.35rem !important;
  }

  .hero-excerpt {
    font-size: 0.9rem !important;
  }

  /* Sidebar */
  .right-sidebar {
    gap: 1.25rem !important;
  }

  .sidebar-widget {
    padding: 1rem !important;
    border-radius: 12px !important;
  }

  .widget-header h3 {
    font-size: 1.1rem !important;
  }

  /* Recent Posts Sidebar */
  .recent-post-item {
    padding: 0.65rem !important;
  }

  .recent-post-thumb {
    width: 70px !important;
    height: 70px !important;
  }

  .recent-post-info h4 {
    font-size: 0.85rem !important;
    line-height: 1.3 !important;
  }

  .recent-post-meta {
    font-size: 0.75rem !important;
  }

  /* Popular Posts */
  .popular-post-item {
    padding: 0.75rem !important;
  }

  .popular-post-number {
    font-size: 1.1rem !important;
    min-width: 32px !important;
    height: 32px !important;
  }

  .popular-post-details h4 {
    font-size: 0.85rem !important;
  }

  /* Categories */
  .category-item {
    padding: 0.65rem !important;
    font-size: 0.9rem !important;
  }

  /* Tag Cloud */
  .tag-cloud {
    gap: 0.5rem !important;
  }

  .tag-cloud-item {
    font-size: 0.8rem !important;
    padding: 0.4rem 0.75rem !important;
  }

  /* Newsletter */
  .newsletter-widget {
    padding: 1rem !important;
  }

  .newsletter-widget h3 {
    font-size: 1.15rem !important;
  }

  .newsletter-widget p {
    font-size: 0.85rem !important;
  }

  .newsletter-input {
    font-size: 0.9rem !important;
    padding: 0.65rem !important;
  }

  .newsletter-btn {
    font-size: 0.9rem !important;
    padding: 0.65rem 1.1rem !important;
  }
}

/* Small Mobile (320px - 480px) */
@media (max-width: 480px) {
  .home-grid {
    padding: 0 0.5rem !important;
    gap: 1rem !important;
  }

  /* Editor's Choice */
  .editor-choice-section {
    padding: 0.85rem !important;
  }

  .editor-section-title {
    font-size: 1.25rem !important;
  }

  .editor-featured-image {
    height: 180px !important;
  }

  .editor-featured-body {
    padding: 0.85rem !important;
  }

  .editor-title {
    font-size: 1.05rem !important;
  }

  .editor-excerpt {
    font-size: 0.85rem !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }

  .editor-side-card {
    padding: 0.6rem !important;
  }

  .editor-side-thumb {
    width: 75px !important;
    height: 65px !important;
  }

  .editor-side-title {
    font-size: 0.85rem !important;
  }

  /* Category Tabs */
  .category-tabs-section {
    padding: 0.85rem !important;
  }

  .category-tabs-section .section-header h3 {
    font-size: 1.25rem !important;
  }

  .category-tab-btn {
    padding: 0.45rem 0.7rem !important;
    font-size: 0.8rem !important;
  }

  .tab-count {
    min-width: 20px !important;
    height: 20px !important;
    font-size: 0.7rem !important;
    padding: 0 0.35rem !important;
  }

  .category-post-image {
    height: 160px !important;
  }

  .category-post-content {
    padding: 0.85rem !important;
  }

  .category-post-content h5 {
    font-size: 0.95rem !important;
  }

  .category-post-excerpt {
    font-size: 0.8rem !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }

  /* Hero Post */
  .hero-post-image {
    height: 180px !important;
  }

  .hero-post-content {
    padding: 1rem !important;
  }

  .hero-post h2 {
    font-size: 1.2rem !important;
  }

  .hero-excerpt {
    font-size: 0.85rem !important;
  }

  /* Sidebar */
  .sidebar-widget {
    padding: 0.85rem !important;
  }

  .widget-header h3 {
    font-size: 1rem !important;
  }

  .recent-post-item {
    padding: 0.5rem !important;
  }

  .recent-post-thumb {
    width: 60px !important;
    height: 60px !important;
  }

  .recent-post-info h4 {
    font-size: 0.8rem !important;
  }

  .popular-post-number {
    font-size: 1rem !important;
    min-width: 28px !important;
    height: 28px !important;
  }

  .category-item {
    padding: 0.55rem !important;
    font-size: 0.85rem !important;
  }

  .tag-cloud-item {
    font-size: 0.75rem !important;
    padding: 0.35rem 0.65rem !important;
  }

  .newsletter-widget h3 {
    font-size: 1.05rem !important;
  }

  .newsletter-input,
  .newsletter-btn {
    font-size: 0.85rem !important;
  }
}

/* Extra Small Mobile (< 360px) */
@media (max-width: 359px) {
  .home-grid {
    padding: 0 0.4rem !important;
  }

  .editor-choice-section,
  .category-tabs-section,
  .sidebar-widget {
    padding: 0.7rem !important;
  }

  .editor-section-title,
  .category-tabs-section .section-header h3 {
    font-size: 1.15rem !important;
  }

  .editor-featured-image,
  .category-post-image,
  .hero-post-image {
    height: 150px !important;
  }

  .editor-side-thumb,
  .recent-post-thumb {
    width: 55px !important;
    height: 55px !important;
  }
}

/* Landscape Mobile */
@media (max-width: 767px) and (orientation: landscape) {
  .editor-featured-image {
    height: 180px !important;
  }

  .category-post-image {
    height: 150px !important;
  }

  .hero-post-image {
    height: 180px !important;
  }

  .editor-side-column {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Minimum touch target size: 44x44px (Apple HIG) */
  .category-tab-btn,
  .tag-cloud-item,
  .category-item,
  .quick-link {
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Disable hover transforms on touch */
  .editor-featured-card:hover,
  .editor-side-card:hover,
  .category-post-card:hover,
  .recent-post-item:hover {
    transform: none !important;
  }

  /* Larger tap areas */
  .editor-side-card,
  .recent-post-item,
  .popular-post-item {
    padding: 0.75rem !important;
  }
}

/* Print Styles */
@media print {
  .featured-slider-section,
  .right-sidebar,
  .newsletter-widget,
  .theme-toggle,
  .search-toggle {
    display: none !important;
  }

  .home-grid {
    grid-template-columns: 1fr !important;
  }

  .editor-choice-section,
  .category-tabs-section {
    page-break-inside: avoid !important;
  }
}
