/**
 * SampreShan Profile Page
 * Uses the existing icon-system + design-system tokens.
 * Mobile, tablet, desktop, large desktop, 4K.
 *
 * @package SampreShan_Child
 */

.sp-profile,
.sp-fu-profile {
    --sp-profile-pad: clamp(1rem, 3vw, 2rem);
    --sp-profile-max: 1280px;
    --sp-profile-radius: var(--radius-lg, 20px);

    max-width: var(--sp-profile-max);
    margin: 0 auto;
    padding: var(--sp-profile-pad);
    display: grid;
    gap: var(--space-6, 1.5rem);
}

.sp-fu-profile {
    position: relative;
    display: block !important;
    box-sizing: border-box;
    width: min(calc(100% - 2rem), 1180px) !important;
    max-width: 1180px !important;
    margin: 0 auto;
    padding: 0 0 2.5rem;
    color: #f5efe8;
}

#main.sp-fu-wash {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.page-template-template-profile #content,
body.page-template-template-profile #primary,
body.page-template-template-profile .site-content-grid,
body.page-template-template-profile .bb-grid {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
}

.sp-fu-profile > .sp-fu-cover {
    display: block;
    width: 100%;
}

.sp-fu-cover {
    position: relative;
    height: clamp(180px, 28vw, 260px);
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(255,159,80,0.95), rgba(200,89,20,0.9));
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}

.sp-fu-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 18% 30%, rgba(255,255,255,0.38), transparent 20%),
                radial-gradient(circle at 65% 10%, rgba(255,219,121,0.22), transparent 24%);
}

.sp-fu-cover__om {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: clamp(4rem, 8vw, 9rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    opacity: 0.18;
    color: rgba(255,255,255,0.92);
}

.sp-fu-id {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-top: -3rem;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

.sp-fu-avatar {
    width: clamp(110px, 16vw, 148px);
    height: clamp(110px, 16vw, 148px);
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid rgba(12, 17, 25, 0.9);
    background: linear-gradient(135deg, #f2d0a2, #d98f40);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.25);
    flex-shrink: 0;
}

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

.sp-fu-id__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.sp-fu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 12px;
    padding: 0.76rem 1.1rem;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease, border-color 0.2s ease;
}

.sp-fu-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
}

.sp-fu-btn--sm {
    padding: 0.66rem 0.95rem;
    font-size: 0.85rem;
}

.sp-fu-btn--mor {
    background: rgba(255,255,255,0.06);
    color: #f5efe8;
    border-color: rgba(255,255,255,0.12);
}

.sp-fu-btn--secondary {
    background: rgba(255,255,255,0.08);
    color: #fffaf3;
    border-color: rgba(255,255,255,0.14);
}

.sp-fu-btn--primary {
    background: linear-gradient(135deg, #ff9b37, #eb6a0d);
    color: #fff;
    border-color: rgba(255,150,70,0.6);
    box-shadow: 0 10px 26px rgba(237, 122, 26, 0.34);
}

.sp-fu-name {
    margin: 0;
    font-size: clamp(2.1rem, 3.4vw, 3rem);
    line-height: 1.05;
    font-family: var(--font-display, 'Cormorant Garamond', serif);
    color: #f8f4ef;
}

.sp-fu-names {
    padding: 0 1rem;
    margin-top: 1rem;
}

.sp-fu-handle,
.sp-fu-bio,
.sp-fu-meta,
.sp-fu-complete,
.sp-fu-post__meta,
.sp-fu-post__title a,
.sp-fu-link,
.sp-fu-stats span,
.sp-fu-tab {
    color: #d9d0c6;
}

.sp-fu-handle {
    margin: 0.3rem 0 0.75rem;
    color: #d9cbb9;
}

.sp-fu-bio {
    margin: 0.5rem 0 0.8rem;
    max-width: 58ch;
    line-height: 1.7;
    color: #e8e1d9;
}

.sp-fu-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 0.5rem 0 0;
    color: #d7d1ca;
    font-size: 0.9rem;
}

.sp-fu-chips {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.9rem 0 0;
    padding: 0;
}

.sp-fu-chips li {
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    padding: 0.42rem 0.7rem;
    font-size: 0.8rem;
    color: #f6efe8;
}

.sp-fu-complete {
    margin: 1.1rem 1rem 0;
    padding: 0.95rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    line-height: 1.6;
}

.sp-fu-complete__bar {
    display: block;
    margin-top: 0.7rem;
    width: 100%;
    height: 7px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
}

.sp-fu-complete__fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, #f5b250, #eb6a0d);
}

.sp-fu-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 0.7rem;
    margin: 1.1rem 1rem 0;
}

.sp-fu-stats span {
    display: block;
    padding: 0.9rem 1rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    line-height: 1.6;
}

.sp-fu-stats strong {
    display: block;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1.1;
}

.sp-fu-tabs {
    display: flex;
    gap: 0.5rem;
    margin: 1.25rem 1rem 0;
    padding-top: 0.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sp-fu-tab {
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 0.7rem 0.9rem;
    font-weight: 700;
    cursor: pointer;
    color: #d4cabf;
}

.sp-fu-tab.is-active {
    color: #fff;
    border-color: rgba(245, 178, 80, 0.9);
}

.sp-fu-pane {
    display: none;
    margin: 1rem 1rem 0;
}

.sp-fu-pane.is-active {
    display: block;
}

.sp-fu-post {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 1rem;
    margin-bottom: 0.9rem;
}

.sp-fu-post__head {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.75rem;
}

.sp-fu-post__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    background: rgba(255,255,255,0.06);
}

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

.sp-fu-post__who {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.sp-fu-post__title {
    margin: 0 0 0.35rem;
    font-size: 1.2rem;
    line-height: 1.4;
}

.sp-fu-post__title a {
    color: #fff;
    text-decoration: none;
}

.sp-fu-post__meta {
    margin: 0;
    color: #d1c8be;
}

.sp-fu-post__engage {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    align-items: center;
    margin-top: 0.9rem;
}

.sp-fu-link {
    color: #f5d4a3;
    text-decoration: none;
}

@media (max-width: 767px) {
    .sp-fu-id {
        flex-direction: column;
        align-items: flex-start;
    }

    .sp-fu-id__actions {
        justify-content: flex-start;
        margin-bottom: 0;
    }

    .sp-fu-stats {
        grid-template-columns: 1fr;
    }
}

/* ====== HERO ====== */
.sp-profile__hero {
    position: relative;
    padding: var(--space-8, 2rem);
    border-radius: var(--sp-profile-radius);
    overflow: hidden;
    box-shadow: var(--elev-3, 0 8px 24px rgba(30,58,138,.10));
}

.sp-profile__hero-inner {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-6, 1.5rem);
    align-items: center;
    position: relative;
    z-index: 1;
}

.sp-profile__avatar {
    position: relative;
    width: clamp(96px, 14vw, 160px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--bg-card, #fff);
    padding: 4px;
    box-shadow: var(--elev-4, 0 16px 40px rgba(30,58,138,.14));
}

.sp-profile__avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.sp-profile__avatar-edit {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-saffron, linear-gradient(135deg,#FFB877,#E0851A));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--elev-2, 0 2px 6px rgba(30,58,138,.08));
}

.sp-profile__identity { min-width: 0; }

.sp-profile__name {
    font-family: var(--font-display, 'Cormorant Garamond', serif);
    font-size: var(--text-4xl, 2.25rem);
    line-height: 1.1;
    margin: 0 0 var(--space-3, .75rem);
    color: var(--text, #1A1A1A);
    word-wrap: break-word;
}

.sp-profile__chips {
    list-style: none;
    margin: 0 0 var(--space-4, 1rem);
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2, .5rem);
}

.sp-profile__bio {
    font-size: var(--text-base, 1rem);
    line-height: var(--leading-relaxed, 1.65);
    color: var(--text-muted, #5C5C5C);
    margin: 0 0 var(--space-4, 1rem);
    max-width: 60ch;
}

.sp-profile__completeness {
    max-width: 480px;
}

.sp-profile__completeness-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2, .5rem);
    font-size: var(--text-sm, .875rem);
    color: var(--text-muted, #5C5C5C);
    margin-bottom: var(--space-2, .5rem);
}

.sp-profile__completeness-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-muted, #F4F0E8);
    border-radius: var(--radius-full, 9999px);
    overflow: hidden;
}

.sp-profile__completeness-fill {
    height: 100%;
    background: var(--gradient-aurora, linear-gradient(135deg,#FFB877,#FF9933,#E0851A,#9A4F0B));
    background-size: 200% auto;
    border-radius: inherit;
    transition: width 600ms var(--ease-out, cubic-bezier(.16,1,.3,1));
}

.sp-profile__actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3, .75rem);
    margin-top: var(--space-4, 1rem);
}

/* ====== STATS STRIP ====== */
.sp-profile__stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4, 1rem);
}

.sp-profile__stat {
    padding: var(--space-5, 1.25rem);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2, .5rem);
}

.sp-profile__stat-num {
    font-family: var(--font-display, 'Cormorant Garamond', serif);
    font-size: var(--text-3xl, 1.875rem);
    line-height: 1;
    color: var(--text, #1A1A1A);
}

.sp-profile__stat-num small {
    font-size: var(--text-sm, .875rem);
    color: var(--text-muted, #5C5C5C);
    font-family: var(--font-body, 'Inter', sans-serif);
    font-weight: 400;
    margin-left: 2px;
}

.sp-profile__stat-label {
    font-size: var(--text-sm, .875rem);
    color: var(--text-muted, #5C5C5C);
}

/* ====== BODY: two columns on desktop, stacked on mobile ====== */
.sp-profile__body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4, 1rem);
}

.sp-profile__section {
    padding: var(--space-5, 1.25rem);
}

.sp-profile__section-head {
    display: flex;
    align-items: center;
    gap: var(--space-3, .75rem);
    margin-bottom: var(--space-4, 1rem);
    padding-bottom: var(--space-3, .75rem);
    border-bottom: 1px solid var(--border, #E8E2D5);
}

.sp-profile__section-title {
    font-family: var(--font-heading, 'Inter', sans-serif);
    font-size: var(--text-lg, 1.125rem);
    font-weight: var(--weight-semibold, 600);
    margin: 0;
    color: var(--text, #1A1A1A);
}

.sp-profile__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-3, .75rem);
}

.sp-profile__list-item { margin: 0; }

.sp-profile__list-link {
    display: block;
    padding: var(--space-3, .75rem);
    border-radius: var(--radius, 10px);
    background: var(--bg-soft, #FAF8F4);
    text-decoration: none;
    color: inherit;
    transition: background var(--transition, 250ms var(--ease-out, ease-out)),
                transform var(--transition, 250ms var(--ease-out, ease-out));
}

.sp-profile__list-link:hover {
    background: var(--bg-card, #fff);
    transform: translateY(-1px);
    box-shadow: var(--elev-2, 0 2px 6px rgba(30,58,138,.08));
}

.sp-profile__list-title {
    font-weight: var(--weight-semibold, 600);
    color: var(--text, #1A1A1A);
    margin-bottom: var(--space-2, .5rem);
    line-height: 1.35;
}

.sp-profile__list-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3, .75rem);
    font-size: var(--text-sm, .875rem);
    color: var(--text-muted, #5C5C5C);
}

.sp-profile__list-count { font-variant-numeric: tabular-nums; }

.sp-profile__list-bar {
    flex: 1 1 auto;
    height: 4px;
    background: var(--bg-muted, #F4F0E8);
    border-radius: var(--radius-full, 9999px);
    overflow: hidden;
    max-width: 200px;
}

.sp-profile__list-fill {
    height: 100%;
    background: var(--gradient-saffron, linear-gradient(135deg,#FFB877,#E0851A));
    border-radius: inherit;
}

.sp-profile__empty {
    text-align: center;
    padding: var(--space-8, 2rem) var(--space-3, .75rem);
    color: var(--text-muted, #5C5C5C);
}

.sp-profile__empty p { margin: var(--space-3, .75rem) 0; }

.sp-empty {
    text-align: center;
    padding: var(--space-16, 4rem) var(--space-3, .75rem);
    max-width: 560px;
    margin: var(--space-12, 3rem) auto;
}

.sp-empty__title {
    font-family: var(--font-display, 'Cormorant Garamond', serif);
    font-size: var(--text-3xl, 1.875rem);
    margin: var(--space-4, 1rem) 0 var(--space-3, .75rem);
}

.sp-empty__body {
    color: var(--text-muted, #5C5C5C);
    margin: 0 0 var(--space-6, 1.5rem);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Large phones / phablets (480-639) — keep two-col body, shrink stats */
@media (max-width: 767px) {
    .sp-profile__body { grid-template-columns: 1fr; }
    .sp-profile__stats { grid-template-columns: repeat(2, 1fr); }
    .sp-profile__hero-inner { grid-template-columns: 1fr; text-align: center; }
    .sp-profile__avatar { margin: 0 auto; }
    .sp-profile__chips { justify-content: center; }
    .sp-profile__completeness { margin: 0 auto; }
    .sp-profile__actions { justify-content: center; }
}

/* Small phones (≤479) */
@media (max-width: 479px) {
    .sp-profile__stats { grid-template-columns: 1fr 1fr; }
    .sp-profile__name { font-size: var(--text-3xl, 1.875rem); }
}

/* Tablets portrait (640-767) */
@media (min-width: 640px) and (max-width: 767px) {
    .sp-profile__stats { grid-template-columns: repeat(4, 1fr); }
}

/* Desktop (1024+) — wider, looser */
@media (min-width: 1024px) {
    .sp-profile { padding: var(--space-10, 2.5rem); }
    .sp-profile__hero { padding: var(--space-10, 2.5rem); }
}

/* Large desktop / 4K (1536+) */
@media (min-width: 1536px) {
    .sp-profile { --sp-profile-max: 1440px; }
}

/* High-DPI tweak */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .sp-profile__avatar { box-shadow: var(--elev-4, 0 16px 40px rgba(30,58,138,.14)), inset 0 0 0 1px rgba(255,255,255,.5); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .sp-profile__completeness-fill,
    .sp-profile__list-link { transition: none !important; }
}
