/* =========================================================
   DuckWow /picks/ 精选页 —— Flipboard 式图片流
   模板接管后的单流版式：分类导航 + 中心头条 + 每行四张
   仅作用于 page-id-200，不影响其他页面与绿色 banner
   ========================================================= */

/* ---------------------------------------------------------
   1. 容器：去掉主题白卡与内边距
   --------------------------------------------------------- */
body.page-id-200 .content-layout .content-card {
  padding: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* 文章为空时的提示占满整行 */
body.page-id-200 .content-card .row > :not(.posts-item) {
  grid-column: 1 / -1;
}

/* ---------------------------------------------------------
   2. 分类导航胶囊（banner 与文章流之间）
   --------------------------------------------------------- */
body.page-id-200 .dws-picksnav-wrap {
  margin: 0 0 24px;
}

body.page-id-200 .dws-picksnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  justify-content: safe center;
  gap: 10px;
}

body.page-id-200 .dws-picksnav-item {
  flex: none;
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  border-radius: 999px;
  border: 1px solid rgba(0, 170, 144, 0.28);
  color: var(--main-color);
  background: rgba(0, 170, 144, 0.08);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

body.page-id-200 .dws-picksnav-item:hover {
  border-color: #00aa90;
  background: #00aa90;
  color: #fff;
}

body.page-id-200 .dws-picksnav-item.is-active {
  border-color: #00aa90;
  background: #00aa90;
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 170, 144, 0.28);
}

@media (max-width: 767.98px) {
  body.page-id-200 .dws-picksnav {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    padding: 0 12px;
  }

  body.page-id-200 .dws-picksnav::-webkit-scrollbar {
    display: none;
  }
}

/* ---------------------------------------------------------
   3. 网格（移动端基准）：2 列，头条通栏
   --------------------------------------------------------- */
body.page-id-200 .content-card .row {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-auto-rows: 92px;
  gap: 12px;
  margin: 0 !important;
  padding: 0 !important;
  flex-wrap: nowrap !important;
}

body.page-id-200 .content-card .row > .posts-item {
  display: flex !important;
  flex-direction: column !important;
  width: auto !important;
  max-width: none !important;
  flex: none !important;
  margin: 0 !important;
  padding: 0 !important;
  position: relative;
  overflow: hidden;
  grid-column: span 1;
  grid-row: span 2;
  border-radius: var(--main-radius, 12px);
  background: var(--main-bg-color, #fff);
  box-shadow: none !important;
  transform: none !important;
}

/* 移动端头条：通栏大卡 */
body.page-id-200 .content-card .row > .posts-item:first-child {
  grid-column: span 2;
  grid-row: span 3;
}

/* ---------------------------------------------------------
   4. 卡片内部：上方封面 + 下方纯色文字区
   --------------------------------------------------------- */
body.page-id-200 .content-card .row > .posts-item .item-header {
  position: relative !important;
  inset: auto !important;
  flex: 1 1 auto !important;
  min-height: 0;
  margin: 0 !important;
  z-index: 0;
  overflow: hidden;
}

body.page-id-200 .content-card .row > .posts-item .item-media {
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
  padding-bottom: 0 !important;
  border-radius: 0;
  background: transparent;
  box-shadow: none !important;
}

/* 主题的斜向高光在整图卡片上会显得脏 */
body.page-id-200 .content-card .row > .posts-item .item-media::after {
  display: none !important;
}

body.page-id-200 .content-card .row > .posts-item .item-media .item-image {
  display: block;
  width: 100%;
  height: 100%;
}

body.page-id-200 .content-card .row > .posts-item .item-media img {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  border-radius: 0;
}

body.page-id-200 .content-card .row > .posts-item .item-body {
  position: relative !important;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: 2;
  flex: 0 0 auto !important;
  padding: 10px 12px 12px !important;
  background: var(--main-bg-color, #fff);
  color: var(--main-color);
  pointer-events: auto;
  text-align: left;
}

body.page-id-200 .content-card .row > .posts-item .item-body::before {
  display: none !important;
}

body.page-id-200 .content-card .row > .posts-item .item-title {
  margin: 0 !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  color: var(--main-color) !important;
  -webkit-font-smoothing: antialiased;
  white-space: normal !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transform: none !important;
}

body.page-id-200 .content-card .row > .posts-item .item-title a {
  color: inherit !important;
  text-decoration: none !important;
}

/* 副标题：所有卡片显示，小卡 1 行、头条 2 行 */
body.page-id-200 .content-card .row > .posts-item .item-body .text-muted {
  display: -webkit-box !important;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 5px !important;
  opacity: 1 !important;
  color: var(--muted-color) !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
  transform: none !important;
  white-space: normal !important;
}

body.page-id-200 .content-card .row > .posts-item:first-child .item-title {
  font-size: 19px !important;
}

body.page-id-200 .content-card .row > .posts-item a:focus-visible {
  outline: 2px solid #00aa90;
  outline-offset: -4px;
}

/* 悬停：只放大封面，标题变品牌色 */
@media (hover: hover) {
  body.page-id-200 .content-card .row > .posts-item:hover .item-media img {
    transform: scale(1.04);
  }

  body.page-id-200 .content-card .row > .posts-item:hover,
  body.page-id-200 .content-card .row > .posts-item:hover .item-media {
    box-shadow: none !important;
    transform: none !important;
  }

  body.page-id-200 .content-card .row > .posts-item:hover .item-title a {
    color: #00aa90 !important;
  }
}

/* ---------------------------------------------------------
   5. 平板 / 桌面（≥768px）：4 列，中心头条
      第 1 篇中间 2×2，第 2/3 篇左列，第 4/5 篇右列
   --------------------------------------------------------- */
@media (min-width: 768px) {
  body.page-id-200 .content-card .row {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-auto-rows: 180px;
    gap: 14px;
  }

  body.page-id-200 .content-card .row > .posts-item {
    grid-column: span 2;
    grid-row: span 2;
  }

  body.page-id-200 .content-card .row > .posts-item:nth-child(1) {
    grid-column: 2 / 4;
    grid-row: 1 / 3;
  }

  body.page-id-200 .content-card .row > .posts-item:nth-child(2) {
    grid-column: 1;
    grid-row: 1;
  }

  body.page-id-200 .content-card .row > .posts-item:nth-child(3) {
    grid-column: 1;
    grid-row: 2;
  }

  body.page-id-200 .content-card .row > .posts-item:nth-child(4) {
    grid-column: 4;
    grid-row: 1;
  }

  body.page-id-200 .content-card .row > .posts-item:nth-child(5) {
    grid-column: 4;
    grid-row: 2;
  }

  /* 平板：第 6 篇起每行 2 张 */
  body.page-id-200 .content-card .row > .posts-item:nth-child(n+6) {
    grid-column: span 2;
    grid-row: span 2;
  }

  body.page-id-200 .content-card .row > .posts-item .item-title {
    font-size: 16px !important;
  }

  body.page-id-200 .content-card .row > .posts-item:first-child .item-title {
    font-size: 21px !important;
  }

  /* 篇数兜底：1 / 2 / 3 / 4 篇不留半排空洞 */
  body.page-id-200 .content-card .row:has(> .posts-item:only-child) > .posts-item:first-child {
    grid-column: 1 / 5;
    grid-row: 1 / 3;
  }

  body.page-id-200 .content-card .row:has(> .posts-item:nth-child(2):last-child) > .posts-item:first-child {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
  }

  body.page-id-200 .content-card .row:has(> .posts-item:nth-child(2):last-child) > .posts-item:nth-child(2) {
    grid-column: 3 / 5;
    grid-row: 1 / 3;
  }

  body.page-id-200 .content-card .row:has(> .posts-item:nth-child(3):last-child) > .posts-item:nth-child(2) {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  body.page-id-200 .content-card .row:has(> .posts-item:nth-child(3):last-child) > .posts-item:nth-child(3) {
    grid-column: 4;
    grid-row: 1 / 3;
  }

  body.page-id-200 .content-card .row:has(> .posts-item:nth-child(4):last-child) > .posts-item:nth-child(2) {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  body.page-id-200 .content-card .row:has(> .posts-item:nth-child(4):last-child) > .posts-item:nth-child(3) {
    grid-column: 4;
    grid-row: 1;
  }

  body.page-id-200 .content-card .row:has(> .posts-item:nth-child(4):last-child) > .posts-item:nth-child(4) {
    grid-column: 4;
    grid-row: 2;
  }
}

/* ---------------------------------------------------------
   6. 桌面（≥1200px）：行高加大，第 6 篇起每行 4 张
   --------------------------------------------------------- */
@media (min-width: 1200px) {
  body.page-id-200 .content-card .row {
    grid-auto-rows: 240px;
    gap: 16px;
  }

  body.page-id-200 .content-card .row > .posts-item:nth-child(n+6) {
    grid-column: span 1;
    grid-row: span 1;
  }

  body.page-id-200 .content-card .row > .posts-item .item-title {
    font-size: 16px !important;
  }

  body.page-id-200 .content-card .row > .posts-item:first-child .item-title {
    font-size: 22px !important;
  }

  body.page-id-200 .content-card .row > .posts-item:first-child .item-body .text-muted {
    -webkit-line-clamp: 2;
    font-size: 12px !important;
  }
}
