/*
 * SBN Developer Notes.
 * Scope: single member profile, identity card, details, representatives, offerings.
 * Used by: templates/single-member.html and member metadata shortcodes.
 * Edit risk: high; missing member meta must still render cleanly.
 * QA: profiles with/without logo, phone, email, reps, offerings, mobile sticky card.
 */

.sbn-member-profile-section {
    padding: var(--sbn-section-space) var(--sbn-dynamic-edge) var(--sbn-section-space) !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    box-sizing: border-box;
}

.sbn-profile-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 52px;
    align-items: start;
}

.sbn-profile-aside {
    position: sticky;
    top: var(--sbn-sticky-offset);
}

.sbn-profile-id-card {
    background: #fff;
    border: 1.5px solid var(--sbn-mist-soft);
    border-radius: var(--sbn-radius-card);
    padding: 28px 24px;
    box-shadow: var(--sbn-shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
}

.sbn-profile-logo {
    width: min(100%, 176px);
    height: 116px;
    border: 1px solid var(--sbn-mist-soft);
    border-radius: 16px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(15, 30, 61, 0.1);
    overflow: hidden;
    flex-shrink: 0;
}

.sbn-profile-logo .sbn-member-logo-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sbn-profile-logo .sbn-member-logo-fallback {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    background: var(--sbn-navy);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--sbn-sans);
    font-size: 22px;
    font-weight: 700;
    color: var(--sbn-gold);
    letter-spacing: 0.04em;
}

.sbn-profile-identity {
    width: 100%;
}

.sbn-profile-name {
    font-family: var(--sbn-sans) !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    color: var(--sbn-navy) !important;
    margin: 0 0 10px !important;
    line-height: 1.25 !important;
}

.sbn-profile-name .wp-block-post-title {
    font-family: var(--sbn-serif) !important;
    font-size: 32px !important;
    font-weight: 400 !important;
    color: var(--sbn-navy) !important;
    margin-bottom: 8px !important;
}

.sbn-profile-person {
    margin: -2px 0 14px;
    color: rgba(20, 33, 61, 0.74);
    font-family: var(--sbn-sans);
    font-size: 14px;
    line-height: 1.45;
}

.sbn-profile-person:empty {
    display: none;
}

.sbn-profile-person .sbn-member-person-name {
    display: block;
    font-weight: 800;
}

.sbn-profile-person .sbn-member-person-role {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: rgba(20, 33, 61, 0.56);
}

.sbn-profile-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.sbn-profile-tags .sbn-taxonomy-pills {
    justify-content: center;
    gap: 8px;
}

.sbn-profile-tags .sbn-taxonomy-pill {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 7px 12px;
    border: 1px solid rgba(195, 204, 210, 0.72);
    border-radius: var(--sbn-radius-pill);
    background: rgba(250, 246, 236, 0.92);
    color: var(--sbn-ink);
    font-family: var(--sbn-sans);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
}

.sbn-profile-tags .sbn-taxonomy-pill strong {
    font-weight: 700;
}

.sbn-profile-tags .sbn-taxonomy-pill--member-chapter {
    border-color: rgba(111, 138, 106, 0.34);
    background: rgba(111, 138, 106, 0.1);
}

.sbn-profile-tags .sbn-taxonomy-pill--member-industry {
    border-color: rgba(47, 110, 134, 0.3);
    background: rgba(47, 110, 134, 0.1);
}

.sbn-profile-tag-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    min-width: 0;
}

.sbn-profile-tag-pill {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.sbn-profile-cta {
    width: 100%;
    text-align: center;
    justify-content: center;
    display: flex !important;
}

.sbn-profile-cta--disabled {
    opacity: 0.62;
    cursor: not-allowed;
    pointer-events: none;
}

.sbn-profile-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.sbn-profile-block {
    padding: var(--sbn-space-md) 0;
    border-bottom: 1px solid var(--sbn-mist-soft);
}

.sbn-profile-block:first-child {
    padding-top: 0;
}

.sbn-profile-block:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sbn-profile-block-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--sbn-gold);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sbn-profile-block-label::after {
    content: "";
    display: block;
    width: 32px;
    height: 1px;
    background: currentColor;
    opacity: 0.5;
    flex-shrink: 0;
}

.sbn-profile-bio {
    font-size: 16px;
    color: var(--sbn-ink);
    line-height: 1.75;
    margin-bottom: 16px;
}

.sbn-profile-body {
    font-size: 15px;
    color: var(--sbn-ink);
    line-height: 1.75;
    opacity: 0.85;
}

.sbn-profile-body .wp-block-post-content:empty {
    display: none;
}

.sbn-profile-block--summary:has(.sbn-profile-detail-list:empty),
.sbn-profile-block--summary:empty {
    display: none;
}

.sbn-profile-detail-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-width: 760px;
}

.sbn-profile-detail-list:empty {
    display: none;
}

.sbn-profile-detail-row {
    padding: 18px 20px;
    border: 1px solid var(--sbn-mist-soft);
    border-radius: var(--sbn-radius-btn);
    background: rgba(255, 255, 255, 0.58);
}

.sbn-profile-detail-row span {
    display: block;
    margin-bottom: 6px;
    color: var(--sbn-gold);
    font-family: var(--sbn-sans);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.16em;
    line-height: 1.2;
    text-transform: uppercase;
}

.sbn-profile-detail-row strong {
    display: block;
    color: var(--sbn-navy);
    font-family: var(--sbn-sans);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
}

.sbn-profile-detail-row a {
    color: var(--sbn-navy);
    text-decoration-color: rgba(201, 163, 84, 0.55);
    text-underline-offset: 3px;
}

.sbn-profile-detail-row a:hover {
    color: var(--sbn-gold);
}

.sbn-profile-detail-list--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
}

.sbn-profile-muted {
    color: rgba(20, 33, 61, 0.52);
    font-style: italic;
    font-weight: 600;
}

.sbn-representative-list {
    display: grid;
    gap: 16px;
}

.sbn-representative-card {
    border: 1px solid var(--sbn-mist-soft);
    border-radius: var(--sbn-radius-card);
    background: rgba(255, 255, 255, 0.62);
    padding: 20px;
}

.sbn-representative-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.sbn-representative-card h3 {
    margin: 0;
    color: var(--sbn-navy);
    font-family: var(--sbn-serif);
    font-size: 24px;
    font-weight: 400;
    line-height: 1.2;
}

.sbn-representative-card p {
    margin: 4px 0 0;
    color: rgba(20, 33, 61, 0.68);
    font-family: var(--sbn-sans);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    text-align: right;
}

.sbn-profile-inline-list {
    margin: 0;
    padding-left: 18px;
}

.sbn-profile-inline-list li + li {
    margin-top: 5px;
}

.sbn-profile-offerings {
    font-size: 15px;
    color: var(--sbn-ink);
    line-height: 1.75;
}

.sbn-profile-contact {
    font-size: 15px;
    color: var(--sbn-ink);
    line-height: 1.75;
    margin-bottom: 12px;
}

.sbn-profile-website-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 600;
    color: var(--sbn-gold);
    text-decoration: none;
    transition: gap 0.15s ease;
}

.sbn-profile-website-link:hover {
    gap: 9px;
}

@media (max-width: 900px) {
    .sbn-profile-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .sbn-profile-aside {
        position: static;
    }
    .sbn-profile-id-card {
        flex-direction: row;
        text-align: left;
        align-items: flex-start;
        flex-wrap: wrap;
        padding: 24px;
        gap: 20px;
    }
    .sbn-profile-identity {
        flex: 1;
        min-width: 0;
    }
    .sbn-profile-tags {
        justify-content: flex-start;
    }
    .sbn-profile-tag-group {
        justify-content: flex-start;
    }
    .sbn-profile-cta {
        width: auto;
        flex-shrink: 0;
    }
}

@media (max-width: 600px) {
    .sbn-member-profile-section {
        padding-top: var(--sbn-space-md);
        padding-bottom: var(--sbn-space-md);
    }
    .sbn-profile-id-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .sbn-profile-tags {
        justify-content: center;
    }
    .sbn-profile-tag-group {
        justify-content: center;
    }
    .sbn-profile-detail-list {
        grid-template-columns: 1fr;
    }
    .sbn-profile-detail-list--compact {
        grid-template-columns: 1fr;
    }
    .sbn-representative-card-head {
        display: block;
    }
    .sbn-representative-card p {
        text-align: left;
    }
    .sbn-profile-cta {
        width: 100%;
    }

    .sbn-profile-bio,
    .sbn-profile-body,
    .sbn-profile-offerings,
    .sbn-profile-contact,
    .sbn-profile-detail-row strong,
    .sbn-representative-card p,
    .sbn-profile-inline-list {
        font-size: 16px;
    }

    .sbn-profile-website-link,
    .sbn-profile-cta {
        min-height: 44px;
    }
}
