/* ================================
   BLOG.CSS
   Blog listing and individual post styles
   Depends on: base.css
   ================================ */

/* ================================
   BLOG HERO SECTION
   ================================ */
.blog-hero {
    padding: 100px 0 60px;
    background: linear-gradient(135deg, #f5e6d3 0%, #e8d4b8 100%);
    position: relative;
    overflow: hidden;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(139, 69, 19, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(160, 82, 45, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.blog-hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.blog-hero h1 {
    font-size: 3rem;
    color: var(--brand-brown-dark);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.blog-subtitle {
    font-size: 1.3rem;
    color: var(--brand-brown-medium);
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* ================================
   FILTER BUTTONS IN HERO
   ================================ */
.blog-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid var(--brand-brown-dark);
    background: transparent;
    color: var(--brand-brown-dark);
    border-radius: 25px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 500;
    font-family: 'Crimson Text', serif;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

/* Button shine effect */
.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left var(--transition-medium);
}

.filter-btn:hover::before {
    left: 100%;
}

/* Active and hover states */
.filter-btn.active,
.filter-btn:hover {
    background: linear-gradient(45deg, var(--brand-brown-dark), var(--brand-brown-medium));
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

.filter-btn:active {
    transform: translateY(0);
}

/* ================================
   BLOG LISTING SECTION
   ================================ */
.blog-listing {
    padding: 80px 0;
    background: var(--bg-light-parchment);
    position: relative;
}

.blog-listing::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 70%, rgba(139, 69, 19, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 70% 30%, rgba(160, 82, 45, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

/* ================================
   BLOG GRID
   ================================ */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    position: relative;
    z-index: 1;
    margin-bottom: 3rem;
}

/* ================================
   BLOG CARD - Similar to Portfolio
   ================================ */
.blog-card {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
    border: 2px solid transparent;
    text-decoration: none;
    display: block;
    background: white;
}

.blog-card:hover {
    transform: translateY(-8px);
    border-color: rgba(139, 69, 19, 0.3);
    box-shadow: var(--shadow-lg);
}

/* Featured Image */
.blog-card-image {
    width: 100%;
    height: 280px;
    overflow: hidden;
    position: relative;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-fast);
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.08);
}

/* Category Badge - Top Right Corner */
.blog-category-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 15px;
    background: rgba(139, 69, 19, 0.9);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ================================
   CARD CAPTION - Hover Overlay
   Desktop: Shows on hover
   Mobile: Always visible
   ================================ */
.blog-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 50%, transparent 100%);
    color: white;
    padding: 8rem 1.5rem 1.5rem;
    transform: translateY(100%);
    transition: transform var(--transition-fast);
}

.blog-card:hover .blog-card-overlay {
    transform: translateY(0);
}

.blog-card-overlay h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.3rem;
    color: white;
    font-weight: 600;
    line-height: 1.3;
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.blog-meta-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.blog-meta-item i {
    font-size: 0.8rem;
}

.blog-excerpt {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ================================
   LOAD MORE BUTTON
   ================================ */
.blog-load-more {
    text-align: center;
    margin-top: 3rem;
}

.blog-load-more .btn {
    min-width: 200px;
}

/* Hide load more button when not needed */
.blog-load-more.hidden {
    display: none;
}

/* ================================
   INDIVIDUAL BLOG POST STYLES
   ================================ */
.post-header {
    padding: 120px 0 60px;
    background: linear-gradient(135deg, rgba(245, 245, 220, 0.95) 0%, rgba(240, 230, 210, 0.95) 100%);
    position: relative;
    border-bottom: 3px solid rgba(139, 69, 19, 0.2);
}

.post-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 70%, rgba(139, 69, 19, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 70% 30%, rgba(160, 82, 45, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.post-header-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.post-category {
    display: inline-block;
    background: linear-gradient(45deg, #8b4513, #a0522d);
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

.post-header h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: #1a1a1a;
}

.post-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    font-size: 1rem;
    color: #666;
}

.post-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-meta-item i {
    color: #8b4513;
}

/* ================================
   POST CONTENT
   ================================ */
.post-content {
    padding: 80px 0;
    background: rgba(255, 255, 255, 0.9);
}

.post-article {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(139, 69, 19, 0.1);
}

.post-featured-image {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.post-article h2 {
    color: #2c2c2c;
    margin-top: 2rem;
    margin-bottom: 1rem;
    text-align: left;
}

.post-article h3 {
    color: #8b4513;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.post-article p {
    color: #4a4a4a;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.post-article ul,
.post-article ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.post-article li {
    color: #4a4a4a;
    line-height: 1.8;
    margin-bottom: 0.5rem;
}

.post-article img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.post-article blockquote {
    border-left: 4px solid #8b4513;
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #666;
}

.post-article code {
    background: rgba(139, 69, 19, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.post-article pre {
    background: #2c2c2c;
    color: #f5f5f5;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
}

.post-article pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* ================================
   SOCIAL SHARE BUTTONS
   ================================ */
.post-share {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(139, 69, 19, 0.2);
    text-align: center;
}

.post-share h3 {
    margin-bottom: 1rem;
    color: #8b4513;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    color: white;
    font-weight: 600;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.share-btn i {
    font-size: 1.1rem;
}

/* Share button colors */
.share-twitter {
    background: #1DA1F2;
}

.share-facebook {
    background: #4267B2;
}

.share-linkedin {
    background: #0077B5;
}

.share-pinterest {
    background: #E60023;
}

.share-email {
    background: #8b4513;
}

/* ================================
   RELATED POSTS SECTION
   ================================ */
.related-posts {
    padding: 80px 0;
    background: rgba(248, 246, 240, 0.9);
}

.related-posts h2 {
    text-align: center;
    margin-bottom: 3rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.related-card {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    border: 2px solid transparent;
    text-decoration: none;
    display: block;
    background: white;
}

.related-card:hover {
    transform: translateY(-5px);
    border-color: rgba(139, 69, 19, 0.3);
    box-shadow: 0 20px 40px rgba(139, 69, 19, 0.2);
}

.related-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.related-card:hover img {
    transform: scale(1.05);
}

.related-card-content {
    padding: 1.5rem;
}

.related-label {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(139, 69, 19, 0.1);
    color: #8b4513;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.related-card h4 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    color: #2c2c2c;
}

.related-card p {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}

/* ================================
   PRINT STYLES
   ================================ */
@media print {
    /* Hide non-essential elements */
    .navbar,
    .breadcrumb,
    .post-share,
    .related-posts,
    .footer,
    .back-to-top {
        display: none !important;
    }
    
    /* Adjust post content for printing */
    .post-article {
        box-shadow: none;
        border: 1px solid #ddd;
        padding: 2rem;
    }
    
    .post-header {
        background: white;
        border-bottom: 2px solid #8b4513;
    }
    
    /* Ensure images fit page */
    .post-article img {
        max-width: 100%;
        page-break-inside: avoid;
    }
    
    /* Better text contrast */
    body {
        color: #000;
        background: white;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    /* Page breaks */
    h2, h3 {
        page-break-after: avoid;
    }
    
    p {
        orphans: 3;
        widows: 3;
    }
}

/* ================================
   MOBILE RESPONSIVE
   ================================ */
@media screen and (max-width: 768px) {
    .blog-hero {
        padding: 60px 0 40px;
    }
    
    .blog-hero h1 {
        font-size: 2rem;
    }
    
    .blog-subtitle {
        font-size: 1.1rem;
        padding: 0 1rem;
    }

/* Filter buttons on mobile */
    .blog-filters {
        gap: 0.5rem;
        padding: 0 1rem;
        margin-top: 1.5rem;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .blog-listing {
        padding: 60px 0;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .blog-card-image {
        height: 220px;
    }
    
    /* MOBILE: Always show captions */
    .blog-card-overlay {
        transform: translateY(0) !important;
        position: relative;
        padding: 1.2rem;
        background: rgba(0, 0, 0, 0.9);
        pointer-events: auto;
    }
    
    .blog-card:hover {
        transform: translateY(-3px);
    }
    
    .blog-card-overlay h3 {
        font-size: 1.1rem;
    }
    
    .blog-meta {
        font-size: 0.8rem;
        gap: 0.75rem;
    }
    
    /* Post Header */
    .post-header {
        padding: 100px 20px 60px;
    }
    
    .post-header h1 {
        font-size: 2rem;
    }
    
    .post-meta {
        gap: 1rem;
        flex-direction: column;
    }
    
    /* Post Content */
    .post-content {
        padding: 60px 0;
    }
    
    .post-article {
        padding: 1.5rem;
    }
    
    /* Related Posts */
    .related-posts {
        padding: 60px 0;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    /* Share Buttons */
    .share-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .share-btn {
        width: 100%;
        justify-content: center;
    }
}

@media screen and (max-width: 480px) {
    .blog-hero h1 {
        font-size: 1.5rem;
    }
    
    .post-header h1 {
        font-size: 1.5rem;
    }
    
    .post-article {
        padding: 1rem;
    }
}