/* Trang /de-tai-nckh — lọc + Mã | Lĩnh vực | Ảnh | Đề tài | Cấp */
.nckh-page {
    background: var(--bg-page);
}

.nckh-hero {
    color: var(--ink);
    padding: 28px 0 20px;
}

.nckh-kicker {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--brand);
    margin: 0 0 8px;
    padding: 3px 8px;
    background: var(--mist);
    border-left: 3px solid var(--brand);
}

.nckh-title {
    font-family: var(--font-display);
    font-size: clamp(22px, 2.4vw, 30px);
    color: var(--ink);
    margin: 0 0 8px;
}

.nckh-lead {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink-soft);
    max-width: 56ch;
}

/* —— Shop: sidebar lọc + danh sách —— */
.nckh-shop {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 24px;
    padding-top: 12px;
    padding-bottom: 48px;
    align-items: start;
}

.nckh-filters {
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 104px);
    overflow: auto;
    padding: 16px 14px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-md);
}

.nckh-filters-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.nckh-filters-title {
    font-family: var(--font-display);
    font-size: 15px;
    margin: 0;
    color: var(--ink);
}

.nckh-reset {
    appearance: none;
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    color: var(--brand);
    cursor: pointer;
}
.nckh-reset:hover {
    color: var(--brand-deep);
    text-decoration: underline;
}

.nckh-search {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.nckh-search-label,
.nckh-filter-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.nckh-search input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--mist);
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    padding: 10px 12px;
    outline: none;
}
.nckh-search input:focus {
    border-color: var(--brand);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 65, 144, 0.12);
}

.nckh-filter-group {
    margin-bottom: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}
.nckh-filter-group:last-child {
    margin-bottom: 0;
}

.nckh-filter-label {
    display: block;
    margin-bottom: 8px;
}

.nckh-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nckh-chip {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink-soft);
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.2;
    padding: 7px 10px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.nckh-chip:hover {
    border-color: var(--brand);
    color: var(--brand);
}
.nckh-chip.is-active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}
.nckh-chip--tech {
    border-color: rgba(0, 65, 144, 0.28);
    background: rgba(0, 65, 144, 0.04);
}
.nckh-chip-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4em;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    color: inherit;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
}
.nckh-chip.is-active .nckh-chip-count {
    background: rgba(255, 255, 255, 0.22);
}

.nckh-results {
    min-width: 0;
}

.nckh-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.nckh-count {
    margin: 0;
    font-size: 14px;
    color: var(--ink-soft);
}
.nckh-count strong {
    color: var(--brand);
    font-size: 16px;
}

.nckh-empty {
    margin: 24px 0 0;
    padding: 20px;
    border: 1px dashed var(--line);
    border-radius: var(--radius-lg);
    background: var(--mist);
    color: var(--ink-soft);
    font-size: 15px;
    text-align: center;
}

/* —— Bảng danh sách —— */
.nckh-table {
    border: 1px solid var(--line);
    background: #fff;
}

.nckh-row {
    display: grid;
    grid-template-columns: 88px 120px minmax(320px, 0.62fr) minmax(0, 1fr) 130px;
    gap: 14px;
    padding: 14px;
    border-bottom: 1px solid var(--line);
    align-items: stretch;
}
.nckh-row:last-child { border-bottom: none; }

/* display:grid trên .nckh-row ghi đè [hidden] mặc định — phải !important */
.nckh-item[hidden],
.nckh-item.is-hidden {
    display: none !important;
}
.nckh-table[hidden],
.nckh-empty[hidden] {
    display: none !important;
}

.nckh-item:hover {
    background: #f7fbff;
    box-shadow: inset 3px 0 0 var(--brand);
}
.nckh-item:hover .nckh-name a {
    color: var(--brand) !important;
}

.nckh-head {
    background: var(--mist);
}
.nckh-head > div {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    padding-top: 2px;
    padding-bottom: 2px;
}

.nckh-code {
    font-size: 13px;
    font-weight: 700;
    color: var(--brand);
    font-family: var(--font-display);
}

.nckh-field {
    font-size: 13px;
    font-weight: 600;
    color: var(--brand);
    line-height: 1.35;
}

.nckh-thumb {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--mist);
    align-self: start;
}
.nckh-thumb-link {
    display: block;
    width: 100%;
    line-height: 0;
}
.nckh-thumb img {
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
    object-fit: contain;
    display: block;
    background: var(--mist);
}

.nckh-name {
    font-family: var(--font-display);
    font-size: 17px;
    color: var(--ink);
    margin: 0 0 6px;
    line-height: 1.35;
}
.nckh-name a {
    color: inherit !important;
    text-decoration: none !important;
}
.nckh-name a:hover {
    color: var(--brand) !important;
}

.nckh-goal,
.nckh-method {
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink-soft);
    margin: 0 0 4px;
}
.nckh-goal strong,
.nckh-method strong {
    color: var(--ink);
}

.nckh-btn {
    display: inline-flex;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 700;
    color: #fff !important;
    background: var(--grad-brand);
    border: 1px solid transparent;
    padding: 8px 12px;
    text-decoration: none !important;
}
.nckh-btn:hover {
    background: var(--grad-brand-hover);
    color: #fff !important;
}

.nckh-level {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
    line-height: 1.35;
}

@media (max-width: 1100px) {
    .nckh-shop {
        grid-template-columns: 260px minmax(0, 1fr);
        gap: 18px;
    }
    .nckh-row {
        grid-template-columns: 72px 100px minmax(200px, 0.5fr) minmax(0, 1fr) 110px;
    }
}

@media (max-width: 960px) {
    .nckh-shop {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    .nckh-filters {
        position: static;
        max-height: none;
    }

    .nckh-head { display: none; }
    .nckh-row {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "code field"
            "thumb thumb"
            "main main"
            "level level";
        gap: 10px;
    }
    .nckh-code { grid-area: code; }
    .nckh-field { grid-area: field; text-align: right; }
    .nckh-thumb { grid-area: thumb; }
    .nckh-main { grid-area: main; }
    .nckh-level { grid-area: level; }
}
