/* ==========================================================================
   HW Social — Profiles, Activity Feed, Groups
   Uses the site-wide design tokens from style.css.
   ========================================================================== */


/* ── Profile Header ───────────────────────────────────────────────────── */
.hw-profile-page {
    max-width: var(--hw-max-width, 1200px);
    margin: 0 auto;
    padding: var(--hw-space-lg, 2rem);
}

.hw-profile-header {
    background: var(--hw-bg-cream, #EBEDDF);
    border-radius: var(--hw-radius-lg, 16px);
    padding: var(--hw-space-xl, 3rem);
    margin-bottom: var(--hw-space-lg, 2rem);
}

.hw-profile-header__inner {
    display: flex;
    align-items: center;
    gap: var(--hw-space-xl, 3rem);
}

.hw-profile-avatar__img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--hw-bg, #fff);
    box-shadow: var(--hw-shadow-md, 0 4px 16px rgba(0,0,0,0.1));
}

.hw-profile-name {
    font-family: var(--hw-font-heading);
    font-size: 2rem;
    color: var(--hw-brown, #755126);
    margin: 0 0 0.5rem;
}

.hw-profile-tier {
    display: inline-block;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    margin-bottom: 0.5rem;
}

.hw-profile-location,
.hw-profile-joined {
    font-size: 0.9rem;
    color: var(--hw-text-muted, #8A8580);
    margin: 0.2rem 0;
}

.hw-btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
}

/* Notice */
.hw-profile-notice {
    padding: 0.75rem 1rem;
    border-radius: var(--hw-radius-sm, 8px);
    margin-bottom: var(--hw-space-lg, 2rem);
    font-size: 0.9rem;
}

.hw-profile-notice--success {
    background: rgba(0, 145, 58, 0.08);
    color: var(--hw-green, #00913A);
    border: 1px solid rgba(0, 145, 58, 0.2);
}

/* Profile body layout */
.hw-profile-body {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--hw-space-xl, 3rem);
}

.hw-profile-section {
    margin-bottom: var(--hw-space-xl, 3rem);
}

.hw-profile-section h2 {
    font-family: var(--hw-font-heading);
    font-size: 1.3rem;
    color: var(--hw-brown);
    margin-bottom: var(--hw-space-md, 1rem);
    padding-bottom: var(--hw-space-sm, 0.5rem);
    border-bottom: 1px solid var(--hw-border-light, #E8E0D4);
}

.hw-profile-bio {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--hw-text);
}

/* Tags */
.hw-profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.hw-profile-tag {
    background: rgba(0, 145, 58, 0.08);
    color: var(--hw-green);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
}

/* Course progress */
.hw-profile-course {
    margin-bottom: var(--hw-space-md, 1rem);
}

.hw-profile-course__info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.hw-profile-course__title {
    font-weight: 600;
    color: var(--hw-brown);
    text-decoration: none;
    font-size: 0.95rem;
}

.hw-profile-course__title:hover {
    color: var(--hw-green);
}

.hw-profile-course__pct {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--hw-green);
}

.hw-profile-progress-bar {
    height: 6px;
    background: var(--hw-border-light, #E8E0D4);
    border-radius: 3px;
    overflow: hidden;
}

.hw-profile-progress-bar__fill {
    height: 100%;
    background: var(--hw-green);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Sidebar cards */
.hw-profile-sidebar-card {
    background: var(--hw-bg-warm, #FDFCF9);
    border: 1px solid var(--hw-border-light);
    border-radius: var(--hw-radius-md, 12px);
    padding: var(--hw-space-lg, 2rem);
    margin-bottom: var(--hw-space-lg, 2rem);
}

.hw-profile-sidebar-card h3 {
    font-family: var(--hw-font-heading);
    font-size: 1rem;
    color: var(--hw-brown);
    margin-bottom: var(--hw-space-sm);
}

.hw-profile-groups-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hw-profile-groups-list li {
    margin-bottom: 0.4rem;
}

.hw-profile-groups-list a {
    color: var(--hw-green);
    font-size: 0.9rem;
}


/* ── Profile Edit Form ────────────────────────────────────────────────── */
.hw-profile-edit-wrap {
    max-width: 640px;
    margin: 0 auto;
}

.hw-profile-edit-wrap h1 {
    font-family: var(--hw-font-heading);
    color: var(--hw-brown);
    margin-bottom: var(--hw-space-lg);
}

.hw-profile-form__field {
    margin-bottom: var(--hw-space-md);
}

.hw-profile-form__field label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
    color: var(--hw-text);
}

.hw-form-hint {
    font-weight: 400;
    color: var(--hw-text-muted);
}

.hw-profile-form__field input,
.hw-profile-form__field textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    font-family: var(--hw-font-body);
    font-size: 0.95rem;
    border: 1px solid var(--hw-border-light);
    border-radius: var(--hw-radius-sm);
    background: var(--hw-bg-warm);
    transition: border-color 0.2s;
}

.hw-profile-form__field input:focus,
.hw-profile-form__field textarea:focus {
    border-color: var(--hw-green);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 145, 58, 0.1);
}

.hw-profile-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--hw-space-md);
}

.hw-profile-form__actions {
    display: flex;
    gap: var(--hw-space-md);
    margin-top: var(--hw-space-lg);
}


/* ── Activity Feed ────────────────────────────────────────────────────── */
.hw-activity-feed {
    max-width: var(--hw-max-width, 1200px);
    margin: 0 auto;
    padding: var(--hw-space-lg);
}

.hw-activity-feed__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--hw-space-lg);
    flex-wrap: wrap;
    gap: var(--hw-space-md);
}

.hw-activity-feed__header h2 {
    font-family: var(--hw-font-heading);
    color: var(--hw-brown);
    margin: 0;
}

.hw-activity-filter {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--hw-border-light);
    border-radius: var(--hw-radius-sm);
    font-family: var(--hw-font-body);
    font-size: 0.85rem;
    background: var(--hw-bg-warm);
}

.hw-activity-item {
    display: flex;
    gap: var(--hw-space-md);
    padding: var(--hw-space-md) 0;
    border-bottom: 1px solid var(--hw-border-light);
}

.hw-activity-item:last-child {
    border-bottom: none;
}

.hw-activity-item__icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    padding-top: 0.15rem;
}

.hw-activity-item__body {
    display: flex;
    gap: var(--hw-space-sm);
    flex: 1;
}

.hw-activity-item__avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.hw-activity-item__text {
    font-size: 0.9rem;
    color: var(--hw-text);
    margin: 0 0 0.2rem;
    line-height: 1.5;
}

.hw-activity-item__text a {
    color: var(--hw-green);
    font-weight: 600;
}

.hw-activity-item__time {
    font-size: 0.75rem;
    color: var(--hw-text-muted);
}

.hw-activity-load-more {
    text-align: center;
    margin-top: var(--hw-space-lg);
}

.hw-activity-empty {
    text-align: center;
    color: var(--hw-text-muted);
    padding: var(--hw-space-xl) 0;
}


/* ── Members Directory ────────────────────────────────────────────────── */
.hw-members-directory {
    max-width: var(--hw-max-width);
    margin: 0 auto;
    padding: var(--hw-space-lg);
}

.hw-members-header {
    margin-bottom: var(--hw-space-xl);
}

.hw-members-header h1 {
    font-family: var(--hw-font-heading);
    color: var(--hw-brown);
    margin-bottom: var(--hw-space-xs);
}

.hw-members-count {
    color: var(--hw-text-muted);
    font-size: 0.9rem;
    margin-bottom: var(--hw-space-md);
}

.hw-members-search {
    display: flex;
    gap: 0.5rem;
    max-width: 400px;
}

.hw-members-search input {
    flex: 1;
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--hw-border-light);
    border-radius: var(--hw-radius-sm);
    font-family: var(--hw-font-body);
}

.hw-members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--hw-space-md);
}

.hw-member-card {
    display: flex;
    align-items: center;
    gap: var(--hw-space-md);
    padding: var(--hw-space-md);
    background: var(--hw-bg-warm);
    border: 1px solid var(--hw-border-light);
    border-radius: var(--hw-radius-md);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.hw-member-card:hover {
    border-color: var(--hw-green);
    box-shadow: var(--hw-shadow-sm);
}

.hw-member-card__avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.hw-member-card__name {
    display: block;
    font-weight: 600;
    color: var(--hw-brown);
    font-size: 0.95rem;
}

.hw-member-card__tier {
    display: block;
    font-size: 0.7rem;
    color: var(--hw-green);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.hw-member-card__location {
    display: block;
    font-size: 0.8rem;
    color: var(--hw-text-muted);
}

.hw-members-pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: var(--hw-space-xl);
}

.hw-members-pagination a,
.hw-page-current {
    padding: 0.4rem 0.8rem;
    border-radius: var(--hw-radius-sm);
    font-size: 0.85rem;
    text-decoration: none;
}

.hw-members-pagination a {
    background: var(--hw-bg-warm);
    color: var(--hw-text);
    border: 1px solid var(--hw-border-light);
}

.hw-page-current {
    background: var(--hw-green);
    color: #fff;
    font-weight: 700;
}

.hw-members-gate {
    max-width: 500px;
    margin: var(--hw-space-2xl) auto;
    text-align: center;
}


/* ── Groups ───────────────────────────────────────────────────────────── */
.hw-groups-page {
    max-width: var(--hw-max-width);
    margin: 0 auto;
    padding: var(--hw-space-lg);
}

.hw-groups-header {
    margin-bottom: var(--hw-space-xl);
}

.hw-groups-header h1 {
    font-family: var(--hw-font-heading);
    color: var(--hw-brown);
    margin-bottom: var(--hw-space-sm);
}

.hw-groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--hw-space-lg);
}

.hw-group-card {
    background: var(--hw-bg);
    border: 1px solid var(--hw-border-light);
    border-radius: var(--hw-radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s;
}

.hw-group-card:hover {
    box-shadow: var(--hw-shadow-md);
}

.hw-group-card__body {
    padding: var(--hw-space-lg);
    flex: 1;
}

.hw-group-card__name {
    font-family: var(--hw-font-heading);
    font-size: 1.2rem;
    margin-bottom: var(--hw-space-sm);
}

.hw-group-card__name a {
    color: var(--hw-brown);
    text-decoration: none;
}

.hw-group-card__name a:hover {
    color: var(--hw-green);
}

.hw-group-card__desc {
    font-size: 0.9rem;
    color: var(--hw-text-light);
    line-height: 1.6;
    margin-bottom: var(--hw-space-sm);
}

.hw-group-card__count {
    font-size: 0.8rem;
    color: var(--hw-text-muted);
}

.hw-group-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--hw-space-md) var(--hw-space-lg);
    background: var(--hw-bg-warm);
    border-top: 1px solid var(--hw-border-light);
}

.hw-group-card__status {
    font-size: 0.8rem;
    color: var(--hw-green);
    font-weight: 600;
}


/* ── Single Group Page ────────────────────────────────────────────────── */
.hw-group-page {
    max-width: var(--hw-max-width);
    margin: 0 auto;
    padding: var(--hw-space-lg);
}

.hw-group-page__header {
    background: var(--hw-bg-cream);
    border-radius: var(--hw-radius-lg);
    padding: var(--hw-space-xl);
    margin-bottom: var(--hw-space-lg);
}

.hw-group-page__header h1 {
    font-family: var(--hw-font-heading);
    color: var(--hw-brown);
    margin-bottom: var(--hw-space-sm);
}

.hw-group-page__meta {
    font-size: 0.9rem;
    color: var(--hw-text-muted);
    margin-bottom: var(--hw-space-md);
}

.hw-group-page__meta a {
    color: var(--hw-green);
}

.hw-group-page__body {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--hw-space-xl);
}

.hw-group-section h2 {
    font-family: var(--hw-font-heading);
    font-size: 1.3rem;
    color: var(--hw-brown);
    margin-bottom: var(--hw-space-md);
}

.hw-group-description {
    line-height: 1.8;
}

.hw-group-members-card {
    background: var(--hw-bg-warm);
    border: 1px solid var(--hw-border-light);
    border-radius: var(--hw-radius-md);
    padding: var(--hw-space-lg);
}

.hw-group-members-card h3 {
    font-family: var(--hw-font-heading);
    font-size: 1rem;
    color: var(--hw-brown);
    margin-bottom: var(--hw-space-md);
}

.hw-group-member {
    display: flex;
    align-items: center;
    gap: var(--hw-space-sm);
    padding: 0.4rem 0;
    text-decoration: none;
    color: var(--hw-text);
    font-size: 0.9rem;
}

.hw-group-member:hover {
    color: var(--hw-green);
}

.hw-group-member img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.hw-group-member small {
    color: var(--hw-text-muted);
    font-size: 0.75rem;
}


/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .hw-profile-header__inner {
        flex-direction: column;
        text-align: center;
    }

    .hw-profile-body {
        grid-template-columns: 1fr;
    }

    .hw-profile-form__row {
        grid-template-columns: 1fr;
    }

    .hw-group-page__body {
        grid-template-columns: 1fr;
    }
}
