/* Author Page Component */

.author-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.author-card:hover {
  transform: translate3d(0, -2px, 0);
  box-shadow: var(--elevation-low);
}

.author-card-link {
  text-decoration: none;
  color: inherit;
}

.author-card-avatar {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.author-card-avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
}

.author-card-content {
  flex: 1;
  min-width: 0;
}

.author-card-name {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  margin: 0 0 var(--space-1) 0;
}

.author-card-meta {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.author-card-bio {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}

.author-card-stats {
  display: flex;
  gap: var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.authors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-6);
  margin-top: var(--space-8);
}

.authors-page {
  max-width: var(--container-lg);
  margin: 0 auto;
  padding: var(--space-8);
}

.authors-page__content {
  margin-bottom: var(--space-8);
}

/* List view overrides (authors/list.html) - compact cards */
.authors-page .author-card-link {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-6);
}

.authors-page .author-card-avatar,
.authors-page .author-card-avatar-placeholder {
  width: 64px;
  height: 64px;
}

.author-meta {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.author-page {
  max-width: var(--container-lg);
  margin: 0 auto;
}

/* Author Header */
.author-header {
    display: flex;
    gap: var(--space-8);
    align-items: start;
    margin-bottom: var(--space-12);
    padding: var(--space-8);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    transition: transform var(--transition-smooth) var(--ease-smooth),
                box-shadow var(--transition-smooth) var(--ease-smooth);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    will-change: transform, box-shadow;

}

.author-header:hover {
    transform: translate3d(0, -2px, 0);
    box-shadow: var(--elevation-card-hover);
}

@supports (color: color-mix(in srgb, white, black)) {
    .author-header:hover {
        background: color-mix(in srgb, var(--color-bg-secondary) 98%, var(--color-primary));
    }
}

.author-header:hover .author-avatar-large,
.author-header:hover .author-avatar-placeholder {
    transform: translate3d(0, 0, 0) scale(1.05);
}

.author-avatar-large {
    width: 150px;
    height: 150px;
    aspect-ratio: 1 / 1; /* Added */
    border-radius: var(--radius-full);
    object-fit: cover;
    flex-shrink: 0;
    transition: transform var(--transition-smooth) var(--ease-smooth);
    will-change: transform;
}

.author-avatar-placeholder {
    width: 150px;
    height: 150px;
    aspect-ratio: 1 / 1; /* Added */
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: var(--color-text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-6xl);
    font-weight: var(--weight-bold);
    flex-shrink: 0;
    transition: transform var(--transition-smooth) var(--ease-smooth);
    will-change: transform;
}

.author-header-content {
    flex: 1;
    min-width: 0;
}

.author-name {
    margin: 0 0 var(--space-2) 0;
    font-size: var(--text-4xl);
    font-weight: var(--weight-bold);
    color: var(--color-text-primary);
}

.author-bio {
    margin: var(--space-2) 0 var(--space-4) 0;
    font-size: var(--text-lg);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
}

/* Social Links */
.author-social {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    padding: var(--space-2) var(--space-4);
    background: var(--color-surface);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--color-text-primary);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    transition: background var(--transition-smooth) var(--ease-smooth),
        color var(--transition-smooth) var(--ease-smooth),
        transform var(--transition-smooth) var(--ease-smooth),
        box-shadow var(--transition-smooth) var(--ease-smooth);
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    will-change: transform, background, box-shadow;
}

.social-link:hover {
    background: var(--color-primary);
    color: var(--color-text-inverse);
    transform: translate3d(0, -2px, 0);
    box-shadow: var(--elevation-low);
}

@supports (color: color-mix(in srgb, white, black)) {
    .social-link:hover {
        background: color-mix(in srgb, var(--color-primary) 90%, black);
    }
}

.social-link:active {
    transform: translate3d(0, 0, 0);
}

/* Author Statistics */
.author-stats {
    margin: var(--space-8) 0 var(--space-12) 0;
}

.author-stats h2 {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-4);
}

.stat-card {
    text-align: center;
    padding: var(--space-6);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
}

.stat-value {
    display: block;
    font-size: var(--text-5xl);
    font-weight: var(--weight-bold);
    color: var(--color-primary);
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-top: var(--space-2);
}

/* Author Content */
.author-content {
    margin: var(--space-8) 0;
}

/* Author Posts Section */
.author-posts {
    margin-top: var(--space-12);
}

.author-posts h2 {
    font-size: var(--type-h2);
    font-weight: var(--weight-bold);
    color: var(--color-text-primary);
    margin: 0 0 var(--space-6) 0;
}

/* View Toggle */
.posts-view-toggle {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-8);
    flex-wrap: wrap;
}

.view-btn {
    padding: var(--space-2) var(--space-4);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--color-text-primary);
    transition: all var(--transition-smooth) var(--ease-smooth);
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    will-change: transform, background;

}

.filter-button:hover {
    background: var(--color-bg-hover);
    transform: translate3d(0, -1px, 0);
}

@supports (color: color-mix(in srgb, white, black)) {
    .filter-button:hover {
        background: color-mix(in srgb, var(--color-bg-hover) 95%, var(--color-primary));
    }
}

.filter-button:active {
    transform: translate3d(0, 0, 0);
}

.filter-button.active {
    background: var(--color-primary);
    color: var(--color-text-inverse);
    border-color: var(--color-primary);
}

@supports (color: color-mix(in srgb, white, black)) {
    .filter-button.active {
        background: color-mix(in srgb, var(--color-primary) 90%, black);
    }
}

/* Post List */
.post-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

/* Shared post card styling - article-card (post_card component) and legacy author-post-card */
.author-post-card,
.author-posts .post-list .article-card {
    padding: var(--space-6);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    transition: transform var(--transition-smooth) var(--ease-smooth),
        box-shadow var(--transition-smooth) var(--ease-smooth),
        background var(--transition-smooth) var(--ease-smooth);
    touch-action: manipulation;
    will-change: transform, box-shadow;
}

.author-post-card:hover,
.author-posts .post-list .article-card:hover {
    transform: translate3d(0, -2px, 0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@supports (color: color-mix(in srgb, white, black)) {
    .author-post-card:hover,
    .author-posts .post-list .article-card:hover {
        background: color-mix(in srgb, var(--color-bg-secondary) 95%, var(--color-primary));
    }
}

[data-theme="dark"] .author-post-card:hover,
[data-theme="dark"] .author-posts .post-list .article-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.post-card-content,
.author-posts .article-card .blog-card-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* Year/Tag Groups */
.year-group,
.tag-group {
    margin-bottom: var(--space-8);
}

.year-group h3,
.tag-group h3 {
    font-size: var(--text-xl);
    font-weight: var(--weight-semibold);
    color: var(--color-text-primary);
    margin: 0 0 var(--space-3) 0;
}

.post-list-compact {
    list-style: none;
    padding: 0;
    margin: 0;
}

.post-list-compact li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: var(--space-2) 0;
    border-block-end: 1px solid var(--color-border);
}

.post-list-compact li:last-child {
    border-block-end: none;
}

.post-list-compact a {
    color: var(--color-text-primary);
    text-decoration: none;
    flex: 1;
    transition: color var(--transition-smooth) var(--ease-smooth),
                transform var(--transition-fast) var(--ease-out);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.post-list-compact a:hover {
    color: var(--color-primary);
    transform: translate3d(4px, 0, 0);
}

@supports (color: color-mix(in srgb, white, black)) {
    .post-list-compact a:hover {
        color: color-mix(in srgb, var(--color-primary) 90%, black);
    }
}

.post-list-compact time {
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
    flex-shrink: 0;
    margin-inline-start: var(--space-4); /* Changed from margin-left */
}

/* Empty State */
.author-empty {
    padding: var(--space-12);
    text-align: center;
    color: var(--color-text-secondary);
}

/* Responsive */
@media (max-width: 640px) {
    .author-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .author-social {
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .author-header,
    .author-avatar-large,
    .author-avatar-placeholder,
    .social-link,
    .author-post-card,
    .author-posts .post-list .article-card,
    .view-btn {
        transition: none !important;
        animation: none !important;
        will-change: auto !important;
        transform: none !important;
    }
}
