/* 知識中心「主題指南」專用：卡片縮圖與分類側欄。
   只由 knowledge_hub 載入，不動全站共用的 site-experience.css
   （該檔的 ?v= 出現在 85 個頁面，改它等於改全站）。 */

#resources .kh-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 264px;
  gap: 40px;
  align-items: start;
}

#resources .kh-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* 縮圖以負邊距做滿版，避免更動卡片既有的 padding 結構 */
#resources .ss-card .kh-thumb {
  display: block;
  width: calc(100% + 56px);
  margin: -28px -28px 20px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
  background: var(--ss-line);
}

#resources .kh-side {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 20px;
}

#resources .kh-box {
  background: var(--ss-white);
  border: 1px solid var(--ss-line);
  border-radius: 13px;
  padding: 22px;
}

#resources .kh-box h3 {
  font-size: 1rem;
  margin: 0 0 12px;
}

#resources .kh-cats {
  list-style: none;
  margin: 0;
  padding: 0;
}

#resources .kh-cats button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 2px;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--ss-line);
  font: inherit;
  font-size: .95rem;
  color: var(--ss-muted);
  text-align: left;
  cursor: pointer;
}

#resources .kh-cats li:last-child button {
  border-bottom: 0;
}

#resources .kh-cats button:hover .kh-name,
#resources .kh-cats button[aria-current="true"] .kh-name {
  color: var(--ss-teal);
}

#resources .kh-cats button[aria-current="true"] {
  font-weight: 700;
}

#resources .kh-count {
  font-size: .85rem;
  color: var(--ss-muted);
}

#resources .kh-reset {
  margin-top: 12px;
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  font-size: .88rem;
  color: var(--ss-teal);
  cursor: pointer;
}

#resources .kh-reset[hidden] {
  display: none;
}

#resources .kh-note {
  margin: 0;
  font-size: .86rem;
  line-height: 1.7;
  color: var(--ss-muted);
}

@media (max-width: 980px) {
  #resources .kh-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  #resources .kh-side {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  #resources .kh-grid {
    grid-template-columns: 1fr;
  }

  #resources .kh-side {
    grid-template-columns: 1fr;
  }

  /* 共用樣式在此斷點把卡片 padding 收成 25px，縮圖負邊距要跟著改 */
  #resources .ss-card .kh-thumb {
    width: calc(100% + 50px);
    margin: -25px -25px 18px;
  }
}
