/* ===== Author profile (on top of posts.css, questions.css, category.css) ===== */
.au-area {
    padding-top: 24px;
}

/* ----- Profile card ----- */
.au-card {
    position: relative;
    margin-bottom: 24px;
    overflow: hidden;
    border: 1px solid var(--pl-border);
    border-radius: 24px;
    background: var(--pl-surface);
}

.au-cover {
    height: 130px;
    background:
        radial-gradient(60% 120% at 90% 0%, rgba(236, 72, 153, 0.35), transparent 70%),
        radial-gradient(1px 1px at 20px 20px, rgba(255, 255, 255, 0.35) 1px, transparent 1px) 0 0 / 22px 22px,
        linear-gradient(135deg, #2e0f5c, #49108b 55%, #6d28d9);
}

.au-main {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 14px 20px;
    margin-top: -56px;
    padding: 0 28px;
}

.au-avatar {
    flex: none;
    width: 120px;
    height: 120px;
    border: 5px solid var(--pl-surface);
    border-radius: 50%;
    background: var(--pl-surface-2);
    object-fit: cover;
    box-shadow: 0 12px 30px rgba(16, 12, 40, 0.15);
}

.au-identity {
    flex: 1 1 260px;
    min-width: 0;
    padding-top: 68px; /* start below the cover, next to the overlapping avatar */
}

.au-area .au-name {
    margin: 0 0 6px;
    color: var(--pl-text);
    font-size: 28px;
    font-weight: 800;
}

.au-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    color: var(--pl-muted);
    font-size: 13px;
}

.au-role {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 12px;
    border-radius: 999px;
    background: var(--pl-surface-2);
    color: var(--pl-text);
    font-weight: 700;
}

.au-role--author {
    background: var(--pl-accent-soft);
    color: var(--pl-accent);
}

.au-handle {
    font-weight: 600;
}

/* Bottom padding when there is no socials bar */
.au-spacer {
    height: 24px;
}

.au-since {
    font-family: Dana, Dana-fallback, Tahoma, sans-serif;
}

.au-since i {
    margin-left: 4px;
}

.au-actions {
    padding-top: 72px;
}

.au-area .au-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    min-width: 150px;
    height: 44px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: var(--color-primary, #49108b);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

body.active-dark-mode .au-area .au-btn {
    background: #6d3fd1;
}

.au-area .au-btn.is-following,
.au-area .au-btn--ghost {
    border-color: var(--pl-border);
    background: var(--pl-surface-2);
    color: var(--pl-text);
}

body.active-dark-mode .au-area .au-btn.is-following,
body.active-dark-mode .au-area .au-btn--ghost {
    background: var(--pl-surface-2);
}

.au-area .au-btn:disabled {
    opacity: 0.6;
}

.au-bio {
    max-width: 760px;
    margin: 18px 28px 0;
    color: var(--pl-text);
    font-size: 15px;
    line-height: 2;
    white-space: pre-line;
}

.au-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 20px;
    margin-top: 20px;
    padding: 16px 28px;
    border-top: 1px solid var(--pl-border);
    background: var(--pl-surface-2);
}

.au-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 20px 28px 0;
    padding: 0;
    list-style: none;
}

.au-stats li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 14px 8px;
    border: 1px solid var(--pl-border);
    border-radius: 14px;
    background: var(--pl-surface-2);
    text-align: center;
}

.au-stats strong {
    color: var(--pl-text);
    font-family: Dana, Dana-fallback, Tahoma, sans-serif;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.3;
}

.au-stats span {
    color: var(--pl-muted);
    font-size: 12px;
}

.au-stats span i {
    margin-left: 3px;
}

/* ----- Most read posts ----- */
.au-top {
    margin: 0 0 24px;
    padding: 18px 20px;
    border: 1px solid var(--pl-border);
    border-radius: 18px;
    background: var(--pl-surface);
}

.au-area .au-top-title {
    margin: 0 0 12px;
    color: var(--pl-text);
    font-size: 17px;
    font-weight: 800;
}

.au-top-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.au-top-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    margin: 0;
    padding: 8px;
    border-radius: 12px;
    transition: background-color 0.15s ease;
}

.au-top-item:hover,
.au-top-item:focus-within {
    background: var(--pl-surface-2);
}

.au-top-rank {
    flex: none;
    width: 22px;
    color: var(--pl-accent);
    font-family: Dana, Dana-fallback, Tahoma, sans-serif;
    font-size: 20px;
    font-weight: 800;
    text-align: center;
}

.au-top-thumb {
    flex: none;
    width: 96px;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
    aspect-ratio: 16 / 9;
}

.au-top-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.au-area .au-top-name {
    display: -webkit-box;
    overflow: hidden;
    color: var(--pl-text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.7;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* The whole item opens the post */
.au-top-name::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
}

.au-area .au-top-item:hover .au-top-name {
    color: var(--pl-accent);
}

.au-top-name:focus-visible {
    outline: none;
}

.au-top-item:has(.au-top-name:focus-visible) {
    outline: 3px solid color-mix(in srgb, var(--pl-accent) 40%, transparent);
    outline-offset: 2px;
}

.au-top-meta {
    color: var(--pl-muted);
    font-family: Dana, Dana-fallback, Tahoma, sans-serif;
    font-size: 12px;
}

@media (max-width: 991px) {
    .au-top-list {
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
    }
}

.au-socials {
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.au-socials li {
    margin: 0;
}

.au-area .au-socials a {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--pl-border);
    border-radius: 12px;
    background: var(--pl-surface);
    color: var(--pl-muted);
}

.au-area .au-socials a:hover {
    border-color: var(--pl-accent);
    color: var(--pl-accent);
}

/* ----- Posts grid ----- */
.au-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 20px;
}

.au-post {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--pl-border);
    border-radius: 18px;
    background: var(--pl-surface);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.au-post:hover,
.au-post:focus-within {
    border-color: color-mix(in srgb, var(--pl-accent) 30%, transparent);
    box-shadow: 0 16px 32px rgba(16, 12, 40, 0.08);
    transform: translateY(-3px);
}

.au-post-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--pl-surface-2);
}

.au-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.au-post-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px 16px;
}

.au-post-name {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.75;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.au-area .au-post-name a {
    color: var(--pl-text);
}

.au-post-name a::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

.au-area .au-post:hover .au-post-name a {
    color: var(--pl-accent);
}

.au-post .plist-cats {
    position: relative;
    z-index: 2;
}

.au-post-meta {
    display: flex;
    gap: 14px;
    margin-top: auto;
    color: var(--pl-muted);
    font-family: Dana, Dana-fallback, Tahoma, sans-serif;
    font-size: 12px;
}

.au-post-meta i {
    margin-left: 4px;
}

@media (max-width: 575px) {
    .au-cover {
        height: 100px;
    }

    .au-main {
        margin-top: -48px;
        padding: 0 18px;
    }

    .au-avatar {
        width: 96px;
        height: 96px;
    }

    .au-area .au-name {
        font-size: 23px;
    }

    .au-identity {
        flex-basis: 100%;
        padding-top: 0;
    }

    .au-actions {
        width: 100%;
        padding-top: 0;
    }

    .au-area .au-btn {
        width: 100%;
    }

    .au-bio {
        margin: 14px 18px 0;
    }

    .au-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin: 16px 18px 0;
    }

    .au-stats strong {
        font-size: 19px;
    }

    .au-top {
        padding: 14px 12px;
    }

    .au-foot {
        padding: 14px 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .au-post {
        transition: none;
    }

    .au-post:hover,
    .au-post:focus-within {
        transform: none;
    }
}
