/* ══ Post Grid ══════════════════════════════════════════════ */
.pg-wrapper { width: 100%; font-family: inherit; box-sizing: border-box; }
.pg-wrapper *, .pg-wrapper *::before, .pg-wrapper *::after { box-sizing: inherit; }

/* ─── Grid layout ─── */
.pg-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px 24px;
}

/* ─── List layout ─── */
.pg-list { display: flex; flex-direction: column; gap: 24px; }
.pg-layout-list .pg-card { flex-direction: row; overflow: hidden; }
.pg-layout-list .pg-thumb { flex: 0 0 260px; width: 260px; height: 180px !important; border-radius: 0 !important; }
.pg-layout-list .pg-card-body { padding: 20px 24px; }

/* ─── Card ─── */
.pg-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .3s ease, box-shadow .3s ease;
}

/* ─── Hover effects ─── */
.pg-hover-lift .pg-card:hover { transform: translateY(-6px); box-shadow: 0 16px 40px rgba(0,0,0,.13) !important; }
.pg-hover-zoom .pg-thumb img { transition: transform .5s ease; }
.pg-hover-zoom .pg-card:hover .pg-thumb img { transform: scale(1.07); }
.pg-hover-fade .pg-card:hover .pg-thumb-overlay { background: rgba(0,0,0,.2) !important; }

/* ─── Thumbnail ─── */
.pg-thumb {
    display: block;
    overflow: hidden;
    position: relative;
    height: 220px;
    background: #f0f0f0;
    flex-shrink: 0;
    text-decoration: none;
}
.pg-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}
.pg-thumb-overlay {
    position: absolute; inset: 0;
    background: transparent;
    transition: background .3s ease;
    pointer-events: none;
}

/* ─── Card body ─── */
.pg-card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ─── Meta row ─── */
.pg-meta-row {
    display: flex; align-items: center;
    flex-wrap: wrap; gap: 5px;
    margin-bottom: 10px;
}
.pg-meta { font-size: 13px; color: #888; text-decoration: none; line-height: 1; }
.pg-sep { color: #ccc; font-size: 11px; }
.pg-cat { font-size: 13px; color: #b5865a; text-decoration: none; transition: opacity .2s; }
.pg-cat:hover { opacity: .75; }
.pg-author { font-size: 13px; color: #888; }

/* ─── Title ─── */
.pg-title { margin: 0 0 8px; font-size: 18px; line-height: 1.4; font-weight: 600; }
.pg-title a { color: #1a1a1a; text-decoration: none; transition: color .2s ease; }
.pg-title a:hover { color: #b5865a; }

/* ─── Excerpt ─── */
.pg-excerpt { font-size: 14px; color: #666; line-height: 1.65; margin: 0 0 12px; flex: 1; }

/* ─── Read More ─── */
.pg-read-more {
    display: inline-block;
    font-size: 14px; color: #b5865a;
    border: 1px solid currentColor;
    padding: 7px 18px; border-radius: 4px;
    text-decoration: none;
    margin-top: auto; align-self: flex-start;
    transition: background .2s, color .2s;
}
.pg-read-more:hover { background: #b5865a; color: #fff !important; }

/* ─── No posts ─── */
.pg-no-posts { padding: 48px 20px; text-align: center; color: #aaa; font-size: 15px; margin: 0; }

/* ══ Card entrance animation (stagger — added by JS) ═════════ */
@keyframes pg-slide-up {
    from {
        opacity: 0;
        transform: translateY(32px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Step 1: JS adds --animate → card hidden immediately */
.pg-card--animate {
    opacity: 0;
    will-change: opacity, transform;
}

/* Step 2: JS adds --in (with stagger delay) → animation plays */
.pg-card--animate.pg-card--in {
    animation: pg-slide-up 0.55s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Ensure hover transforms still work after animation fill */
.pg-hover-lift .pg-card--animate.pg-card--in:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0,0,0,.13) !important;
}

/* ══ Pagination ═════════════════════════════════════════════ */
.pg-pagination {
    display: flex; align-items: center;
    justify-content: center;
    gap: 6px; margin-top: 40px;
    flex-wrap: wrap;
}

/* Number buttons — works for both <button> and <a> elements */
.pg-page-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 6px;
    border: none; background: #f5f5f5; color: #1a1a1a;
    border-radius: 4px; cursor: pointer;
    font-size: 14px; font-family: inherit; font-weight: 500;
    transition: background .2s, color .2s, transform .15s;
    line-height: 1;
    text-decoration: none; /* for <a> tags */
    box-sizing: border-box;
}
.pg-page-btn:hover { background: #b5865a; color: #fff; transform: translateY(-1px); }
.pg-page-btn.is-active { background: #b5865a; color: #fff; cursor: default; pointer-events: none; transform: none; }
.pg-page-btn.pg-nav { font-size: 16px; font-weight: 700; min-width: 34px; }
.pg-page-btn:disabled { opacity: .4; pointer-events: none; }
.pg-ellipsis { color: #bbb; font-size: 14px; line-height: 36px; padding: 0 2px; user-select: none; }

/* Loading state — show spinner-like opacity while AJAX runs */
.pg-pagination.pg-loading .pg-page-btn {
    pointer-events: none;
    opacity: 0.5;
    cursor: default;
    transform: none;
}
.pg-pagination.pg-loading .pg-page-btn.is-active { opacity: 0.85; }

/* Load more button */
.pg-load-more-btn {
    display: block; margin: 0 auto;
    padding: 12px 40px;
    background: #b5865a; color: #fff;
    border: none; border-radius: 4px;
    cursor: pointer; font-size: 15px; font-family: inherit;
    transition: opacity .2s, transform .2s;
    min-width: 160px;
}
.pg-load-more-btn:hover { opacity: .88; transform: translateY(-2px); }
.pg-load-more-btn:disabled { opacity: .5; cursor: wait; transform: none; }
.pg-no-more { display: block; text-align: center; color: #aaa; font-size: 14px; }

/* Infinite sentinel */
.pg-sentinel {
    height: 20px;
    display: block;
    text-align: center;
    color: #aaa;
    font-size: 13px;
    transition: height .2s;
}
.pg-sentinel.pg-sentinel-done {
    height: auto;
    padding: 8px 0;
    font-size: 14px;
}

/* ══ Responsive ══════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .pg-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 640px) {
    .pg-grid { grid-template-columns: 1fr !important; }
    .pg-layout-list .pg-card { flex-direction: column; }
    .pg-layout-list .pg-thumb { flex: none; width: 100% !important; height: 200px !important; }
}
