/* Property Documents (Brochures) — xem libs/documents.php
 * 1 tài liệu: .is-single (khối nổi bật). Từ 2 tài liệu: .is-list (danh sách dạng hàng). */
.hhv-docs {
    --hhv-docs-ink: #3e2f26;
    --hhv-docs-gold: #bb9b62;
    --hhv-docs-gold-dark: #a3854f;
    --hhv-docs-cream: #faf7f1;
    --hhv-docs-line: #e8e2d6;
    --hhv-docs-muted: #7a6d62;
    color: var(--hhv-docs-ink);
}

/* Tiêu đề: giống các mục khác của trang (vd "Unit & Pricing", "Map"). */
.hhv-docs .kvum__heading { margin: 15px 0 20px; padding: 0; font-family: Merriweather, sans-serif; font-size: 30px; font-weight: 600; font-style: normal; line-height: 1.2em; letter-spacing: normal; text-transform: none; color: var(--hhv-docs-ink); text-align: start; }
@media (max-width: 767px) { .hhv-docs .kvum__heading { text-align: center; } }

/* Widget không có tài liệu → không chừa khoảng trống */
.elementor-widget-hhv_documents:not(:has(.hhv-docs, .hhv-docs-empty)) { display: none; }
.hhv-docs-empty { padding: 14px 16px; border: 1px dashed #c9bfae; border-radius: 6px; background: #faf7f1; color: #7a6d62; font-size: 13px; }

/* ---------- Thành phần chung ---------- */
.hhv-docs__ic { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.hhv-docs .hhv-docs__title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; padding: 0; color: var(--hhv-docs-ink); word-break: break-word; }
.hhv-docs__type { flex: 0 0 auto; padding: 2px 7px; border-radius: 3px; background: var(--hhv-docs-ink); color: #fff; font-family: Poppins, sans-serif; font-size: 11px; font-weight: 600; line-height: 16px; letter-spacing: .05em; }
.hhv-docs__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.hhv-docs__btn, .hhv-docv__btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; margin: 0; padding: 0 18px; border: 1px solid var(--hhv-docs-gold, #bb9b62); border-radius: 4px; background: #fff; color: var(--hhv-docs-ink, #3e2f26); font-family: Poppins, sans-serif; font-size: 14px; font-weight: 500; line-height: 1.2; text-align: center; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.hhv-docs__btn:hover, .hhv-docv__btn:hover { background: var(--hhv-docs-cream, #faf7f1); color: var(--hhv-docs-ink, #3e2f26); text-decoration: none; }
.hhv-docs__btn.is-primary, .hhv-docv__btn.is-primary { background: #bb9b62; border-color: #bb9b62; color: #fff; }
.hhv-docs__btn.is-primary:hover, .hhv-docv__btn.is-primary:hover { background: #a3854f; border-color: #a3854f; color: #fff; }
.hhv-docs__btn:focus-visible, .hhv-docv__btn:focus-visible { outline: 2px solid #3e2f26; outline-offset: 2px; }

/* Bìa: ảnh trang 1 của PDF, hoặc icon file trên nền kem */
.hhv-docs__cover, .hhv-docs__thumb { position: relative; display: block; margin: 0; padding: 0; border: 0; border-radius: 3px; background: #fff; color: var(--hhv-docs-gold); }
button.hhv-docs__cover, button.hhv-docs__thumb { cursor: pointer; }
button.hhv-docs__cover:focus-visible, button.hhv-docs__thumb:focus-visible { outline: 2px solid var(--hhv-docs-gold); outline-offset: 4px; }
.hhv-docs__cover img, .hhv-docs__thumb img { display: block; width: 100%; height: 100%; border-radius: 3px; object-fit: cover; }
.no-img { background: var(--hhv-docs-cream); border: 1px solid var(--hhv-docs-line); }
.hhv-docs__file { position: absolute; inset: 0; display: grid; place-items: center; }
.hhv-docs__file svg { width: 26%; max-width: 64px; height: auto; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linejoin: round; }
.hhv-docs__lock { position: absolute; z-index: 3; top: 8px; right: 8px; display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--hhv-docs-gold); border-radius: 50%; background: #fff; color: var(--hhv-docs-gold-dark); }
.hhv-docs__lock .hhv-docs__ic { width: 14px; height: 14px; stroke-width: 2; }
.hhv-docs__hover { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; border-radius: 3px; background: rgba(43, 32, 26, .55); color: #fff; opacity: 0; transition: opacity .2s; }
.hhv-docs__hover > span { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border: 1px solid rgba(255, 255, 255, .7); border-radius: 999px; font-family: Poppins, sans-serif; font-size: 13px; font-weight: 500; }
button:hover > .hhv-docs__hover, button:focus-visible > .hhv-docs__hover { opacity: 1; }
@media (hover: none) { .hhv-docs__hover { display: none; } }

/* ---------- 1 tài liệu: khối nổi bật ---------- */
.hhv-docs__feature { display: grid; grid-template-columns: minmax(0, 46fr) minmax(0, 54fr); gap: 44px; align-items: center; padding: 0 0 12px; }
.hhv-docs__stage { position: relative; display: flex; justify-content: center; padding: 0 16px 12px 0; }
.hhv-docs__feature .hhv-docs__cover { --hhv-ar: 1.6; position: relative; width: min(100%, calc(440px * var(--hhv-ar))); aspect-ratio: var(--hhv-ar); box-shadow: 0 10px 24px rgba(62, 47, 38, .18); }
.hhv-docs__feature .hhv-docs__cover.no-img { box-shadow: 0 6px 16px rgba(62, 47, 38, .1); }
/* Hiệu ứng xếp 2 tờ phía sau */
.hhv-docs__feature .hhv-docs__cover::before, .hhv-docs__feature .hhv-docs__cover::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 3px; box-shadow: 0 4px 10px rgba(62, 47, 38, .12); }
.hhv-docs__feature .hhv-docs__cover::before { background: #efe6d4; transform: translate(14px, 10px) rotate(2.2deg); }
.hhv-docs__feature .hhv-docs__cover::after { background: #f6efe1; transform: translate(7px, 5px) rotate(1.1deg); }
.hhv-docs__stage { isolation: isolate; }
.hhv-docs__feature .hhv-docs__text { display: grid; gap: 12px; justify-items: start; min-width: 0; }
.hhv-docs__feature .hhv-docs__title { flex-direction: column; align-items: flex-start; gap: 12px; }
.hhv-docs__feature .hhv-docs__name { font-family: Poppins, sans-serif; font-size: 24px; font-weight: 500; line-height: 1.3; }
.hhv-docs__desc { margin: 0; max-width: 52ch; color: var(--hhv-docs-muted); font-family: Poppins, sans-serif; font-size: 14px; line-height: 1.6; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.hhv-docs__feature .hhv-docs__actions { margin-top: 8px; }

/* ---------- Từ 2 tài liệu: danh sách ---------- */
.hhv-docs__list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--hhv-docs-line); }
.hhv-docs__row { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 20px; align-items: center; margin: 0; padding: 14px 4px; border-bottom: 1px solid var(--hhv-docs-line); }
.hhv-docs__row .hhv-docs__thumb { width: 112px; aspect-ratio: 16 / 10; box-shadow: 0 3px 8px rgba(62, 47, 38, .15); }
.hhv-docs__row .hhv-docs__thumb img { object-position: top center; }
.hhv-docs__row .hhv-docs__lock { top: 5px; right: 5px; width: 22px; height: 22px; }
.hhv-docs__row .hhv-docs__lock .hhv-docs__ic { width: 11px; height: 11px; }
.hhv-docs__row .hhv-docs__hover > span { padding: 0; border: 0; }
.hhv-docs__row .hhv-docs__hover > span { font-size: 0; }
.hhv-docs__row .hhv-docs__hover .hhv-docs__ic { width: 22px; height: 22px; }
.hhv-docs__row .hhv-docs__text { min-width: 0; }
.hhv-docs__row .hhv-docs__name { font-family: Poppins, sans-serif; font-size: 15px; font-weight: 500; line-height: 1.4; }
.hhv-docs__row .hhv-docs__actions { gap: 8px; flex-wrap: nowrap; }
.hhv-docs__row .hhv-docs__btn { min-height: 38px; padding: 0 14px; font-size: 13px; }

@media (max-width: 767px) {
    /* 1 tài liệu: bìa trên, chữ + nút dưới; nhãn PDF cùng dòng với tên */
    .hhv-docs__feature { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 0 0 8px; }
    .hhv-docs__feature .hhv-docs__cover { width: min(100%, calc(320px * var(--hhv-ar))); }
    /* Điện thoại: chữ căn trái (tên, mô tả), nút chiếm hết bề ngang */
    .hhv-docs__feature .hhv-docs__text { justify-items: stretch; gap: 10px; text-align: left; }
    .hhv-docs__feature .hhv-docs__title { flex-direction: row; flex-wrap: nowrap; align-items: center; justify-content: flex-start; gap: 10px; } /* nhãn PDF cân giữa khi tên xuống 2 dòng */
    .hhv-docs__feature .hhv-docs__name { font-size: 17px; text-align: left; }
    .hhv-docs__desc { justify-self: start; max-width: none; font-size: 13px; line-height: 1.55; -webkit-line-clamp: 3; }
    .hhv-docs__feature .hhv-docs__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
    .hhv-docs__feature .hhv-docs__btn { flex: 1 1 auto; min-width: 0; padding: 6px 14px; white-space: normal; }

    /* Danh sách: bìa nhỏ bên trái, tên + nút bên phải */
    .hhv-docs__row { grid-template-columns: 76px minmax(0, 1fr); gap: 8px 14px; align-items: start; padding: 14px 0; }
    .hhv-docs__row .hhv-docs__thumb { grid-row: span 2; width: 76px; }
    .hhv-docs__row .hhv-docs__name { font-size: 14px; }
    .hhv-docs__row .hhv-docs__title { flex-wrap: nowrap; align-items: baseline; gap: 8px; }
    .hhv-docs__row .hhv-docs__type { position: relative; top: -1px; font-size: 10px; padding: 1px 6px; }
    .hhv-docs__row .hhv-docs__actions { grid-column: 2; flex-wrap: wrap; }
    .hhv-docs__row .hhv-docs__btn { flex: 1 1 auto; min-width: 0; min-height: 36px; padding: 6px 10px; white-space: normal; }
}

/* ---------------- Trình xem PDF ---------------- */
html.hhv-docv-open, html.hhv-docv-open body { overflow: hidden; }
.hhv-docv { position: fixed; inset: 0; z-index: 100020; /* dưới lead modal (100050) */ display: flex; flex-direction: column; background: #2b2420; color: #fff; font-family: Poppins, sans-serif; }
.hhv-docv[hidden] { display: none; }
.hhv-docv__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 8px 12px 8px 20px; padding-top: max(8px, env(safe-area-inset-top)); background: #3e2f26; box-shadow: 0 1px 0 rgba(255, 255, 255, .06); }
.hhv-docv__title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hhv-docv__name { overflow: hidden; font-size: 15px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.hhv-docv__flag { flex: 0 0 auto; padding: 1px 8px; border: 1px solid #bb9b62; border-radius: 3px; color: #e3cc9f; font-size: 11px; font-weight: 600; line-height: 18px; letter-spacing: .04em; }
.hhv-docv__flag[hidden] { display: none; }
.hhv-docv__tools { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; }
.hhv-docv__page { margin-right: 6px; color: rgba(255, 255, 255, .7); font-size: 13px; white-space: nowrap; }
.hhv-docv__icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin: 0; padding: 0; border: 0; border-radius: 4px; background: transparent; color: #fff; cursor: pointer; }
.hhv-docv__icon:hover { background: rgba(255, 255, 255, .1); }
.hhv-docv__icon:disabled { opacity: .35; cursor: default; background: transparent; }
.hhv-docv__icon:focus-visible { outline: 2px solid #bb9b62; outline-offset: 1px; }
.hhv-docv__icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.hhv-docv__btn { flex: 0 0 auto; min-height: 38px; }
.hhv-docv__dl { background: transparent; border-color: rgba(255, 255, 255, .45); color: #fff; }
.hhv-docv__dl:hover { background: rgba(255, 255, 255, .1); color: #fff; border-color: #fff; }
.hhv-docv__dl[hidden] { display: none; }
.hhv-docv__close { margin-left: 4px; }

.hhv-docv__scroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; outline: 0; touch-action: pan-x pan-y; }
/* Khoảng cách co giãn theo mức phóng → điểm đang xem giữ nguyên vị trí khi zoom. */
.hhv-docv__pages { --hhv-docv-zoom: 1; display: flex; flex-direction: column; align-items: center; gap: calc(16px * var(--hhv-docv-zoom)); box-sizing: border-box; width: calc(min(100%, 1000px) * var(--hhv-docv-zoom)); margin: 0 auto; padding: calc(20px * var(--hhv-docv-zoom)) calc(20px * var(--hhv-docv-zoom)) 40px; transform-origin: 0 0; }
.hhv-docv__pages.is-pinching { will-change: transform; }
.hhv-docv__sheet { position: relative; width: 100%; background: #fff; box-shadow: 0 4px 18px rgba(0, 0, 0, .35); -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.hhv-docv__sheet canvas { position: absolute; display: block; }
.hhv-docv__sheet .hhv-docv__base { inset: 0; width: 100%; height: 100%; }
.hhv-docv__sheet .hhv-docv__tile { z-index: 1; }
.hhv-docv__msg { margin: 60px 0; color: rgba(255, 255, 255, .75); font-size: 15px; text-align: center; }
.hhv-docv__end { width: 100%; padding: 28px 20px; box-sizing: border-box; border: 1px solid rgba(187, 155, 98, .5); border-radius: 6px; background: #3e2f26; text-align: center; }
.hhv-docv__end p { margin: 0 0 16px; color: #fff; font-size: 15px; line-height: 1.5; }

@media (max-width: 767px) {
    .hhv-docv__bar { flex-wrap: wrap; gap: 6px; padding: 8px 8px 8px 14px; padding-top: max(8px, env(safe-area-inset-top)); }
    .hhv-docv__title { flex: 1 1 calc(100% - 50px); order: 1; }
    .hhv-docv__name { font-size: 14px; }
    .hhv-docv__tools { display: contents; }
    .hhv-docv__close { order: 2; margin-left: 0; }
    .hhv-docv__page { order: 3; flex: 1 1 auto; margin: 0; }
    .hhv-docv__icon[data-zoom] { order: 4; }
    .hhv-docv__dl { order: 5; }
    .hhv-docv__cta { order: 6; }
    .hhv-docv__btn { min-height: 36px; padding: 0 12px; font-size: 13px; }
    .hhv-docv__pages { width: calc(100% * var(--hhv-docv-zoom)); padding: calc(12px * var(--hhv-docv-zoom)) calc(10px * var(--hhv-docv-zoom)) 30px; gap: calc(10px * var(--hhv-docv-zoom)); }
}
