/* Homepage Layout Styles */

/* Homepage Layout - 1/3 and 2/3 split */
.homepage-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
  margin-bottom: 2.25rem;
  align-items: start;
}

/* Posts Section (Left 1/3) */
.posts-section {
  background: var(--bg-color);
  border-radius: 7.5px;
  padding: 1.125rem;
  box-shadow: var(--shadow);
}

.posts-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-color);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 0.5rem;
}

.posts-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Posts list on homepage - one column */
.homepage-layout .posts-section .posts-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Posts list on posts page - 2 columns */
.posts-section .posts-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.post-item {
  background: var(--bg-light);
  border-radius: 6px;
  padding: 0.75rem;
  border-left: 2.25px solid var(--primary-color);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.post-item .post-meta {
  display: flex;
  gap: 0.75rem;
  color: var(--text-medium);
  font-size: 0.675rem;
  flex-wrap: wrap;
  margin-bottom: 0.5625rem;
  justify-content: flex-start;
}

.post-item .post-meta span {
  display: flex;
  align-items: center;
  gap: 0.1875rem;
}

.post-item .post-content {
  margin-top: 0.5625rem;
  margin-bottom: 0.5625rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  word-wrap: break-word;
  word-break: break-word;
  white-space: normal;
  text-align: left;
}

.post-item .post-categories {
  margin-top: 0.75rem;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.post-item:hover {
  transform: translateX(3.75px);
  box-shadow: var(--shadow);
}

/* Articles Section (Right 2/3) */
.articles-section {
  background: var(--bg-color);
  border-radius: 0 0 7.5px 7.5px;
  padding: 1.125rem;
  box-shadow: var(--shadow);
}

.articles-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-color);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 0.5rem;
}

/* Articles Grid */
.articles-section .articles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 1.5rem;
  margin-bottom: 0;
}

/* Remove bottom padding from containers */
#postsContainer,
#articlesContainer {
  padding-bottom: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .homepage-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .articles-grid {
    grid-template-columns: 1fr;
  }

  .articles-section .articles-grid {
    grid-template-columns: 1fr !important;
  }

  .posts-list {
    grid-template-columns: 1fr;
  }

  .posts-section,
  .articles-section {
    padding: 0.75rem;
  }
}
