/*
 * Shared "member card" component — used by the search results grid
 * (member/searchresults.blade.php + member/partials/member-card.blade.php)
 * and the "Recommended Matches" grid on the My Profile dashboard-home
 * section (member/user.blade.php). Pulled out of searchresults.blade.php's
 * inline <style> so both pages render the exact same card without
 * duplicating ~250 lines of CSS.
 *
 * Every custom property below carries a literal fallback (var(--x, #hex))
 * so the card renders correctly even on a page that never defines the
 * --ur-* brand tokens (they're only declared on .ur-search-page).
 */
.member-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 22px;
}

@media (max-width: 767px) {
    .member-results {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

.member-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--ur-border, #E7E2D6);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(15, 46, 36, .06);
    transition: box-shadow .25s ease, transform .25s ease;
}

.member-card:hover {
    box-shadow: 0 14px 30px rgba(15, 46, 36, .12);
    transform: translateY(-3px);
}

.member-card__photo {
    position: relative;
    width: 100%;
    aspect-ratio: 8 / 5;
    background: var(--ur-bg, #F6F4EF);
    overflow: hidden;
}

.member-card__photo a {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
}

/* Member photos are only ever generated up to ~210px on their longest
   side, so forcing them to `cover` a much larger box upscales and
   crops them hard (blurry, oddly zoomed faces). We show the photo
   untouched (`contain`, never cropped/upscaled beyond native size)
   and fill the rest of the box with a softly blurred copy of the
   same photo instead of dead space, so every card still reads as a
   uniform, deliberate frame regardless of the source image's size
   or orientation. */
.member-card__photo-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(20px) saturate(1.1) brightness(.92);
    transform: scale(1.15);
}

.member-card__photo img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.member-card__ribbon {
    position: absolute;
    top: 12px;
    left: -34px;
    transform: rotate(-45deg);
    width: 130px;
    padding: 3px 0;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: #fff;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.member-card__ribbon--new {
    background: var(--ur-gold, #C9974D);
    color: var(--ur-green-dark, #0F2E24);
}

.member-card__ribbon--updated {
    background: var(--ur-green, #123A2E);
}

.member-card__id-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    background: rgba(15, 46, 36, 0.6);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .3px;
    padding: 4px 9px;
    border-radius: 20px;
    pointer-events: none;
}

/* Admin-verified badge — bottom-left over the photo so it never
   collides with the diagonal New/Updated ribbon (top-left) or the
   ID badge (top-right). */
.member-card__badge--verified {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #1E7A46;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .2px;
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
    pointer-events: none;
}

.member-card__body {
    padding: 16px 16px 4px;
    flex: 1;
}

.member-card__name {
    margin: 0 0 10px;
    font-size: 1.05rem;
    font-weight: 600;
}

.member-card__name a {
    color: var(--ur-text, #1C2321);
    cursor: pointer;
}

.member-card__name a:hover {
    color: var(--ur-green, #123A2E);
}

.member-card__quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
    font-size: .8rem;
    color: var(--ur-text-muted, #6B7570);
}

.member-card__quick li i {
    color: var(--ur-gold, #C9974D);
    margin-right: 5px;
}

.member-card__details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0 10px;
    list-style: none;
    padding: 12px 0;
    margin: 0;
    border-top: 1px dashed var(--ur-border, #E7E2D6);
    border-bottom: 1px dashed var(--ur-border, #E7E2D6);
}

.member-card__details li {
    display: flex;
    flex-direction: column;
    font-size: .78rem;
    overflow: hidden;
}

.member-card__details li span {
    color: var(--ur-text-muted, #6B7570);
    text-transform: uppercase;
    font-size: .65rem;
    letter-spacing: .3px;
    margin-bottom: 2px;
}

.member-card__details li b {
    color: var(--ur-text, #1C2321);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-card__footer {
    display: flex;
    gap: 10px;
    padding: 14px 16px 16px;
}

.member-card__footer a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    padding: 11px 8px;
    border-radius: 10px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
    border: 1px solid var(--ur-border, #E7E2D6);
    color: var(--ur-green, #123A2E);
    background: #fff;
}

.member-card__footer a:hover {
    background: var(--ur-bg, #F6F4EF);
    border-color: var(--ur-gold, #C9974D);
}

.member-card__footer a.is-interest {
    border-color: var(--ur-gold, #C9974D);
    background: var(--ur-gold, #C9974D);
    color: #fff;
}

/* Force white text even for the accepted/declined states, whose
   inner <span class="c-green"/"c-red"> otherwise override the
   color with !important. */
.member-card__footer a.is-interest span {
    color: #fff !important;
}

.member-card__footer a.is-interest:hover {
    background: #B07C3D;
    border-color: #B07C3D;
}

@media (max-width: 420px) {
    .member-card__footer {
        flex-direction: column;
    }
}
