/**
 * Widget: (BB) Profile fields
 *
 * Replicates the styling of the BuddyBoss profile details page
 * (buddypress/members/single/profile/profile-loop.php) for use in
 * a sidebar or widget area outside the regular #buddypress / #item-body
 * context.
 *
 * CSS is scoped to .povigo-profile-fields-widget so it does not bleed
 * into any other part of the page. The rules mirror the #buddypress
 * and .bp-profile-wrapper rules from the BuddyBoss theme's buddypress.css.
 *
 * @package Povigo
 * @since 1.0.1
 */


/* =============================================================
   Field table
   ============================================================= */

.povigo-profile-fields-widget table.profile-fields {
    width: 100%;
    box-shadow: none;
    border-radius: 0;
    border: 0;
    background: transparent;
    border-collapse: collapse;
}


/* =============================================================
   Cells (shared label + data rules)
   Mirror: #buddypress table.profile-fields tr td.label,
           #buddypress table.profile-fields tr td.data
   ============================================================= */

.povigo-profile-fields-widget table.profile-fields tr td {
    padding: 5px 0;
    font-size: 14px;
    font-weight: normal;
    line-height: inherit;
    background: none;
    border: 0;
    vertical-align: top;
}


/* =============================================================
   Label column
   Mirror: #buddypress table.profile-fields tr td.label
   ============================================================= */

.povigo-profile-fields-widget table.profile-fields tr td.label {
    color: var(--bb-alternate-text-color, #7a7a7a);
    width: 35%;
    padding-right: 20px;
    display: table-cell;
}


/* =============================================================
   Data column
   Mirror: #buddypress table.profile-fields tr td.data
   ============================================================= */

.povigo-profile-fields-widget table.profile-fields tr td.data {
    color: var(--bb-body-text-color, #1a1a1a);
    width: 65%;
    display: table-cell;
}


/* =============================================================
   No row highlights in widget context
   Mirror: #buddypress table.profile-fields tr:hover
           .bp-profile-wrapper .bp-tables-user tbody tr:nth-child(odd)
   ============================================================= */

.povigo-profile-fields-widget .bp-tables-user tbody tr,
.povigo-profile-fields-widget .bp-tables-user tbody tr:nth-child(odd),
.povigo-profile-fields-widget .bp-tables-user tbody tr:hover,
.povigo-profile-fields-widget table.profile-fields tr:hover {
    background: transparent;
}


/* =============================================================
   Field group spacing
   Mirror: .bp-profile-wrapper .bp-widget:not(:last-child)
   ============================================================= */

.povigo-profile-fields-widget .bp-widget:not(:last-child) {
    margin-bottom: 30px;
}


/* =============================================================
   Group title (h3.profile-group-title)
   Mirror: #item-body > div.profile h2.screen-heading
   Adapted from h2 → h3, and margin adjusted for widget context.
   ============================================================= */

.povigo-profile-fields-widget .profile-group-title {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.33px;
    line-height: 1;
    color: var(--bb-headings-color, #1a1a1a);
    margin: 0 0 15px;
    padding: 0 0 15px;
    border-bottom: 1px solid var(--bb-content-border-color, #e0e0e0);
}


/* =============================================================
   Responsive — narrow (< 600px): stack label above data
   ============================================================= */

@media (max-width: 600px) {

    .povigo-profile-fields-widget table.profile-fields tr td.label,
    .povigo-profile-fields-widget table.profile-fields tr td.data {
        display: block;
        width: 100%;
        padding-right: 0;
    }

    .povigo-profile-fields-widget table.profile-fields tr td.label {
        padding-bottom: 2px;
    }

    .povigo-profile-fields-widget table.profile-fields tr td.data {
        padding-bottom: 12px;
    }
}


/* =============================================================
   Responsive — wide (≥ 800px): narrower label column
   Mirror: @media (min-width: 800px) #buddypress table.profile-fields td.label/data
   ============================================================= */

@media (min-width: 800px) {

    .povigo-profile-fields-widget table.profile-fields tr td.label {
        width: 25%;
    }

    .povigo-profile-fields-widget table.profile-fields tr td.data {
        width: 75%;
    }
}

/* --- Per-group edit button (own user only) --- */
.povigo-profile-fields-widget .profile-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.povigo-profile-fields-widget .povigo-widget-edit-group {
    margin-left: auto;
    font-size: 11px;
    font-weight: normal;
    text-transform: none;
    letter-spacing: 0;
    padding: 3px 10px;
    flex-shrink: 0;
}
