/* ============================================================
   users.css — User pages (petitions, members, feed, settings)
   Clean light aesthetic matching dashboard + landing.
   ============================================================ */

.sp-users {
    background: var(--bg-soft, #faf8f4);
}

.sp-users .sp-users__hero,
.sp-users__hero {
    max-width: 1120px;
    margin: 0 auto 1.25rem;
    background: linear-gradient(180deg, #fffaf2 0%, #ffffff 75%);
    border: 1px solid #f3e7d3;
    border-radius: 22px;
    padding: clamp(1.5rem, 4vw, 2.5rem);
}

.sp-users__hero--center {
    text-align: center;
}

.sp-users__title {
    margin: 0 0 0.5rem;
    font-family: var(--font-display, serif);
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    line-height: 1.1;
    color: #1c1917;
}

.sp-users__sub {
    margin: 0 0 1.25rem;
    color: #57534e;
    line-height: 1.7;
    max-width: 40rem;
}

.sp-users__hero--center .sp-users__sub {
    margin-left: auto;
    margin-right: auto;
}

.sp-users__hero-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.sp-users__hero--center .sp-users__hero-actions {
    justify-content: center;
}

/* page wrapper widths */
.sp-page.sp-users {
    max-width: 1160px;
    margin: 0 auto;
    padding: clamp(1rem, 3vw, 2rem) clamp(1rem, 3vw, 1.5rem) 3.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sp-users--narrow .sp-users__hero,
.sp-users--narrow .sp-feed {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

/* filters */
.sp-users__filters {
    max-width: 1120px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
    background: #fff;
    border: 1px solid #f0e8dc;
    border-radius: 16px;
    padding: 0.7rem;
}

.sp-users__search {
    flex: 1;
    min-width: 220px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #faf7f1;
    border: 1px solid #eee4d3;
    border-radius: 12px;
    padding: 0.55rem 0.8rem;
    color: #78716c;
}

.sp-users__search input {
    border: 0;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 0.92rem;
    color: #1c1917;
}

.sp-users__select select {
    border: 1px solid #eee4d3;
    background: #faf7f1;
    border-radius: 12px;
    padding: 0.6rem 0.8rem;
    font-size: 0.88rem;
    color: #44403c;
    max-width: 240px;
}

.sp-users__count {
    max-width: 1120px;
    margin: 0.25rem auto 0;
    width: 100%;
    font-size: 0.85rem;
    color: #78716c;
}

/* petition grid */
.sp-pet-grid {
    max-width: 1120px;
    margin: 0 auto;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.9rem;
}

.sp-pet-card {
    background: #fff;
    border: 1px solid #f0e8dc;
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.sp-pet-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 34px rgba(16, 24, 40, 0.1);
}

.sp-pet-card__media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    background: #fff7ed;
    overflow: hidden;
}

.sp-pet-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sp-pet-card__ph {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e2a04a;
}

.sp-pet-card__cause {
    position: absolute;
    left: 0.7rem;
    bottom: 0.7rem;
    background: rgba(28, 25, 23, 0.82);
    color: #fde9cf;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
}

.sp-pet-card__body {
    padding: 1rem 1.05rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex: 1;
}

.sp-pet-card__title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.4;
}

.sp-pet-card__title a {
    color: inherit;
    text-decoration: none;
}

.sp-pet-card__title a:hover {
    color: #c2660a;
}

.sp-pet-card__meta {
    margin: 0;
    font-size: 0.8rem;
    color: #78716c;
}

.sp-pet-card__foot {
    margin-top: auto;
    padding-top: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

/* pagination */
.sp-users__pagination {
    max-width: 1120px;
    margin: 0.5rem auto 0;
    width: 100%;
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: center;
}

.sp-users__pagination .page-numbers {
    display: inline-flex;
    min-width: 38px;
    height: 38px;
    padding: 0 0.7rem;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #eee4d3;
    border-radius: 12px;
    text-decoration: none;
    color: #44403c;
    font-size: 0.86rem;
    font-weight: 600;
}

.sp-users__pagination .page-numbers.current {
    background: #1c1917;
    border-color: #1c1917;
    color: #fff;
}

/* dashboard rows reuse (list pages) */
.sp-dash-list.sp-dash-card,
.sp-signed-list.sp-dash-card {
    max-width: 1120px;
    margin: 0 auto;
    width: 100%;
    background: #fff;
    border: 1px solid #f0e8dc;
    border-radius: 20px;
    list-style: none;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* members */
.sp-member-grid {
    max-width: 1120px;
    margin: 0 auto;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.9rem;
}

.sp-member-card {
    background: #fff;
    border: 1px solid #f0e8dc;
    border-radius: 18px;
    padding: 1.25rem 1rem;
    text-align: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.sp-member-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 34px rgba(16, 24, 40, 0.1);
}

.sp-member-card__avatar {
    display: inline-flex;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
    outline: 2px solid rgba(255, 153, 51, 0.35);
    background: #fff7ed;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.7rem;
}

.sp-member-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sp-member-card__name {
    margin: 0;
    font-size: 0.98rem;
}

.sp-member-card__name a {
    color: inherit;
    text-decoration: none;
}

.sp-member-card__name a:hover {
    color: #c2660a;
}

.sp-member-card__handle {
    margin: 0.1rem 0 0.4rem;
    font-size: 0.78rem;
    color: #a8a29e;
}

.sp-member-card__loc {
    margin: 0 0 0.4rem;
    font-size: 0.78rem;
    color: #78716c;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.sp-member-card__bio {
    margin: 0 0 0.5rem;
    font-size: 0.82rem;
    color: #57534e;
    line-height: 1.55;
}

.sp-member-card__stats {
    margin: 0 0 0.6rem;
    font-size: 0.76rem;
    color: #a8a29e;
}

/* feed */
.sp-feed {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.sp-feed__head {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.7rem;
}

.sp-feed__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: #faf3e9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #a8a29e;
}

.sp-feed__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sp-feed__who {
    flex: 1;
    display: flex;
    flex-direction: column;
    font-size: 0.86rem;
    line-height: 1.35;
}

.sp-feed__who small {
    color: #a8a29e;
    font-size: 0.76rem;
}

.sp-feed__title {
    margin: 0 0 0.4rem;
    font-size: 1.08rem;
    line-height: 1.4;
}

.sp-feed__title a {
    color: inherit;
    text-decoration: none;
}

.sp-feed__title a:hover {
    color: #c2660a;
}

.sp-feed__excerpt {
    margin: 0 0 0.7rem;
    color: #57534e;
    font-size: 0.92rem;
    line-height: 1.65;
}

/* settings */
.sp-settings-form .sp-form-group {
    margin-bottom: 1rem;
}

.sp-settings__subhead {
    margin: 1.5rem 0 0.75rem;
    font-size: 1rem;
}

.sp-settings__actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}

/* responsive */
@media (max-width: 1024px) {
    .sp-pet-grid { grid-template-columns: repeat(2, 1fr); }
    .sp-member-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 680px) {
    .sp-pet-grid { grid-template-columns: 1fr; }
    .sp-member-grid { grid-template-columns: repeat(2, 1fr); }
    .sp-users__filters { flex-direction: column; align-items: stretch; }
    .sp-users__select select { max-width: none; width: 100%; }
}

@media (max-width: 440px) {
    .sp-member-grid { grid-template-columns: 1fr; }
}

/* ====== Danger zone (delete account) ====== */
.sp-danger-zone {
    margin-top: var(--space-6, 1.5rem);
    padding: var(--space-5, 1.25rem);
    border: 1px solid #f3c2c2;
    border-radius: 16px;
    background: #fffafa;
}
.sp-danger-zone__form { display: flex; flex-direction: column; gap: 0.8rem; margin-top: 0.8rem; }
.btn--danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.25rem;
    border: 0;
    border-radius: 12px;
    background: #b91c1c;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.btn--danger:hover { background: #991b1b; }
