/* Blog Responsive Styles - Based on Reference Design */

:root {
    --primary: #1a1a2e;
    --secondary: #16213e;
    --accent: #0f3460;
    --highlight: #eeff00;
    --text: #ffffff;
    --light-text: #b8b8b8;
    --card-bg: #ffffff;
    --card-text: #333333;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.8), rgba(15, 52, 96, 0.7)), url('../img/blog-hero2.svg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 100px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 70vh;
    display: flex;
    align-items: center;
}

.jj-blog-background-wrapper {
    position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    background-image: url('../img/blog-hero.svg');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
}

/* Ensure content within the wrapper is above the background */
.jj-blog-background-wrapper > .container {
    position: relative;
    z-index: 1; /* Ensure content is clickable */
}


.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(233, 69, 96, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(15, 52, 96, 0.15) 0%, transparent 50%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    color: var(--text);
}

.hero h1 {
    font-family: "Sheiloria Stylish Brush", cursive;
    font-size: 4rem; /* Larger font size for impact */
    margin-bottom: 20px;
    background: linear-gradient(90deg, #ff8c00, #ff2d00); /* Vibrant orange gradient */
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-transform: uppercase;
    letter-spacing: 3px; /* Slightly more prominent letter spacing */
    font-weight: 700;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
}

.hero .subtitle {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--text);
    font-weight: 600;
}

.hero p {
    font-size: 1.2rem;
    color: var(--light-text);
    max-width: 700px;
    margin: 0 auto 30px;
    line-height: 1.6;
}

.cta-button {
    display: inline-block;
    background: var(--highlight);
    color: rgb(37, 37, 37);
    padding: 12px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background: #77e40a;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(230, 233, 69, 0.3);
    color: white;
    text-decoration: none;
}

/* Main Content Layout */
.main-content {
    display: flex;
    gap: 48px;
    padding: 80px 0;
    max-width: 1200px; /* align with site container */
    margin: 0 auto;    /* center the layout */
    align-items: flex-start;
}

.content-area {
    flex: 3;           /* widen content area */
    min-width: 0;      /* prevent overflow and allow flexing */
}

.sidebar {
    flex: 1.2;         /* slightly wider sidebar */
    min-width: 300px;  /* ensure usable width for widgets */
}

/* Single post refinements */
.single-post .main-content { gap: 56px; }
.single-post .content-area { flex: 3.2; }
.single-post .sidebar { flex: 1; }

/* Ensure images and embeds fit content width */
.content-area img,
.content-area iframe,
.content-area video { max-width: 100%; height: auto; }

/* Section Headers */
.section-header {
    margin-bottom: 40px;
    text-align: center;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--highlight);
    border-radius: 2px;
}

.section-header p {
    color: #666;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Featured Stories */
.featured-stories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.story-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.story-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

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

.story-content {
    padding: 20px;
}

.story-category {
    display: inline-block;
    background: var(--highlight);
    color: rgb(0, 0, 0);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.story-title {
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 10px;
    line-height: 1.4;
}

.story-title a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.story-title a:hover {
    color: var(--highlight);
}

.story-excerpt {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

.story-meta {
    display: flex;
    justify-content: space-between;
    color: #999;
    font-size: 0.85rem;
}

/* Blog Filters */
.blog-filters {
    margin: 20px 0 40px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.blog-filter {
    padding: 8px 16px;
    border-radius: 25px;
    border: 2px solid #e0e0e0;
    background: #fff;
    color: #666;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.blog-filter:hover {
    border-color: var(--highlight);
    color:rgb(0, 0, 0);
}

.blog-filter.is-active {
    background: var(--highlight);
    color: rgb(0, 0, 0);
    border-color: var(--highlight);
}

/* Blog Grid */
.blog-grid__inner {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* Sidebar Widgets */
.sidebar-widget {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.widget-title {
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    position: relative;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--highlight);
}

/* Recent Posts */
.recent-post {
    display: flex;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

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

.recent-post-image {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 15px;
}

.recent-post-content h4 {
    font-size: 0.95rem;
    color: var(--primary);
    margin-bottom: 5px;
    line-height: 1.4;
}

.recent-post-content h4 a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.recent-post-content h4 a:hover {
    color: var(--highlight);
}

.recent-post-content .post-date {
    color: #999;
    font-size: 0.8rem;
}

/* Categories */
.categories-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.categories-list li {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.categories-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.categories-list a {
    color: #555;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.3s ease;
}

.categories-list a:hover {
    color: var(--highlight);
}

.category-count {
    background: #f0f0f0;
    color: #777;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
}

/* Tags */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    background: #f0f0f0;
    color: #555;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.tag:hover {
    background: var(--highlight);
    color: white;
}

/* Pagination */
.blog-pagination {
    margin-top: 40px;
    text-align: center;
}

.blog-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 4px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
}

.blog-pagination .page-numbers:hover,
.blog-pagination .page-numbers.current {
    background: var(--highlight);
    color: white;
    border-color: var(--highlight);
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
        gap: 30px;
        padding: 40px 0;
    }
    
    .hero {
        padding: 60px 0;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero .subtitle {
        font-size: 1.4rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .featured-stories,
    .blog-grid__inner {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .blog-filters {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .blog-filter {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .sidebar {
        order: 2; /* Move sidebar below content area on mobile */
    }
    
    .content-area {
        order: 1; /* Ensure content area is first */
    }
    
    .story-image {
        height: 180px;
    }
    
    .recent-post {
        flex-direction: column;
    }
    
    .recent-post-image {
        width: 100%;
        height: 120px;
        margin-right: 0;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero .subtitle {
        font-size: 1.2rem;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .story-content {
        padding: 15px;
    }
    
    .sidebar-widget {
        padding: 20px;
    }
}

/* Related Posts (single post) */
.related-posts { margin-top: 32px; }
.related-posts .blog-grid__inner {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}
.related-posts .blog-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
}
.related-posts .blog-card__thumb img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}
.related-posts .blog-card__body { padding: 14px; }
.related-posts .blog-card__title { font-size: 1rem; margin: 6px 0; color: var(--primary); }
.related-posts .blog-card__title a { color: inherit; text-decoration: none; }
.related-posts .blog-card__title a:hover { color: var(--highlight); }
.related-posts time { color: #567; font-size: .85rem; }

@media (max-width: 768px) {
    .related-posts .blog-grid__inner { grid-template-columns: 1fr 1fr; }

    /* Single blog post H1 styling for mobile */
    .single-post h1 {
        font-size: 1.5rem;
        margin-top: 40px;
        text-align: center;
    }
}

@media (max-width: 520px) {
    .related-posts .blog-grid__inner { grid-template-columns: 1fr; }
    .related-posts .blog-card__thumb img { height: 160px; }
}