/* blog.css - All blog-specific styles */
:root {
    --primary-color: #333333;
    --secondary-color: #6d6d6d;
    --accent-color: #8b5a2b;
    --light-color: #f8f8f8;
    --dark-color: #222222;
}

/* Blog Listing Page */
.blog-header {
    padding: clamp(3rem, 6vw, 6rem) 0 2rem;
    text-align: center;
}

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

/* Category Filter */
.category-filter {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.category-filter button {
    padding: 0.8rem 1.5rem;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 0.9rem;
}

.category-filter button.active {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.category-filter button:hover:not(.active) {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Blog Posts Grid */
/* Updated Blog Posts Grid with Edge Protection */
.blog-posts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(350px, 100%), 1fr));
    gap: 2rem;
    padding: 2rem var(--page-padding); /* Added horizontal padding */
    margin: 0 auto;
    max-width: var(--max-content-width, 1400px); /* Optional max-width constraint */
    opacity: 1;
    transition: opacity 0.3s ease;
    box-sizing: border-box; /* Ensures padding is included in width */
}

/* If you need full-width background with contained content: */
.blog-section {
    padding: var(--section-padding) 0;
    background: var(--light-color); /* Example background */
}

.blog-section > .container { /* Optional container for better control */
    padding-left: var(--page-padding);
    padding-right: var(--page-padding);
    max-width: var(--max-content-width, 1400px);
    margin: 0 auto;
}


.blog-post {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.blog-post:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.blog-post img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.post-content {
    padding: 1.5rem;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    color: var(--secondary-color);
    font-size: 0.85rem;
}

.blog-post h2 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.blog-post h2 a {
    color: var(--primary-color);
    text-decoration: none;
}

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

.post-excerpt {
    margin-bottom: 1.25rem;
    color: var(--secondary-color);
    font-size: 0.95rem;
}

.read-more {
    font-weight: 600;
    color: var(--accent-color);
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-block;
}

/* Single Blog Post Page */
.full-blog-post {
    max-width: min(800px, 90%);
    margin: 4rem auto;
}

.post-header {
    margin-bottom: 3rem;
    text-align: center;
}

.post-header img {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.post-meta.single {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.post-body {
    line-height: 1.7;
    font-size: 1.05rem;
}

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

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 1rem 0;
}

/* Comments Section */
.comments-section {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.comment {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.comment:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.comment h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.comment-date {
    color: var(--secondary-color);
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
    display: block;
}

/* Loading States */
.loading-indicator {
    display: none;
    text-align: center;
    padding: 2rem;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid var(--accent-color);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-container {
    display: none;
    text-align: center;
    padding: 2rem;
    background: #ffeeee;
    border-radius: 8px;
    margin: 2rem auto;
    max-width: 600px;
    border: 1px solid #ffcccc;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .blog-posts {
        grid-template-columns: 1fr;
    }
    
    .post-meta.single {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
    
    .full-blog-post {
        margin: 2rem auto;
    }
}

@media (max-width: 480px) {
    .category-filter {
        flex-direction: column;
        align-items: center;
    }
    
    .category-filter button {
        width: 100%;
        max-width: 200px;
    }
}

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

.blog-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
}

.blog-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-card-content {
    padding: 1.5rem;
}

.blog-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.blog-meta {
    display: flex;
    justify-content: space-between;
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.btn-secondary {
    background-color: var(--secondary-color);
    margin-top: 2rem;
}

.btn-secondary:hover {
    background-color: var(--primary-color);
}

.loading-spinner {
    border: 3px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top: 3px solid var(--accent-color);
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Blog Grid - Matching Gallery Style */
.featured-blogs {
    padding: var(--section-padding) 0;
    background-color: var(--light-color);
}

.featured-blogs .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--page-padding);
}

.featured-blogs h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 1rem;
    color: var(--primary-color);
}

.featured-blogs h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background-color: var(--accent-color);
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}
.read-more {
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    align-self: flex-start;
    margin-top: auto;
}

.btn-secondary {
    background-color: var(--accent-color);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 4px;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.btn-secondary:hover {
    background-color: var(--primary-color);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 0 var(--page-padding);
}

.blog-post-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.blog-post-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.blog-post-content {
    padding: 1.5rem;
}

.blog-post-meta {
    display: flex;
    justify-content: space-between;
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.blog-post-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.blog-post-excerpt {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid var(--accent-color);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}