/* =============================================================
   NBS Posts Shortcode — assets/css/nbs-posts.css
   Fixed: no empty space, card height = content height
   ============================================================= */

/* ── Wrapper ─────────────────────────────────────────────── */
.nbs-posts-wrap {
    position: relative;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #333;
    max-width: 1040px;
    margin: 0 auto;
}

/* ── Post List ───────────────────────────────────────────── */
.nbs-posts-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Single Post Card ────────────────────────────────────── */
.nbs-post-item {
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    /* NO min-height — card is exactly as tall as its content */
    transition: box-shadow 0.35s ease, border-color 0.35s ease;
}

.nbs-post-item:hover {
    box-shadow: 0 8px 32px rgba(204, 34, 41, 0.13);
    border-color: #CC2229;
}

/* ── Thumbnail Column ────────────────────────────────────── */
.nbs-post-thumb {
    position: relative;
    flex: 0 0 210px;
    width: 210px;
    overflow: hidden;
    background: #1AACE3;
    /* stretch to full card height naturally */
    display: block;
}

.nbs-post-thumb a {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    z-index: 2;
}

.nbs-post-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease, filter 0.35s ease;
    filter: brightness(0.92) saturate(0.95);
}

.nbs-post-item:hover .nbs-post-thumb img {
    transform: scale(1.06);
    filter: brightness(1.08) saturate(1.15);
}

/* Blue tint overlay */
.nbs-post-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(26, 172, 227, 0.18);
    transition: opacity 0.35s ease;
    pointer-events: none;
    z-index: 1;
}

.nbs-post-item:hover .nbs-post-thumb::after {
    opacity: 0;
}

/* No-thumbnail fallback */
.nbs-no-thumb {
    min-height: 160px;
}

.nbs-thumb-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1AACE3;
}

.nbs-thumb-placeholder svg {
    width: 64px;
    height: 64px;
    opacity: 0.55;
    transition: opacity 0.3s;
}

.nbs-post-item:hover .nbs-thumb-placeholder svg {
    opacity: 0.85;
}

/* ── Date Badge ──────────────────────────────────────────── */
.nbs-date-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #CC2229;
    color: #fff;
    text-align: center;
    padding: 4px 10px 6px;
    border-radius: 3px;
    min-width: 56px;
    z-index: 3;
    line-height: 1;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.nbs-post-item:hover .nbs-date-badge {
    transform: scale(1.07);
    box-shadow: 0 3px 10px rgba(204, 34, 41, 0.35);
}

.nbs-date-day {
    display: block;
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.5px;
}

.nbs-date-my {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 3px;
}

/* ── Post Content Column ─────────────────────────────────── */
.nbs-post-content {
    flex: 1;
    padding: 20px 24px 18px;
    display: flex;
    flex-direction: column;
    /* align-items: flex-start so nothing stretches */
    align-items: flex-start;
    gap: 0;
    /* height fits content — no justify-content: space-between */
}

/* ── Post Title ──────────────────────────────────────────── */
.nbs-post-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.35;
    color: #1a1a1a;
    width: 100%;
}

.nbs-post-title a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.2s;
}

.nbs-post-item:hover .nbs-post-title a {
    color: #CC2229;
}

/* ── Category Badge ──────────────────────────────────────── */
.nbs-cat-badge {
    display: inline-block;
    background: #1AACE3;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 4px 12px;
    border-radius: 3px;
    text-decoration: none;
    margin-bottom: 12px;
    transition: background 0.2s, transform 0.2s;
}

.nbs-cat-badge:hover {
    background: #CC2229;
    color: #fff;
    text-decoration: none;
}

.nbs-post-item:hover .nbs-cat-badge {
    background: #CC2229;
}

/* ── Excerpt ─────────────────────────────────────────────── */
.nbs-post-excerpt {
    font-size: 14px;
    color: #555;
    line-height: 1.65;
    /* collapsed by default */
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin: 0;
    width: 100%;
    transition: max-height 0.4s ease, opacity 0.35s ease, margin 0.35s ease;
}

.nbs-post-item:hover .nbs-post-excerpt {
    max-height: 200px;
    opacity: 1;
    margin: 0 0 12px;
}

/* ── Meta Row — pushed to bottom with margin-top: auto ───── */
.nbs-post-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    flex-wrap: wrap;
    gap: 8px;
    transition: border-color 0.3s;
}

.nbs-post-item:hover .nbs-post-meta {
    border-top-color: #ffd4d5;
}

.nbs-meta-author {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #888;
}

.nbs-meta-author svg {
    color: #aaa;
    flex-shrink: 0;
    transition: color 0.2s;
}

.nbs-post-item:hover .nbs-meta-author svg {
    color: #1AACE3;
}

/* ── Read More Button ────────────────────────────────────── */
.nbs-read-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #CC2229;
    text-decoration: none;
    border: 1.5px solid #CC2229;
    padding: 6px 16px;
    border-radius: 3px;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    white-space: nowrap;
}

.nbs-post-item:hover .nbs-read-more {
    background: #CC2229;
    color: #fff;
}

.nbs-read-more:hover {
    transform: translateX(3px);
}

/* ── No Posts ────────────────────────────────────────────── */
.nbs-no-posts {
    text-align: center;
    padding: 40px;
    color: #999;
    background: #f9f9f9;
    border-radius: 4px;
    border: 1px dashed #ddd;
}

/* ── Loading Spinner ─────────────────────────────────────── */
.nbs-loading {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 4px;
}

.nbs-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e4e4e4;
    border-top-color: #CC2229;
    border-radius: 50%;
    animation: nbs-spin 0.75s linear infinite;
}

@keyframes nbs-spin {
    to { transform: rotate(360deg); }
}

/* ── Pagination ──────────────────────────────────────────── */
.nbs-pagination {
    margin-top: 30px;
}

.nbs-page-numbers {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.nbs-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1.5px solid #ddd;
    border-radius: 3px;
    background: #fff;
    color: #444;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1;
}

.nbs-page-btn:hover {
    border-color: #1AACE3;
    color: #1AACE3;
    background: #f0faff;
}

.nbs-page-btn.active {
    background: #CC2229;
    border-color: #CC2229;
    color: #fff;
    cursor: default;
    pointer-events: none;
}

.nbs-page-btn.nbs-prev,
.nbs-page-btn.nbs-next {
    font-weight: 700;
    padding: 0 16px;
    background: #1AACE3;
    border-color: #1AACE3;
    color: #fff;
}

.nbs-page-btn.nbs-prev:hover,
.nbs-page-btn.nbs-next:hover {
    background: #0d8fbf;
    border-color: #0d8fbf;
}

.nbs-page-ellipsis {
    font-size: 16px;
    color: #aaa;
    padding: 0 2px;
    line-height: 38px;
}

/* ── Responsive: Tablet ──────────────────────────────────── */
@media (max-width: 768px) {
    .nbs-post-item {
        flex-direction: column;
    }

    .nbs-post-thumb {
        flex: none;
        width: 100%;
        height: 200px;
        position: relative;
    }

    .nbs-post-content {
        padding: 16px 18px 14px;
    }

    .nbs-post-title {
        font-size: 17px;
    }

    .nbs-post-excerpt {
        max-height: 80px;
        opacity: 1;
        margin: 0 0 10px;
    }
}

/* ── Responsive: Mobile ──────────────────────────────────── */
@media (max-width: 480px) {
    .nbs-post-thumb {
        height: 170px;
    }

    .nbs-post-content {
        padding: 14px;
    }

    .nbs-post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .nbs-page-btn {
        min-width: 34px;
        height: 34px;
        font-size: 13px;
    }
}