/**
 * Blog Styles
 * 
 * Blog archive, single posts, post cards, author bio
 * Dark Mode Compatible
 * 
 * @package Commerce_Elite
 */

/* ============================================
   BLOG ARCHIVE / INDEX
   ============================================ */

.blog-posts-grid,
.archive-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

/* ============================================
   POST CARD
   ============================================ */

.post-card {
    display: flex;
    flex-direction: column;
    background: var(--color-background);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
    height: 100%;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(34, 113, 177, 0.2);
}

/* Post thumbnail */
.post-thumbnail {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--color-surface);
}

.post-thumbnail a {
    display: block;
    width: 100%;
    height: 100%;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.05);
}

/* Sticky badge */
.sticky-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: var(--color-primary);
    color: #ffffff;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
}

/* Post content */
.post-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-grow: 1;
}

/* Post meta */
.post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.post-meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.post-meta-item svg {
    width: 0.875rem;
    height: 0.875rem;
}

.post-author a,
.post-categories a {
    color: var(--color-primary);
    font-weight: var(--font-weight-medium);
}

.post-author a:hover,
.post-categories a:hover {
    text-decoration: underline;
}

/* Post title */
.post-card-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    margin: 0;
}

.post-card-title a {
    color: var(--color-text);
}

.post-card-title a:hover {
    color: var(--color-primary);
}

/* Post excerpt */
.post-excerpt {
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
    color: var(--color-text-light);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Read more */
.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-primary);
    margin-top: auto;
    transition: gap var(--transition-fast);
}

.read-more:hover {
    gap: 0.625rem;
}

.read-more svg {
    width: 1rem;
    height: 1rem;
}

/* ============================================
   SINGLE POST
   ============================================ */

.single-post .site-content {
    max-width: var(--container-md);
}

/* Post header */
.post-header {
    margin-bottom: 2rem;
}

.post-header .post-meta {
    margin-bottom: 1rem;
    justify-content: flex-start;
}

.post-title {
    font-size: var(--font-size-4xl);
    line-height: var(--line-height-tight);
    margin-bottom: 1.5rem;
}

/* Featured image */
.post-featured-image {
    margin-bottom: 3rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.post-featured-image figcaption {
    padding: 1rem;
    background: var(--color-surface);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    text-align: center;
}

/* Post content */
.post-content {
    font-size: var(--font-size-md);
    line-height: var(--line-height-relaxed);
}

.post-content > * + * {
    margin-top: 1.5rem;
}

.post-content h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.post-content h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.post-content img {
    border-radius: var(--radius-md);
}

.post-content blockquote {
    background: var(--color-surface);
    border-left: 4px solid var(--color-primary);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: var(--radius-md);
}

/* ============================================
   POST FOOTER
   ============================================ */

.post-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

/* Post tags */
.post-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.post-tags span {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
}

.post-tags a {
    display: inline-flex;
    padding: 0.375rem 0.75rem;
    background: var(--color-surface);
    color: var(--color-text);
    font-size: var(--font-size-xs);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.post-tags a:hover {
    background: var(--color-primary);
    color: #ffffff;
}

/* Social share */
.social-share {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.social-share-label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
}

.social-share-buttons {
    display: flex;
    gap: 0.5rem;
}

.social-share-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    color: var(--color-text);
    transition: all var(--transition-fast);
}

.social-share-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.social-share-button.facebook:hover {
    background: #1877f2;
    color: #ffffff;
}

.social-share-button.twitter:hover {
    background: #1da1f2;
    color: #ffffff;
}

.social-share-button.linkedin:hover {
    background: #0077b5;
    color: #ffffff;
}

.social-share-button.pinterest:hover {
    background: #e60023;
    color: #ffffff;
}

.social-share-button svg {
    width: 1.125rem;
    height: 1.125rem;
}

/* ============================================
   AUTHOR BIO
   ============================================ */

.author-bio {
    display: flex;
    gap: 1.5rem;
    background: var(--color-surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-top: 3rem;
}

.author-avatar {
    flex-shrink: 0;
}

.author-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--color-border);
}

.author-info {
    flex: 1;
}

.author-name {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin-bottom: 0.5rem;
}

.author-name a {
    color: var(--color-text);
}

.author-name a:hover {
    color: var(--color-primary);
}

.author-description {
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
    color: var(--color-text-light);
    margin-bottom: 1rem;
}

.author-links {
    display: flex;
    gap: 0.75rem;
}

.author-link {
    font-size: var(--font-size-sm);
    color: var(--color-primary);
}

/* ============================================
   POST NAVIGATION (Previous/Next)
   ============================================ */

.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.nav-previous,
.nav-next {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-next {
    align-items: flex-end;
    text-align: right;
}

.nav-label {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}

.nav-title {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.nav-title:hover {
    color: var(--color-primary);
}

/* ============================================
   COMMENTS
   ============================================ */

.comments-area {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--color-border);
}

.comments-title {
    margin-bottom: 2rem;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
}

.comment {
    padding: 1.5rem;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.comment-body {
    display: flex;
    gap: 1rem;
}

.comment-author {
    flex-shrink: 0;
}

.comment-author img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.comment-content-wrap {
    flex: 1;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.comment-author-name {
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
}

.comment-date {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.comment-text {
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
    color: var(--color-text-light);
}

.reply {
    margin-top: 0.75rem;
}

.reply a {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-primary);
}

/* Nested comments */
.children {
    list-style: none;
    padding-left: 2rem;
    margin-top: 1rem;
}

/* Comment form */
.comment-respond {
    background: var(--color-surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
}

.comment-reply-title {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

/* ============================================
   CATEGORY/TAG ARCHIVE HEADER
   ============================================ */

.archive-header {
    text-align: center;
    padding: 3rem 0;
    margin-bottom: 3rem;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
}

.archive-title {
    font-size: var(--font-size-3xl);
    margin-bottom: 0.5rem;
}

.archive-description {
    font-size: var(--font-size-md);
    line-height: var(--line-height-relaxed);
    color: var(--color-text-light);
    max-width: 600px;
    margin: 0 auto;
}

.archive-count {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-top: 1rem;
}

/* ============================================
   SEARCH RESULTS
   ============================================ */

.search-header {
    padding: 2rem;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.search-results-count {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-top: 0.5rem;
}

/* No results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
}

.no-results-title {
    font-size: var(--font-size-2xl);
    margin-bottom: 1rem;
}

.no-results-content {
    font-size: var(--font-size-md);
    color: var(--color-text-light);
    margin-bottom: 2rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .blog-posts-grid,
    .archive-posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .post-title {
        font-size: var(--font-size-2xl);
    }
    
    .post-content {
        font-size: var(--font-size-base);
    }
    
    .author-bio {
        flex-direction: column;
        text-align: center;
    }
    
    .post-navigation {
        flex-direction: column;
    }
    
    .nav-next {
        align-items: flex-start;
        text-align: left;
    }
    
    .comment-body {
        flex-direction: column;
    }
    
    .children {
        padding-left: 1rem;
    }
}

/* ============================================
   DARK MODE ADJUSTMENTS
   ============================================ */

body.dark-mode .sticky-badge {
    box-shadow: var(--shadow-md);
}

body.dark-mode .social-share-button {
    backdrop-filter: blur(10px);
}