/* 双栏卡片布局样式 - 仅用于首页文章列表 */

/* 文章列表容器 - 仅首页 */
#recent-posts.recent-posts {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: space-between !important;
}

/* 分类磁贴 - 占一整行 */
#recent-posts.recent-posts > .category-bar-wrapper {
  width: 100% !important;
  flex: 0 0 100% !important;
  max-width: 100% !important;
  margin-top: 0 !important;
  margin-bottom: 1rem !important;
  box-shadow: none !important;
  display: block !important;
}

#recent-posts.recent-posts > .category-bar-wrapper:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* 轮播卡片 - 占一整行 */
#recent-posts.recent-posts > .recent-post-item.carousel-wrapper {
  width: 100% !important;
  flex: 0 0 100% !important;
  max-width: 100% !important;
  margin-top: 1rem !important;
  margin-bottom: 0 !important;
  box-shadow: none !important;
  display: block !important;
  height: auto !important;
}

#recent-posts.recent-posts > .recent-post-item.carousel-wrapper:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* 确保轮播卡片内部的 swiper 占满宽度 - 仅首页 */
#recent-posts.recent-posts .blog-slider {
  width: 100% !important;
  max-width: 100% !important;
}

/* 单篇文章卡片 - 强制纵向布局（排除分类磁贴和轮播） */
#recent-posts.recent-posts > .recent-post-item:not(.category-bar-wrapper):not(.carousel-wrapper) {
  width: 49.5% !important;
  margin-top: 1rem !important;
  display: flex !important;
  flex-direction: column !important;
  height: auto !important;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

#recent-posts.recent-posts > .recent-post-item:not(.category-bar-wrapper):not(.carousel-wrapper):hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

/* 封面图容器 - 宽度100%，高度固定 */
#recent-posts.recent-posts > .recent-post-item:not(.category-bar-wrapper):not(.carousel-wrapper) .post_cover {
  width: 100% !important;
  height: 200px !important;
  overflow: hidden;
  position: relative;
  order: 1 !important;
}

/* 左右圆角都改为顶部圆角 */
#recent-posts.recent-posts > .recent-post-item:not(.category-bar-wrapper):not(.carousel-wrapper) .post_cover.left_radius,
#recent-posts.recent-posts > .recent-post-item:not(.category-bar-wrapper):not(.carousel-wrapper) .post_cover.right_radius,
#recent-posts.recent-posts > .recent-post-item:not(.category-bar-wrapper):not(.carousel-wrapper) .post_cover.left,
#recent-posts.recent-posts > .recent-post-item:not(.category-bar-wrapper):not(.carousel-wrapper) .post_cover.right {
  border-radius: 8px 8px 0 0 !important;
  order: 0 !important;
}

/* 封面图样式 */
#recent-posts.recent-posts > .recent-post-item:not(.category-bar-wrapper):not(.carousel-wrapper) .post_cover img.post_bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

#recent-posts.recent-posts > .recent-post-item:not(.category-bar-wrapper):not(.carousel-wrapper):hover .post_cover img.post_bg {
  transform: scale(1.05);
}

/* 文章信息区域 - 宽度100% */
#recent-posts.recent-posts > .recent-post-item:not(.category-bar-wrapper):not(.carousel-wrapper) > .recent-post-info {
  width: 100% !important;
  padding: 20px 30px !important;
  order: 2 !important;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* 无封面时的样式 */
#recent-posts.recent-posts > .recent-post-item:not(.category-bar-wrapper):not(.carousel-wrapper) > .recent-post-info.no-cover {
  padding: 30px !important;
  order: 1 !important;
}

/* 文章标题 */
#recent-posts.recent-posts > .recent-post-item:not(.category-bar-wrapper):not(.carousel-wrapper) .article-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 1.2em !important;
  line-height: 1.5;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

/* 文章元信息 */
#recent-posts.recent-posts > .recent-post-item:not(.category-bar-wrapper):not(.carousel-wrapper) .article-meta-wrap {
  margin-top: auto;
  font-size: 0.9em;
}

/* 隐藏文章详情内容 */
#recent-posts.recent-posts > .recent-post-item:not(.category-bar-wrapper):not(.carousel-wrapper) .content {
  display: none !important;
}

/* 分类磁贴样式调整 - 确保占满整行 - 仅首页 */
#recent-posts.recent-posts #categoryBar {
  width: 100% !important;
  display: block !important;
}

#recent-posts.recent-posts .categoryBar-list {
  width: 100% !important;
  max-width: 100% !important;
  margin: 5px 0 0 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: space-between !important;
  box-sizing: border-box !important;
}

/* 确保每个分类项的宽度正确 - 仅首页 */
#recent-posts.recent-posts .categoryBar-list-item {
  box-sizing: border-box !important;
}

/* 响应式设计：小屏幕下单栏显示 */
@media (max-width: 768px) {
  #recent-posts.recent-posts > .recent-post-item:not(.category-bar-wrapper):not(.carousel-wrapper) {
    width: 100% !important;
    flex-direction: column !important;
  }
  
  #recent-posts.recent-posts > .recent-post-item:not(.category-bar-wrapper):not(.carousel-wrapper) .post_cover {
    height: 230px !important;
  }
}

/* 暗黑模式适配 */
[data-theme="dark"] #recent-posts.recent-posts > .recent-post-item:not(.category-bar-wrapper):not(.carousel-wrapper) {
  background: var(--card-bg);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] #recent-posts.recent-posts > .recent-post-item:not(.category-bar-wrapper):not(.carousel-wrapper):hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}
