/* =============================================
   BLOG STYLES - My Tally
   blog.css - Imported on all blog pages
   ============================================= */

/* --- Nav additions for blog pages --- */
.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-blog-link {
    color: var(--text-secondary, #8E8E93);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.nav-blog-link:hover {
    color: #ffffff;
}

/* --- Blog Hub Hero --- */
.blog-hero {
    text-align: center;
    padding: 7rem 5% 4rem 5%;
}

.blog-hero-content {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.blog-hero h1 {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1.05;
    color: #ffffff;
}

.blog-hero p {
    font-size: 1.15rem;
    color: #8E8E93;
    line-height: 1.7;
    max-width: 560px;
}

/* --- Blog Grid --- */
.blog-section {
    padding: 2rem 5% 6rem 5%;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

/* --- Blog Card --- */
.blog-card {
    background: #1C1C1C;
    border-radius: 24px;
    border: 1px solid #2C2C2E;
    overflow: hidden;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.35s ease, box-shadow 0.35s ease;
}

.blog-card:hover {
    transform: translateY(-8px);
    border-color: #B3FF00;
    box-shadow: 0 20px 50px rgba(179, 255, 0, 0.1);
}

.blog-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    background: #2C2C2E;
}

.blog-card-image-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #1C1C1C 0%, #2C2C2E 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.blog-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 12px;
}

.blog-card-date {
    font-size: 0.8rem;
    font-weight: 600;
    color: #B3FF00;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.35;
    margin: 0;
}

.blog-card-excerpt {
    font-size: 0.9rem;
    color: #8E8E93;
    line-height: 1.6;
    flex-grow: 1;
    margin: 0;
    /* Clamp to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid #2C2C2E;
}

.blog-card-author {
    font-size: 0.82rem;
    color: #8E8E93;
    font-weight: 500;
}

.blog-card-read-more {
    font-size: 0.82rem;
    font-weight: 700;
    color: #B3FF00;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.2s ease;
}

.blog-card:hover .blog-card-read-more {
    gap: 8px;
}

/* --- No posts state --- */
.blog-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: #8E8E93;
}

.blog-empty h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: #ffffff;
}

/* =============================================
   INDIVIDUAL POST STYLES
   ============================================= */

.post-article {
    max-width: 780px;
    margin: 0 auto;
    padding: 3rem 5% 6rem 5%;
}

.post-cover {
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 2.5rem;
    aspect-ratio: 16 / 9;
    background: #1C1C1C;
}

.post-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.back-to-blog {
    display: inline-block;
    color: #B3FF00;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    transition: opacity 0.2s ease;
}

.back-to-blog:hover {
    opacity: 0.7;
}

.post-header {
    margin-bottom: 2.5rem;
}

.post-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -1.5px;
    color: #ffffff;
    margin-bottom: 1.25rem;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    color: #8E8E93;
    font-size: 0.9rem;
}

.post-author,
.post-date {
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-author svg,
.post-date svg {
    stroke: #B3FF00;
    flex-shrink: 0;
}

/* --- Article Body Typography --- */
.post-content {
    color: #D1D1D6;
    font-size: 1.05rem;
    line-height: 1.85;
    border-top: 1px solid #2C2C2E;
    padding-top: 2.5rem;
    margin-bottom: 3rem;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
    color: #ffffff;
    font-weight: 700;
    line-height: 1.2;
    margin: 2rem 0 1rem 0;
}

.post-content h2 { font-size: 1.75rem; letter-spacing: -0.5px; }
.post-content h3 { font-size: 1.35rem; }

.post-content p { margin-bottom: 1.25rem; }

.post-content a {
    color: #B3FF00;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.post-content ul,
.post-content ol {
    margin: 0 0 1.25rem 1.5rem;
}

.post-content li { margin-bottom: 0.4rem; }

.post-content blockquote {
    border-left: 3px solid #B3FF00;
    margin: 1.5rem 0;
    padding: 0.75rem 1.25rem;
    background: rgba(179, 255, 0, 0.05);
    border-radius: 0 12px 12px 0;
    color: #8E8E93;
    font-style: italic;
}

.post-content code {
    background: #2C2C2E;
    border-radius: 6px;
    padding: 2px 7px;
    font-size: 0.9em;
    font-family: 'Courier New', monospace;
    color: #B3FF00;
}

.post-content pre {
    background: #1C1C1C;
    border: 1px solid #2C2C2E;
    border-radius: 12px;
    padding: 1.5rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.post-content pre code {
    background: none;
    padding: 0;
    color: #D1D1D6;
}

.post-content img {
    width: 100%;
    border-radius: 16px;
    margin: 1.5rem 0;
}

.post-content strong { color: #ffffff; }

/* --- Post CTA box --- */
.post-cta-box {
    background: linear-gradient(135deg, #1C1C1C 0%, #242424 100%);
    border: 1px solid #B3FF00;
    border-radius: 24px;
    padding: 2.5rem;
    text-align: center;
}

.post-cta-box h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.75rem;
}

.post-cta-box p {
    color: #8E8E93;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .blog-hero {
        padding: 5rem 5% 3rem 5%;
    }
    
    .blog-hero h1 {
        font-size: 2.75rem;
        letter-spacing: -1.2px;
    }
    
    .blog-hero p {
        font-size: 1.05rem;
    }
    
    .post-title {
        font-size: 2.25rem;
        letter-spacing: -0.8px;
    }
    
    .post-article {
        padding: 2.5rem 5% 5rem 5%;
    }
    
    .post-content {
        padding-top: 2rem;
    }
    
    .post-cta-box {
        padding: 2rem;
    }
    
    .post-cta-box h3 {
        font-size: 1.4rem;
    }
}

@media (max-width: 600px) {
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .blog-hero {
        padding: 4rem 5% 2.5rem 5%;
    }
    
    .blog-hero h1 {
        font-size: 2.25rem;
    }
    
    .blog-section {
        padding: 1rem 5% 4rem 5%;
    }
    
    .post-title {
        font-size: 1.85rem;
    }
    
    .post-article {
        padding: 2rem 5% 4rem 5%;
    }
    
    .post-content {
        font-size: 1rem;
        padding-top: 1.5rem;
    }
    
    .post-content h2 {
        font-size: 1.5rem;
    }
    
    .post-content h3 {
        font-size: 1.25rem;
    }
    
    .post-cta-box {
        padding: 1.75rem 1.25rem;
        border-radius: 20px;
    }
    
    .post-cta-box h3 {
        font-size: 1.3rem;
    }
    
    .post-cta-box p {
        font-size: 0.92rem;
        margin-bottom: 1.25rem;
    }
}

@media (max-width: 480px) {
    .blog-hero h1 {
        font-size: 2rem;
    }
    
    .blog-card-body {
        padding: 1.25rem;
        gap: 8px;
    }
    
    .blog-card-title {
        font-size: 1.15rem;
    }
    
    .blog-card-excerpt {
        font-size: 0.85rem;
    }
    
    .post-meta {
        flex-wrap: wrap;
        gap: 12px 16px;
        font-size: 0.85rem;
    }
}
