/* ===================================
   BLOG PAGE - MAGAZINE STYLE
   =================================== */

/* Blog Hero Section */
.blog-hero {
    position: relative;
    height: 60vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: var(--spacing-xl);
}

.blog-hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/coffee-cherries.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 1;
}

.blog-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    max-width: 800px;
    padding: var(--spacing-md);
}

.blog-hero h1 {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.02em;
}

.blog-hero p {
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 300;
    opacity: 0.9;
}

/* Main Blog Layout */
.blog-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

/* ===================================
   SIDEBAR
   =================================== */
.blog-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-section {
    background: var(--bg-light);
    border: 1px solid var(--border-muted);
    border-radius: 12px;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.sidebar-section h3 {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--primary);
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
}

.categories-list {
    list-style: none;
}

.categories-list li {
    margin-bottom: 0.75rem;
}

.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    color: var(--text);
}

.category-link:hover {
    background: var(--bg-dark);
    color: var(--primary);
    transform: translateX(4px);
}

.category-count {
    font-size: 0.875rem;
    color: var(--text-muted);
    background: var(--bg-dark);
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
}

/* Recent Posts in Sidebar */
.recent-posts-list {
    list-style: none;
}

.recent-post-item {
    display: flex;
    gap: 0.75rem;
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-muted);
}

.recent-post-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.recent-post-thumb {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.recent-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.recent-post-item:hover .recent-post-thumb img {
    transform: scale(1.1);
}

.recent-post-info h4 {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.25rem;
    color: var(--text);
    transition: color 0.2s ease;
}

.recent-post-item:hover .recent-post-info h4 {
    color: var(--primary);
}

.recent-post-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===================================
   BLOG POSTS GRID (MASONRY STYLE)
   =================================== */
.blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--spacing-md);
    grid-auto-flow: dense;
}

/* Blog Post Card */
.blog-post-card {
    background: var(--bg-light);
    border: 1px solid var(--border-muted);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
    cursor: pointer;
}

.blog-post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    border-color: var(--primary);
}

/* Masonry Variations */
.blog-post-card.featured {
    grid-column: span 2;
    grid-row: span 2;
}

.blog-post-card.tall {
    grid-row: span 2;
}

.blog-post-card.wide {
    grid-column: span 2;
}

/* Animation Delays */
.blog-post-card:nth-child(1) { animation-delay: 0.1s; }
.blog-post-card:nth-child(2) { animation-delay: 0.2s; }
.blog-post-card:nth-child(3) { animation-delay: 0.3s; }
.blog-post-card:nth-child(4) { animation-delay: 0.4s; }
.blog-post-card:nth-child(5) { animation-delay: 0.5s; }
.blog-post-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Post Image */
.post-image {
    position: relative;
    overflow: hidden;
    height: 250px;
}

.blog-post-card.featured .post-image {
    height: 400px;
}

.blog-post-card.tall .post-image {
    height: 350px;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.blog-post-card:hover .post-image img {
    transform: scale(1.08);
}

/* Post Content */
.post-content {
    padding: var(--spacing-md);
}

.blog-post-card.featured .post-content {
    padding: var(--spacing-lg);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    font-size: 0.875rem;
}

.post-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary);
    color: var(--bg-dark);
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.post-date {
    color: var(--text-muted);
}

.post-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: var(--spacing-sm);
    color: var(--text);
}

.blog-post-card.featured .post-title {
    font-size: 2rem;
}

.post-excerpt {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-post-card.featured .post-excerpt {
    -webkit-line-clamp: 4;
    line-clamp: 4;
    font-size: 1rem;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.875rem;
    transition: gap 0.3s ease;
}

.read-more:hover {
    gap: 0.75rem;
}

.read-more::after {
    content: '→';
    font-size: 1.25rem;
}

/* ===================================
   PAGINATION
   =================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: var(--spacing-xl) 0;
    padding: var(--spacing-md) 0;
}

.pagination-btn,
.pagination-number {
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--bg-light);
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
}

.pagination-btn:hover,
.pagination-number:hover {
    background: var(--primary);
    color: var(--bg-dark);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.pagination-number.active {
    background: var(--primary);
    color: var(--bg-dark);
    border-color: var(--primary);
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-btn:disabled:hover {
    background: var(--bg-light);
    color: var(--text);
    transform: none;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */
@media (max-width: 1200px) {
    .blog-container {
        grid-template-columns: 250px 1fr;
        gap: var(--spacing-md);
    }
}

@media (max-width: 992px) {
    .blog-container {
        grid-template-columns: 1fr;
    }

    .blog-sidebar {
        position: relative;
        top: 0;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: var(--spacing-md);
    }

    .blog-posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .blog-post-card.featured,
    .blog-post-card.wide {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .blog-hero {
        height: 50vh;
        min-height: 350px;
    }

    .blog-posts-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .blog-post-card.featured,
    .blog-post-card.tall {
        grid-row: span 1;
    }

    .blog-post-card.featured .post-image,
    .blog-post-card.tall .post-image {
        height: 250px;
    }

    .post-title {
        font-size: 1.25rem;
    }

    .blog-post-card.featured .post-title {
        font-size: 1.5rem;
    }

    .blog-sidebar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .blog-container {
        padding: 0 var(--spacing-sm);
    }

    .sidebar-section {
        padding: var(--spacing-sm);
    }

    .post-content {
        padding: var(--spacing-sm);
    }

    .blog-post-card.featured .post-content {
        padding: var(--spacing-md);
    }
}

/* Light Mode Adjustments */
body.light-mode .blog-post-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

body.light-mode .category-link:hover {
    background: var(--bg);
}
