/* ==========================================================================
   Post Archive Filter — Front-end styles
   ========================================================================== */

/* ---- Filter bar ---- */
.paf-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.paf-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: 1px solid #d0d0d0;
    border-radius: 24px;
    background: #fff;
    color: #444;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4;
    white-space: nowrap;
}

.paf-filter-btn:hover {
    border-color: #888;
    color: #222;
    background: #f5f5f5;
}

.paf-filter-btn.paf-active {
    background: #2c3e50;
    color: #fff;
    border-color: #2c3e50;
}

.paf-filter-btn.paf-active:hover {
    background: #1a252f;
    border-color: #1a252f;
}

.paf-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: rgba(0, 0, 0, 0.08);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.paf-active .paf-count {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ---- Posts grid ---- */
.paf-grid {
    display: grid;
    gap: 28px;
    transition: opacity 0.2s ease;
}

.paf-cols-1 { grid-template-columns: 1fr; }
.paf-cols-2 { grid-template-columns: repeat(2, 1fr); }
.paf-cols-3 { grid-template-columns: repeat(3, 1fr); }
.paf-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ---- Post card ---- */
.paf-card {
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.paf-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12), 0 8px 24px rgba(0, 0, 0, 0.06);
}

/* Card image */
.paf-card-image {
    display: block;
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #f0f0f0;
    text-decoration: none;
}

.paf-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #f0f0f0;
    object-position: center;
    transition: transform 0.3s ease;
}

.paf-card:hover .paf-card-image img {
    transform: scale(1.05);
}

.paf-no-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8ecef 0%, #d5dce0 100%);
}

.paf-placeholder-icon {
    font-size: 48px;
    opacity: 0.4;
}

/* Card body */
.paf-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 18px 20px 20px;
}

/* Category badges */
.paf-card-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.paf-card-cat {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    background: #eef2f5;
    color: #556677;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Date */
.paf-card-date {
    display: block;
    margin-bottom: 6px;
    color: #888;
    font-size: 13px;
}

/* Title */
.paf-card-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.paf-card-title a {
    color: #222;
    text-decoration: none;
    transition: color 0.2s ease;
}

.paf-card-title a:hover {
    color: #2c3e50;
}

/* Excerpt */
.paf-card-excerpt {
    flex: 1;
    margin: 0 0 12px 0;
    color: #555;
    font-size: 14px;
    line-height: 1.6;
}

/* Read more link */
.paf-read-more {
    display: inline-block;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.paf-read-more:hover {
    color: #1a252f;
    text-decoration: underline;
}

/* ---- No posts message ---- */
.paf-no-posts {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 20px;
    color: #888;
    font-size: 16px;
}

/* ---- Pagination ---- */
.paf-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.paf-page-btn {
    padding: 8px 20px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    background: #fff;
    color: #444;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.paf-page-btn:hover:not(:disabled) {
    background: #f5f5f5;
    border-color: #888;
}

.paf-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.paf-page-info {
    font-size: 14px;
    color: #666;
}

/* ---- Loading spinner ---- */
.paf-loading {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 0;
}

.paf-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top-color: #2c3e50;
    border-radius: 50%;
    animation: paf-spin 0.7s linear infinite;
}

@keyframes paf-spin {
    to { transform: rotate(360deg); }
}

/* ---- Responsive ---- */

/* Tablets */
@media (max-width: 1024px) {
    .paf-cols-3,
    .paf-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Phones */
@media (max-width: 600px) {
    .paf-filter-bar {
        gap: 6px;
        margin-bottom: 20px;
        padding-bottom: 12px;
    }

    .paf-filter-btn {
        padding: 6px 14px;
        font-size: 13px;
    }

    .paf-cols-2,
    .paf-cols-3,
    .paf-cols-4 {
        grid-template-columns: 1fr;
    }

    .paf-grid {
        gap: 20px;
    }

    .paf-card-title {
        font-size: 16px;
    }

    .paf-card-body {
        padding: 14px 16px 16px;
    }

    .paf-pagination {
        gap: 10px;
        margin-top: 24px;
    }

    .paf-page-btn {
        padding: 6px 14px;
        font-size: 13px;
    }
}
