
  .container {
    display: flex;
    width:98%;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    gap: 2rem;
  }
  main.posts {
    flex: 1 1 65%;
  }
  main.posts article {
    background: #fff;
    margin-bottom: 0.5rem;
    padding: 1rem;
    border-radius: 6px;
    box-shadow: 0 0 8px rgba(0,0,0,0.1);
  }
  main.posts article img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    object-fit: cover;
  }
  aside.sidebar {
    flex: 1 1 30%;
    position: relative; /* For JS positioning */
  }
  .sidebar-inner {
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 6px;
    box-shadow: 0 0 8px rgba(0,0,0,0.1);
    width: 100%;
  }

  /* Sticky sidebar styles */
  .sidebar-inner.fixed {
    position: fixed;
    top: 20px;
    width: 300px; /* fixed width to avoid shrinking */
  }
  .sidebar-inner.absolute {
    position: absolute;
    bottom: 0;
    top: auto;
  }

  /* Responsive: stack posts and sidebar */
  @media (max-width: 768px) {
    .container {
      flex-direction: column;
    }
    aside.sidebar {
      order: 2; /* sidebar below posts */
      width: 100% !important;
      position: static !important;
      margin-top: 2rem;
    }
    .sidebar-inner {
      position: static !important;
      width: 100% !important;
      box-shadow: none;
      background: #fff;
      padding: 1rem 0;
    }
  }