/* ==========================================================================
   SC-PRA  |  categories.css  —  หน้าหมวดหมู่ (list_categories.php)
   ใช้ต่อจาก theme.css (ตัวแปรสี --ink --surface --gold ... มาจาก theme.css)
   ========================================================================== */

.dd-pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px; margin-bottom: 18px; }
.dd-pagehead h1 { font-size: 1.9rem; margin: 0; line-height: 1.35; }
.dd-pagehead p { margin: 0; color: var(--muted); }
.dd-pagehead b { color: var(--gold); font-weight: 600; }

/* ---------- ค้นหาประมูล ---------- */
.dd-search { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.dd-search__field { position: relative; flex: 1 1 240px; min-width: 0; }
.dd-search__field i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.dd-search .form-control { padding-left: 40px; }
.dd-search .form-select { flex: 0 1 170px; min-width: 140px; }
@media (max-width: 575.98px) { .dd-search { gap: 8px; padding: 10px; } .dd-search__field { flex: 1 1 100%; } .dd-search .form-select { flex: 1 1 52%; min-width: 0; } .dd-search .btn { flex: 1 1 38%; } .dd-search .btn-ghost { flex: 1 1 100%; } }

/* ---------- แถบเครื่องมือกรอง ---------- */
.dd-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 26px 0 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.dd-tools__find { position: relative; flex: 1 1 240px; min-width: 0; }
.dd-tools__find i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.dd-tools__find .form-control { padding-left: 40px; }
.dd-tools .form-select { flex: 0 1 190px; min-width: 150px; }
.dd-check { display: inline-flex; align-items: center; gap: .55rem; min-height: 44px; padding: 0 .9rem; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; color: var(--ivory); user-select: none; }
.dd-check:hover { border-color: var(--gold-deep); }
.dd-check input { accent-color: var(--gold-bright); width: 18px; height: 18px; margin: 0; }
.dd-tools__count { margin-left: auto; color: var(--muted); font-size: .92rem; }
@media (max-width: 575.98px) { .dd-tools { margin-top: 18px; gap: 8px; } .dd-tools__find { flex: 1 1 100%; } .dd-tools .form-select { flex: 1 1 52%; min-width: 0; } .dd-check { flex: 1 1 38%; justify-content: center; padding: 0 .6rem; } .dd-tools__count { margin-left: 0; flex: 1 1 100%; } .dd-tools__count:empty { display: none; } }

/* ---------- หัวข้อกลุ่ม ---------- */
.dd-group + .dd-group { margin-top: 30px; }
.dd-group__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.dd-group__head h2 { font-size: 1.2rem; margin: 0; display: flex; align-items: center; gap: .55rem; }
.dd-group__head h2 i { color: var(--gold); font-size: 1rem; }
.dd-group__n { color: var(--muted); font-size: .9rem; }
.dd-note { color: var(--muted); font-size: .92rem; margin: -4px 0 14px; }
.dd-note a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- การ์ดหมวดหมู่ ---------- */
.dd-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
@media (max-width: 575.98px) { .dd-cats { grid-template-columns: minmax(0, 1fr); gap: 10px; } }
.dd-cat {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 14px 56px 14px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  transition: border-color .15s, transform .15s, background .15s;
}
.dd-cat:hover, .dd-cat:focus-within { border-color: var(--gold-deep); background: var(--raised); transform: translateY(-2px); }
.dd-cat__ico { flex: none; width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; background: rgba(217, 169, 58, .14); color: var(--gold); font-size: 1.15rem; transition: background .15s, color .15s; }
.dd-cat:hover .dd-cat__ico { background: var(--gold-bright); color: var(--on-gold); }
.dd-cat__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.dd-cat__name { font-family: var(--font-head); font-weight: 500; font-size: 1rem; line-height: 1.4; color: var(--ivory); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.dd-cat__link { color: inherit; }
.dd-cat__link::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }   /* คลิกได้ทั้งการ์ด */
.dd-cat__link:hover { color: var(--gold-bright); }
.dd-cat__n { align-self: flex-start; display: inline-flex; align-items: center; gap: .4rem; font: 500 .82rem var(--font-head); padding: .08rem .7rem; border-radius: 999px; background: rgba(109, 190, 149, .14); color: var(--jade); border: 1px solid rgba(109, 190, 149, .35); }
.dd-cat__n::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dd-cat.is-empty { background: transparent; }
.dd-cat.is-empty .dd-cat__ico { background: rgba(255, 255, 255, .05); color: var(--muted); }
.dd-cat.is-empty .dd-cat__name { color: #cfc6ad; }
.dd-cat.is-empty .dd-cat__n { background: transparent; color: var(--muted); border-color: var(--line); }
.dd-cat.is-pinned { border-color: var(--gold-deep); background: linear-gradient(0deg, rgba(217, 169, 58, .06), rgba(217, 169, 58, .06)), var(--surface); }

.dd-pin {
  position: absolute; top: 50%; right: 10px; transform: translateY(-50%); z-index: 2;
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: #6f6759; font-size: 1rem;
}
.dd-pin:hover { background: var(--raised); color: var(--gold-bright); }
.dd-pin.is-pinned { color: var(--gold-bright); }
.dd-pin.is-guest { opacity: .8; }

.dd-nores { text-align: center; padding: 40px 16px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r-lg); }
.dd-nores i { display: block; font-size: 2rem; margin-bottom: 8px; color: #6f6759; }
.dd-nores button { margin-top: 12px; }

@media (prefers-reduced-motion: reduce) { .dd-cat { transition: none; } .dd-cat:hover { transform: none; } }
