/* ============================================================
   blogs.css — Worldwide Exporter Blog Listing Page
   Uses global tokens from variables.css — no local :root here.
   ============================================================ */

body {
    font-family: var(--font);
    background: var(--bg) !important;
    color: var(--text-heading);
    line-height: 1.6;
}

.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Container ── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ── Blog header ── */
.blog-header {
    text-align: center;
    padding: 40px 20px 20px;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    margin-bottom: 30px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.blog-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0 0 12px;
    color: var(--text-heading);
    letter-spacing: -.4px;
}

.blog-header p {
    font-size: 1rem;
    color: var(--text-body);
    max-width: 600px;
    margin: 0 auto;
}

/* ── Search ── */
.search-bar {
    margin: 20px 0;
    text-align: center;
    display: flex;
    justify-content: center;
}

.search-bar input {
    padding: 12px 20px;
    width: 100%;
    max-width: 500px;
    font-size: 15px;
    font-family: var(--font);
    border: 1.5px solid var(--border);
    border-radius: 25px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transition: border-color .18s, box-shadow .18s;
    color: var(--text-heading);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.10);
}

#blog-count {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ── Grid ── */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
    align-items: start;
}

/* ── Card ── */
.blog-post {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,.06);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    transition: transform .25s cubic-bezier(.4,0,.2,1), box-shadow .25s;
}

.blog-post:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* ── Thumbnail wrap ── */
.blog-thumb-wrap {
    position: relative;
    margin: 14px 14px 0;
    border-radius: 10px;
    flex-shrink: 0;
    background: var(--bg);
    line-height: 0;
    /* No overflow:hidden here — chip needs to breathe */
}

/* Image gets its own border-radius */
.blog-post-thumbnail {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    border-radius: 10px;
}

/* ── Category chip — floated above image, not clipped ── */
.blog-cat-chip {
    position: absolute;
    top: -1px;
    left: 10px;
    background: var(--primary);
    color: #fff;
    font-family: var(--font);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    padding: 5px 12px;
    border-radius: 0 0 8px 8px;
    white-space: nowrap;
    max-width: calc(100% - 20px);
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    line-height: 1;
    display: inline-block;
    box-shadow: 0 2px 6px rgba(var(--primary-rgb), 0.25);
}

/* ── Card content ── */
.blog-post-content {
    padding: 18px 20px 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Author / read-time row */
.blog-author-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.blog-author-info .author-name {
    font-weight: 600;
    color: var(--text-body);
}

.blog-author-info .separator { color: #ddd; }

/* Title */
.blog-post-content h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-heading);
}

.blog-post-content h3 a {
    color: inherit;
    text-decoration: none;
    transition: color .15s;
}

.blog-post-content h3 a:hover { color: var(--primary); }

/* Tags */
.blog-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.blog-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 11px;
    background: var(--primary-light);
    color: var(--primary-hover);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* Meta footer */
.blog-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid #f0f0f0;
}

.blog-date {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--text-muted);
}

/* Read more */
.read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    transition: background .18s, transform .15s;
    border: none;
    cursor: pointer;
}

.read-more-btn:hover {
    background: var(--primary-hover);
    transform: translateX(2px);
}

/* ── Empty state ── */
.blogs-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 15px;
}

.blogs-empty i {
    font-size: 36px;
    display: block;
    margin-bottom: 10px;
}

/* ── Pagination ── */
.pagination {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin-top: 36px;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination li {
    cursor: pointer;
    padding: 9px 17px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-heading);
    font-size: 14px;
    font-weight: 500;
    transition: background .18s, color .18s, border-color .18s;
    user-select: none;
}

.pagination li:hover:not(.disabled):not(.active) {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination li.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination li.disabled {
    cursor: not-allowed;
    opacity: .45;
    pointer-events: none;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .blog-header h1 { font-size: 1.6rem; }
    .blog-grid { grid-template-columns: 1fr; }
}