/* ============================================================
   WiseLeaf Blog / Insights — blog.css
   Only defines what doesn't already exist in style.css or
   wiseleaf-footer-worldclass.css. Uses existing design tokens.
   ============================================================ */

/* ── Blog Page Header (clean strip, no hero image) ─────── */
.blog-page-header {
    background: #ffffff;
    border-bottom: 2px solid var(--border-light);
    padding: 28px 20px 24px;
}

.blog-page-header-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.blog-page-title {
    font-family: 'Merriweather', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 6px;
    line-height: 1.3;
}

.blog-page-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.breadcrumb a {
    color: var(--accent-color);
    text-decoration: none;
}

.breadcrumb a:hover { text-decoration: underline; }

.breadcrumb span { color: var(--text-light); }

.breadcrumb span[aria-current="page"] {
    color: var(--text-secondary);
    font-weight: 600;
}

/* ── Filter Bar ─────────────────────────────────────────── */
.blog-filter-bar {
    background: #ffffff;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 60px;
    z-index: 100;
    box-shadow: var(--shadow-subtle);
}

.blog-filter-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
}

.blog-filter-inner::-webkit-scrollbar { display: none; }

.filter-tab {
    display: inline-block;
    padding: 13px 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}

.filter-tab:hover { color: var(--primary-color); }

.filter-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--light-accent);
    font-weight: 600;
}

/* ── Listing Layout ─────────────────────────────────────── */
.blog-listing-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 36px 20px 60px;
}

/* ── Featured Post (uses existing .card as base) ────────── */
.blog-featured {
    margin-bottom: 40px;
}

.featured-post-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.featured-post-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-normal);
    border: 1px solid var(--border-light);
    background: #ffffff;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.featured-post-image {
    overflow: hidden;
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
}

.featured-post-image--pharmacy    { background: #e8f5e9; }
.featured-post-image--engineering { background: #e3f2fd; }
.featured-post-image--management  { background: #fff3e0; }

.featured-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    min-height: 240px;
}

.featured-post-content {
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
}

.featured-post-content h2 {
    font-family: 'Merriweather', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.45;
}

.featured-post-content p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ── Post Grid (extends existing .card system) ──────────── */
.blog-post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.post-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.post-card-link .card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.post-card-link .card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.post-card-link .card h3 {
    font-size: 0.95rem;
    line-height: 1.45;
}

.post-card-summary {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Post Meta ──────────────────────────────────────────── */
.post-meta-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.post-category-tag {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.post-category-tag--pharmacy    { background: #e8f5e9; color: #2e7d32; }
.post-category-tag--engineering { background: #e3f2fd; color: #1565c0; }
.post-category-tag--management  { background: #fff3e0; color: #e65100; }
.post-category-tag--ai          { background: #f3e5f5; color: #6a1b9a; }

.post-read-time,
.post-date {
    font-size: 12px;
    color: var(--text-light);
}

.post-read-time i,
.post-date i { margin-right: 3px; }

.post-footer-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
    font-size: 12px;
    color: var(--text-light);
}

.post-author { color: var(--text-secondary); font-size: 12px; }
.post-author i { margin-right: 3px; }

.read-more-link {
    margin-left: auto;
    color: var(--accent-color);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
}

.read-more-link i { margin-left: 3px; }

/* ── Empty State ────────────────────────────────────────── */
.blog-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ── Pagination ─────────────────────────────────────────── */
.blog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 48px;
    padding-top: 28px;
    border-top: 1px solid var(--border-light);
}

.pagination-info {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ── Single Post Layout ─────────────────────────────────── */
.blog-post-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 72px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 44px;
    align-items: start;
}

.blog-post-content { min-width: 0; }

.post-title {
    font-family: 'Merriweather', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.4;
    margin: 16px 0 10px;
}

.post-byline {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.post-hero-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 28px;
    display: block;
    border: 1px solid var(--border-light);
}

.post-body {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-primary);
}

.post-body h2 {
    font-family: 'Merriweather', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 32px 0 12px;
}

.post-body h3 {
    font-family: 'Merriweather', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 24px 0 10px;
}

.post-body p { margin-bottom: 16px; }

.post-body ul,
.post-body ol {
    margin: 0 0 16px 22px;
}

.post-body li { margin-bottom: 5px; }

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

.post-body blockquote {
    border-left: 4px solid var(--light-accent);
    margin: 20px 0;
    padding: 10px 18px;
    background: var(--bg-primary);
    border-radius: 0 6px 6px 0;
    font-style: italic;
    color: var(--text-secondary);
    font-size: 13px;
}

/* ── Post Tags ──────────────────────────────────────────── */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.post-tag {
    display: inline-block;
    padding: 3px 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* ── JAPSNP CTA ─────────────────────────────────────────── */
.post-japsnp-cta {
    margin-top: 36px;
    padding: 24px 28px;
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: 10px;
}

.post-japsnp-cta h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #2e7d32;
    margin-bottom: 6px;
}

.post-japsnp-cta p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

/* ── Sidebar ────────────────────────────────────────────── */
.blog-sidebar {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-block {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 18px;
    box-shadow: var(--shadow-subtle);
}

.sidebar-block h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-light);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sidebar-block p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 10px;
}

.sidebar-link {
    font-size: 13px;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

.sidebar-link:hover { text-decoration: underline; }

.sidebar-related-post {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-related-post:last-child { border-bottom: none; }

.sidebar-related-post a {
    font-size: 13px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    line-height: 1.4;
}

.sidebar-related-post a:hover { color: var(--accent-color); }

.sidebar-related-date {
    font-size: 11px;
    color: var(--text-light);
}

.sidebar-newsletter { background: var(--primary-color); }

.sidebar-newsletter h4 {
    color: #ffffff;
    border-bottom-color: rgba(255,255,255,0.2);
}

.sidebar-newsletter p { color: rgba(255,255,255,0.8); }

.sidebar-newsletter .newsletter-form { flex-direction: column; }

.sidebar-newsletter .newsletter-input {
    background: rgba(255,255,255,0.15);
    color: #ffffff;
    border-color: rgba(255,255,255,0.3);
}

.sidebar-newsletter .newsletter-input::placeholder { color: rgba(255,255,255,0.6); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
    .blog-post-grid { grid-template-columns: repeat(2, 1fr); }
    .blog-post-layout { grid-template-columns: 1fr; }
    .blog-sidebar { position: static; }
}

@media (max-width: 768px) {
    .hero.blog-hero .hero-title { font-size: 1.5rem; }
    .featured-post-card { grid-template-columns: 1fr; }
    .featured-post-image { max-height: 200px; }
    .featured-post-content { padding: 20px; }
    .blog-post-grid { grid-template-columns: 1fr; }
    .post-title { font-size: 1.4rem; }
    .blog-post-layout { padding: 20px 16px 48px; gap: 28px; }
}
