/*
Theme Name: Nhà Việt
Theme URI: https://thuviennhaviet.vn/
Author: Thiết kế kiến trúc Nhà Việt
Description: Theme cổ điển cho website Thiết kế kiến trúc Nhà Việt: giới thiệu công ty, thư viện mẫu nhà phố, biệt thự, nội thất.
Version: 1.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 8.0
License: Proprietary
License URI: https://thuviennhaviet.vn/
Text Domain: nhaviet
Tags: architecture, company, vietnamese
*/

/* ============ PHẦN 1: BIẾN + NỀN ============ */
:root {
  --nv-xanh-dam: #09502A;
  --nv-xanh: #09A250;
  --nv-dong: #09A250;
  --nv-vang: #09A250;
  --nv-nga: #F4EFE6;
  --nv-xam: #C9D2CC;
  --nv-chu: #000;
  --nv-trang: #FFFFFF;
}

@font-face {
  font-family: "Montserrat";
  src: url("assets/fonts/Montserrat-400.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("assets/fonts/Montserrat-600.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  font-family: "Roboto", Arial, Helvetica, sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.6;
  color: #000;
  background: #fff;
}

h1, h2, h3, h4, h5, h6 { font-family: "Roboto Condensed", "Roboto", Arial, sans-serif; font-weight: 400; text-transform: uppercase; line-height: 1.3; color: #000; margin: 0 0 0.6em; }
p { margin: 0 0 1em; }
a { color: var(--nv-xanh); text-decoration: none; }
a:hover { color: var(--nv-dong); }
img { max-width: 100%; height: auto; }

.nv-khung { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.nv-noi-dung { padding: 32px 0 48px; }
.nv-tieu-de-trang { font-size: 1.75rem; text-transform: uppercase; }

/* ============ HEADER (S2A giống trang cũ: cố định 70px, không thanh trên) ============ */
body:not(.home) { padding-top: 70px; }

.nv-thanh-tren { display: none !important; }
.nv-thanh-tren-cu {
  background: var(--nv-xanh-dam);
  color: var(--nv-nga);
  font-size: 0.875rem;
}
.nv-thanh-tren .nv-khung {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 6px;
  padding-bottom: 6px;
  flex-wrap: wrap;
}
.nv-thanh-tren a { color: var(--nv-nga); }
.nv-thanh-tren a:hover { color: var(--nv-vang); }
.nv-thanh-tren-trai { display: flex; align-items: center; gap: 6px; }
.nv-thanh-tren-phai { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.nv-thanh-chinh {
  background: #fff;
  box-shadow: 0 8px 16px rgba(0,0,0,.15);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
}
.nv-thanh-chinh .nv-khung {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 70px;
  height: 70px;
}
.nv-logo img { height: 50px; width: auto; display: block; }
.nv-logo a { display: inline-block; }
.nv-dieu-huong { margin-left: auto; display: flex; align-items: center; gap: 12px; }

/* Menu desktop */
.nv-menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: stretch; gap: 4px; }
.nv-menu > li { position: static; display: flex; align-items: stretch; }
.nv-menu > li > a {
  display: flex;
  align-items: center;
  padding: 25px 9px;
  font-family: "Roboto", Arial, sans-serif;
  font-size: 15px;
  font-weight: 400;
  text-transform: uppercase;
  color: #09A250;
  border-bottom: 0;
  white-space: nowrap;
}
.nv-menu > li > a:hover { color: #09A250; }

/* Mega menu (S2A giống trang cũ: bảng trắng 894px) */
.nv-mega {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: #fff;
  border-top: 0;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}
li.menu-item-has-children { position: static; }
li.menu-item-has-children:hover > .nv-mega,
li.menu-item-has-children:focus-within > .nv-mega { display: block; }
.nv-mega-trong {
  max-width: 894px;
  margin: 0 auto;
  padding: 10px;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.nv-mega-cot { min-width: 170px; flex: 1 1 170px; }
.nv-mega-ten {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #09A250;
  text-transform: uppercase;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--nv-xam);
}
.nv-mega-cot ul { list-style: none; margin: 0; padding: 0; }
.nv-mega-cot ul a { display: block; padding: 5px 0; font-size: 14px; color: #000; }
.nv-mega-cot ul a:hover { color: #09A250; }
.nv-mega-don { list-style: none; margin: 0; padding: 0; }
.nv-mega-don a { display: block; padding: 5px 0; }

/* Nút tìm kiếm + form */
.nv-nut-tim { background: none; border: 0; cursor: pointer; font-size: 1.2rem; color: #09A250; padding: 8px; }
.nv-nut-tim:hover { color: #09A250; }
.nv-hop-tim { display: none; padding: 10px 0 16px; }
.nv-thanh-chinh .nv-hop-tim { display: none; }
.nv-thanh-chinh .nv-hop-tim.mo { display: block; }
.nv-hop-tim.mo { display: block; }
.nv-hop-tim form { display: flex; gap: 8px; }
.nv-hop-tim input[type="search"] { flex: 1; padding: 10px 12px; border: 1px solid var(--nv-xam); border-radius: 4px; font: inherit; }
.nv-hop-tim button { padding: 10px 18px; background: var(--nv-dong); color: #fff; border: 0; border-radius: 4px; cursor: pointer; font: inherit; font-weight: 600; }

/* Nút menu di động */
.nv-nut-menu { display: none; background: none; border: 1px solid var(--nv-xam); border-radius: 4px; font-size: 1.3rem; padding: 4px 10px; cursor: pointer; color: var(--nv-xanh-dam); }

/* Menu di động */
.nv-nen-mo { display: none; }
.nv-menu-mobi { display: none; }

/* ============ LƯỚI THẺ BÀI (dùng chung) ============ */
.nv-luoi { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 24px; }
.nv-the { border: 1px solid var(--nv-xam); border-radius: 8px; overflow: hidden; background: #fff; }
.nv-the-anh { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--nv-xam); }
.nv-the-anh img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nv-the-than { padding: 12px 14px 16px; }
.nv-the-than h2, .nv-the-than h3 { font-size: 1rem; margin: 0 0 6px; }
.nv-the-trich { font-size: 0.85rem; color: #5a6a6a; }
.nv-the-meta { font-size: 0.8rem; color: #5a6a6a; margin-bottom: 6px; }
.nv-phan-trang { margin-top: 28px; text-align: center; }
.nv-phan-trang .nav-links { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.nv-phan-trang a, .nv-phan-trang span { padding: 8px 14px; border: 1px solid var(--nv-xam); border-radius: 4px; color: var(--nv-xanh-dam); }
.nv-phan-trang .current { background: var(--nv-xanh-dam); color: #fff; border-color: var(--nv-xanh-dam); }

/* Breadcrumb */
.nv-breadcrumb { font-size: 0.85rem; color: #5a6a6a; margin-bottom: 12px; }
.nv-breadcrumb a { color: var(--nv-xanh); }

/* Ảnh đại diện bài viết */
.nv-anh-dai-dien { margin: 0 0 20px; }
.nv-anh-dai-dien img { width: 100%; height: auto; border-radius: 8px; }
.nv-ngay-dang { color: #5a6a6a; font-size: 0.85rem; margin-bottom: 16px; }

/* ============ FOOTER (S2A giống trang cũ) ============ */
.nv-chan {
  background: #09A250 url("assets/img/bg-footer.png.webp") center center / cover no-repeat;
  color: #fff;
  font-size: 14px;
}
.nv-chan a { color: #fff; }
.nv-chan a:hover { color: #fff; text-decoration: underline; }
.nv-chan-luoi { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 28px; padding: 40px 0 24px; }
.nv-chan h3 {
  color: #fff;
  font-family: "Roboto Condensed", "Roboto", Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
}
.nv-chan ul { list-style: none; margin: 0; padding: 0; }
.nv-chan ul li { margin-bottom: 8px; font-size: 14px; }
.nv-chan-logo img { height: 52px; width: auto; margin-bottom: 10px; }
.nv-chan p { font-size: 14px; }
.nv-chan iframe { max-width: 100%; }
.nv-chan-hang2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  padding: 8px 0 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.4);
}
.nv-chan-ten { font-weight: 700; text-transform: uppercase; }
.nv-ban-quyen {
  background: #09502A;
  color: #fff;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  text-align: center;
  font-size: 14px;
}
.nv-dang-ky { display: flex; gap: 0; }
.nv-dang-ky input { flex: 1; min-width: 0; padding: 10px; border: 0; border-radius: 0; font: inherit; background: #fff; color: #000; }
.nv-dang-ky button { padding: 10px 18px; background: #09502A; color: #fff; border: 0; border-radius: 0; cursor: pointer; font: inherit; font-weight: 700; text-transform: uppercase; }
.nv-mxh { display: flex; gap: 10px; margin-top: 12px; }
.nv-mxh a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  color: #09A250;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}
.nv-mxh a:hover { text-decoration: none; }
.nv-mxh svg { width: 18px; height: 18px; fill: #09A250; }

/* Nút nổi (S2A giống trang cũ) */
.nv-cot-trai {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  width: 45px;
  z-index: 200;
}
.nv-cot-trai a {
  width: 45px;
  height: 45px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin-bottom: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.nv-cot-trai svg { width: 24px; height: 24px; fill: #fff; }
.nv-cot-fb { background: #3B5998; }
.nv-cot-messenger { background: #0084FF; }
.nv-cot-zalo { background: #0068FF; font-weight: 700; font-size: 12px; }
@media (max-width: 991px) {
  .nv-cot-trai { display: none; }
}

/* Nút gọi góc trái dưới, hiệu ứng sóng "alo" */
.nv-goi-alo {
  position: fixed;
  left: 16px;
  bottom: 16px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #09A250;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.nv-goi-alo svg { width: 28px; height: 28px; fill: #fff; position: relative; z-index: 2; }
.nv-goi-alo::before,
.nv-goi-alo::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid #09A250;
  animation: nv-alo 2s ease-out infinite;
}
.nv-goi-alo::after { animation-delay: 1s; }
@keyframes nv-alo {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* Cụm lên đầu trang góc phải dưới (giữ lại) */
.nv-nut-noi {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
}
.nv-nut-noi button {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border: 0;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.nv-nut-noi svg { width: 26px; height: 26px; fill: currentColor; }
.nv-noi-len { background: #09502A; display: none; }
.nv-noi-len.hien { display: flex; }

/* ============ DI ĐỘNG ============ */
@media (max-width: 1100px) {
  .nv-luoi { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 992px) {
  .nv-nut-menu { display: block; }
  .nv-dieu-huong nav.nv-menu-desktop { display: none; }
  .nv-menu > li > a { padding: 14px 10px; }

  /* Menu trượt trái */
  .nv-menu-mobi {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(340px, 88vw);
    background: var(--nv-trang);
    z-index: 300;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    overflow-y: auto;
    padding: 16px;
  }
  .nv-menu-mobi.mo { transform: translateX(0); }
  .nv-nen-mo.mo {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 250;
  }
  .nv-mobi-dong { float: right; background: none; border: 1px solid var(--nv-xam); border-radius: 4px; font-size: 1rem; padding: 4px 10px; cursor: pointer; }
  .nv-menu-mobi ul { list-style: none; margin: 12px 0 0; padding: 0; }
  .nv-menu-mobi li { border-bottom: 1px solid var(--nv-xam); }
  .nv-menu-mobi a { display: inline-block; padding: 10px 4px; color: var(--nv-xanh-dam); font-weight: 600; font-size: 0.9rem; text-transform: uppercase; }
  .nv-mobi-nhom { display: block; font-weight: 600; color: var(--nv-xanh); font-size: 0.85rem; text-transform: uppercase; margin: 10px 0 2px; }
  .nv-mobi-cap3 a { font-weight: 400; text-transform: none; padding: 7px 4px 7px 12px; display: block; }
  .nv-mobi-hang { display: flex; align-items: center; justify-content: space-between; }
  .nv-mobi-mo { background: none; border: 1px solid var(--nv-xam); border-radius: 4px; width: 30px; height: 30px; cursor: pointer; font-size: 1rem; line-height: 1; }
  .nv-mobi-con { display: none; }
  .nv-mobi-con.mo { display: block; }

  .nv-chan-luoi { grid-template-columns: 1fr 1fr; }
  .nv-chan-hang2 { grid-template-columns: 1fr; }
  .nv-luoi { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .nv-thanh-tren .nv-khung { font-size: 0.78rem; }
  .nv-luoi { grid-template-columns: 1fr; }
  .nv-chan-luoi { grid-template-columns: 1fr; }
  .nv-tieu-de-trang { font-size: 1.35rem; }
}

/* ==== THẺ MẪU NHÀ (Phần 2) ==== */
.nv-luoi { display: grid; gap: 24px; grid-template-columns: 1fr; }
.nv-the {
  background: #fff;
  border: 1px solid var(--nv-xam);
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.25s ease;
}
.nv-the:hover { box-shadow: 0 10px 26px rgba(31, 42, 42, 0.18); }
.nv-the-anh {
  display: block;
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--nv-xam);
}
.nv-the-anh img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.nv-the:hover .nv-the-anh img { transform: scale(1.05); }
.nv-the-trong {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 180px;
  background: var(--nv-xam);
}
.nv-the-trong img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}
.nv-the-nhan {
  position: absolute;
  left: 12px;
  top: 12px;
  background: var(--nv-dong);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
}
.nv-the-than { padding: 12px 14px 14px; }
.nv-the-than h3 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nv-the-than h3 a { color: var(--nv-xanh-dam); }
.nv-the-than h3 a:hover { color: var(--nv-dong); }
.nv-the-phu { font-size: 0.8125rem; color: #5a6a6a; margin: 0; }

@media (min-width: 480px) {
  .nv-luoi { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 768px) {
  .nv-luoi { grid-template-columns: 1fr 1fr 1fr; }
}
@media (min-width: 1100px) {
  .nv-luoi { grid-template-columns: 1fr 1fr 1fr 1fr; }
}

/* ==== SUA NHO 2: thanh tren mobile 1 dong (767px) ==== */
@media (max-width: 767px) {
  .nv-thanh-tren { font-size: 13px; }
  .nv-thanh-tren .nv-khung { justify-content: center; flex-wrap: nowrap; font-size: 13px; }
  .nv-thanh-tren-trai { display: none; }
  .nv-thanh-tren-phai { flex-wrap: nowrap; white-space: nowrap; justify-content: center; }
  .nv-thanh-tren-phai a[href^="mailto:"] { display: none; }
  .nv-thanh-tren-phai > span:nth-child(4) { display: none; }
}
