/* ==========================================================================
   Categories hub (/categories) — redesign approved 1 Oct 2026

   Every category, grouped by kind, as a card showing its three most-opened
   designs (one large, two small), then the languages. Loaded after
   listing.css, which gives the tokens (.lp-page), the header, the page head
   and the chips. Classes here are prefixed ch-.
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  html:has(.ch-jump) { scroll-behavior: smooth; }
}
.ch-jump { margin-top: 2px; }

.ch-sec { padding-top: 34px; scroll-margin-top: calc(var(--lp-header-h, 72px) + 12px); }
.ch-sec__hd { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ch-sec__hd h2 { font-size: 20px; font-weight: 800; letter-spacing: -.015em; line-height: 1.25; color: var(--lp-ink); }
.ch-sec__hd span { font-size: 13px; font-weight: 600; color: var(--lp-muted); white-space: nowrap; }

/* ---------- category cards ---------- */
.ch-boards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 18px; }
.ch-board { display: block; min-width: 0; }
.ch-board__art { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 3px; aspect-ratio: 5 / 4; border-radius: 14px; overflow: hidden; background: var(--lp-soft); box-shadow: 0 0 0 1px rgba(15, 23, 42, .06); transition: box-shadow .2s; }
.ch-board__art img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.ch-board__art img:first-child { grid-row: 1 / 3; }
.ch-board__art--2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ch-board__art--2 img { grid-row: 1 / 3; }
.ch-board__art--1 { grid-template-columns: minmax(0, 1fr); }
.ch-board__none { grid-row: 1 / 3; display: grid; place-items: center; color: var(--lp-faint); }
.ch-board:hover .ch-board__art { box-shadow: 0 0 0 1px rgba(15, 23, 42, .06), 0 16px 32px -16px rgba(15, 23, 42, .4); }
.ch-board:hover .ch-board__art img { transform: scale(1.045); }
.ch-board__meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 10px; }
.ch-board__meta b { min-width: 0; font-size: 15px; font-weight: 800; color: var(--lp-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .15s; }
.ch-board__meta small { font-size: 12.5px; color: var(--lp-muted); white-space: nowrap; }
.ch-board:hover .ch-board__meta b { color: var(--lp-brand); }

/* ---------- languages: the same cards as the home page ---------- */
.ch-langs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.ch-lang { display: flex; flex-direction: column; justify-content: space-between; min-height: 112px; padding: 16px 18px; border: 1px solid var(--lp-line); border-radius: 16px; background: #fff; transition: border-color .15s, box-shadow .15s, transform .15s; }
.ch-lang:hover { border-color: transparent; box-shadow: 0 10px 28px -12px rgba(15, 23, 42, .28); transform: translateY(-2px); }
.ch-lang__hello { font-size: 22px; font-weight: 700; line-height: 1.3; color: var(--lp-ink); overflow-wrap: anywhere; }
.ch-lang__row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 10px; }
.ch-lang__row b { font-size: 14px; color: var(--lp-ink); }
.ch-lang__row small { font-size: 12.5px; color: var(--lp-muted); white-space: nowrap; }
.ch-lang.is-soon .ch-lang__row small { color: var(--lp-faint); }

@media (prefers-reduced-motion: reduce) {
  .ch-board__art img, .ch-lang { transition: none; }
  .ch-board:hover .ch-board__art img, .ch-lang:hover { transform: none; }
}

/* ---------- tablet / phone ---------- */
@media (max-width: 1023px) {
  .ch-boards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ch-langs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .ch-sec { padding-top: 26px; }
  .ch-sec__hd h2 { font-size: 18px; }
  .ch-boards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
  .ch-board__art { gap: 2px; border-radius: 12px; }
  .ch-board__meta { display: block; margin-top: 7px; }
  .ch-board__meta b { display: block; font-size: 14px; }
  .ch-board__meta small { display: block; font-size: 12px; }
  .ch-langs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ch-lang { min-height: 96px; padding: 14px; }
  .ch-lang__hello { font-size: 19px; }
}
