/* ============================================
   Blog Listing Page Styles
   Dark Fantasy Theme with Golden Accents
   Uses Design System Tokens from design-system.css
   ============================================ */

.blog-container {
    max-width: var(--page-max-width-xl);
    margin: 0 auto;
    padding: var(--page-padding-y) var(--page-padding-x);
}


/* Hero Header */
.blog-hero {
    text-align: center;
    padding: var(--space-3xl) var(--space-2xl);
    background: linear-gradient(145deg, var(--color-bg-elevated), var(--color-bg-elevated-alt));
    border: 1px solid var(--color-border-hover);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-2xl);
}

.hero-title {
    font-family: var(--font-display);
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    margin: 0 0 var(--space-lg) 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
    color: var(--color-text-secondary);
    font-size: var(--font-size-lg);
    margin: 0;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Filter Bar */
.filter-bar {
    background: var(--color-bg-elevated-alt);
    border: 1px solid var(--color-border-hover);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}

.filter-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: var(--space-xl);
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.filter-label {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.filter-input,
.filter-select {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-hover);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    color: var(--color-text-primary);
    font-size: var(--font-size-md);
    transition: all var(--transition-base);
    font-family: inherit;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.15);
    background: var(--color-bg-elevated);
}

.filter-input::placeholder {
    color: var(--color-text-tertiary);
}

.filter-select option {
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    padding: var(--space-sm);
}

.filter-button {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border: none;
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-2xl);
    color: var(--color-bg-base);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-base);
    cursor: pointer;
    transition: all var(--transition-base);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    align-self: flex-end;
}

.filter-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
}

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

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-2xl);
    margin-bottom: var(--space-3xl);
}

/* Blog Post Card */
.blog-post-card {
    display: flex;
    flex-direction: column;
    background: var(--color-bg-elevated-alt);
    border: 1px solid var(--color-border-hover);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-slow);
    cursor: pointer;
    height: 100%;
}

.blog-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(255, 215, 0, 0.3);
    border-color: rgba(255, 215, 0, 0.4);
}

.post-image-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: rgba(30, 41, 59, 0.8);
}

.post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-post-card:hover .post-image {
    transform: scale(1.05);
}

.post-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

/* Post Type Badge */
.post-type-badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: fit-content;
}

.badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-success {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-primary {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.badge-secondary {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-default {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

/* Post Title */
.post-title {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffd700;
    margin: 0;
    line-height: 1.3;
    transition: color 0.2s;
}

.blog-post-card:hover .post-title {
    color: #ffed4e;
}

/* Post Summary */
.post-summary {
    color: #cbd5e1;
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Post Tags */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.post-tag {
    padding: 0.25rem 0.75rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 4px;
    font-size: 0.8125rem;
    color: #94a3b8;
    transition: all 0.2s;
}

.post-tag:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: #ffd700;
    color: #ffd700;
}

.post-tag-more {
    padding: 0.25rem 0.75rem;
    font-size: 0.8125rem;
    color: #64748b;
    font-style: italic;
}

/* Post Metadata */
.post-metadata {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8125rem;
    color: #94a3b8;
    flex-wrap: wrap;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 215, 0, 0.1);
}

.metadata-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.metadata-icon {
    font-size: 1rem;
}

/* Read More Button */
.read-more-button {
    background: linear-gradient(135deg, #ffd700, #daa520);
    border: none;
    border-radius: 6px;
    padding: 0.75rem 1.5rem;
    color: #0f172a;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 1rem;
}

.read-more-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 4rem 2rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 215, 0, 0.1);
    border-radius: 10px;
    text-align: center;
}

.empty-state h3 {
    font-family: 'Cinzel', serif;
    color: #ffd700;
    margin: 0;
    font-size: 1.5rem;
}

.empty-state p {
    color: #94a3b8;
    margin: 0;
    font-size: 1rem;
}

/* Loading State */
.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem 2rem;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 215, 0, 0.1);
    border-top-color: #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.pagination-button {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    color: #f8fafc;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 40px;
    text-align: center;
}

.pagination-button:hover:not(:disabled) {
    background: rgba(255, 215, 0, 0.1);
    border-color: #ffd700;
}

.pagination-button.active {
    background: linear-gradient(135deg, #ffd700, #daa520);
    border-color: #ffd700;
    color: #0f172a;
}

.pagination-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-ellipsis {
    color: #64748b;
    padding: 0.5rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .filter-content {
        grid-template-columns: 1fr;
    }
    
    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .blog-hero {
        padding: 2rem 1rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .pagination-container {
        flex-wrap: wrap;
    }
}

/* ============================================
   Recent Posts Widget (Sidebar Component)
   Uses BlogPostCard for consistency
   ============================================ */

.recent-posts-widget {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 10px;
    padding: 1.5rem;
}

.widget-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(255, 215, 0, 0.2);
}

.widget-title {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffd700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.recent-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 450px));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Make blog cards more compact in the widget */
.recent-posts-widget .blog-post-card {
    font-size: 0.9rem;
}

.recent-posts-widget .post-title {
    font-size: 1.125rem;
}

.recent-posts-widget .post-summary {
    font-size: 0.875rem;
    -webkit-line-clamp: 2;
}

.recent-posts-widget .post-image-container {
    height: 150px;
}

.view-all-posts-button {
    width: 100%;
    background: transparent;
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 6px;
    padding: 0.75rem 1.5rem;
    color: #ffd700;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.view-all-posts-button:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: #ffd700;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
}

.no-posts-message {
    text-align: center;
    color: #94a3b8;
    padding: 2rem 1rem;
    font-size: 0.9375rem;
    margin: 0;
}

.recent-posts-widget .loading-container {
    padding: 2rem;
}

/* ============================================
   Blog Post Display (Full Article View)
   ============================================ */

.blog-post-page {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem 2rem;
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.875rem;
}

.breadcrumb-item {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-item:hover:not(.active) {
    color: #ffd700;
}

.breadcrumb-item.active {
    color: #cbd5e1;
    font-weight: 600;
}

.breadcrumb-separator {
    color: #64748b;
}

/* Article Header */
.article-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid rgba(255, 215, 0, 0.2);
}

.article-header .post-type-badge {
    margin: 0 auto 1.5rem;
}

.article-title {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    font-weight: 700;
    color: #ffd700;
    margin: 0 0 2rem 0;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Article Metadata */
.article-metadata {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin: 2rem auto;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 10px;
    max-width: 800px;
}

.metadata-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #daa520);
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    font-family: 'Cinzel', serif;
}

.author-name {
    font-weight: 600;
    color: #ffd700;
    font-size: 1rem;
}

.publish-date {
    font-size: 0.875rem;
    color: #94a3b8;
}

.metadata-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
    font-size: 0.875rem;
}

/* Article Tags */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.article-tags .post-tag {
    cursor: pointer;
}

/* Featured Image */
.featured-image-container {
    margin: 3rem auto;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 215, 0, 0.2);
    max-width: 1200px;
}

.featured-image {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: cover;
    display: block;
}

/* Article Content */
.article-content {
    max-width: 1400px;
    margin: 3rem auto;
    padding: 3rem 4rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 10px;
    line-height: 1.8;
    color: #cbd5e1;
}

/* Markdown Content Styling */
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
    font-family: 'Cinzel', serif;
    color: #ffd700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.article-content h1 {
    font-size: 2.25rem;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
    padding-bottom: 0.5rem;
}

.article-content h2 {
    font-size: 1.875rem;
}

.article-content h3 {
    font-size: 1.5rem;
}

.article-content p {
    margin-bottom: 1.5rem;
    font-size: 1.0625rem;
}

.article-content a {
    color: #60a5fa;
    text-decoration: underline;
    transition: color 0.2s;
}

.article-content a:hover {
    color: #93c5fd;
}

.article-content strong {
    color: #ffd700;
    font-weight: 600;
}

.article-content em {
    color: #e2e8f0;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content code {
    background: rgba(0, 0, 0, 0.4);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9375rem;
    color: #4ade80;
}

.article-content pre {
    background: rgba(0, 0, 0, 0.6);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
    border: 1px solid rgba(255, 215, 0, 0.1);
}

.article-content pre code {
    background: none;
    padding: 0;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.article-content blockquote {
    border-left: 4px solid #ffd700;
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #94a3b8;
}

/* Related Posts Section */
.related-posts-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 2px solid rgba(255, 215, 0, 0.2);
}

.related-posts-section .section-title {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    font-weight: 700;
    color: #ffd700;
    text-align: center;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Back Navigation */
.back-navigation {
    margin-top: 3rem;
    text-align: center;
}

.back-button {
    background: transparent;
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 6px;
    padding: 0.875rem 2rem;
    color: #ffd700;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.back-button:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: #ffd700;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .blog-post-page {
        padding: 1rem;
    }

    .article-title {
        font-size: 2rem;
    }

    .article-metadata {
        flex-direction: column;
        gap: 1rem;
    }

    .article-content {
        padding: 2rem 1.5rem;
    }

    .article-content h1 {
        font-size: 1.75rem;
    }

    .article-content h2 {
        font-size: 1.5rem;
    }
}
