/* ===================================
   Blog System - Using Main Site Design
   =================================== */

/* Additional Blog-Specific Styles */
/* Main site styles are loaded from /styles.css */
/* Header and Footer styles are in /styles.css - DO NOT override */

.blog-main {
    min-height: calc(100vh - 72px);
}

/* ===================================
   Hero Section
   =================================== */
.blog-hero {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    color: var(--text);
    padding: 4rem 0;
    text-align: center;
}

.blog-hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 600;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    opacity: 0.9;
    margin-bottom: 2rem;
    color: var(--muted);
}

/* Search Box */
.blog-search {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    gap: 0.5rem;
    background: var(--panel);
    border-radius: var(--radius);
    padding: 0.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--stroke);
}

.blog-search input {
    flex: 1;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    outline: none;
    background: transparent;
    color: var(--text);
}

.blog-search button {
    background: var(--accent);
    color: var(--text);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: calc(var(--radius) - 4px);
    cursor: pointer;
    transition: all .18s ease;
    font-weight: 600;
}

.blog-search button:hover {
    transform: translateY(-1px);
}

/* ===================================
   Category Filter
   =================================== */
.blog-categories {
    background: var(--panel);
    padding: 2rem 0;
    border-bottom: 1px solid var(--stroke);
}

.category-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.category-btn {
    background: var(--panel2);
    border: 1px solid var(--stroke);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all .18s ease;
    font-weight: 500;
    color: var(--text);
    font-size: 0.95rem;
}

.category-btn:hover,
.category-btn.active {
    background: var(--accent);
    color: var(--text);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* ===================================
   Blog Posts Grid
   =================================== */
.blog-posts {
    padding: 4rem 0;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); /* wider cards */
    gap: 2.5rem;
    margin-bottom: 3rem;
}

/* Post Card */
.post-card {
    background: var(--panel);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 18px 60px rgba(0,0,0,.45); /* stronger shadow */
    transition: transform .18s cubic-bezier(.4,2,.3,1), box-shadow .18s cubic-bezier(.4,2,.3,1);
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--stroke);
    position: relative;
}

.post-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 32px 80px rgba(37,99,235,.18), 0 8px 32px rgba(0,0,0,.32);
    border-color: var(--accent);
}

.post-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 8; /* more panoramic */
    background: var(--panel2);
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .18s cubic-bezier(.4,2,.3,1);
    border-bottom: 1px solid var(--stroke);
}

.post-card:hover .post-image img {
    transform: scale(1.07);
    filter: brightness(1.08) saturate(1.1);
}

.post-category {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--accent);
    color: var(--text);
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 600;
    box-shadow: var(--shadow);
    letter-spacing: .03em;
    z-index: 2;
}

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

.post-date {
    color: var(--muted);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    display: block;
}

.post-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.7rem;
    line-height: 1.35;
    letter-spacing: .01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-excerpt {
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 1.1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.92rem;
    color: var(--muted);
    border-top: 1px solid var(--stroke);
    padding-top: 0.7rem;
    margin-top: auto;
}

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

.pagination-btn {
    background: var(--panel);
    border: 1px solid var(--stroke);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all .18s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-numbers {
    display: flex;
    gap: 0.5rem;
}

.pagination-number {
    background: var(--panel);
    border: 1px solid var(--stroke);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all .18s ease;
    font-weight: 500;
    min-width: 45px;
    color: var(--text);
}

.pagination-number:hover,
.pagination-number.active {
    background: var(--accent);
    border-color: var(--accent);
}

/* ===================================
   Newsletter Section
   =================================== */
.blog-newsletter {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    padding: 4rem 0;
    color: var(--text);
}

.newsletter-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.newsletter-content p {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    color: var(--muted);
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    font-size: 1rem;
    outline: none;
    background: var(--panel);
    color: var(--text);
}

.newsletter-form button {
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--stroke);
    padding: 1rem 2rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    transition: all .18s ease;
    white-space: nowrap;
}

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

@media (max-width: 640px) {
    .newsletter-form {
        flex-direction: column;
    }
}

/* ===================================
   Footer
   =================================== */
/* Footer styles are in main site styles.css - DO NOT add footer styles here */

/* ===================================
   Individual Post Page
   =================================== */
.post-main {
    background: var(--bg);
    min-height: 100vh;
}

.post-article {
    max-width: 900px;
    padding: 2rem 1rem 4rem;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 2rem;
}

.breadcrumb ol {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
}

.breadcrumb li:not(:last-child)::after {
    content: '/';
    margin-left: 0.5rem;
    color: var(--muted);
}

.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Post Header */
.post-header {
    background: var(--panel);
    padding: 2rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--stroke);
}

.post-meta-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.post-header h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.post-meta-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--stroke);
}

.author-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.post-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: var(--muted);
}

/* Featured Image */
.post-featured-image {
    margin-bottom: 2rem;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

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

.post-featured-image figcaption {
    background: var(--panel);
    padding: 1rem;
    font-size: 0.875rem;
    color: var(--muted);
    text-align: center;
}

/* Post Content */
.post-content {
    background: var(--panel);
    padding: 3rem 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    line-height: 1.8;
    font-size: 1.0625rem;
    border: 1px solid var(--stroke);
}

.post-content .lead {
    font-size: 1.25rem;
    color: var(--muted);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.post-content h2 {
    font-size: 1.875rem;
    margin: 2.5rem 0 1rem;
    color: var(--text);
    scroll-margin-top: 100px;
}

.post-content h3 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: var(--text);
    scroll-margin-top: 100px;
}

.post-content h4 {
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem;
    color: var(--text);
}

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

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

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

.post-content a {
    color: var(--accent);
    text-decoration: underline;
}

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

.post-content strong {
    font-weight: 600;
    color: var(--text);
}

.post-content code {
    background: var(--panel2);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    color: var(--accent2);
}

/* Code Blocks */
.code-block {
    background: var(--panel2);
    color: var(--text);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin: 1.5rem 0;
    overflow-x: auto;
    box-shadow: var(--shadow);
    border: 1px solid var(--stroke);
}

.code-block pre {
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.code-block code {
    background: transparent;
    padding: 0;
    color: inherit;
}

/* Callout Box */
.post-callout {
    background: var(--panel2);
    border-left: 4px solid var(--accent);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin: 2rem 0;
}

.post-callout h3 {
    color: var(--accent2);
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
}

.post-callout p {
    margin: 0;
    color: var(--text);
}

/* Post Tags */
.post-tags {
    background: var(--panel);
    padding: 1.5rem 2rem;
    border-radius: var(--radius);
    margin-top: 2rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    border: 1px solid var(--stroke);
}

.post-tags strong {
    color: var(--text);
}

.post-tags a {
    background: var(--panel2);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    font-size: 0.875rem;
    transition: all .18s ease;
    border: 1px solid var(--stroke);
}

.post-tags a:hover {
    background: var(--accent);
    border-color: var(--accent);
}

/* Share Buttons */
.post-share {
    background: var(--panel);
    padding: 2rem;
    border-radius: var(--radius);
    margin-top: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--stroke);
}

.post-share h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.share-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.share-btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: all .18s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    background: var(--panel2);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    background: var(--accent);
}

/* Author Bio */
.author-bio {
    background: var(--panel);
    padding: 2rem;
    border-radius: var(--radius);
    margin-top: 2rem;
    box-shadow: var(--shadow);
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    border: 1px solid var(--stroke);
}

.author-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    flex-shrink: 0;
}

.author-bio-content h3 {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
}

.author-bio-content p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

/* Related Posts */
.related-posts {
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 2px solid var(--stroke);
}

.related-posts h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.related-post-card {
    background: var(--panel);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all .18s ease;
    border: 1px solid var(--stroke);
}

.related-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0,0,0,.45);
}

.related-post-card a {
    text-decoration: none;
    color: inherit;
}

.related-post-card img {
    width: 100%;
    height: auto;
    display: block;
}

.related-post-card h3 {
    padding: 1rem;
    font-size: 1.125rem;
    margin: 0;
}

.related-post-card time {
    padding: 0 1rem 1rem;
    display: block;
    font-size: 0.875rem;
    color: var(--muted);
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 768px) {
    .blog-hero {
        padding: 3rem 0;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .post-content {
        padding: 2rem 1.5rem;
    }
    
    .author-bio {
        flex-direction: column;
        text-align: center;
    }
    
    .pagination-numbers {
        display: none;
    }
}

/* ===================================
   Performance & Loading States
   =================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Print Styles */
@media print {
    .site-header,
    .site-footer,
    .blog-categories,
    .blog-newsletter,
    .post-share,
    .pagination,
    .breadcrumb {
        display: none;
    }
    
    .post-content {
        box-shadow: none;
    }
}