/*
  Trang tin nhà phố /nha-pho/{slug}. Chỉ nạp ở tin nhà phố, qua @section Styles
  của Pages/Projects/Details.cshtml; trang dự án vẫn dùng khung 430px cũ trong
  site.css.

  Bố cục theo ảnh tham khảo 2026-09: lưới ảnh + khối giá ở trên, dải thông tin
  nhanh, rồi hai cột — nội dung bên trái, tóm tắt và tiện ích bên phải.
*/
.np {
  --np-navy: #0b2447;
  --np-ink: #172033;
  --np-muted: #6b7486;
  --np-line: #e6e8ee;
  --np-soft: #f5f7fb;
  --np-gold: #c9962f;
  --np-gold-soft: #fff6e3;
  --np-red: #d62d20;
  --np-zalo: #0068ff;
  --np-radius: 14px;

  width: min(100%, 1200px);
  margin-inline: auto;
  padding: 0 16px 96px;
  background: #fff;
  color: var(--np-ink);
}

.np h1,
.np h2 {
  color: var(--np-navy);
  margin: 0;
}

.np-icon {
  flex: none;
}

/* Phần tử lưới mặc định rộng tối thiểu bằng nội dung, mà dải ảnh cuộn ngang thì
   rộng bằng cả chục tấm ảnh — không chặn là trang tràn ngang trên điện thoại. */
.np-top > *,
.np-gallery > *,
.np-body > *,
.np-col > *,
.np-side > *,
.np-location > * {
  min-width: 0;
}

/* Thanh đầu trang: nền xanh navy #07152b, logo viền vàng — cùng màu với thanh
   đầu các trang khác của site, để khách không có cảm giác rời sang site lạ. */
.np-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  margin: 0 -16px;
  padding: 0 16px;
  background: #07152b;
  color: #fff;
}

.np-bar a {
  color: #fff;
  text-decoration: none;
}

.np-bar__back {
  justify-self: start;
  color: rgba(255, 255, 255, 0.78) !important;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.np-bar__brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.np-bar__brand span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1.5px solid #d8a84e;
  border-radius: 8px;
  color: #d8a84e;
  font-weight: 900;
  font-size: 0.62rem;
}

.np-bar__brand strong {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
}

.np-bar__menu {
  display: grid;
  justify-self: end;
  gap: 5px;
  width: 38px;
  padding: 8px 6px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.np-bar__menu span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: #d8a84e;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Mở thì ba gạch gập thành dấu X. */
.np-bar__menu[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.np-bar__menu[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.np-bar__menu[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.np-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 12px;
  left: 12px;
  z-index: 30;
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid rgba(216, 168, 78, 0.24);
  border-radius: 14px;
  background: #0b1a30;
  box-shadow: 0 18px 40px rgba(3, 10, 22, 0.55);
}

.np-menu[hidden] {
  display: none;
}

.np-menu a {
  padding: 11px 12px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 0.9rem;
}

.np-menu a:hover,
.np-menu a:focus-visible {
  background: rgba(216, 168, 78, 0.14);
  color: #efd184;
}

/* Máy tính: menu thả xuống gọn ở góc phải thay vì trải hết bề ngang. */
@media (min-width: 768px) {
  .np-menu {
    left: auto;
    width: 260px;
  }
}

.np-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 0;
  font-size: 0.85rem;
  color: var(--np-muted);
}

.np-crumbs a {
  color: var(--np-muted);
}

/* Ảnh + khối giá */
.np-top {
  display: grid;
  gap: 16px;
}

.np-gallery {
  display: grid;
  gap: 8px;
}

.np-main {
  position: relative;
  border-radius: var(--np-radius);
  overflow: hidden;
  background: var(--np-soft);
  aspect-ratio: 4 / 3;
}

.np-slides {
  display: flex;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.np-slides::-webkit-scrollbar {
  display: none;
}

.np-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  height: 100%;
}

.np-slide picture,
.np-slide img,
.np-slide-empty {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.np-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--np-navy);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}

.np-arrow {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-top: -19px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--np-navy);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}

.np-arrow--prev {
  left: 12px;
}

.np-arrow--next {
  right: 12px;
}

.np-arrow:disabled {
  opacity: 0.4;
  cursor: default;
}

.np-count {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Chấm tròn chỉ để site.js dựng carousel; hàng ảnh nhỏ bên dưới đã làm
   việc điều hướng nên ẩn đi cho khỏi thừa. */
.np-dots {
  display: none !important;
}

/* Hai tầng: ảnh lớn ở trên, hàng ảnh nhỏ ở dưới. */
.np-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.np-thumb {
  aspect-ratio: 4 / 3;
  position: relative;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--np-soft);
  cursor: pointer;
}

.np-thumb picture,
.np-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.np-thumb:hover img {
  transform: scale(1.04);
}

.np-thumb__more {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(6, 26, 51, 0.55);
  color: #fff;
  font-weight: 700;
}

.np-info {
  display: grid;
  align-content: start;
  gap: 14px;
}

.np-address {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  color: var(--np-muted);
  font-size: 0.92rem;
}

.np-address .np-icon {
  color: var(--np-navy);
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.np-info h1 {
  font-size: clamp(1.45rem, 3.2vw, 2rem);
  line-height: 1.25;
}

.np-info h1 small {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--np-soft);
  color: var(--np-muted);
  font-size: 0.8rem;
  font-weight: 600;
  vertical-align: middle;
}

.np-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}

.np-price strong {
  color: var(--np-red);
  font-size: clamp(1.7rem, 3.6vw, 2.2rem);
  font-weight: 800;
}

.np-price span {
  padding: 3px 10px;
  border-radius: 999px;
  background: #fdecea;
  color: var(--np-red);
  font-size: 0.85rem;
  font-weight: 600;
}

.np-specs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 8px;
  margin: 0;
  padding: 14px 0;
  list-style: none;
  border-block: 1px solid var(--np-line);
}

.np-specs li {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
}

.np-specs .np-icon {
  width: 26px;
  height: 26px;
  color: var(--np-navy);
}

.np-cta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.np-cta a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 10px 14px;
  border-radius: 12px;
  color: #fff;
  text-decoration: none;
}

.np-cta a span {
  display: grid;
  line-height: 1.25;
}

.np-cta small {
  opacity: 0.9;
  font-size: 0.82rem;
}

.np-cta__call {
  background: var(--np-gold);
}

.np-cta__call .np-icon {
  width: 26px;
  height: 26px;
}

.np-cta__zalo {
  background: var(--np-zalo);
}

.np-cta__zalo i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  color: var(--np-zalo);
  font-style: normal;
  font-weight: 800;
  font-size: 0.68rem;
}

/* Thân trang */
.np-body {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.np-col,
.np-side {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
}

.np-card {
  padding: 18px;
  border: 1px solid var(--np-line);
  border-radius: var(--np-radius);
  background: #fff;
}

.np-card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
}

.np-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.np-card__head p {
  margin: 4px 0 0;
  color: var(--np-muted);
  font-size: 0.88rem;
}

.np-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--np-gold-soft);
  color: var(--np-navy);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.np-pill .np-icon {
  width: 16px;
  height: 16px;
}

.np-link {
  color: var(--np-navy);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}

/* Video: ảnh bìa dọc của TikTok đặt giữa, nền là chính ảnh đó làm mờ. */
.np-video {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  color: #fff;
  text-decoration: none;
}

.np-video__bg {
  position: absolute;
  inset: -20px;
  width: calc(100% + 40px);
  height: calc(100% + 40px);
  object-fit: cover;
  filter: blur(18px) brightness(0.6);
}

/* Đặt tuyệt đối để khung 16:9 quyết định kích thước, không để bề rộng thật
   của ảnh bìa (vài trăm đến cả nghìn px) đẩy cả cột nội dung tràn ra ngoài. */
.np-video__cover {
  position: absolute;
  top: 0;
  left: 50%;
  width: auto;
  height: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  transform: translateX(-50%);
}

.np-video__brand {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  font-weight: 700;
  font-size: 0.85rem;
}

.np-video__brand .np-icon {
  width: 16px;
  height: 16px;
}

.np-video__caption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: calc(100% - 24px);
}

.np-video__caption b,
.np-video__caption em {
  padding: 6px 10px;
  border-radius: 8px;
  font-style: normal;
  font-weight: 700;
}

.np-video__caption b {
  background: var(--np-navy);
}

.np-video__caption em {
  background: #efd184;
  color: var(--np-navy);
}

.np-video__play {
  position: absolute;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid #fff;
  transition: transform 0.2s ease;
}

.np-video__play .np-icon {
  width: 30px;
  height: 30px;
  margin-left: 4px;
}

.np-video:hover .np-video__play {
  transform: scale(1.08);
}

.np-about p {
  margin: 10px 0 0;
  line-height: 1.7;
}

/* Pháp lý */
.np-legal ul {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.np-legal li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.5;
}

.np-legal li .np-icon {
  flex: none;
  color: var(--np-gold);
}

/* Câu hỏi thường gặp */
.np-faq details {
  margin-top: 12px;
  border: 1px solid var(--np-line);
  border-radius: 10px;
  background: var(--np-soft);
}

.np-faq summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: var(--np-navy);
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  list-style: none;
}

.np-faq summary::-webkit-details-marker {
  display: none;
}

.np-faq summary::after {
  content: "+";
  flex: none;
  color: var(--np-gold);
  font-size: 20px;
  line-height: 1;
}

.np-faq details[open] summary::after {
  content: "\2212";
}

.np-faq details p {
  margin: 0;
  padding: 0 14px 14px;
  color: var(--np-ink);
  line-height: 1.7;
}

/* Vị trí */
.np-location {
  display: grid;
  gap: 16px;
}

.np-location__address {
  margin: 8px 0 0;
  color: var(--np-muted);
}

.np-dots-list {
  margin: 12px 0 0;
  padding-left: 18px;
  line-height: 1.8;
}

.np-dots-list li::marker {
  color: var(--np-gold);
}

.np-btn-dark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--np-navy);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.np-btn-dark .np-icon {
  width: 18px;
  height: 18px;
}

.np-map {
  width: 100%;
  min-height: 220px;
  height: 100%;
  border: 0;
  border-radius: 12px;
  background: var(--np-soft);
}

/* Nhà tương tự */
.np-similar__row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.np-similar__row::-webkit-scrollbar {
  display: none;
}

.np-similar__card {
  flex: 0 0 min(62%, 220px);
  display: grid;
  gap: 4px;
  scroll-snap-align: start;
  color: var(--np-ink);
  text-decoration: none;
}

.np-similar__card picture,
.np-similar__card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  padding: 2px;
}

.np-similar__card strong {
  margin-top: 4px;
  color: var(--np-red);
}

.np-similar__card span {
  font-weight: 600;
  font-size: 0.9rem;
}

.np-similar__card small {
  color: var(--np-muted);
  font-size: 0.8rem;
}

/* Cột phải */
.np-own {
  padding: 20px;
  border-radius: var(--np-radius);
  background: var(--np-gold-soft);
  border: 1px solid #f3dfb2;
}

.np-own h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  line-height: 1.3;
}

.np-own h2 .np-icon {
  width: 34px;
  height: 34px;
  color: var(--np-gold);
}

.np-own ul {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.np-own li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.np-own li .np-icon {
  width: 20px;
  height: 20px;
  color: #1f9d55;
}

.np-own__cta {
  display: block;
  margin-top: 16px;
  padding: 11px;
  border-radius: 10px;
  background: var(--np-navy);
  color: #fff;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.np-nearby ul {
  display: grid;
  gap: 12px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.np-nearby li {
  display: flex;
  gap: 12px;
  align-items: center;
}

.np-nearby li .np-icon {
  width: 24px;
  height: 24px;
  color: var(--np-navy);
}

.np-nearby li span {
  display: grid;
}

.np-nearby small {
  color: var(--np-muted);
}

.np-agent {
  display: flex;
  gap: 14px;
  align-items: center;
}

.np-agent img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
}

.np-agent > div {
  display: grid;
  gap: 2px;
}

.np-agent small {
  color: var(--np-muted);
}

.np-agent div div {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.np-agent div div a {
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--np-navy);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.np-agent div div a + a {
  background: var(--np-zalo);
}

/* Popup phát video, dựng bởi site.js ([data-video-embed]). */
.video-popup {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.82);
}

.video-popup[hidden] {
  display: none;
}

.video-popup iframe {
  width: min(92vw, calc(88vh * 9 / 16));
  aspect-ratio: 9 / 16;
  border: 0;
  border-radius: 12px;
  background: #000;
}

.video-popup__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
}

@media (min-width: 640px) {

  .np-location {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  }
}

@media (min-width: 900px) {
  .np {
    padding-bottom: 48px;
  }

  /* Ảnh một nửa, chữ một nửa. */
  .np-top {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 28px;
  }


  .np-body {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
  }

  .np-side {
    position: sticky;
    top: 72px;
    align-self: start;
  }



  .np-similar__card {
    flex-basis: calc((100% - 36px) / 4);
  }
}

/* Tooltip nhẹ khi rê chuột lên ảnh: hiện chú thích của tấm đó. Chỉ bật trên
   máy có chuột — điện thoại không có hover, chạm vào là mở ảnh luôn. */
@media (hover: hover) {
  [data-tip] {
    position: relative;
  }

  [data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    bottom: 14px;
    z-index: 3;
    max-width: calc(100% - 24px);
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(11, 36, 71, 0.88);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.35;
    text-align: center;
    width: max-content;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, 6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  [data-tip]:hover::after,
  [data-tip]:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  /* Ảnh lớn: nhường chỗ cho bộ đếm 1/8 ở góc dưới. */
  .np-slide[data-tip]::after {
    bottom: 48px;
  }

  /* Thẻ nhà tương tự: tooltip nằm trên ảnh, không đè lên giá. */
  .np-similar__card[data-tip]::after {
    bottom: auto;
    top: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-tip]::after,
  .np-thumb img,
  .np-video__play {
    transition: none;
  }
}

/* Dòng hướng trong hàng thông số: link nhỏ xuống khối hợp tuổi bên dưới. */
.np-specs__tuoi {
  color: var(--np-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.np-specs__tuoi.is-hop {
  color: #1c7a3e;
  text-decoration: none;
}

/* Dòng trả góp dưới giá: cả dòng là link sang /tinh-lai-vay?tin=… */
.np-vay {
  display: grid;
  gap: 2px;
  margin: -4px 0 12px;
  padding: 10px 12px;
  border: 1px solid #efd9a8;
  border-radius: 10px;
  background: var(--np-gold-soft);
  color: var(--np-navy);
  font-size: 0.92rem;
}

.np-vay small {
  color: var(--np-muted);
  font-size: 0.78rem;
}
