/*
Theme Name: TekVN-blog
Theme URI: https://tekvn.net
Author: TEKVN
Author URI: https://tekvn.net
Description: Theme rieng cho blog TEKVN — dang xay dung dan. Mau thuong hieu: xanh #069A65, do #EF0032.
Version: 0.6.4
License: GPL-2.0-or-later
Text Domain: tekvn-blog
*/

:root {
  --tekvn-green: #069a65;
  --tekvn-red: #ef0032;
  --tekvn-ink: #1f2937;
  --tekvn-muted: #6b7280;
  --tekvn-line: #e5e7eb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--tekvn-ink);
  line-height: 1.65;
  background: #fff;
}

a { color: var(--tekvn-green); text-decoration: none; }
a:hover { text-decoration: underline; }

.tekvn-container { max-width: 1440px; margin: 0 auto; padding: 0 16px; }

/* Header (bo cuc CanhMe: hang logo + o banner, thanh menu xanh full-width) */
.tekvn-header-top { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding-top: 20px; padding-bottom: 20px; }
.tekvn-branding { display: flex; align-items: center; gap: 12px; flex: none; }
.tekvn-branding img { width: 200px; height: auto; display: block; }
.tekvn-site-name { font-size: 28px; font-weight: 800; color: var(--tekvn-ink); letter-spacing: -0.5px; }
.tekvn-site-name:hover { text-decoration: none; }
.tekvn-banner-slot { width: 728px; max-width: 100%; height: 90px; flex: none; }
.tekvn-menu-bar { background: var(--tekvn-green); }
.tekvn-menu-inner { display: flex; align-items: stretch; justify-content: space-between; }
.tekvn-nav ul { display: flex; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.tekvn-nav a { display: block; color: #fff; font-weight: 700; font-size: 14.5px; text-transform: uppercase; letter-spacing: 0.2px; padding: 14px 16px; }
.tekvn-nav a:hover { background: rgba(0, 0, 0, 0.16); text-decoration: none; }
.tekvn-nav .current-menu-item > a { background: rgba(0, 0, 0, 0.16); }
.tekvn-search-btn { background: none; border: none; cursor: pointer; padding: 0 10px; display: flex; align-items: center; }
.tekvn-search-row { display: none; padding: 0 0 14px; }
.tekvn-search-row .search-form { display: flex; gap: 8px; }
.tekvn-search-row .search-field { flex: 1; padding: 9px 12px; border: none; border-radius: 6px; font-size: 15px; }
.tekvn-search-row .search-submit { background: #0b1220; color: #fff; border: none; border-radius: 6px; padding: 9px 18px; font-weight: 600; cursor: pointer; }
@media (max-width: 1100px) { .tekvn-banner-slot { display: none; } }
@media (max-width: 720px) { .tekvn-nav a { padding: 11px 10px; font-size: 13.5px; } }

/* Danh sach bai viet */
.tekvn-main { padding: 32px 0 48px; }
.tekvn-post { padding: 22px 0; border-bottom: 1px solid var(--tekvn-line); }
.tekvn-post:first-child { padding-top: 0; }
.tekvn-post-title { font-size: 24px; line-height: 1.3; margin: 0 0 8px; }
.tekvn-post-title a { color: var(--tekvn-ink); }
.tekvn-post-title a:hover { color: var(--tekvn-green); text-decoration: none; }
.tekvn-post-meta { color: var(--tekvn-muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 8px; }
.tekvn-post-excerpt { color: #374151; margin: 0; }
.tekvn-thumb { margin-bottom: 14px; }
.tekvn-thumb img { max-width: 100%; height: auto; display: block; border-radius: 6px; }

/* Bai viet don */
.tekvn-single-title { font-size: 34px; line-height: 1.25; margin: 0 0 10px; }
.tekvn-content { font-size: 17px; }
.tekvn-content img { max-width: 100%; height: auto; }
.tekvn-post-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--tekvn-line); font-size: 14px; }

/* Phan trang */
.tekvn-pagination { margin-top: 28px; }
.tekvn-pagination .page-numbers { display: inline-block; padding: 6px 12px; border: 1px solid var(--tekvn-line); border-radius: 6px; margin-right: 6px; color: var(--tekvn-ink); }
.tekvn-pagination .page-numbers.current { background: var(--tekvn-green); color: #fff; border-color: var(--tekvn-green); }

/* Footer (v0.6.0 — nen toi muc N4, 4 cot, theo phac thao da duyet 2026-11-26) */
.tekvn-footer { background: #0b1220; color: #b9c5d4; font-size: 14.5px; line-height: 1.6; }
.tekvn-ft-inner { padding-top: 46px; }
.tekvn-ft-cols { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 36px; padding-bottom: 38px; }
.tekvn-ft-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.tekvn-ft-logo:hover { text-decoration: none; }
.tekvn-ft-disc { width: 42px; height: 42px; flex: none; display: block; }
.tekvn-ft-wordmark { height: 34px; width: auto; display: block; }
.tekvn-ft-tagline { font-size: 11px; letter-spacing: 2.2px; color: #8a94a6; font-weight: 600; margin-bottom: 16px; }
.tekvn-ft-intro { color: #b9c5d4; max-width: 340px; margin: 0; }
.tekvn-ft-mail { margin: 16px 0 0; font-size: 14px; }
.tekvn-ft-mail a { color: #e5e7eb; font-weight: 600; }
.tekvn-ft-mail a:hover { color: #2fbf8f; text-decoration: none; }
.tekvn-ft-title { color: #fff; font-size: 15px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; margin: 0 0 16px; padding-bottom: 10px; border-bottom: 2px solid var(--tekvn-green); display: inline-block; }
.tekvn-ft-list { list-style: none; margin: 0; padding: 0; }
.tekvn-ft-list a { color: #b9c5d4; display: inline-block; padding: 5px 0; font-size: 14.5px; }
.tekvn-ft-list a:hover { color: #2fbf8f; text-decoration: none; }
.tekvn-ft-bottom { border-top: 1px solid rgba(255, 255, 255, 0.12); padding: 18px 0 22px; display: flex; justify-content: space-between; gap: 10px 24px; flex-wrap: wrap; font-size: 13.5px; color: #8a94a6; }
.tekvn-ft-copy { color: #c7d0dc; font-weight: 600; }

/* ===== Trang chu (v0.3.0) ===== */
.tekvn-home { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }

/* Badge chuyen muc */
.tekvn-badge { display: inline-block; background: #e7f6ef; color: var(--tekvn-green); font-size: 12.5px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; margin-bottom: 10px; }
.tekvn-badge:hover { background: var(--tekvn-green); color: #fff; text-decoration: none; }

/* Anh bia sinh theo chuyen muc (khi bai chua co anh dai dien) */
.tekvn-cover { display: flex; align-items: center; justify-content: center; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, #374151, #111827); aspect-ratio: 16 / 9; }
.tekvn-cover:hover { text-decoration: none; }
.tekvn-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tekvn-cover-t { font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: 96px; color: rgba(255, 255, 255, 0.92); line-height: 1; }
.tekvn-cover-ten-mien-hosting { background: linear-gradient(135deg, #069a65, #0e7c86); }
.tekvn-cover-wordpress { background: linear-gradient(135deg, #21759b, #0e7c86); }
.tekvn-cover-vps-server { background: linear-gradient(135deg, #1e3a8a, #2563eb); }
.tekvn-cover-lap-trinh { background: linear-gradient(135deg, #4f46e5, #9333ea); }
.tekvn-cover-khuyen-mai-ma-giam-gia { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.tekvn-cover-chung { background: linear-gradient(135deg, #475569, #0f172a); }

/* Danh sach bai viet (theo canhme.com): bia trai, noi dung phai, xep doc */
.tekvn-list { display: flex; flex-direction: column; }
.tekvn-item { display: grid; grid-template-columns: 250px 1fr; gap: 22px; padding: 22px 0; border-bottom: 1px solid var(--tekvn-line); align-items: start; }
.tekvn-home-main .tekvn-item:first-child { padding-top: 0; }
.tekvn-item .tekvn-cover { aspect-ratio: 16 / 10; }
.tekvn-item .tekvn-cover-t { font-size: 64px; }
.tekvn-item-body { display: flex; flex-direction: column; align-items: flex-start; }
.tekvn-item-title { font-size: 21px; line-height: 1.35; margin: 0 0 8px; }
.tekvn-item-title a { color: var(--tekvn-ink); }
.tekvn-item-title a:hover { color: var(--tekvn-green); text-decoration: none; }
.tekvn-item-excerpt { color: #4b5563; font-size: 15px; margin: 0 0 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tekvn-item .tekvn-post-meta { margin-bottom: 0; }

/* Sidebar */
.tekvn-sidebar { display: flex; flex-direction: column; gap: 26px; }
.tekvn-widget { border: 1px solid var(--tekvn-line); border-radius: 14px; padding: 20px 22px; background: #fff; }
.tekvn-widget-title { font-size: 16px; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 2px solid var(--tekvn-green); display: inline-block; }
.tekvn-cat-list, .tekvn-recent-list, .tekvn-tools-list { list-style: none; margin: 0; padding: 0; }
.tekvn-cat-list li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--tekvn-line); font-size: 15px; }
.tekvn-cat-list li:last-child { border-bottom: none; }
.tekvn-cat-list a { color: var(--tekvn-ink); font-weight: 600; }
.tekvn-cat-list a:hover { color: var(--tekvn-green); text-decoration: none; }
.tekvn-recent-list li { padding: 9px 0; border-bottom: 1px dashed var(--tekvn-line); }
.tekvn-recent-list li:last-child { border-bottom: none; }
.tekvn-recent-list a { color: var(--tekvn-ink); font-weight: 600; font-size: 15px; line-height: 1.4; display: block; }
.tekvn-recent-list a:hover { color: var(--tekvn-green); text-decoration: none; }
.tekvn-recent-date { color: var(--tekvn-muted); font-size: 13px; }
.tekvn-tools-box { background: #0b1220; border-color: #0b1220; }
.tekvn-tools-box .tekvn-widget-title { color: #fff; border-bottom-color: var(--tekvn-red); }
.tekvn-tools-list li { padding: 6px 0; }
.tekvn-tools-list a { color: #e5e7eb; font-weight: 600; font-size: 15px; }
.tekvn-tools-list a:hover { color: #fff; text-decoration: none; }
.tekvn-tools-list a::before { content: "→ "; color: var(--tekvn-green); font-weight: 700; }

@media (max-width: 960px) {
  .tekvn-home { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .tekvn-item { grid-template-columns: 1fr; gap: 14px; }
  .tekvn-item-title { font-size: 19px; }
}

/* ===== v0.5.0 — Giao dien mobile (ban trai nghiem da chot 2026-11-25) ===== */

/* Mac dinh (desktop): an toan bo chrome mobile */
.tekvn-m-brandrow, .tekvn-m-barwrap, .tekvn-m-postbar, .tekvn-chips { display: none; }
.tekvn-backdrop, .tekvn-drawer { display: none; }
.tekvn-meta-cat { display: none; }

/* Breadcrumb (bai viet + chuyen muc) */
.tekvn-crumb { font-size: 12.5px; color: var(--tekvn-muted); margin-bottom: 14px; }
.tekvn-crumb a { color: var(--tekvn-green); font-weight: 600; }
.tekvn-crumb-current { color: var(--tekvn-muted); }

/* Hop cong cu lien quan (cuoi bai viet) */
.tekvn-toolbox { background: #0b1220; border-radius: 14px; padding: 20px; color: #fff; margin: 28px 0 8px; }
.tekvn-toolbox-title { font-size: 16px; font-weight: 700; }
.tekvn-toolbox p { color: #c3cede; font-size: 14px; margin: 7px 0 14px; }
.tekvn-toolbox-btn { display: block; text-align: center; background: var(--tekvn-green); color: #fff; font-weight: 700; font-size: 15px; padding: 13px; border-radius: 11px; }
.tekvn-toolbox-btn:hover { background: #057a50; text-decoration: none; }

/* Bai viet lien quan */
.tekvn-rel-title { font-size: 19px; margin: 30px 0 14px; }
.tekvn-rel-list { display: flex; flex-direction: column; gap: 10px; }
.tekvn-rel-item { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--tekvn-line); border-radius: 12px; padding: 10px; }
.tekvn-rel-item:hover { text-decoration: none; border-color: var(--tekvn-green); }
.tekvn-rel-thumb { flex: none; width: 104px; height: 78px; border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #374151, #111827); }
.tekvn-rel-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tekvn-rel-thumb .tekvn-cover-t { font-size: 30px; }
.tekvn-rel-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tekvn-rel-name { color: var(--tekvn-ink); font-weight: 700; font-size: 15px; line-height: 1.4; }
.tekvn-rel-meta { color: var(--tekvn-muted); font-size: 12.5px; }

/* Trang chuyen muc */
.tekvn-cat-desc { color: #4b5563; font-size: 15px; margin: 6px 0 0; }
.tekvn-cat-count { color: var(--tekvn-muted); font-size: 13.5px; margin: 6px 0 18px; }
.tekvn-cattree { background: #fff; border: 1px solid var(--tekvn-line); border-radius: 14px; overflow: hidden; }
.tekvn-cattree-row { display: flex; justify-content: space-between; align-items: center; padding: 15px 16px; color: var(--tekvn-ink); font-weight: 600; font-size: 15px; border-bottom: 1px solid #f0f1f2; }
.tekvn-cattree-row:last-child { border-bottom: none; }
.tekvn-cattree-row:hover { color: var(--tekvn-green); text-decoration: none; }
.tekvn-cattree-cnt { color: var(--tekvn-muted); font-size: 12.5px; font-weight: 600; }
.tekvn-cattree-sub { padding-left: 36px; font-size: 13.5px; font-weight: 500; }

@media (max-width: 820px) {
  body { background: #f6f7f8; }
  .tekvn-main { padding: 18px 0 40px; }
  .tekvn-container { padding: 0 12px; }

  /* An header desktop, hien chrome mobile */
  .tekvn-header-top, .tekvn-menu-bar { display: none; }
  .tekvn-m-brandrow { display: flex; justify-content: center; background: #fff; padding: 12px 0 10px; }
  .tekvn-m-brandrow img { width: 132px; height: auto; display: block; }
  .tekvn-m-brandrow .tekvn-site-name { font-size: 26px; }
  .tekvn-m-barwrap { display: block; position: sticky; top: 0; z-index: 90; }
  body.admin-bar .tekvn-m-barwrap, body.admin-bar .tekvn-m-postbar { top: 46px; }
  .tekvn-m-bar { background: var(--tekvn-green); display: flex; align-items: center; justify-content: space-between; height: 50px; padding: 0 6px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); }
  .tekvn-m-menu-btn { background: none; border: none; color: #fff; cursor: pointer; display: flex; align-items: center; gap: 8px; font: inherit; font-weight: 700; font-size: 13px; text-transform: uppercase; padding: 10px 12px; border-radius: 8px; }
  .tekvn-m-menu-btn svg { width: 22px; height: 22px; }
  .tekvn-m-icon-btn { background: none; border: none; color: #fff; cursor: pointer; display: flex; align-items: center; padding: 10px 12px; border-radius: 8px; }
  .tekvn-m-icon-btn svg { width: 22px; height: 22px; }
  .tekvn-m-search { display: none; background: #fff; padding: 12px 16px; border-bottom: 1px solid var(--tekvn-line); }
  .tekvn-m-search.open { display: block; }
  .tekvn-m-search .search-form { display: flex; gap: 8px; }
  .tekvn-m-search .search-field { flex: 1; min-width: 0; font-size: 16px; padding: 12px 14px; border: 1.5px solid var(--tekvn-line); border-radius: 10px; outline: none; }
  .tekvn-m-search .search-field:focus { border-color: var(--tekvn-green); }
  .tekvn-m-search .search-submit { background: var(--tekvn-green); color: #fff; border: none; border-radius: 10px; padding: 0 18px; font-weight: 700; font-size: 15px; cursor: pointer; }

  /* Thanh xanh gon cho trang bai viet / chuyen muc */
  .tekvn-m-postbar { display: flex; align-items: center; gap: 4px; background: var(--tekvn-green); padding: 6px 8px; position: sticky; top: 0; z-index: 90; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); }
  .tekvn-m-postbar-title { flex: 1; text-align: center; color: #fff; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.4px; }

  /* Ngan keo menu truot tu ben trai */
  .tekvn-backdrop { display: block; position: fixed; inset: 0; background: rgba(11, 18, 32, 0.45); z-index: 190; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
  .tekvn-backdrop.open { opacity: 1; pointer-events: auto; }
  .tekvn-drawer { display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; width: 78%; max-width: 300px; background: #fff; z-index: 200; transform: translateX(-105%); transition: transform 0.32s ease; box-shadow: 8px 0 24px rgba(11, 18, 32, 0.18); }
  .tekvn-drawer.open { transform: translateX(0); }
  .tekvn-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--tekvn-line); }
  .tekvn-drawer-head img { width: 104px; height: auto; display: block; }
  .tekvn-drawer-head .tekvn-site-name { font-size: 22px; }
  .tekvn-drawer-close { background: #f3f4f6; border: none; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; font-size: 16px; color: var(--tekvn-ink); line-height: 1; flex: none; }
  .tekvn-drawer-nav { overflow-y: auto; }
  .tekvn-drawer-link { display: flex; justify-content: space-between; align-items: center; padding: 15px 18px; color: var(--tekvn-ink); text-decoration: none; font-weight: 600; font-size: 14px; border-bottom: 1px solid #f0f1f2; }
  .tekvn-drawer-link:hover { text-decoration: none; background: #f9fafb; }
  .tekvn-drawer-arr { color: #9ca3af; font-weight: 400; }
  .tekvn-drawer-label { padding: 16px 18px 6px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.7px; color: var(--tekvn-muted); text-transform: uppercase; }

  /* Chips chuyen muc (trang chu) */
  .tekvn-chips { display: flex; gap: 8px; padding: 2px 2px 12px; overflow-x: auto; scrollbar-width: none; }
  .tekvn-chips::-webkit-scrollbar { display: none; }
  .tekvn-chip { flex: none; border: 1.5px solid var(--tekvn-line); background: #fff; color: var(--tekvn-ink); padding: 7px 13px; border-radius: 999px; font-size: 13px; font-weight: 600; }
  .tekvn-chip:hover { text-decoration: none; }
  .tekvn-chip.on { background: var(--tekvn-green); border-color: var(--tekvn-green); color: #fff; }

  /* Danh sach bai: bai dau the lon, cac bai sau hang gon */
  .tekvn-list { gap: 0; }
  .tekvn-item { display: grid; grid-template-columns: 104px 1fr; gap: 12px; align-items: center; background: #fff; border: 1px solid #eef0f1; border-bottom: 1px solid #eef0f1; border-radius: 12px; padding: 10px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(11, 18, 32, 0.06); }
  .tekvn-item .tekvn-cover { width: 104px; height: 78px; aspect-ratio: auto; border-radius: 8px; }
  .tekvn-item .tekvn-cover-t { font-size: 30px; }
  .tekvn-item .tekvn-badge { display: none; }
  .tekvn-item-title { font-size: 13.5px; line-height: 1.4; margin: 0 0 5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .tekvn-item-excerpt { display: none; }
  .tekvn-item .tekvn-post-meta { font-size: 12px; text-transform: none; letter-spacing: 0; margin: 0; }
  .tekvn-meta-cat { display: inline; }
  .tekvn-home-main .tekvn-item:first-child { grid-template-columns: 1fr; gap: 0; padding: 0; overflow: hidden; align-items: stretch; border-radius: 14px; }
  .tekvn-home-main .tekvn-item:first-child .tekvn-cover { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 0; }
  .tekvn-home-main .tekvn-item:first-child .tekvn-cover-t { font-size: 64px; }
  .tekvn-home-main .tekvn-item:first-child .tekvn-item-body { padding: 14px 16px 16px; }
  .tekvn-home-main .tekvn-item:first-child .tekvn-badge { display: inline-block; font-size: 11px; padding: 4px 9px; margin-bottom: 8px; }
  .tekvn-home-main .tekvn-item:first-child .tekvn-item-title { font-size: 17px; line-height: 1.35; display: block; overflow: visible; }
  .tekvn-home-main .tekvn-item:first-child .tekvn-item-excerpt { display: -webkit-box; font-size: 13.5px; margin: 0 0 10px; }
  .tekvn-home-main .tekvn-item:first-child .tekvn-meta-cat { display: none; }

  /* Sidebar xuong duoi, gon lai */
  .tekvn-sidebar { margin-top: 10px; }
  .tekvn-widget { border-radius: 12px; padding: 16px 18px; }

  /* Trang bai viet */
  .tekvn-single-title { font-size: 20px; line-height: 1.35; }
  .tekvn-single-meta { text-transform: none; letter-spacing: 0; font-size: 12.5px; }
  .tekvn-single-cover { margin-bottom: 16px; }
  .tekvn-content { font-size: 15px; line-height: 1.75; }
  .tekvn-content h2 { font-size: 17px; line-height: 1.4; }
  .tekvn-content h3 { font-size: 15.5px; }
  .tekvn-rel-name { font-size: 13.5px; }
  .tekvn-toolbox { padding: 16px; }
  .tekvn-toolbox-btn { padding: 12px; }

  /* Trang chuyen muc */
  .tekvn-cathead .tekvn-single-title { margin-bottom: 0; }

  /* Footer mobile: cot xep doc, moi lien ket mot hang cham rieng */
  .tekvn-ft-inner { padding-top: 36px; }
  .tekvn-ft-cols { grid-template-columns: 1fr; gap: 30px; padding-bottom: 30px; }
  .tekvn-ft-intro { max-width: none; }
  .tekvn-ft-title { font-size: 14px; margin-bottom: 8px; }
  .tekvn-ft-list a { display: block; padding: 10px 0; font-size: 15px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
  .tekvn-ft-list li:last-child a { border-bottom: none; }
  .tekvn-ft-bottom { flex-direction: column; font-size: 13px; }
}
