/* ============================================
   Posts Archive Grid v2 – with Filter Bar
   ============================================ */

.pag-wrapper *, .pag-wrapper *::before, .pag-wrapper *::after { box-sizing: border-box; }

/* ── Header ── */
.pag-header { margin-bottom: 30px; text-align: center; }

.pag-header__title {
    margin: 0 0 10px;
    font-size: 36px;
    font-weight: 700;
    color: #1a2a3a;
    line-height: 1.25;
    font-family: Georgia, 'Times New Roman', serif;
}

.pag-header__sub {
    margin: 0 auto;
    font-size: 16px;
    line-height: 1.65;
    color: #666;
    max-width: 640px;
    font-style: italic;
}

/* ═══════════════════════════════
   FILTER BAR
   ═══════════════════════════════ */
.pag-filters {
    margin-bottom: 24px;
}

/* Pills row */
.pag-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.pag-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    background: #ffffff;
    border: 1px solid #dde3e8;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    line-height: 1.3;
    font-family: inherit;
}

.pag-pill:hover {
    border-color: #1a8c8c;
    color: #1a8c8c;
}

.pag-pill--active {
    background: #1a8c8c;
    border-color: #1a8c8c;
    color: #ffffff;
}

.pag-pill--active:hover {
    opacity: 0.9;
    color: #ffffff;
}

/* Sort bar */
.pag-sort {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #888;
}

.pag-sort__icon {
    display: inline-flex;
    align-items: center;
    opacity: 0.6;
}

.pag-sort__label {
    color: #888;
}

.pag-sort__select {
    border: none;
    background: transparent;
    color: #1a8c8c;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    padding: 2px 4px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.pag-sort__select:hover {
    opacity: 0.8;
}

/* ═══════════════════════════════
   GRID
   ═══════════════════════════════ */
.pag-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 28px;
    row-gap: 28px;
    transition: opacity 0.3s ease;
    min-height: 200px;
}

.pag-grid--loading {
    opacity: 0.4;
    pointer-events: none;
}

/* ═══════════════════════════════
   CARD
   ═══════════════════════════════ */
.pag-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
    transition: box-shadow 0.4s ease, transform 0.4s ease;
    display: flex;
    flex-direction: column;
}

.pag-card:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    transform: translateY(-4px);
}

/* Image */
.pag-card__image-link {
    display: block;
    overflow: hidden;
    text-decoration: none;
    position: relative;
    line-height: 0;
}

.pag-card__image {
    width: 100%;
    height: 220px;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s cubic-bezier(0.25,0.46,0.45,0.94), filter 0.6s ease;
}

.pag-card__image--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8ecef;
    color: #b0b8c1;
}

.pag-card--hover-zoom:hover .pag-card__image { transform: scale(1.06); }
.pag-card--hover-brighten:hover .pag-card__image { filter: brightness(1.12); }

/* Category badge on image */
.pag-card__cat {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #1a8c8c;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 4px;
    line-height: 1.2;
    z-index: 2;
}

/* Body */
.pag-card__body {
    padding: 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Meta */
.pag-card__meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 12px;
    font-weight: 500;
    color: #999;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.pag-card__date,
.pag-card__readtime,
.pag-card__author {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.pag-card__meta svg { opacity: 0.55; flex-shrink: 0; }

/* Author line */
.pag-card__author-line {
    font-size: 13px;
    color: #888;
    margin-bottom: 8px;
}

/* Title */
.pag-card__title {
    margin: 0 0 10px;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.35;
    color: #1a2a3a;
}

.pag-card__title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.25s ease;
}

.pag-card__title a:hover { color: #1a8c8c; }

/* Excerpt */
.pag-card__excerpt {
    font-size: 14.5px;
    line-height: 1.7;
    color: #555;
    margin: 0 0 16px;
    flex: 1;
}

/* Read More */
.pag-card__readmore {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #1a8c8c;
    text-decoration: none;
    transition: gap 0.3s ease;
    margin-top: auto;
}

.pag-card__readmore:hover { gap: 8px; }

/* No posts */
.pag-no-posts {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #888;
    font-size: 15px;
}

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

.pag-pagination a,
.pag-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #dde3e8;
    border-radius: 8px;
    background: #fff;
    color: #555;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
}

.pag-pagination a:hover {
    background: #1a8c8c;
    border-color: #1a8c8c;
    color: #fff;
}

.pag-pagination .current {
    background: #1a8c8c;
    border-color: #1a8c8c;
    color: #fff;
    cursor: default;
}

.pag-pagination .dots {
    border: none;
    background: transparent;
    min-width: auto;
    padding: 0 4px;
    color: #999;
    cursor: default;
}

/* ═══════════════════════════════
   EMPTY / EDITOR STATE
   ═══════════════════════════════ */
.pag-empty {
    padding: 60px 40px;
    text-align: center;
    background: #f8f9fa;
    border: 2px dashed #dde3e8;
    border-radius: 12px;
    color: #666;
}
.pag-empty__icon { font-size: 40px; margin-bottom: 12px; }
.pag-empty p { margin: 4px 0; font-size: 14px; }
.pag-empty strong { font-size: 16px; color: #333; }
.pag-empty code { background: #e8ecef; padding: 2px 8px; border-radius: 4px; font-size: 13px; }

/* ═══════════════════════════════
   RESPONSIVE
   ═══════════════════════════════ */
@media (max-width: 1024px) {
    .pag-grid { grid-template-columns: repeat(2, 1fr); }
    .pag-header__title { font-size: 30px; }
}

@media (max-width: 600px) {
    .pag-grid { grid-template-columns: 1fr; }
    .pag-header__title { font-size: 24px; }
    .pag-header__sub { font-size: 14px; }
    .pag-card__image { height: 200px; }
    .pag-pills { gap: 6px; }
    .pag-pill { padding: 6px 14px; font-size: 13px; }
    .pag-filters { margin-bottom: 18px; }
}
