/* ============================================
   Blog-Specific Styles
   Extends main styles.css with blog layouts
   ============================================ */

/* Fix logo when it's a link */
a.logo {
    text-decoration: none;
    color: inherit;
}

a.logo:hover {
    opacity: 0.9;
}

/* Ensure nav active state works */
.nav-links a.active {
    color: var(--primary);
}

/* Blog Header */
.blog-header {
    background: linear-gradient(135deg, #0a0e1a 0%, #1a1f2e 100%);
    padding: 6rem 0 4rem;
    border-bottom: 2px solid var(--border-strong);
}

.blog-header-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.blog-header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.blog-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Featured Post */
.featured-post-section {
    padding: 4rem 0;
    background: var(--bg-primary);
}

.featured-post {
    background: var(--bg-secondary);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.featured-badge {
    position: absolute;
    top: 2rem;
    left: 2rem;
    background: var(--primary);
    color: var(--bg-primary);
    padding: 0.5rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 2;
    border-radius: 2px;
}

.featured-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 3rem;
    position: relative;
    z-index: 1;
}

.featured-image {
    position: relative;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
}

.featured-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-text h2 {
    font-size: 2rem;
    margin: 1rem 0;
    line-height: 1.3;
}

.featured-text p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Post Meta */
.post-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.post-category {
    background: rgba(191, 255, 0, 0.1);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 2px;
    font-weight: 600;
}

.post-date, .post-reading-time {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Blog Layout */
.blog-posts {
    padding: 4rem 0 6rem;
    background: var(--bg-primary);
}

.blog-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 4rem;
}

.blog-main {
    min-width: 0; /* Prevents grid blowout */
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.post-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.post-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

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

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

.post-category-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(10, 14, 26, 0.9);
    backdrop-filter: blur(10px);
    color: var(--primary);
    padding: 0.5rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid var(--border-strong);
    border-radius: 2px;
}

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

.post-content h3 {
    font-size: 1.25rem;
    margin: 0.5rem 0 1rem;
    line-height: 1.4;
}

.post-content h3 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-content h3 a:hover {
    color: var(--primary);
}

.post-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex: 1;
}

.post-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s ease;
}

.post-link:hover {
    gap: 1rem;
}

/* Sidebar */
.blog-sidebar {
    position: sticky;
    top: 2rem;
    align-self: start;
}

.sidebar-widget {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.sidebar-widget h3 {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

/* Popular Posts */
.popular-posts {
    list-style: none;
    padding: 0;
    margin: 0;
}

.popular-posts li {
    margin-bottom: 1.5rem;
}

.popular-posts li:last-child {
    margin-bottom: 0;
}

.popular-posts a {
    display: flex;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.popular-posts a:hover {
    color: var(--primary);
}

.popular-number {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    background: rgba(191, 255, 0, 0.1);
    color: var(--primary);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 700;
}

.popular-title {
    line-height: 1.4;
    font-size: 0.9375rem;
}

/* Categories */
.categories {
    list-style: none;
    padding: 0;
    margin: 0;
}

.categories li {
    margin-bottom: 0.75rem;
}

.categories a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(191, 255, 0, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.categories a:hover {
    background: rgba(191, 255, 0, 0.1);
    border-color: var(--border-strong);
}

.categories a span {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 2px;
}

/* Sidebar CTA */
.sidebar-cta {
    background: linear-gradient(135deg, rgba(191, 255, 0, 0.05) 0%, rgba(191, 255, 0, 0.02) 100%);
    border-color: var(--border-strong);
    text-align: center;
}

.cta-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.sidebar-cta h3 {
    border: none;
    padding: 0;
    margin-bottom: 0.75rem;
}

.sidebar-cta p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Newsletter Form */
.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.newsletter-form input {
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.newsletter-form input::placeholder {
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 968px) {
    .blog-header h1 {
        font-size: 2.5rem;
    }

    .blog-subtitle {
        font-size: 1.125rem;
    }

    .featured-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem;
    }

    .featured-image {
        height: 250px;
    }

    .blog-layout {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .blog-sidebar {
        position: static;
    }

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

@media (max-width: 640px) {
    .blog-header {
        padding: 4rem 0 3rem;
    }

    .blog-header h1 {
        font-size: 2rem;
    }

    .featured-content {
        padding: 1.5rem;
    }

    .featured-text h2 {
        font-size: 1.5rem;
    }

    .post-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}
