/**
 * BLOG LAYOUT - Sistema de diseño limpio
 */

/* Base styles - Mobile first */
.blog-layout {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  gap: 2rem;
}

.blog-layout .posts-container {
  width: 100%;
  max-width: 100%;
  order: 1;
}

.blog-layout .blog-sidebar {
  width: 100%;
  max-width: 100%;
  order: 2;
  position: static;
  height: auto;
  margin-top: 40px;
  margin-bottom: 0;
}

/* Desktop layout */
@media (min-width: 992px) {
  .blog-layout {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
  }
  
  .blog-layout .posts-container {
    flex: 1;
    max-width: calc(100% - 320px);
    padding-right: 20px;
    order: 1;
  }
  
  .blog-layout .blog-sidebar {
    width: 300px;
    flex: 0 0 300px;
    max-width: 300px;
    position: sticky;
    top: 100px;
    margin-top: 0;
    margin-bottom: 0;
    order: 2;
  }
}

/* Asegurar correcto comportamiento en móvil con especificidad en lugar de !important */
@media (max-width: 991.98px) {
  body .container .blog-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
  }
  
  body .container .blog-layout .posts-container {
    width: 100%;
    max-width: 100%;
    order: 1;
  }
  
  body .container .blog-layout .blog-sidebar {
    width: 100%;
    max-width: 100%;
    order: 2;
    margin-top: 40px;
    margin-bottom: 0;
    position: static;
    height: auto;
  }
}

/* Extra small devices - Force column layout even more aggressively */
@media (max-width: 767px) {
  .blog-layout {
    display: flex !important;
    flex-direction: column !important;
  }
  
  body .container .blog-layout,
  .container .blog-layout,
  div.container div.blog-layout {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  body .container .blog-layout .posts-container,
  .container .blog-layout .posts-container,
  div.container div.blog-layout main.posts-container {
    width: 100% !important;
    max-width: 100% !important;
    order: 1 !important;
  }
  
  body .container .blog-layout .blog-sidebar,
  .container .blog-layout .blog-sidebar,
  div.container div.blog-layout aside.blog-sidebar {
    width: 100% !important;
    max-width: 100% !important;
    order: 2 !important;
    margin-top: 40px !important;
    position: static !important;
    height: auto !important;
  }
}

/* Make post cards stack on very small screens */
@media (max-width: 767px) {
  .post-card {
    grid-template-columns: 1fr !important;
  }
  
  .post-card .post-card-image {
    order: -1 !important;
  }
  
  .featured-post {
    grid-template-columns: 1fr !important;
  }
} 