/* =============================================================
   CallemOut — Members Directory Redesign
   Page background + card grid with cover/avatar hero
   ============================================================= */

/* ── Page background ── */
body.page-id-members .nv-page-title-wrap,
body.page-template-page-members .nv-page-title-wrap {
    display: none;
}

/* Target the members page via BuddyPress body class */
body.directory.members.buddypress {
    background-image: url('https://callemout.vip/wp-content/uploads/2026/04/members-background.jpg') !important;
    background-size: cover !important;
    background-position: center top !important;
    background-attachment: fixed !important;
    background-repeat: no-repeat !important;
}

/* Overlay so content stays readable */
body.directory.members.buddypress::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.60);
    z-index: 0;
    pointer-events: none;
}

/* Lift all content above overlay */
body.directory.members.buddypress .wrapper,
body.directory.members.buddypress #page,
body.directory.members.buddypress .neve-main,
body.directory.members.buddypress .nv-sidebar-wrap {
    position: relative;
    z-index: 1;
}

/* Make the main content area transparent */
body.directory.members.buddypress .neve-main,
body.directory.members.buddypress .nv-content-wrap,
body.directory.members.buddypress .container,
body.directory.members.buddypress #buddypress {
    background: transparent !important;
}

/* ── Members search / filter bar ── */
body.directory.members.buddypress #members-dir-search,
body.directory.members.buddypress .dir-search,
body.directory.members.buddypress #subnav {
    background: rgba(0,0,0,0.55) !important;
    border-color: rgba(212,175,55,0.3) !important;
    border-radius: 8px;
}

body.directory.members.buddypress #members-dir-search input,
body.directory.members.buddypress .dir-search input[type="search"] {
    background: rgba(255,255,255,0.08) !important;
    color: #fff !important;
    border: 1px solid rgba(212,175,55,0.4) !important;
    border-radius: 6px;
}

body.directory.members.buddypress #members-dir-search input::placeholder {
    color: rgba(255,255,255,0.5);
}

body.directory.members.buddypress #subnav li a {
    color: #ccc !important;
}

body.directory.members.buddypress #subnav li.selected a,
body.directory.members.buddypress #subnav li a:hover {
    color: #d4af37 !important;
}

/* ── Pagination ── */
.co-members-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
}

.co-members-pagination .pagination-links a,
.co-members-pagination .pagination-links span {
    display: inline-block;
    padding: 4px 10px;
    margin: 0 2px;
    border-radius: 4px;
    border: 1px solid rgba(212,175,55,0.4);
    color: #d4af37;
    background: rgba(0,0,0,0.4);
    font-size: 12px;
    text-decoration: none;
}

.co-members-pagination .page-numbers.current {
    background: #d4af37 !important;
    color: #000 !important;
    border-color: #d4af37 !important;
}

/* ── Card grid ── */
.co-members-grid {
    list-style: none;
    margin: 16px 0 0 0 !important;
    padding: 0 !important;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

/* ── Individual card ── */
.co-member-card {
    background: rgba(10, 10, 10, 0.75);
    border: 1px solid rgba(212,175,55,0.25);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.co-member-card:hover {
    transform: translateY(-4px);
    border-color: rgba(212,175,55,0.7);
    box-shadow: 0 8px 24px rgba(212,175,55,0.25);
}

/* ── Hero (cover image or gradient) ── */
.co-member-hero {
    display: block;
    height: 90px;
    background: linear-gradient(135deg, #1a0a00 0%, #2d1a00 50%, #0a0a0a 100%);
    background-size: cover;
    background-position: center;
    position: relative;
    text-decoration: none;
}

.co-member-hero.co-has-cover {
    background-color: #111;
}

.co-member-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.7) 100%);
}

/* ── Avatar ── */
.co-member-avatar-wrap {
    position: relative;
    margin-top: -42px;
    padding: 0 0 0 14px;
    z-index: 2;
}

.co-member-avatar-wrap a {
    display: inline-block;
    border: 3px solid #d4af37;
    border-radius: 50%;
    line-height: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    overflow: hidden;
}

.co-member-avatar-wrap img {
    width: 80px !important;
    height: 80px !important;
    border-radius: 50%;
    display: block;
    object-fit: cover;
}

/* ── Card body ── */
.co-member-body {
    padding: 8px 14px 14px;
}

.co-member-name a {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    line-height: 1.2;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.co-member-name a:hover {
    color: #d4af37;
}

.co-member-type-badge {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 20px;
    background: rgba(212,175,55,0.15);
    border: 1px solid rgba(212,175,55,0.5);
    color: #d4af37;
}

.co-member-type-badge span {
    color: inherit !important;
    background: transparent !important;
}

.co-member-active {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    margin-top: 5px;
}

.co-member-update {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    margin-top: 6px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.co-member-actions {
    margin-top: 10px;
}

.co-member-actions a {
    display: inline-block;
    padding: 5px 12px;
    font-size: 12px;
    border-radius: 20px;
    background: rgba(212,175,55,0.15);
    border: 1px solid rgba(212,175,55,0.5);
    color: #d4af37;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.15s;
}

.co-member-actions a:hover {
    background: rgba(212,175,55,0.3);
}

/* ── Mobile ── */
@media (max-width: 600px) {
    .co-members-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .co-member-hero { height: 70px; }
    .co-member-avatar-wrap img { width: 64px !important; height: 64px !important; }
    .co-member-avatar-wrap { margin-top: -34px; }
    .co-member-name a { font-size: 13px; }
}
/* ---- Force grid layout (override BP list-item default) ---- */
#members-list.co-members-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    gap: 20px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 16px 0 0 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    position: static !important;
    left: auto !important;
}

#members-list.co-members-grid li.co-member-card {
    display: block !important;
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Mobile: 2-col grid */
@media (max-width: 600px) {
    #members-list.co-members-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
}

/* ---- Hide both BP nav bars on members directory ---- */
#buddypress div.item-list-tabs:not(#subnav) { display: none !important; }
#buddypress #subnav { display: none !important; }
/* ---- Hide pagination (all members loaded at once) ---- */
.co-members-pagination,
#buddypress #pag-top,
#buddypress #pag-bottom {
    display: none !important;
}

/* ---- Hide social share bar on members page ---- */
body.directory.members.buddypress .sharedaddy,
body.directory.members.buddypress .sd-sharing,
body.directory.members.buddypress #sharing_email {
    display: none !important;
}

/* ---- Members count pill ---- */
.co-members-count {
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    margin-bottom: 12px;
    padding: 0 2px;
}

/* ---- Progressive reveal (IntersectionObserver) ---- */
.co-member-card.co-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.co-member-card.co-reveal.co-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Kill white page-title block ---- */
body.directory.members.buddypress .nv-page-title-wrap,
body.directory.members.buddypress .nv-title-meta-wrap {
    display: none !important;
}
