/* Blog Shared Styles */

/* Hero Featured Section */
.blog-hero {
    margin-bottom: 3rem;
}
.blog-hero-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #f8f9fa;
    height: 100%;
}
.blog-hero-card .hero-image {
    width: 100%;
    height: 280px;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.blog-hero-card:hover .hero-image {
    transform: scale(1.03);
}
.blog-hero-card .hero-content {
    padding: 1.5rem;
}
.blog-hero-card .hero-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-hero-card .hero-title a {
    color: #1a1a1a;
    text-decoration: none;
}
.blog-hero-card .hero-title a:hover {
    color: #2D5A27;
}

/* Topic Pills */
.topic-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e5e5;
}
.topic-pill {
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    background-color: #f5f5f5;
    color: #666;
}
.topic-pill:hover {
    background-color: #2D5A27;
    color: white;
}
.topic-pill.active {
    background-color: #2D5A27;
    color: white;
}

/* Child Tags */
.child-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}
.child-tag {
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    text-decoration: none;
    background-color: #e9f5ec;
    color: #2D5A27;
    transition: all 0.2s;
}
.child-tag:hover {
    background-color: #2D5A27;
    color: white;
}

/* Blog Card Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}
@media (max-width: 992px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 576px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
}

/* Blog Card */
.blog-card {
    border-radius: 12px;
    overflow: hidden;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}
.blog-card .card-image-wrapper {
    overflow: hidden;
    position: relative;
}
.blog-card .card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.blog-card:hover .card-image {
    transform: scale(1.05);
}
.blog-card .card-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.blog-card .card-tag {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #2D5A27;
    margin-bottom: 0.5rem;
}
.blog-card .card-tag a {
    color: inherit;
    text-decoration: none;
}
.blog-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-card .card-title a {
    color: #1a1a1a;
    text-decoration: none;
}
.blog-card .card-title a:hover {
    color: #2D5A27;
}
.blog-card .card-excerpt {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}
.blog-card .card-meta {
    font-size: 0.8rem;
    color: #999;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.blog-card .card-meta .author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #2D5A27;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Pagination */
.blog-pagination {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e5e5;
}
.blog-pagination .page-link {
    border: none;
    color: #666;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}
.blog-pagination .page-link:hover {
    background-color: #f5f5f5;
    color: #1a1a1a;
}
.blog-pagination .page-item.active .page-link {
    background-color: #2D5A27;
    color: white;
}

/* Section Headers */
.section-header {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #1a1a1a;
}

/* Blog Post Content */
.blog-post-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #333;
}
.blog-post-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}
.blog-post-content p {
    line-height: 1.8;
    margin-bottom: 1.25rem;
}
.blog-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

/* Post Meta */
.post-meta {
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

/* Tag Links */
.tag-link {
    background-color: #f0f0f0;
    padding: 4px 12px;
    border-radius: 20px;
    text-decoration: none;
    color: #666;
    margin-right: 5px;
    font-size: 0.9rem;
}
.tag-link:hover {
    background-color: #0098ff;
    color: white;
}

/* Related Posts */
.related-post-card {
    transition: transform 0.2s;
}
.related-post-card:hover {
    transform: translateY(-3px);
}

/* ==========================================
   Sticky Topic Bar (article pages)
   ========================================== */
.blog-topic-bar-sentinel {
    height: 0;
}
.blog-topic-bar {
    background: white;
    border-bottom: 1px solid #e5e5e5;
    padding: 0.6rem 0;
    transition: box-shadow 0.2s;
    z-index: 100;
}
.blog-topic-bar.is-sticky {
    position: fixed;
    top: 98px;
    left: 0;
    right: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.blog-topic-bar-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.blog-topic-bar-inner::-webkit-scrollbar {
    display: none;
}
.blog-topic-bar-brand {
    font-weight: 700;
    font-size: 1rem;
    color: #2D5A27;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.blog-topic-bar-brand:hover {
    color: #1a3d18;
}
.blog-topic-bar-links {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}
.blog-topic-bar-link {
    padding: 0.35rem 0.9rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    color: #555;
    white-space: nowrap;
    transition: all 0.2s;
}
.blog-topic-bar-link:hover {
    background-color: #f0f0f0;
    color: #1a1a1a;
}

/* ==========================================
   Blog Category Sections (index page)
   ========================================== */
.blog-category-section {
    margin-bottom: 3rem;
    padding-top: 1rem;
}
.blog-category-header {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #2D5A27;
}
.blog-category-header .section-header {
    margin-bottom: 0.25rem;
}
.blog-category-header p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* ==========================================
   Sidebar Table of Contents
   ========================================== */
.blog-toc {
    position: sticky;
    top: 10rem;
    max-height: calc(100vh - 11rem);
    overflow-y: auto;
    padding-right: 1rem;
    scrollbar-width: thin;
}
.blog-toc-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #999;
    margin-bottom: 0.75rem;
}
.blog-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 2px solid #e5e5e5;
}
.blog-toc-item {
    margin: 0;
}
.blog-toc-item--sub {
    padding-left: 0.75rem;
}
.blog-toc-link {
    display: block;
    padding: 0.4rem 0 0.4rem 1rem;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #888;
    text-decoration: none;
    border-left: 2px solid transparent;
    margin-left: -2px;
    transition: all 0.15s;
}
.blog-toc-link:hover {
    color: #333;
}
.blog-toc-link.active {
    color: #2D5A27;
    border-left-color: #2D5A27;
    font-weight: 600;
}

/* ==========================================
   Topic section "view all" link
   Bootstrap's btn-outline-secondary rendered as low-contrast grey on the
   light section background. This uses the brand green on a pale sage fill,
   which clears WCAG AA comfortably.
   ========================================== */
.blog-topic-link {
    display: inline-block;
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    color: #235c43;
    background-color: #eef6f2;
    border: 1px solid #9ec9b4;
    border-radius: 999px;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.blog-topic-link:hover,
.blog-topic-link:focus {
    background-color: #235c43;
    border-color: #235c43;
    color: #ffffff;
    text-decoration: none;
}

.blog-topic-link:focus-visible {
    outline: 2px solid #235c43;
    outline-offset: 2px;
}
