/* =========================================================
   Bản Làng Miền Núi Phía Bắc – giao diện
   Bảng màu lấy cảm hứng từ thổ cẩm và thiên nhiên vùng cao:
   xanh rừng (hero), chàm (indigo), đỏ đất (rust), vàng nắng (gold).
   Font: Be Vietnam Pro (Google Fonts) – đủ dấu tiếng Việt.
   ========================================================= */

:root {
    --bg: #f6f4ee;
    --surface: #ffffff;
    --surface-2: #eef0ea;
    --ink: #17202b;
    --muted: #5a6470;
    --line: #e1e3dc;

    --forest: #1f3d2c;        /* xanh rừng – hero */
    --forest-deep: #132a1d;
    --indigo: #1f3c6e;        /* chàm */
    --indigo-deep: #14284c;
    --rust: #b8502a;          /* đỏ đất / thổ cẩm */
    --gold: #f0b24a;          /* vàng nắng */
    --leaf: #3f7d4e;
    --link: #1f4fa0;

    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 8px 28px rgba(19, 42, 29, .10);
    --max: 1120px;
    --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

:root[data-theme="dark"] {
    --bg: #0e1612;
    --surface: #17221b;
    --surface-2: #1d2b22;
    --ink: #eef3ee;
    --muted: #a7b6aa;
    --line: #2a3b2f;
    --forest: #2b5a3f;
    --forest-deep: #0a120d;
    --indigo: #9bb8f2;
    --indigo-deep: #0a120d;
    --rust: #e27a52;
    --gold: #f5c46b;
    --leaf: #6cba84;
    --link: #a9cbff;
    --shadow: 0 8px 28px rgba(0, 0, 0, .4);
}

/* ===== Nền tảng ===== */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img, iframe { max-width: 100%; display: block; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.section-title { font-size: 1.4rem; font-weight: 800; margin: 2.75rem 0 .35rem; letter-spacing: -.01em; }
.section-lead { color: var(--muted); margin: 0 0 1.1rem; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; }
.section-head .section-title { margin-bottom: .35rem; }

/* Dải hoa văn thổ cẩm */
.brocade {
    height: 8px;
    background: repeating-linear-gradient(90deg,
        var(--rust) 0 14px, var(--gold) 14px 20px,
        var(--indigo) 20px 36px, var(--leaf) 36px 42px, var(--bg) 42px 50px);
}

/* ===== Header ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
}
.header-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); min-width: 0; }
.brand:hover { text-decoration: none; }
.brand .logo {
    flex: none;
    width: 44px; height: 44px; padding: 9px;
    border-radius: 12px;
    background: var(--forest);
    color: #fff;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-name { font-size: 1.12rem; font-weight: 800; letter-spacing: -.01em; }
.brand-tagline { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-wrap { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; }
.primary-nav { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.primary-nav::-webkit-scrollbar { display: none; }
.primary-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 10px 0 0; white-space: nowrap; }
.primary-nav a {
    display: block;
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 600;
    font-size: .94rem;
}
.primary-nav a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.primary-nav .current-menu-item > a,
.primary-nav .current_page_item > a { color: #fff; background: var(--forest); }

.icon-btn {
    flex: none;
    width: 40px; height: 40px;
    margin-top: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--surface-2);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
}

/* ===== Nút, thẻ, form ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 11px 22px;
    border-radius: 999px;
    border: 1px solid var(--rust);
    background: var(--rust);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s ease, filter .15s ease;
}
.btn:hover { text-decoration: none; filter: brightness(1.06); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); filter: none; }
.btn-sm { padding: 8px 15px; font-size: .9rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.chip {
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
    font-size: .9rem;
    font-weight: 600;
    color: var(--ink);
}
.chip:hover { text-decoration: none; border-color: var(--rust); color: var(--rust); }
.badge {
    font-size: .75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--gold);
    color: #3a2a06;
    vertical-align: middle;
}
input, select, textarea {
    font: inherit;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--gold) 75%, transparent);
    outline-offset: 2px;
}
input[type="search"], input[type="text"], input[type="email"], input[type="password"] { width: 100%; }
.alert, .nepnha-alert {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--rust);
    background: var(--surface-2);
    margin: 12px 0;
}
.alert p, .nepnha-alert p { margin: 4px 0; }

/* ===== Hero trang chủ (theo ảnh mẫu) ===== */
.home-hero {
    position: relative;
    margin: 0 calc(50% - 50vw);
    padding: 72px 20px 84px;
    text-align: center;
    color: #fff;
    background:
        linear-gradient(180deg, rgba(19, 42, 29, .55) 0%, rgba(19, 42, 29, .82) 100%),
        url("../img/hero-terrace.jpg") center 60% / cover no-repeat;
    background-color: var(--forest-deep);
}
.eyebrow {
    margin: 0 0 10px;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--gold);
}
.home-hero .eyebrow { margin-bottom: 14px; }
.home-title {
    font-size: clamp(2rem, 5.2vw, 3.3rem);
    font-weight: 800;
    margin: 0 auto 14px;
    letter-spacing: -.02em;
    line-height: 1.12;
    max-width: 18ch;
}
.home-sub { color: #e3ece5; margin: 0 auto 30px; max-width: 640px; font-size: 1.05rem; }

.home-searchcard {
    max-width: 680px;
    margin: 0 auto;
    padding: 14px;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .28);
    text-align: left;
}
.home-searchcard input[type="search"] {
    border: 1px solid #d9ddd6;
    border-radius: 999px;
    padding: 14px 20px;
    font-size: 1.02rem;
    background: #f6f4ee;
    color: #17202b;
}
.home-searchrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.home-searchrow select {
    flex: 1 1 200px;
    min-width: 0;
    border-radius: 999px;
    border: 1px solid #d9ddd6;
    background: #f6f4ee;
    color: #17202b;
    padding: 11px 16px;
}
.home-searchrow .btn { flex: 0 0 auto; padding: 12px 26px; }

/* ===== Bản đồ & phim giới thiệu ===== */
.map-video {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 18px;
    margin: -34px 0 0;
    position: relative;
}
.map-card, .video-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.card-head h2 { font-size: 1.1rem; margin: 0; font-weight: 800; }
.card-head span { font-size: .85rem; color: var(--muted); }

.map-canvas {
    position: relative;
    flex: 1;
    min-height: 300px;
    border-radius: 14px;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}
.map-canvas::before {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(19, 42, 29, .15), rgba(19, 42, 29, .45));
}
.map-pin {
    position: absolute;
    transform: translate(-50%, -100%);
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    color: #fff;
    font-weight: 700;
    font-size: .85rem;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}
.map-pin:hover { text-decoration: none; }
.map-pin:hover .pin-dot { transform: scale(1.15); }
.pin-dot {
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--gold);
    border: 3px solid #fff;
    box-shadow: 0 0 0 6px rgba(240, 178, 74, .3);
    transition: transform .15s ease;
}
.pin-label { background: rgba(19, 42, 29, .8); padding: 3px 10px; border-radius: 999px; }

.video-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.video-item {
    display: flex; gap: 12px; align-items: center;
    padding: 8px; border-radius: 14px;
    color: var(--ink);
    border: 1px solid var(--line);
    background: var(--surface-2);
}
.video-item:hover { text-decoration: none; border-color: var(--rust); }
.video-thumb {
    position: relative;
    flex: 0 0 132px; height: 78px;
    border-radius: 10px;
    background-size: cover; background-position: center;
}
.video-thumb::before { content: ""; position: absolute; inset: 0; border-radius: 10px; background: rgba(0, 0, 0, .18); }
.play {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255, 255, 255, .92); color: var(--forest-deep);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .9rem; padding-left: 3px;
}
.video-text { display: flex; flex-direction: column; min-width: 0; }
.video-text strong { font-size: 1rem; }
.video-text small { color: var(--muted); }

/* ===== Thẻ dân tộc ===== */
.ethnic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 1rem 0 0; }
.ethnic-card {
    position: relative;
    display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
    min-height: 240px;
    padding: 20px;
    border-radius: var(--radius);
    overflow: hidden;
    color: #fff;
    background: var(--forest) center / cover no-repeat;
    box-shadow: var(--shadow);
    transition: transform .2s ease;
}
.ethnic-card::before {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(10, 20, 14, 0) 25%, rgba(10, 20, 14, .9) 100%);
}
.ethnic-card > * { position: relative; }
.ethnic-card:hover { transform: translateY(-3px); text-decoration: none; }
.ethnic-tag {
    align-self: flex-start;
    font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    background: var(--gold); color: #2b2008;
    padding: 3px 10px; border-radius: 999px; margin-bottom: 8px;
}
.ethnic-name { font-size: 1.3rem; font-weight: 800; }
.ethnic-loc { font-size: .88rem; color: #dfe9e2; }
.ethnic-cta { margin-top: 8px; font-weight: 700; font-size: .92rem; color: var(--gold); }

/* ===== Ba nhóm nội dung ===== */
.topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.topic-card {
    display: flex; flex-direction: column; gap: 6px;
    padding: 22px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 4px solid var(--leaf);
    color: var(--ink);
}
.topic-card:nth-child(2) { border-top-color: var(--rust); }
.topic-card:nth-child(3) { border-top-color: var(--indigo); }
.topic-card:hover { text-decoration: none; box-shadow: var(--shadow); }
.topic-icon { font-size: 1.6rem; line-height: 1; }
.topic-card h3 { margin: 4px 0 0; font-size: 1.08rem; font-weight: 800; }
.topic-card p { margin: 0; color: var(--muted); font-size: .95rem; }
.topic-cta { margin-top: auto; padding-top: 8px; font-weight: 700; color: var(--rust); }

/* ===== Thư viện bản vẽ ===== */
.drawing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.drawing-card {
    display: flex; flex-direction: column; gap: 4px;
    padding: 18px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px dashed color-mix(in srgb, var(--forest) 45%, transparent);
    color: var(--ink);
    min-height: 190px;
}
.drawing-card:hover { text-decoration: none; border-style: solid; border-color: var(--forest); }
.drawing-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.drawing-icon {
    flex: none;
    width: 68px; height: 68px; padding: 13px;
    border-radius: 16px;
    background: var(--forest); color: #f5e6c4;
}
.drawing-card:nth-child(2) .drawing-icon { background: var(--rust); color: #fff; }
.drawing-card:nth-child(3) .drawing-icon { background: var(--indigo); color: #fff; }
.drawing-card:nth-child(4) .drawing-icon { background: #7a5a2a; color: #fff; }
.drawing-badge {
    font-size: .7rem; font-weight: 700; white-space: nowrap;
    padding: 3px 8px; border-radius: 6px;
    border: 1px solid var(--line); color: var(--muted);
}
.drawing-card h3 { margin: 0; font-size: 1rem; font-weight: 800; }
.drawing-card p { margin: 0; color: var(--muted); font-size: .9rem; }

/* ===== Kêu gọi đóng góp ===== */
.cta-band {
    margin: 2.75rem 0 1rem;
    padding: 28px;
    border-radius: var(--radius);
    background: var(--forest);
    color: #fff;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
    position: relative; overflow: hidden;
}
.cta-band::after {
    content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px;
    border-radius: 50%; background: rgba(240, 178, 74, .22);
}
.cta-band h2 { margin: 0 0 4px; font-size: 1.3rem; position: relative; }
.cta-band p { margin: 0; color: #d7e6dc; position: relative; max-width: 60ch; }
.cta-band .btn { position: relative; background: var(--gold); border-color: var(--gold); color: #2b2008; }

/* ===== Trang chi tiết dân tộc ===== */
.ethnic-hero {
    margin: 0 calc(50% - 50vw) 0;
    padding: 56px 20px 64px;
    color: #fff;
    background:
        linear-gradient(90deg, rgba(19, 42, 29, .92) 0%, rgba(19, 42, 29, .55) 60%, rgba(19, 42, 29, .35) 100%);
    background-color: var(--forest-deep);
    background-size: cover;
    background-position: center;
}
.ethnic-hero > * { max-width: var(--max); margin-left: auto; margin-right: auto; }
.ethnic-hero { padding-left: calc(50vw - 50% + 20px); padding-right: calc(50vw - 50% + 20px); }
.ethnic-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; margin: 0 0 6px; letter-spacing: -.01em; }
.ethnic-hero .ethnic-loc { font-size: 1rem; color: #e3ece5; margin: 0; }
.ethnic-hero .ethnic-intro { color: #d3e0d6; max-width: 60ch; margin: 10px 0 0; }
.ethnic-hero .eyebrow { margin-bottom: 8px; }
.crumbs-light, .crumbs-light a { color: #cfdcd2; }
.crumbs-light { margin: 0 0 18px; font-size: .9rem; }
.ethnic-media { margin-top: -34px; }
.embed { width: 100%; height: 300px; border: 0; border-radius: 14px; background: var(--surface-2); }
.embed-placeholder {
    display: flex; align-items: center; justify-content: center; text-align: center;
    height: 300px; padding: 20px;
    border-radius: 14px; border: 1px dashed var(--line);
    background: var(--surface-2); color: var(--muted);
}

/* ===== Tra cứu & kết quả ===== */
.nepnha-search { max-width: 860px; margin: 1.5rem auto 2rem; }
.nepnha-searchbox { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 16px; box-shadow: var(--shadow); }
.nepnha-searchbox input[type="search"] { border-radius: 999px; padding: 14px 22px; font-size: 1.05rem; }
.nepnha-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.nepnha-filters select, .nepnha-filters input { flex: 1 1 180px; min-width: 0; border-radius: 999px; }
.nepnha-filters .btn { flex: 0 0 auto; }
.nepnha-more { margin-top: 10px; font-size: .92rem; color: var(--muted); }
.nepnha-more summary { cursor: pointer; font-weight: 600; }
.nepnha-more .nepnha-filters { margin-top: 8px; }
.nepnha-count { color: var(--muted); font-size: .92rem; margin: 22px 4px 6px; }
.nepnha-results { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 20px; }
.nepnha-result { padding: 16px 0; border-bottom: 1px solid var(--line); }
.nepnha-result:last-child { border-bottom: 0; }
.nepnha-result-title { font-size: 1.15rem; color: var(--link); font-weight: 700; }
.nepnha-result-meta { font-size: .86rem; color: var(--rust); font-weight: 600; margin: 2px 0 4px; }
.nepnha-result p { margin: 0; color: var(--muted); font-size: .95rem; }
.nepnha-pagination { display: flex; flex-wrap: wrap; gap: 6px; margin: 22px 0; justify-content: center; }
.nepnha-pagination .page-numbers { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: var(--surface); }
.nepnha-pagination .current { background: var(--forest); color: #fff; border-color: var(--forest); }

.nepnha-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 1rem 0; }
.nepnha-card {
    display: flex; flex-direction: column; gap: 6px;
    padding: 18px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 4px solid var(--rust);
    color: var(--ink);
    box-shadow: var(--shadow);
}
.nepnha-card:hover { text-decoration: none; transform: translateY(-2px); }
.nepnha-card-title { font-weight: 700; }
.nepnha-card-meta { font-size: .85rem; color: var(--muted); }

/* ===== Trang nội dung & banner ===== */
.page-banner {
    margin: 0 calc(50% - 50vw) 28px;
    padding: 56px 20px;
    color: #fff;
    background:
        linear-gradient(90deg, rgba(19, 42, 29, .9), rgba(19, 42, 29, .4)),
        url("../img/valley-village.jpg") center 45% / cover no-repeat;
    background-color: var(--forest-deep);
}
.page-banner .container { padding: 0 20px; }
.page-banner h1 { margin: 0; font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; }
.page-banner p { margin: 6px 0 0; color: #e0e8f6; }

/* ===== Chi tiết hồ sơ ===== */
.crumbs { font-size: .9rem; color: var(--muted); margin: 1.5rem 0 .5rem; }
.nepnha-detail, .nepnha-page { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; margin: 1rem 0 2rem; }
.nepnha-detail h1, .nepnha-page h1 { font-size: clamp(1.6rem, 3.5vw, 2.1rem); font-weight: 800; margin: .2rem 0; letter-spacing: -.01em; }
.facts { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.facts th, .facts td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.facts th { color: var(--muted); font-weight: 500; width: 38%; }
.entry { margin: 1rem 0; }
.file-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.file-item { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.file-head { margin-bottom: 10px; }
.file-item iframe { width: 100%; height: 480px; border: 0; border-radius: var(--radius-sm); background: var(--bg); }
.file-item p { margin: 12px 0 0; }

/* ===== Đăng nhập / đăng ký ===== */
.nepnha-auth-box {
    max-width: 440px; margin: 2.5rem auto; padding: 30px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
}
.nepnha-auth-box h2 { margin-top: 0; }
.nepnha-form label, #nepnha-loginform label { display: block; margin-bottom: 14px; font-size: .92rem; font-weight: 600; color: var(--muted); }
.nepnha-form input { margin-top: 6px; }
#nepnha-loginform p { margin: 0 0 14px; }
#nepnha-loginform .login-remember { font-size: .9rem; color: var(--muted); }
#nepnha-loginform input[type="submit"] {
    padding: 11px 22px; border-radius: 999px; border: 1px solid var(--rust);
    background: var(--rust); color: #fff; font: inherit; font-weight: 700; cursor: pointer;
}
.nepnha-form .btn { width: 100%; }
.nepnha-auth-links { font-size: .95rem; color: var(--muted); margin-top: 16px; text-align: center; }

.nepnha-box { padding: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 1rem 0; }
.nepnha-steps li { margin-bottom: 8px; }

/* Bảng trong nội dung */
.entry table, .nepnha-page table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .95rem; }
.entry th, .entry td, .nepnha-page th, .nepnha-page td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: top; }
.entry th, .nepnha-page th { background: var(--surface-2); }

/* ===== Chân trang ===== */
.site-footer { margin-top: 4rem; background: var(--forest-deep); color: #c3d1c7; }
.site-footer a { color: #e3ece5; }
.site-footer a:hover { color: var(--gold); }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1.2fr 1fr 1fr; gap: 28px; padding-top: 40px; }
.footer-grid p, .footer-grid li { margin: 6px 0; font-size: .93rem; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-title { color: #fff; font-size: 1.05rem; font-weight: 800; margin: 0 0 10px; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 28px; padding: 16px 20px; font-size: .85rem; color: #94a89b; text-align: center; }

/* ===== Bản đồ bản làng (Leaflet) ===== */
.map-card.wide { flex-direction: column; padding: 0; overflow: hidden; }
.map-card.wide .nmap { border: 0; border-radius: 0; box-shadow: none; }
.map-card.wide .card-head { padding: 14px 16px 0; margin: 0; }
.map-card.wide .card-head a { font-weight: 700; font-size: .9rem; }

.nmap {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.nmap-tools {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
}
.nmap-search { flex: 0 1 260px; min-width: 180px; border-radius: 999px; padding: 9px 16px; font-size: .95rem; }
.nmap-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.nmap-chip {
    display: inline-flex; align-items: center;
    border: 1px solid var(--line); background: var(--surface);
    color: var(--ink); border-radius: 999px;
    padding: 5px 12px; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
}
.nmap-chip:hover { border-color: var(--rust); }
.nmap-chip[aria-pressed="true"] { background: var(--forest); border-color: var(--forest); color: #fff; }
.nmap-chip-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; flex: none; }
.nmap-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; height: 540px; }
.nmap-canvas { height: 100%; min-height: 0; background: var(--surface-2); }
.nmap-list {
    list-style: none; margin: 0; padding: 0;
    overflow-y: auto;
    border-left: 1px solid var(--line);
}
.nmap-item { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.nmap-focus {
    flex: 1; min-width: 0;
    display: flex; align-items: flex-start; gap: 6px;
    background: none; border: 0; padding: 12px 8px 12px 14px;
    color: var(--ink); text-align: left; font: inherit; cursor: pointer;
}
.nmap-focus:hover { background: var(--surface-2); }
.nmap-item-text { display: flex; flex-direction: column; min-width: 0; }
.nmap-item-text strong { font-size: .95rem; line-height: 1.3; }
.nmap-item-text small { color: var(--muted); font-size: .82rem; }
.nmap-go { flex: none; padding: 0 14px 0 4px; font-weight: 700; font-size: .85rem; white-space: nowrap; }
.nmap-empty { padding: 16px; color: var(--muted); }
.nmap-pin span {
    display: block; width: 24px; height: 24px; border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
.nmap-popup { min-width: 180px; font-size: .9rem; line-height: 1.45; }
.nmap-popup strong { display: block; margin-bottom: 2px; }
.nmap-popup-ethnic { color: var(--rust); font-weight: 600; font-size: .85rem; }
.nmap-popup a { font-weight: 700; }
.nmap-body .leaflet-control-attribution { font-size: 10px; }

/* ===== Lưới bản làng ===== */
.village-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 1rem 0 0; }
.village-card {
    display: flex; flex-direction: column;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink);
    box-shadow: var(--shadow);
    transition: transform .2s ease;
}
.village-card:hover { transform: translateY(-3px); text-decoration: none; }
.village-thumb { display: block; height: 140px; background: var(--forest) center / cover no-repeat; }
.village-body { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px 16px; }
.village-eth { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--rust); }
.village-body strong { font-size: 1.02rem; line-height: 1.3; }
.village-body small { color: var(--muted); font-size: .86rem; }

/* ===== Trang bản làng & dân tộc ===== */
.ethnic-stat { margin: 14px 0 0; font-weight: 700; color: var(--gold); }
.village-hero { background-size: cover; background-position: center; }
.village-detail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; margin: 1rem 0 2rem; align-items: start; }
.village-main, .village-side { min-width: 0; }
.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; position: sticky; top: 130px; }
.side-card h3 { margin: 0 0 8px; font-size: 1.05rem; font-weight: 800; }
.facts-compact th, .facts-compact td { padding: 8px 4px; font-size: .92rem; }
.facts-compact th { width: 34%; }
.video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ===== Responsive ===== */
@media (max-width: 960px) {
    .map-video { grid-template-columns: 1fr; margin-top: -24px; }
    .drawing-grid { grid-template-columns: repeat(2, 1fr); }
    .topic-grid { grid-template-columns: 1fr; }
    .ethnic-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
    .brand-tagline { display: none; }
    .header-actions .btn-ghost { display: none; }
    .nmap-body { grid-template-columns: 1fr; height: auto; }
    .nmap-canvas { height: 340px; }
    .nmap-list { max-height: 300px; border-left: 0; border-top: 1px solid var(--line); }
    .village-detail { grid-template-columns: 1fr; }
    .side-card { position: static; }
}
@media (max-width: 560px) {
    body { font-size: 15px; }
    .container { padding: 0 16px; }
    .header-top { flex-wrap: wrap; }
    .brand-name { font-size: 1rem; }
    .header-actions { width: 100%; justify-content: flex-end; }
    .home-hero { padding: 52px 16px 64px; }
    .home-searchcard { padding: 10px; border-radius: 18px; }
    .home-searchrow select, .home-searchrow .btn { flex-basis: 100%; width: 100%; }
    .map-canvas { min-height: 240px; }
    .embed, .embed-placeholder { height: 220px; }
    .drawing-grid { grid-template-columns: 1fr; }
    .ethnic-card { min-height: 200px; }
    .cta-band { padding: 22px; }
    .nepnha-detail, .nepnha-page, .nepnha-auth-box { padding: 20px; }
    .file-item iframe { height: 320px; }
    .footer-grid { grid-template-columns: 1fr; gap: 18px; }
    .nepnha-filters select, .nepnha-filters input { flex-basis: 100%; }
    .nepnha-filters .btn { width: 100%; }
}
