/*
 Theme Name: Twenty Twenty-Three Child
 Theme URI: https://example.com/
 Description: Child theme of Twenty Twenty-Three (block theme)
 Author: Your Name
 Author URI: https://example.com/
 Template: twentytwentythree
 Version: 1.0.0
 Text Domain: twentytwentythree-child
*/

/* 在这里添加你的自定义样式（子主题样式） */
/* 示例：调整正文最大宽度 */
.wp-site-blocks {
  max-width: 1200px;
  margin: 0 auto;
}

/* 列表页文章标题：缩小字号并最多显示两行 */
.wp-block-query .wp-block-post-title {
  font-size: var(--wp--preset--font-size--medium);
  line-height: 1.3;
}

.wp-block-query .wp-block-post-title,
.wp-block-query .wp-block-post-title a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

/* 列表页（查询循环）特色图片：图片按比例完整显示 */
body.category-shopping  .wp-block-query .wp-block-post-featured-image img,
body.category-shopping  .wp-block-post-template .wp-block-post-featured-image img,
body.category-shopping  .wp-block-post-featured-image img {
  object-fit: contain !important;
}





/* Shopping 分类下：精确选择 li.category-shopping 使用图片背景 */
body.category-shopping li.wp-block-post.category-shopping {
  /* 请将图片上传到子主题：wp-content/themes/twentytwentythree-child/assets/shopping-card-bg.png */
  background: url(./discount-bg.png) center center / 100% 100% no-repeat;
}

body.category-shopping {
  background-color: #f0b90b;
  color: #fff;
}

body.category-shopping .wp-block-post-title a {
  color: #fff;
  text-align: center;
}

body.category-shopping li.wp-block-post.category-shopping img {
  padding-bottom: 1rem;
  padding-top: 1rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Shopping 分类列表：桌面四列，手机端两列 */
body.category-shopping .wp-block-post-template,
body.category-shopping .wp-block-post-template.is-layout-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 20px;
  /* 调整卡片间距 */
}

/* 防止子项有固定宽度或最大宽度影响分栏 */
body.category-shopping .wp-block-post-template>* {
  width: auto !important;
  max-width: none !important;
}

@media (max-width: 767px) {
  body.category-shopping .wp-block-post-template,
  body.category-shopping .wp-block-post-template.is-layout-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}