/* =========================================
   ELAIA BLOG - Neo-Hellenic Theme Extension
   Extends public/styles.css
   ========================================= */

/* 
   NOTE: Core variables (colors, fonts, etc.) are inherited from styles.css.
   We only define blog-specific variables or overrides here.
*/

:root {
    /* Blog specific adjustments if needed */
}

/* === NAVBAR OVERRIDE FOR BLOG === */
/* Give navbar a solid background on blog pages (instead of transparent) */
.nav {
    background: var(--bg-primary);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

/* === BLOG SPECIFIC COMPONENTS === */

/* Hero Section overrides */
.blog-hero.hero {
    min-height: 50vh;
    padding-top: 120px;
    padding-bottom: 60px;
    background: transparent; /* Let body background show through */
}

.blog-hero .hero-title {
    font-size: clamp(36px, 6vw, 56px);
}

.blog-hero .hero-subtitle {
    margin-bottom: 0;
}

/* Categories Section */
.categories-section {
    background: var(--bg-secondary);
    padding: 30px 0;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.4s ease;
}

.categories-filter {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.category-btn {
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
}

.category-btn:hover {
    border-color: var(--elaia-purple);
    color: var(--elaia-purple);
    transform: translateY(-2px);
}

.category-btn.active {
    background: var(--gradient-brand);
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-purple);
}

/* Blog Posts Grid */
.blog-posts {
    padding: 60px 0;
    min-height: 500px;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.loading-container {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-secondary);
    border-top: 4px solid var(--elaia-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Post Card - Aligning with card-base */
.post-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    cursor: pointer;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-purple);
    border-color: var(--elaia-purple);
}

.post-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--border-color) 100%);
}

.post-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-category {
    display: inline-block;
    padding: 5px 12px;
    background: rgba(124, 58, 237, 0.1);
    color: var(--elaia-purple);
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
    align-self: flex-start;
}

.post-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.3;
    font-family: var(--font-display);
}

.post-excerpt {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.6;
    flex: 1;
}

.post-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 64px;
    color: var(--border-color);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

/* Article Page */
.article-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

.loading-article,
.error-state {
    text-align: center;
    padding: 100px 20px;
    min-height: 60vh;
}

.error-state i {
    font-size: 64px;
    color: var(--status-error);
    margin-bottom: 20px;
}

.error-state h2 {
    font-size: 32px;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.error-state p {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.breadcrumb {
    padding: 30px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--elaia-purple);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    text-decoration: underline;
    color: var(--elaia-purple-dark);
}

.article-header {
    text-align: center;
    padding: 20px 0 40px;
}

.article-category {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(124, 58, 237, 0.1);
    color: var(--elaia-purple);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.article-header h1 {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 20px;
}

.article-meta {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--text-secondary);
}

.featured-image {
    margin-bottom: 50px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Article Body Typography */
.article-body {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 50px;
    font-family: var(--font-body);
}

.article-body h2 {
    font-size: 32px;
    margin: 50px 0 24px;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.article-body h3 {
    font-size: 24px;
    margin: 40px 0 20px;
    color: var(--text-primary);
    font-weight: 600;
}

.article-body p {
    margin-bottom: 24px;
}

.article-body ul,
.article-body ol {
    margin: 24px 0 24px 20px;
    padding-left: 20px;
}

.article-body li {
    margin-bottom: 12px;
    position: relative;
}

.article-body a {
    color: var(--elaia-purple);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}

.article-body a:hover {
    color: var(--elaia-purple-dark);
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 40px 0;
    box-shadow: var(--shadow-sm);
}

.article-body blockquote {
    border-left: 4px solid var(--elaia-gold);
    padding: 24px 32px;
    margin: 40px 0;
    font-style: italic;
    color: var(--text-primary);
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.05) 0%, transparent 100%);
    border-radius: 0 12px 12px 0;
    font-family: var(--font-display);
    font-size: 22px;
    line-height: 1.6;
}

.article-body strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* Code blocks */
.article-body code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--elaia-purple);
}

.article-body pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 24px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 40px 0;
}

.article-body pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* --- Tables --- */
.article-body table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 40px 0;
    font-size: 15px;
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.article-body th {
    padding: 20px 24px;
    color: white;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 13px;
    background: linear-gradient(135deg, var(--elaia-purple) 0%, var(--elaia-purple-dark) 100%);
}

.article-body td {
    padding: 16px 24px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.article-body tr:last-child td {
    border-bottom: none;
}

.article-body tr:nth-child(even) {
    background: var(--bg-secondary);
}

.article-body td:first-child {
    font-weight: 600;
    color: var(--text-primary);
}

/* Responsive Tables */
@media (max-width: 768px) {
    .article-body table {
        display: block;
        overflow-x: auto;
    }
}

/* --- References --- */
.article-references {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 32px;
    margin: 60px 0 40px;
    border: 1px solid var(--border-color);
}

.article-references h2 {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--elaia-gold);
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
}

.article-references h2::before {
    content: '\f02d';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--elaia-gold);
}

.references-list {
    list-style: none;
    counter-reset: ref-counter;
}

.reference-item {
    position: relative;
    padding: 16px 16px 16px 48px;
    margin-bottom: 12px;
    background: var(--bg-card);
    border-radius: 10px;
    border-left: 3px solid var(--elaia-purple);
    font-size: 15px;
    line-height: 1.6;
    counter-increment: ref-counter;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    border-left-width: 3px;
}

.reference-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.reference-item::before {
    content: counter(ref-counter);
    position: absolute;
    left: 12px;
    top: 16px;
    width: 24px;
    height: 24px;
    background: var(--elaia-purple);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ref-authors { color: var(--text-primary); font-weight: 600; }
.ref-year { color: var(--elaia-purple); font-weight: 600; }
.ref-title { color: var(--text-secondary); }

.doi-link, .ref-link {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 12px;
    background: var(--bg-secondary);
    color: var(--elaia-purple) !important;
    text-decoration: none !important;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--elaia-purple);
    transition: all 0.2s;
}

.doi-link:hover, .ref-link:hover {
    background: var(--elaia-purple);
    color: white !important;
}

/* Tags */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
    padding: 30px 0;
    border-top: 1px solid var(--border-color);
}

.tag {
    padding: 6px 16px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.tag:hover {
    border-color: var(--elaia-purple);
    color: var(--elaia-purple);
}

/* Share */
.article-share {
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 40px;
    border: 1px solid var(--border-color);
}

.article-share h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-weight: 600;
}

.share-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.share-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    transition: transform 0.2s;
}

.share-btn:hover { transform: translateY(-2px); }
.share-btn.twitter { background: #1da1f2; }
.share-btn.facebook { background: #4267B2; }
.share-btn.linkedin { background: #0077b5; }
.share-btn.whatsapp { background: #25D366; }

/* CTA */
.article-cta {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    color: white;
    padding: 60px 40px;
    border-radius: 24px;
    text-align: center;
    margin-bottom: 60px;
    box-shadow: var(--shadow-purple);
    position: relative;
    overflow: hidden;
}

.article-cta::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 200px;
    height: 200px;
    background: var(--elaia-purple);
    opacity: 0.2;
    border-radius: 50%;
    filter: blur(50px);
}

.article-cta h3 {
    font-size: 32px;
    margin-bottom: 16px;
    font-family: var(--font-display);
    color: white;
}

.article-cta p {
    font-size: 18px;
    margin-bottom: 32px;
    opacity: 0.9;
    color: #e2e8f0;
}

.cta-button {
    display: inline-block;
    padding: 16px 36px;
    background: var(--elaia-gold);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.3);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(245, 158, 11, 0.4);
}

.back-to-blog {
    text-align: center;
    padding: 30px 0;
}

.back-to-blog a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s;
}

.back-to-blog a:hover {
    color: var(--elaia-purple);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .blog-hero.hero {
        min-height: 40vh;
        padding-top: 100px;
        padding-bottom: 40px;
    }

    .blog-hero .hero-title {
        font-size: 32px;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }

    .article-header h1 {
        font-size: 28px;
    }

    .article-body {
        font-size: 16px;
    }

    .article-meta {
        flex-direction: column;
        gap: 10px;
    }

    .article-cta {
        padding: 40px 20px;
    }
    
    .article-cta h3 {
        font-size: 24px;
    }

    .share-buttons {
        justify-content: center;
    }
}