/* Public profile page (/u/<username>/).
   Builds on app.css tokens and shared components. Page-specific layout,
   the actions menu, tabs, and the album preview grid live here. */

/* ---------- Shared state / spinner ---------- */

.pp-state {
    text-align: center;
    padding: 56px 20px;
    color: var(--muted);
    font-size: 14px;
}

.pp-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid var(--border);
    border-top-color: var(--heading);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-bottom: 10px;
}

.pp-error-text {
    margin-bottom: 16px;
}

/* ---------- Header ---------- */

.profile-header {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
    padding: 28px;
    background: var(--card);
    border-radius: 16px;
    box-shadow: 0 2px 8px var(--shadow);
    margin-bottom: 28px;
}

.avatar-xl {
    width: 96px;
    height: 96px;
    font-size: 38px;
    flex-shrink: 0;
}

.profile-identity {
    flex: 1;
    min-width: 220px;
}

.profile-username {
    font-size: 26px;
    font-weight: 700;
    color: var(--heading);
    word-break: break-word;
}

.profile-meta {
    font-size: 13px;
    color: var(--faint);
    margin-top: 4px;
}

.profile-bio {
    font-size: 15px;
    color: var(--text);
    margin-top: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.profile-stats {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.profile-stat {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    color: var(--muted);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.profile-stat:hover {
    border-color: var(--heading);
    color: var(--heading);
}

.profile-stat-count {
    font-size: 16px;
    font-weight: 700;
    color: var(--heading);
}

/* ---------- Header actions ---------- */

.profile-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.profile-menu {
    position: relative;
}

.profile-menu-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.profile-menu-trigger:hover {
    border-color: var(--heading);
    background: var(--card-hover);
}

.profile-menu-list {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px var(--shadow-strong);
    padding: 6px;
    z-index: 50;
    animation: slideIn 0.15s ease;
}

.profile-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.profile-menu-item:hover {
    background: var(--card-hover);
}

.profile-menu-item.danger {
    color: var(--danger);
}

/* ---------- Blocked notice ---------- */

.profile-blocked {
    text-align: center;
    padding: 48px 24px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.profile-blocked-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.profile-blocked-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--heading);
    margin-bottom: 8px;
}

.profile-blocked-text {
    font-size: 14px;
    color: var(--muted);
    max-width: 420px;
    margin: 0 auto 20px;
}

/* ---------- Tabs ---------- */

.profile-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--heading);
    margin-bottom: 14px;
}

.profile-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 18px;
}

.profile-tab {
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 14px;
    margin-bottom: -1px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.profile-tab:hover {
    color: var(--heading);
}

.profile-tab.active {
    color: var(--heading);
    border-bottom-color: var(--heading);
}

.pp-list-state {
    padding: 32px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

/* ---------- Albums ---------- */

.pp-album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.pp-album-card {
    display: block;
    background: var(--card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.pp-album-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-strong);
}

.pp-album-cover {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--card-hover);
}

.pp-album-cover-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: var(--card-hover);
    color: var(--faint);
    font-size: 30px;
}

.pp-album-cover.nsfw-blur {
    filter: blur(18px);
}

.pp-album-body {
    padding: 12px 14px 14px;
}

.pp-album-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--heading);
}

.pp-album-count {
    font-size: 12px;
    color: var(--faint);
    margin-top: 2px;
}

.profile-block {
    margin-bottom: 32px;
}

/* ---------- Report modal reason list ---------- */

.report-desc-hint {
    text-align: right;
}

@media (max-width: 640px) {
    .profile-header {
        padding: 22px;
        gap: 18px;
    }

    .profile-actions {
        width: 100%;
        margin-top: 4px;
    }

    .profile-actions .btn {
        flex: 1;
    }
}
