/* =========================================================
   Dải "Đã xây dựng & đồng hành" — trang chủ
   Chứng minh uy tín bằng tên thật, đặt ngay dưới Hero.
   ========================================================= */
.nw-brands {
  padding: 0 0 56px;
}
.brands-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.brands-kicker {
  color: var(--earth);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.brands-note {
  color: var(--muted);
  font-size: 14px;
}

.brands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}
.brand-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, .5);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.brand-item:hover {
  transform: translateY(-3px);
  border-color: var(--green-moss);
  background: var(--white-soft);
}
.brand-name {
  color: var(--green-deep);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -.03em;
  line-height: 1.15;
}
.brand-role {
  color: #555d53;
  font-size: 13.5px;
  line-height: 1.4;
}
.brand-year {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  margin-top: 2px;
}

@media (max-width: 640px) {
  .nw-brands { padding-bottom: 40px; }
  .brands-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .brand-item { padding: 13px 14px; }
  .brand-name { font-size: 16px; }
  .brand-role { font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .brand-item { transition: none; }
}

/* =========================================================
   Nhãn trạng thái dự án (dùng chung: dải trang chủ + trang Dự án)
   ========================================================= */
.duan-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 850; letter-spacing: .04em;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.duan-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-active { background: rgba(82,107,79,.14);  color: #3d5a3a; }
.st-ended  { background: rgba(155,118,83,.16); color: #7d5c3d; }
.st-closed { background: rgba(18,51,40,.10);   color: #5d635b; }

/* ---------- Trang Dự án ---------- */
.duan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.duan-card {
  background: var(--cream-light); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 22px 24px 20px;
  display: flex; flex-direction: column; gap: 9px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.duan-card:hover { transform: translateY(-4px); border-color: var(--green-moss); box-shadow: 0 20px 46px rgba(18,51,40,.09); }
.duan-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.duan-top h3 { font-size: 22px; line-height: 1.15; margin: 0; }
.duan-top h3 a { color: var(--green-deep); }
.duan-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.duan-role { font-size: 13px; font-weight: 750; color: #555d53; }
.duan-period { font-size: 12.5px; color: var(--muted); }
.duan-period::before { content: "· "; }
.duan-result {
  font-size: 14px; font-weight: 800; color: var(--green-deep);
  background: var(--paper); border-radius: 8px; padding: 7px 11px; align-self: flex-start;
}
.duan-desc { color: #555d53; font-size: 15px; line-height: 1.6; margin: 0; }
.duan-more { font-size: 13.5px; font-weight: 800; color: var(--earth); margin-top: auto; padding-top: 4px; }
.duan-more:hover { color: var(--green-deep); }

/* ---------- Chi tiết dự án ---------- */
.duan-single-head { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.duan-result-big {
  display: inline-block; margin-top: 12px;
  font-size: 16px; font-weight: 850; color: var(--green-deep);
  background: var(--paper); border-radius: 10px; padding: 9px 14px;
}
.duan-body h2 { font-size: clamp(22px,3vw,28px); margin: 30px 0 12px; }
.duan-body p, .duan-body li { color: #4c534a; font-size: 16.5px; line-height: 1.75; }
.duan-body ul, .duan-body ol { margin: 0 0 14px 20px; }

@media (max-width: 640px) {
  .duan-grid { grid-template-columns: 1fr; }
  .duan-top { flex-direction: column; gap: 8px; }
}

/* Dải trang chủ: có nhãn trạng thái + bấm được */
.brands-link { margin-left: auto; font-size: 13.5px; font-weight: 800; color: var(--earth); }
.brands-link:hover { color: var(--green-deep); }
.brand-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.brand-item { cursor: pointer; }

/* Nhãn "Đã bàn giao" + chú thích trạng thái */
.st-handover { background: rgba(82,107,79,.10); color: #4a6247; }
.duan-status[title] { cursor: help; }
.duan-status-note { font-size: 13.5px; color: var(--muted); margin: 8px 0 0; font-style: italic; }

.duan-legend {
  display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center;
  background: rgba(255,255,255,.45); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 14px 18px; margin-bottom: 24px;
}
.duan-legend-title { font-size: 12px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; color: var(--earth); }
.duan-legend-item { display: inline-flex; align-items: center; gap: 8px; }
.duan-legend-note { font-size: 13px; color: #5c6357; }
@media (max-width: 640px) {
  .duan-legend { flex-direction: column; align-items: flex-start; gap: 10px; }
  .duan-legend-item { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* Bộ lọc dự án theo nhãn trạng thái */
.duan-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.duan-filters .chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.5);
  color: var(--green-deep); font-size: 13.5px; font-weight: 800;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.duan-filters .chip:hover { transform: translateY(-2px); border-color: var(--green-moss); background: var(--white-soft); }
.duan-filters .chip.active { background: var(--green-deep); color: var(--cream); border-color: var(--green-deep); }
.duan-filters .chip-count {
  font-size: 11.5px; font-weight: 850; opacity: .7;
  background: rgba(18,51,40,.08); border-radius: 999px; padding: 1px 7px;
}
.duan-filters .chip.active .chip-count { background: rgba(244,239,228,.22); opacity: .95; }
/* chip mang màu của nhãn khi chưa được chọn */
.duan-filters .chip-status:not(.active)::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .75;
}
.duan-filters .chip-status.st-active:not(.active)  { color: #3d5a3a; }
.duan-filters .chip-status.st-handover:not(.active){ color: #4a6247; }
.duan-filters .chip-status.st-ended:not(.active)   { color: #7d5c3d; }
.duan-filters .chip-status.st-closed:not(.active)  { color: #5d635b; }

.duan-legend-clear { margin-left: auto; font-size: 13px; font-weight: 800; color: var(--earth); }
.duan-legend-clear:hover { color: var(--green-deep); }

/* ---------- Tab các nhánh trong dự án (kiểu NÚT TRANG GIẤY) ----------
   Tab đang chọn liền vào tờ giấy bên dưới, như bìa hồ sơ.
   -------------------------------------------------------------------- */
.duan-tabs { margin-top: 38px; }

.duan-tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: flex-end;
  margin: 0;
  padding: 0 0 0 4px;
  border: 0;
  position: relative;
  z-index: 2;
}
.duan-tab {
  cursor: pointer;
  font: inherit;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -.01em;
  padding: 11px 22px 10px;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  background: var(--paper);
  color: #6b7268;
  position: relative;
  top: 3px;                      /* tab chưa chọn thấp hơn một chút */
  transition: background .18s ease, color .18s ease, top .18s ease;
}
.duan-tab:hover { background: var(--cream); color: var(--green-deep); top: 1px; }

/* Tab ĐANG CHỌN: nổi lên, tô màu khác, liền vào tờ giấy */
.duan-tab.active {
  background: var(--cream-light);
  color: var(--green-deep);
  font-weight: 900;
  border-color: var(--green-moss);
  top: 0;
  padding-top: 13px;
  box-shadow: 0 -3px 0 0 var(--green-deep) inset;   /* gạch màu trên đầu tab */
  z-index: 3;
}
.duan-tab.active::after {          /* che đường viền dưới → tab dính vào tờ giấy */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--cream-light);
}
.duan-tab:focus-visible { outline: 2px solid var(--green-moss); outline-offset: 2px; }

/* Tờ giấy */
.duan-panel {
  background: var(--cream-light);
  border: 1px solid var(--green-moss);
  border-radius: 0 16px 16px 16px;
  padding: 26px 28px 28px;
  position: relative;
  z-index: 1;
  margin-top: -1px;
}
.duan-panel-title { font-size: clamp(20px,3vw,26px); margin: 0 0 14px; }

/* Không JS: hiện hết các nhánh (vẫn đọc được). Có JS: chỉ hiện nhánh đang chọn. */
.duan-tabs.js-on .duan-panel { display: none; }
.duan-tabs.js-on .duan-panel.active { display: block; }
.duan-tabs:not(.js-on) .duan-tablist { display: none; }
.duan-tabs:not(.js-on) .duan-panel { border-radius: 16px; margin-top: 0; }
.duan-tabs:not(.js-on) .duan-panel + .duan-panel { margin-top: 20px; }

/* Video / ảnh nhúng trong nhánh */
.duan-panel iframe,
.duan-panel embed,
.duan-panel object,
.duan-panel video {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: var(--radius-md);
  display: block;
  margin: 18px 0;
}
.duan-panel .wp-video, .duan-panel .wp-embed-aspect-16by9 { margin: 18px 0; }
.duan-panel img { border-radius: var(--radius-md); margin: 18px 0; }
.duan-panel figure { margin: 18px 0; }
.duan-panel figcaption { font-size: 13.5px; color: var(--muted); margin-top: 8px; text-align: center; }

@media (max-width: 640px) {
  .duan-tab { padding: 9px 14px 8px; font-size: 13px; }
  .duan-panel { padding: 20px 18px 22px; border-radius: 0 12px 12px 12px; }
}
@media (prefers-reduced-motion: reduce) { .duan-tab { transition: none; } }

/* ---------- Địa điểm & bản đồ (trang chi tiết dự án) ---------- */
.dd-box {
  margin-top: 34px;
  padding: 26px;
  background: var(--cream-light);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.dd-title { font-size: 21px; line-height: 1.2; margin: 0 0 16px; color: var(--green-deep); }
.dd-list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 9px; }
.dd-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.dd-ico { flex: none; line-height: 1.5; }
.dd-list a { color: var(--green-deep); text-decoration: underline; text-underline-offset: 2px; }
.dd-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }

.dd-map { border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--line); background: var(--paper); }
.dd-map iframe { display: block; width: 100%; height: 380px; border: 0; }

/* Nút giữ chỗ: cao đúng bằng bản đồ để lúc tải xong trang không nhảy */
.dd-map-btn {
  width: 100%; height: 380px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  background: none; border: 0; cursor: pointer; color: var(--green-deep);
  font-family: inherit; font-size: 16px; font-weight: 600;
  transition: background .2s;
}
.dd-map-btn:hover { background: rgba(18, 51, 40, .05); }
.dd-map-btn small { font-weight: 400; font-size: 13px; color: var(--muted); }
.dd-map-btn-ico { font-size: 30px; }

@media (max-width: 640px) {
  .dd-box { padding: 20px 18px; }
  .dd-map iframe, .dd-map-btn { height: 280px; }
  .dd-actions .btn { flex: 1 1 100%; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { .dd-map-btn { transition: none; } }

/* ---------- Dòng thời gian: khối thành tựu so le, ảnh mờ về phía chữ ---------- */
.nw-moc { margin: 32px 0; display: flex; flex-direction: column; gap: 20px; }

.nw-moc-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  min-height: 240px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--cream-light);
  border: 1px solid var(--line);
}
.nw-moc-block.is-rev .nw-moc-text  { order: 2; }
.nw-moc-block.is-rev .nw-moc-media { order: 1; }

.nw-moc-text {
  padding: 28px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.nw-moc-nhan {
  font-size: 13px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--green-moss); margin-bottom: 8px;
}
.nw-moc-tieude {
  font-size: clamp(19px, 2.2vw, 24px); line-height: 1.22;
  color: var(--green-deep); margin: 0 0 12px;
}
.nw-moc-chuyen { font-size: 15px; line-height: 1.7; color: var(--muted); margin: 0; }

.nw-moc-media { position: relative; min-height: 240px; }
.nw-moc-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; display: block;
}
/* Ảnh mờ dần về phía CHỮ: khối thường chữ bên trái → mờ mép trái của ảnh */
.nw-moc-block:not(.is-rev) .nw-moc-img,
.nw-moc-block:not(.is-rev) .nw-moc-noimg {
  -webkit-mask-image: linear-gradient(to left, #000 60%, transparent);
          mask-image: linear-gradient(to left, #000 60%, transparent);
}
.nw-moc-block.is-rev .nw-moc-img,
.nw-moc-block.is-rev .nw-moc-noimg {
  -webkit-mask-image: linear-gradient(to right, #000 60%, transparent);
          mask-image: linear-gradient(to right, #000 60%, transparent);
}
.nw-moc-noimg {
  position: absolute; inset: 0;
  background: var(--green-deep);
  display: flex; align-items: center; justify-content: center;
}
.nw-moc-noimg span { color: rgba(244,239,228,.6); font-size: 13px; letter-spacing: .03em; }

@media (max-width: 720px) {
  .nw-moc-block, .nw-moc-block.is-rev { grid-template-columns: 1fr; }
  .nw-moc-block .nw-moc-media { order: 1; min-height: 200px; }
  .nw-moc-block .nw-moc-text  { order: 2; padding: 22px 20px; }
  /* Trên mobile ảnh nằm trên, chữ dưới → mờ mép DƯỚI cho cả hai kiểu khối */
  .nw-moc-block .nw-moc-img,
  .nw-moc-block .nw-moc-noimg {
    -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent);
            mask-image: linear-gradient(to bottom, #000 62%, transparent);
  }
}

/* Khối có video: khung 16:9 gọn, KHÔNG mờ mép (mờ video che hình + lỗi nút play) */
.nw-moc-block.has-video .nw-moc-media { min-height: 0; display: flex; align-items: center; padding: 16px; }
.nw-moc-video { position: relative; width: 100%; padding-top: 56.25%; border-radius: 12px; overflow: hidden; background: #000; }
.nw-moc-video iframe,
.nw-moc-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Video DỌC (TikTok/Shorts/Reel): khung điện thoại canh giữa, không ép 16:9 */
.nw-moc-block.is-doc .nw-moc-media { padding: 16px; }
.nw-moc-block.is-doc .nw-moc-video { position: static; width: auto; max-width: 320px; margin: 0 auto; padding-top: 0; background: transparent; border-radius: 0; }
.nw-moc-block.is-doc .nw-moc-video iframe,
.nw-moc-block.is-doc .nw-moc-video blockquote { position: static; width: 100% !important; height: auto; margin: 0 auto; }

/* Video tải lên (self-host): ngang letterbox nền đen; dọc canh giữa giữ tỉ lệ */
.nw-moc-video video { object-fit: contain; background: #000; }
.nw-moc-block.is-doc .nw-moc-video video { position: static; width: 100%; height: auto; border-radius: 12px; }
