/* ==========================================================
   Trang Kiến thức - bstangduccuong.com
   ========================================================== */
.ntk {
    --ntk-primary: #0e6b5c;
    --ntk-primary-dark: #0a5649;
    --ntk-soft: #eaf5f2;
    --ntk-input: #eef4f5;
    --ntk-text: #1a2b29;
    --ntk-muted: #6f7d7b;
    --ntk-border: #e4ebe9;
    --ntk-radius: 10px;
    --ntk-max: 1140px;
    color: var(--ntk-text);
    background: #fff;
}
.ntk *, .ntk *::before, .ntk *::after { box-sizing: border-box; }
.ntk h1, .ntk h2, .ntk h3, .ntk p { margin: 0; padding: 0; }
.ntk a { text-decoration: none; }
.ntk-container { max-width: var(--ntk-max); margin: 0 auto; padding: 0 15px; }

/* ---------- Hero ---------- */
.ntk-hero {
    padding: 34px 0 30px;
    background: #fff;
    box-shadow: 0 8px 18px -12px rgba(16, 40, 36, .12);
    position: relative;
    z-index: 1;
}
.ntk-hero__inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }
.ntk-bc { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ntk-muted); margin-bottom: 12px; }
.ntk-bc a { color: var(--ntk-muted); display: inline-flex; align-items: center; gap: 4px; }
.ntk-bc a:hover { color: var(--ntk-primary); }
.ntk-bc__cur { color: var(--ntk-primary); font-weight: 600; }
.ntk-hero__title { font-size: 34px; line-height: 1.25; font-weight: 700; color: var(--ntk-text); letter-spacing: -.02em; }

.ntk-hero__right { flex: 0 0 380px; max-width: 100%; }
.ntk-search { position: relative; display: flex; align-items: center; }
.ntk-search input[type=search] {
    width: 100%; height: 44px; margin: 0;
    padding: 0 54px 0 18px;
    border: 1px solid transparent; border-radius: 999px;
    background: var(--ntk-input); box-shadow: none;
    font-size: 14px; color: var(--ntk-text);
    transition: border-color .2s, background .2s;
}
.ntk-search input[type=search]:focus { outline: none; background: #fff; border-color: var(--ntk-primary); }
.ntk-search button {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px; min-height: 0; margin: 0; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 50%; background: var(--ntk-primary); color: #fff; cursor: pointer;
}
.ntk-search button:hover { background: var(--ntk-primary-dark); }
.ntk-hot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 8px; font-size: 12px; color: var(--ntk-muted); }
.ntk-hot a { color: var(--ntk-muted); text-decoration: underline; text-underline-offset: 2px; }
.ntk-hot a:hover { color: var(--ntk-primary); }
.ntk-hot__dot { font-size: 9px; }

.ntk-cta { display: none; }

/* ---------- Section ---------- */
.ntk-sec { padding: 30px 0 10px; }
.ntk-sec:last-of-type { padding-bottom: 50px; }
.ntk-sec__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; padding: 0 12px; }
.ntk-sec__title { font-size: 20px; font-weight: 700; line-height: 1.3; }
.ntk-sec__title a { color: var(--ntk-primary); }
.ntk-sec__all { font-size: 13px; font-weight: 600; color: var(--ntk-primary); white-space: nowrap; }
.ntk-sec__all:hover { color: var(--ntk-primary-dark); text-decoration: underline; }
.ntk-sec__more { display: none; }

.ntk-sec__grid { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }

/* Bài lớn */
.ntk-feat {
    display: grid;
    grid-template-areas: "media" "meta" "excerpt";
    grid-template-rows: auto auto 1fr;
    background: #fff; border: 1px solid var(--ntk-border); border-radius: var(--ntk-radius);
    overflow: hidden;
}
.ntk-feat__media { grid-area: media; position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--ntk-soft); }
.ntk-feat__media::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.72) 100%);
    pointer-events: none;
}
.ntk-feat__img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.ntk-feat:hover .ntk-feat__img { transform: scale(1.03); }
.ntk-feat__title {
    grid-area: media; align-self: end; position: relative; z-index: 2;
    padding: 0 20px 18px !important; font-size: 20px; font-weight: 600; line-height: 1.35;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    pointer-events: none;
}
.ntk-feat__title a { color: #fff; pointer-events: auto; }
.ntk-feat .ntk-meta { grid-area: meta; padding: 14px 20px 6px; }
.ntk-feat__excerpt {
    grid-area: excerpt; padding: 0 20px 18px !important; font-size: 13.5px; line-height: 1.65; color: var(--ntk-muted);
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* Bài nhỏ */
.ntk-list { display: grid; grid-auto-rows: 1fr; gap: 12px; }
.ntk-item {
    display: flex; align-items: flex-start; gap: 14px; padding: 10px;
    background: #fff; border: 1px solid var(--ntk-border); border-radius: var(--ntk-radius);
    transition: border-color .2s, box-shadow .2s;
}
.ntk-item:hover { border-color: #cfe2de; box-shadow: 0 6px 16px -10px rgba(14, 107, 92, .35); }
.ntk-item__thumb { flex: 0 0 130px; aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; display: block; background: var(--ntk-soft); }
.ntk-item__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ntk-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.ntk-item__title {
    font-size: 15px; font-weight: 600; line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ntk-item__title a { color: var(--ntk-text); }
.ntk-item__title a:hover, .ntk-feat__title a:hover { color: var(--ntk-primary); }
.ntk-feat__title a:hover { color: #fff; text-decoration: underline; }

.ntk-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ntk-muted); }
.ntk-meta svg { color: var(--ntk-primary); flex: 0 0 auto; }

.ntk-noimg { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, var(--ntk-soft), #d7ebe6); }

.ntk-content { padding: 10px 0 50px; }
.ntk-empty { padding: 40px 15px; color: var(--ntk-muted); }

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
    .ntk-hero__title { font-size: 28px; }
    .ntk-hero__right { flex-basis: 320px; }
    .ntk-item__thumb { flex-basis: 100px; }
    .ntk-item__title { font-size: 14px; }
    .ntk-feat__title { font-size: 17px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
    .ntk-hero { padding: 14px 0 16px; box-shadow: none; }
    .ntk-hero__inner { flex-direction: column; align-items: stretch; gap: 12px; }
    .ntk-bc { margin-bottom: 8px; }
    .ntk-hero__title { font-size: 22px; }
    .ntk-hero__right { flex: 1 1 auto; }
    .ntk-search input[type=search] { height: 42px; border-radius: 10px; border-color: var(--ntk-border); background: #fff; padding: 0 16px 0 40px; font-size: 13px; }
    .ntk-search button { left: 6px; right: auto; background: transparent; color: var(--ntk-muted); width: 32px; height: 32px; }
    .ntk-hot { display: none; }

    .ntk-cta {
        display: flex; align-items: center; gap: 10px;
        padding: 10px 12px; border: 1px solid #cfe7e1; border-radius: 12px; background: var(--ntk-soft);
    }
    .ntk-cta__avt { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
    .ntk-cta__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
    .ntk-cta__txt strong { color: var(--ntk-primary); font-size: 13.5px; }
    .ntk-cta__txt span { color: var(--ntk-muted); font-size: 12px; }
    .ntk-cta__btn {
        flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
        padding: 8px 14px; border-radius: 999px; background: var(--ntk-primary); color: #fff !important;
        font-size: 13px; font-weight: 600;
    }

    .ntk-sec { padding: 22px 0 6px; }
    .ntk-sec__head { padding: 0; margin-bottom: 12px; }
    .ntk-sec__title { font-size: 20px; }
    .ntk-sec__title a { color: var(--ntk-text); }
    .ntk-sec__all { display: none; }

    .ntk-sec__grid { grid-template-columns: 1fr; gap: 12px; }

    .ntk-feat { grid-template-areas: "media" "meta" "title" "excerpt"; grid-template-rows: auto; border: 0; border-radius: 0; overflow: visible; }
    .ntk-feat__media { border-radius: var(--ntk-radius); }
    .ntk-feat__media::after { display: none; }
    .ntk-feat__title { grid-area: title; align-self: auto; padding: 6px 0 6px; white-space: normal; font-size: 17px; pointer-events: auto; }
    .ntk-feat__title a { color: var(--ntk-text); }
    .ntk-feat__title a:hover { color: var(--ntk-primary); text-decoration: none; }
    .ntk-feat .ntk-meta { padding: 12px 0 0; }
    .ntk-feat__excerpt { padding: 0; font-size: 13px; -webkit-line-clamp: 2; }

    .ntk-list { grid-auto-rows: auto; gap: 8px; }
    .ntk-item:nth-child(n+4) { display: none; }
    .ntk-item { padding: 8px; gap: 10px; align-items: center; }
    .ntk-item__thumb { flex-basis: 76px; }
    .ntk-item__body { gap: 6px; padding-top: 0; }
    .ntk-item__title { font-size: 13.5px; }

    .ntk-sec__more {
        display: flex; align-items: center; justify-content: center; gap: 6px;
        margin-top: 12px; padding: 11px 14px; border-radius: 10px;
        background: var(--ntk-soft); color: var(--ntk-primary); font-size: 13px; font-weight: 600;
    }
    .ntk-sec__more:hover { background: #dcefea; color: var(--ntk-primary-dark); }
}
