/*
 * Giao diện trang tìm bạn công khai: danh sách theo tiêu chí (friends/by-province) và chi tiết thành viên (friends/profile).
 * Nạp ở route tim-ban-4-phuong.* (xem app/layouts/master.blade.php), body có class "hhnt-public".
 * Dùng chung biến màu và nút .hh-btn với home-ui.css (được nạp cùng).
 */
body.hhnt-public {
    background-image: none;
    background-color: var(--hhnt-bg);
    color: var(--hhnt-ink);
}

.hh-pub { padding: 20px 0 48px; font-size: 15px; line-height: 1.6; }
.hh-pub *, .hh-pub *::before, .hh-pub *::after { box-sizing: border-box; }
.hh-pub svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.hh-pub__container { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.hh-pub__container--narrow { max-width: 760px; }
.hh-pub a { color: var(--hhnt-brand-ink); }

/* Breadcrumb */
.hh-pub .hh-crumbs {
    display: flex; flex-wrap: wrap;
    background: none; padding: 0; margin: 0 0 12px;
    font-size: 13.5px; color: var(--hhnt-muted);
}
.hh-pub .hh-crumbs a { color: var(--hhnt-muted) !important; }
.hh-pub .hh-crumbs a:hover { color: var(--hhnt-brand-ink) !important; }
.hh-pub .hh-crumbs .breadcrumb-item + .breadcrumb-item::before { content: "›"; color: #c4b3bd; }

/* Tiêu đề trang + nút lọc */
.hh-pub__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.hh-pub__title { font-size: clamp(20px, 3vw, 28px); font-weight: 800; line-height: 1.3; margin: 0; color: var(--hhnt-ink); letter-spacing: -.01em; }
.hh-pub__subtitle { font-size: clamp(19px, 2.5vw, 24px); font-weight: 700; margin: 36px 0 16px; color: var(--hhnt-ink); }
.hh-filter-toggle {
    flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; padding: 0;
    border-radius: 999px;
    border: 1.5px solid var(--hhnt-line);
    background: #fff;
    color: var(--hhnt-ink) !important;
    font-size: 14px; font-weight: 600;
    text-decoration: none !important;
}
.hh-filter-toggle img { width: 22px !important; height: auto; opacity: .75; }
.hh-filter-toggle:hover, .hh-filter-toggle[aria-expanded="true"] { border-color: var(--hhnt-brand); background: var(--hhnt-brand-soft); }

/* Bộ lọc (giữ nguyên danh sách link cũ, chỉ đổi giao diện) */
.hh-filter { margin-bottom: 16px; }
.hh-filter__body { background: #fff; border-radius: 16px; padding: 18px 20px 8px; box-shadow: 0 10px 30px rgba(120, 30, 90, .08); }
.hh-filter__body > .font-weight-bold { font-size: 14px; color: var(--hhnt-ink); margin: 6px 0 10px !important; }
.hh-filter__body ul { list-style: none; padding: 0; margin: 0 0 12px !important; display: flex; flex-wrap: wrap; gap: 8px; }
.hh-filter__body ul::after { content: none; }
.hh-filter__body ul li { float: none !important; margin: 0 !important; }
.hh-filter__body ul li a {
    display: inline-flex; align-items: center;
    min-height: 34px; padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--hhnt-line);
    background: #fff;
    color: var(--hhnt-ink) !important;
    font-size: 13.5px;
    text-decoration: none !important;
}
.hh-filter__body ul li a:hover { border-color: var(--hhnt-brand); background: var(--hhnt-brand-soft); color: var(--hhnt-brand-ink) !important; }
/* Danh sách tỉnh thành: lưới link gọn */
.hh-filter__body ul li.list-block-item { width: 100%; }
.hh-filter__body ul:has(> li.list-block-item) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px; }
.hh-filter__body ul li.list-block-item a { border: 0; padding: 6px 8px; border-radius: 8px; min-height: 0; width: 100%; }

/* Hộp nội dung (sapo, giới thiệu, nội dung SEO, FAQ) */
.hh-pub .box-shadow {
    background: #fff;
    box-shadow: 0 10px 30px rgba(120, 30, 90, .06) !important;
    border: 1px solid var(--hhnt-line);
    border-radius: 16px !important;
    margin-top: 0 !important;
}
.hh-pub .hh-prose { max-width: 820px; margin: 0 auto; }
.hh-pub .hh-prose .box-shadow { padding: 22px 24px !important; margin-bottom: 16px !important; }
.hh-pub .hh-prose h2, .hh-pub .hh-prose h3, .hh-pub .hh-prose h4 { color: var(--hhnt-ink); line-height: 1.35; }
.hh-pub .hh-prose h2 { font-size: 20px; }
.hh-pub .hh-prose h3 { font-size: 17px; margin-top: 18px; }
.hh-pub .hh-prose ul { padding-left: 20px; }
.hh-pub .faq-section { max-width: none; }
.hh-pub .faq-section h2 { margin-bottom: 6px !important; }
.hh-pub .faq-item { border-bottom: 1px solid var(--hhnt-line); margin: 0; }
.hh-pub .faq-item:last-child { border-bottom: 0; }
.hh-pub .faq-item summary { color: var(--hhnt-ink); font-size: 15.5px; padding: 14px 28px 14px 0; }
.hh-pub .faq-item summary::after { color: var(--hhnt-brand-strong); }
.hh-pub .faq-content { color: var(--hhnt-muted); }

/* ---------- Lưới thẻ hồ sơ ---------- */
.hh-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hh-card { background: #fff; border-radius: 16px; overflow: hidden; border: 1px solid var(--hhnt-line); transition: box-shadow .2s, transform .2s; }
.hh-card:hover { box-shadow: 0 12px 30px rgba(120, 30, 90, .12); transform: translateY(-2px); }
.hh-card { display: flex; flex-direction: column; }
.hh-card__photo, .hh-card__body { display: block; color: var(--hhnt-ink) !important; text-decoration: none !important; }
.hh-card__body { flex: 1; }
/* Trang chi tiết: tuổi đứng trước tên trong HTML (như cũ) nhưng hiển thị bên phải */
.hh-card--age-first .hh-card__age { order: 2; }
.hh-card__photo { position: relative; aspect-ratio: 3 / 4; background: var(--hhnt-brand-soft); overflow: hidden; }
.hh-card__photo img { width: 100%; height: 100%; object-fit: cover; display: block; color: transparent; font-size: 0; }
.hh-card__bg { position: absolute; inset: 0; background-size: cover; background-position: center; background-repeat: no-repeat; }
.hh-card__body { padding: 10px 12px 12px; }
.hh-card__namerow { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-bottom: 4px; }
.hh-card__name { font-size: 15px; font-weight: 700; line-height: 1.3; margin: 0; color: var(--hhnt-ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hh-card__name sup { top: -.3em; }
.hh-card__name .fa-check-circle { color: #1d9bf0; }
.hh-card__age { flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--hhnt-muted); white-space: nowrap; }
.hh-card__age img { width: 12px !important; height: auto; }
.hh-card__meta { display: flex; flex-direction: column; gap: 1px; font-size: 12.5px; color: var(--hhnt-muted); line-height: 1.45; }
.hh-card__meta > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Phân trang */
.hh-pager { margin: 24px 0; }
.hh-pager .pagination { justify-content: center; gap: 10px; margin: 0; }
.hh-pager .page-link { border-radius: 999px !important; border: 1.5px solid var(--hhnt-line); color: var(--hhnt-brand-ink); padding: 8px 20px; font-weight: 600; }
.hh-pager .page-link:hover { border-color: var(--hhnt-brand); background: var(--hhnt-brand-soft); }
.hh-pager .disabled .page-link { color: #c4b3bd; background: #fff; }

/* Hộp kêu gọi đăng ký */
.hh-cta-box {
    display: flex; flex-direction: column; gap: 14px;
    margin: 0 auto 24px;
    max-width: 820px;
    padding: 20px 22px;
    border-radius: 16px;
    background: linear-gradient(135deg, #fff 0%, var(--hhnt-brand-soft) 100%);
    border: 1px solid var(--hhnt-line);
}
.hh-cta-box__title { font-size: 17px; font-weight: 700; line-height: 1.4; margin: 0 0 4px; color: var(--hhnt-ink); }
.hh-cta-box__text { color: var(--hhnt-muted); }
.hh-cta-box__actions { display: flex; gap: 10px; }
.hh-cta-box__actions .hh-btn { flex: 1 1 0; white-space: nowrap; }

/* ---------- Trang chi tiết thành viên ---------- */
.hh-profile__hero {
    position: relative;
    text-align: center;
    background: #fff;
    border-radius: 20px;
    padding: 28px 20px 22px;
    margin-bottom: 16px;
    box-shadow: 0 12px 36px rgba(120, 30, 90, .08);
    background-image: radial-gradient(500px 160px at 50% 0%, #f7cfe9 0%, rgba(247, 207, 233, 0) 75%);
}
.hh-profile .hh-back {
    position: absolute; left: 14px; top: 14px;
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: #fff; border: 1px solid var(--hhnt-line);
    color: var(--hhnt-ink) !important;
}
.hh-profile .hh-back:hover { border-color: var(--hhnt-brand); }
.hh-profile .hh-back img { width: 12px !important; height: auto; opacity: .8; }
.hh-avatar {
    position: relative;
    width: 96px; height: 96px; margin: 0 auto 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--hhnt-brand) 0%, var(--hhnt-brand-strong) 100%);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(196, 71, 159, .35);
    border: 4px solid #fff;
}
.hh-avatar__lock {
    position: absolute; right: -2px; bottom: -2px;
    width: 30px; height: 30px; border-radius: 50%;
    background: #fff; color: var(--hhnt-brand-strong);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}
.hh-avatar__lock svg { width: 15px; height: 15px; }
.hh-avatar .hh-avatar__user { width: 46px; height: 46px; stroke-width: 1.8; }
.hh-profile__title { font-size: clamp(20px, 3.4vw, 26px); font-weight: 800; line-height: 1.3; margin: 0; color: var(--hhnt-ink); }
.hh-info { background: #fff; border-radius: 16px; border: 1px solid var(--hhnt-line); padding: 10px 18px 4px; margin: 22px 0 12px; }
.hh-info { position: relative; }
.hh-info__icon {
    position: absolute; right: 14px; top: -14px;
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--hhnt-brand-soft); color: var(--hhnt-brand-strong);
    border: 2px solid #fff; font-size: 16px;
}
.hh-rows { margin: 0; }
.hh-rows > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid #f3eaf0; }
.hh-rows > div:first-child { border-top: 0; }
.hh-rows dt { font-weight: 500; color: var(--hhnt-muted); font-size: 14px; }
.hh-rows dd { margin: 0; font-size: 14.5px; color: var(--hhnt-ink); word-break: break-word; }
.hh-rows dd a { font-weight: 600; text-decoration: none; }
.hh-rows dd a:hover { text-decoration: underline; }
.hh-rows sup .fa-check-circle { color: #1d9bf0; }
.hh-masked { letter-spacing: .06em; color: var(--hhnt-muted); margin-right: 6px; }
.hh-reveal { font-size: 13px; padding: 2px 10px; border-radius: 999px; background: var(--hhnt-brand-soft); white-space: nowrap; }
.hh-tag { display: inline-block; margin: 0 6px 6px 0; padding: 3px 10px; border-radius: 999px; background: var(--hhnt-bg); border: 1px solid var(--hhnt-line); font-size: 13px; }
.hh-rows dd .hh-tag + br { display: none; }
.hh-about-quote {
    margin: 0 0 12px;
    padding: 16px 20px;
    border-left: 4px solid var(--hhnt-brand);
    border-radius: 0 16px 16px 0;
    background: #fff;
    color: var(--hhnt-ink);
    font-style: italic;
}
.hh-profile .hh-cta-box { max-width: none; margin: 4px 0 12px; }

/* ---------- Responsive ---------- */
@media (min-width: 576px) {
    .hh-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
    .hh-filter__body ul:has(> li.list-block-item) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hh-cta-box__actions .hh-btn { flex: 0 1 200px; }
}
@media (min-width: 768px) {
    .hh-pub { padding-top: 28px; }
    .hh-cta-box:not(.hh-cta-box--stack) { flex-direction: row; align-items: center; justify-content: space-between; }
    .hh-cta-box:not(.hh-cta-box--stack) .hh-cta-box__actions { flex-shrink: 0; }
    .hh-cta-box:not(.hh-cta-box--stack) .hh-cta-box__actions .hh-btn { flex: 0 0 auto; min-width: 140px; }
    .hh-rows > div { grid-template-columns: 160px minmax(0, 1fr); }
    .hh-info { padding: 12px 24px 6px; }
}
@media (min-width: 992px) {
    .hh-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
    .hh-filter__body ul:has(> li.list-block-item) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .hh-card__body { padding: 12px 14px 14px; }
}
@media (max-width: 575.98px) {
    .hh-pub__head { align-items: center; }
    .hh-filter-toggle { padding: 8px 12px; }
    .hh-card__namerow { flex-direction: column; align-items: flex-start; gap: 0; }
    .hh-card__name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .hh-card__body { padding: 9px 10px 11px; }
    /* Thẻ hẹp: thông tin xuống dòng thay vì bị cắt "..." */
    .hh-card__meta { font-size: 12px; gap: 2px; line-height: 1.4; }
    .hh-card__meta > div { white-space: normal; overflow: visible; }
}

/* ---------- Quyền riêng tư cho khách chưa đăng nhập (App\Helpers\PublicProfile) ---------- */
/* Ảnh mờ: server trả ảnh 24px, phóng to + làm mờ */
.hh-card.is-blurred .hh-card__photo img,
.hh-card.is-blurred .hh-card__bg { filter: blur(10px) saturate(1.1); transform: scale(1.25); }
.hh-card.is-blurred .hh-card__photo { isolation: isolate; }
.hh-card__lock {
    position: absolute; left: 50%; top: 50%;
    width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .9); color: var(--hhnt-brand-strong);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
}
.hh-card__lock svg { width: 20px; height: 20px; }
/* Danh sách Les/Gay: chỉ hiện cho thành viên đã đăng nhập */
.hh-locked {
    text-align: center;
    background: #fff; border: 1px solid var(--hhnt-line); border-radius: 20px;
    padding: 32px 22px; margin-bottom: 24px;
}
.hh-locked__icon {
    width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--hhnt-brand-soft); color: var(--hhnt-brand-strong);
}
.hh-locked__icon svg { width: 28px; height: 28px; }
.hh-locked__title { font-size: 20px; font-weight: 700; margin-bottom: 6px; color: var(--hhnt-ink); }
.hh-locked p { color: var(--hhnt-muted); max-width: 460px; margin: 0 auto 18px; }
.hh-locked__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.hh-locked__actions .hh-btn { min-width: 170px; }
