/* Styles for blog/post_list.html */
/* Header button styles to match community/challenges pages */
.header-action-buttons {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.header-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    color: white !important;
    text-decoration: none;
    border-radius: var(--radius-btn, 10px);
    font-weight: 600;
    transition: var(--transition-ui);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: none;
    color: white !important;
    text-decoration: none;
}

.header-btn i {
    font-size: 1rem;
}

.blog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Featured CTA Box */
.featured-cta {
    background: var(--panel-ink);
    color: white;
    padding: 2.5rem 2rem;
    border-radius: var(--border-radius-xl);
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: none;
    --heading-color: currentColor;
}

.featured-cta h3 {
    color: white;
    margin-bottom: 0.75rem;
    font-size: 1.75rem;
    font-weight: 700;
}

.featured-cta p {
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.featured-cta .cta-btn {
    background: var(--card-bg, #fff);
    color: var(--brand-text, #1e4d8b);
    padding: 0.875rem 2.5rem;
    border-radius: var(--radius-btn, 10px);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    transition: var(--transition-ui);
    display: inline-block;
    box-shadow: none;
}

.featured-cta .cta-btn:hover {
    box-shadow: none;
    text-decoration: none;
    color: var(--brand-text, #1e4d8b);
}

.filter-section {
    background: var(--card-bg, #fff);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.filter-tabs {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color, #e0e0e0);
    border-radius: 25px;
    text-decoration: none;
    color: var(--text-muted, #666);
    transition: var(--transition-ui);
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-tab i {
    font-size: 0.9rem;
}

.filter-tab.active {
    background: var(--cta-bg);
    color: white;
    border-color: #52b788;
}

.filter-tab:hover {
    border-color: #52b788;
    color: #52b788;
    text-decoration: none;
}

.blog-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    margin-top: 2rem;
    align-items: start;
    position: relative;
}

.posts-section {
    min-height: 400px;
    position: relative;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.post-card {
    background: var(--card-bg, #fff);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition-ui);
    display: flex;
    flex-direction: column;
    position: relative;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.post-title::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.post-image {
    width: 100%;
    height: 200px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    position: relative;
    --heading-color: currentColor;
}

/* No featured image: no placeholder tile, just the badges above the text */
.post-image--none { height: auto; background: none; display: block; }
.post-image--none .post-badges { position: static; }
.post-image--none .post-badges:has(span) { padding: 1rem 1.5rem 0; }

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-badges {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.warning-badge,
.personal-story-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.warning-badge {
    background: #b91c1c;
    color: white;
}

.post-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted, #666);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.post-title {
    color: var(--text-dark, #333);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    display: block;
    margin-bottom: 0.75rem;
}

.post-title:hover {
    color: var(--text-dark);
}

.post-excerpt {
    color: var(--text-muted, #666);
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
}

.sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
    align-self: flex-start;
}

.sidebar-section {
    background: var(--card-bg, #fff);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.sidebar-section h5 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.category-list {
    list-style: none;
    padding: 0;
}

.category-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color, #f0f0f0);
}

.category-list li:last-child {
    border-bottom: none;
}

.category-list a {
    color: var(--text-muted, #666);
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.3s;
}

.category-list a:hover {
    color: var(--brand-text, #1e4d8b);
}

.category-count {
    background: var(--bg-gray, #f0f0f0);
    color: var(--text-dark, #2c3e50);
    font-variant-numeric: tabular-nums;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-right: 3rem;
    border: 2px solid var(--border-color, #e0e0e0);
    border-radius: 25px;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-light);
}

.search-box button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--cta-bg);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-btn, 10px);
    cursor: pointer;
    transition: background 0.3s;
}

.search-box button:hover {
    background: var(--cta-bg-hover);
}

.blog-pagination-wrapper a:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

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

    .sidebar {
        position: static;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }

    .filter-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .header-action-buttons {
        flex-direction: column;
        align-items: center;
    }

    .header-btn {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }

    .featured-cta {
        padding: 2rem 1.5rem;
    }

    .featured-cta h3 {
        font-size: 1.5rem;
    }

    .featured-cta p {
        font-size: 1rem;
    }

    .blog-pagination-wrapper {
        padding: 1.5rem 1rem !important;
        margin: 2rem 0 1rem 0 !important;
    }

    .blog-pagination-wrapper a,
    .blog-pagination-wrapper span {
        padding: 0.6rem 1rem !important;
        font-size: 0.9rem !important;
        margin: 0.25rem !important;
    }
}
/* Pager links fill on hover (the inline styles set the resting colours) */
.pager-link-hover:hover { background: #1e4d8b !important; color: white !important; }
