/* css/blog.css */

/* Blog Hero Section */
.blog-hero-section {
    text-align: center;
    padding-top: 0;
    padding-bottom: 2rem;
}
.blog-hero-section h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}
.blog-hero-section p {
    font-size: 1.125rem;
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
}

/* === HORIZONTAL CATEGORIES SECTION === */
.horizontal-categories-section {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(173, 82, 7, 0.1);
    /* Visible on mobile and tablet, hidden on desktop */
    display: block;
}

.categories-slider-container {
    position: relative;
    overflow: hidden;
}

.categories-slider {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem 0;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.categories-slider::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.category-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: #fff;
    border: 1px solid rgba(173, 82, 7, 0.2);
    border-radius: 9999px;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.category-pill:hover {
    background-color: #fff0e1;
    border-color: #e88e07;
    color: #ad5207;
    transform: translateY(-1px);
}

.category-pill.active {
    background-color: #ad5207;
    border-color: #ad5207;
    color: white;
    box-shadow: 0 2px 8px rgba(173, 82, 7, 0.3);
}

.category-pill.active:hover {
    background-color: #92450a;
    transform: translateY(-1px);
}

/* Main Blog Section Layout */
.blog-main-section {
    padding-top: 1rem;
    padding-bottom: 3rem;
}

.blog-layout-grid {
    display: grid;
    grid-template-columns: 1fr; /* Default to 1 column for mobile */
    gap: 3rem;
}

/* Area for the main blog posts */
.blog-posts-area {
    /* No special styles needed */
}

.grid-container-blog-posts {
    display: grid;
    /* Mobile-first: 1 column by default */
    grid-template-columns: repeat(1, 1fr);
    gap: 2.5rem;
}

/* === ENHANCED BLOG CARD STYLES === */
.blog-post-card {
    background: linear-gradient(135deg, #fffaf2 0%, #fff8ed 100%);
    border-radius: 1.25rem;
    box-shadow: 0 4px 20px rgba(173, 82, 7, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid rgba(173, 82, 7, 0.1);
    text-align: left;
}
.blog-post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(173, 82, 7, 0.15), 0 4px 20px rgba(0, 0, 0, 0.1);
}
.blog-post-card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.blog-post-card:hover img {
    transform: scale(1.05);
}
.blog-post-card .card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.blog-post-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}
.blog-post-card p.excerpt {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}
.blog-post-card .card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    border-top: 1px solid rgba(173, 82, 7, 0.1);
    padding-top: 1rem;
    margin-top: auto;
}
.blog-post-card .read-more-link {
    display: inline-block;
    margin-top: 1rem;
    font-weight: 600;
    text-decoration: none;
    align-self: flex-start;
    background-color: #ad5207;
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 9999px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.blog-post-card .read-more-link:hover {
    background-color: #e88e07;
    transform: translateY(-2px);
    color: white;
}

/* Sidebar Styles */
.blog-sidebar {
    /* Visible on mobile, hidden on tablet/desktop */
}
.sidebar-widget {
    background-color: #fffaf2;
    padding: 1.5rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(173, 82, 7, 0.1);
}
.sidebar-widget .widget-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ad5207;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e88e07;
}
.widget-list {
    list-style: none; padding: 0; margin: 0;
}
.widget-list li { margin-bottom: 0.75rem; }
.widget-list li a { 
    text-decoration: none; 
    color: #374151; 
    transition: all 0.3s ease;
    display: inline-block;
    background-color: #fff0e1;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    border: 1px solid #e88e07;
}
.widget-list li a:hover { 
    background-color: #e88e07; 
    color: white; 
}

/* Sidebar Search Form */
.search-form {
    position: relative;
    display: flex;
}

.search-input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem;
    border: 1px solid rgba(173, 82, 7, 0.2);
    border-radius: 9999px;
    background-color: #fff;
    color: #374151;
    font-size: 0.875rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #e88e07;
    box-shadow: 0 0 0 3px rgba(232, 142, 7, 0.2);
}

.search-button {
    position: absolute;
    right: 0.25rem;
    top: 50%;
    transform: translateY(-50%);
    background-color: #ad5207;
    color: white;
    border: none;
    border-radius: 50%;
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.search-button:hover {
    background-color: #e88e07;
}


/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}
.pagination-container > * + * { margin-left: 0.5rem; }
.pagination-container a {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: background-color 0.3s, color 0.3s;
    text-decoration: none;
    font-weight: 500;
}
.pagination-container a.active-page { background-color: #ad5207; color: white; }
.pagination-container a.inactive-page { background-color: white; color: #374151; border: 1px solid #e5e7eb; }
.pagination-container a.inactive-page:hover { background-color: #f3f4f6; }

/* ====== RESPONSIVE STYLES ====== */

/* Mobile View (default - up to 767px) */
.grid-container-blog-posts {
    display: grid;
    grid-template-columns: repeat(1, 1fr); /* 1 column on mobile */
    gap: 2.5rem;
}

/* Show horizontal categories on mobile/tablet, hide sidebar */
.blog-sidebar {
    display: none;
}
.horizontal-categories-section {
    display: block;
}

/* ADD THESE NEW STYLES TO YOUR blog.css FILE */

/* --- Featured Post Section --- */
.featured-post-section {
    padding: 2rem 0;
}
.featured-post-card {
    display: grid;
    grid-template-columns: 1fr;
    background-color: #fffaf2;
    border-radius: 1rem;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.3s ease;
    border: 1px solid #eee;
}
.featured-post-card:hover {
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
}

/* FIXED: Featured image container with proper aspect ratio */
.featured-image-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.featured-image-container img {
    width: 100%;
    aspect-ratio: 16 / 9; /* Same as other blog post images */
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.featured-post-card:hover .featured-image-container img {
    transform: scale(1.05);
}

.featured-content-container {
    padding: 2rem;
}
.featured-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: #ad5207;
    color: white;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
.featured-content-container h2 {
    font-size: 1.5rem;
    margin: 0 0 1rem 0;
    line-height: 1.3;
}
.featured-content-container .excerpt {
    font-size: 1.1rem;
    color: #4B5563;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .featured-post-card {
        grid-template-columns: 1fr 1fr;
    }
    .featured-image-container {
        height: auto; /* Allow natural height */
    }
    .featured-image-container img {
        width: 100%;
        aspect-ratio: 16 / 9; /* Maintain 16:9 aspect ratio on desktop too */
        object-fit: cover;
    }
    .featured-content-container {
        padding: 3rem;
    }
    .featured-content-container h2 {
        font-size: 1.75rem;
    }
}


/* --- New Sidebar Widget Styles --- */
.widget-list-condensed {
    list-style: none;
    padding: 0;
    margin: 0;
}
.widget-list-condensed li a {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    transition: color 0.2s ease;
}
.widget-list-condensed li:last-child a {
    border-bottom: none;
}
.widget-list-condensed li a:hover {
    color: #ad5207;
}

.subscribe-widget {
    background-color: #fffaf2;
    padding: 1.5rem;
    border-radius: 0.5rem;
    text-align: center;
}
.subscribe-widget p {
    font-size: 0.9rem;
    color: #4B5563;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
}
.subscribe-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    margin-bottom: 0.75rem;
}
.subscribe-button {
    width: 100%;
}
/* Tablet View (768px to 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    /* Keep horizontal categories, hide sidebar */
    .horizontal-categories-section {
        display: block;
    }
    .blog-sidebar {
        display: none;
    }
    
    .grid-container-blog-posts {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on tablet */
        gap: 1.5rem; /* Smaller gap for tablet */
    }
    
    /* Keep single column layout for main content */
    .blog-layout-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Scale down blog post card content for tablet */
    .blog-post-card .card-content {
        padding: 1rem;
    }
    
    .blog-post-card h3 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .blog-post-card p.excerpt {
        font-size: 0.8rem;
        line-height: 1.5;
        margin-bottom: 1rem;
    }
    
    .blog-post-card .card-meta {
        font-size: 0.75rem;
        padding-top: 0.75rem;
    }
    
    .blog-post-card .read-more-link {
        font-size: 0.875rem;
        margin-top: 0.75rem;
    }
}

/* Smaller Tablet View (768px to 900px) - Even more compact */
@media (min-width: 768px) and (max-width: 900px) {
    .grid-container-blog-posts {
        gap: 1.25rem; /* Even smaller gap */
    }
    
    .blog-post-card .card-content {
        padding: 0.875rem;
    }
    
    .blog-post-card h3 {
        font-size: 0.95rem;
    }
    
    .blog-post-card p.excerpt {
        font-size: 0.75rem;
    }
    
    .blog-post-card .card-meta {
        font-size: 0.7rem;
    }
    
    .blog-post-card .read-more-link {
        font-size: 0.8rem;
    }
}

/* Desktop View (1024px and up) */
@media (min-width: 1024px) {
    /* Hide horizontal categories, show sidebar */
    .horizontal-categories-section {
        display: none;
    }
    .blog-sidebar {
        display: block;
    }
    
    /* This rule creates the main 2-column layout with a sidebar on the right */
    .blog-layout-grid {
        grid-template-columns: 2fr 1fr;
    }
    
    /* Desktop: Keep 2 columns for blog posts */
    .grid-container-blog-posts {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }
    
    /* Reset to full size for desktop */
    .blog-post-card .card-content {
        padding: 1.5rem;
    }
    
    .blog-post-card h3 {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }
    
    .blog-post-card p.excerpt {
        font-size: 0.9rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
    }
    
    .blog-post-card .card-meta {
        font-size: 0.8rem;
        padding-top: 1rem;
    }
    
    .blog-post-card .read-more-link {
        font-size: 1rem;
        margin-top: 1rem;
    }
}