/* ==========================================================
   Filterable Post Grid — Front-end Styles
   ========================================================== */

/* ── Reset scope ── */
.fpg-wrap *,
.fpg-wrap *::before,
.fpg-wrap *::after {
    box-sizing: border-box;
}

.fpg-wrap {
    --fpg-brown:      #7a4f2e;
    --fpg-brown-dark: #5c3a1e;
    --fpg-text:       #1a1a1a;
    --fpg-muted:      #888888;
    --fpg-border:     #ddd6cc;
    --fpg-tag-bg:     rgba(90, 60, 30, 0.78);
    font-family: 'Lato', sans-serif;
}

/* ── No posts ── */
.fpg-no-posts {
    color: var(--fpg-muted);
    font-size: 15px;
    padding: 40px 0;
    text-align: center;
}

/* ──────────────────────────────────────────
   Filter Pills
────────────────────────────────────────── */
.fpg-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 36px;
}

.fpg-filters button {
    font-family: 'Lato', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 9px 20px;
    border-radius: 4px;
    border: 1.5px solid var(--fpg-brown);
    background: transparent;
    color: var(--fpg-brown);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    white-space: nowrap;
    line-height: 1;
}

.fpg-filters button:hover,
.fpg-filters button.active {
    background: var(--fpg-brown);
    color: #fff;
}

/* ──────────────────────────────────────────
   Grid
────────────────────────────────────────── */
.fpg-grid {
    display: grid;
    gap: 24px;
}

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

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

@media (max-width: 900px) {
    .fpg-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .fpg-cols-2,
    .fpg-cols-3,
    .fpg-cols-4 { grid-template-columns: 1fr; }
}

/* ──────────────────────────────────────────
   Card
────────────────────────────────────────── */
.fpg-card {
    background: #fff;
    border: 1px solid var(--fpg-border);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.fpg-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(90, 60, 30, 0.13);
}

.fpg-card.fpg-hidden {
    display: none;
}

/* ──────────────────────────────────────────
   Thumbnail
────────────────────────────────────────── */
.fpg-thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #e5e0d8;
    flex-shrink: 0;
}

.fpg-thumb a {
    display: block;
    width: 100%;
    height: 100%;
}

.fpg-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.fpg-card:hover .fpg-thumb img {
    transform: scale(1.05);
}

/* Category badge overlaid on thumbnail */
.fpg-cat {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--fpg-tag-bg);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 3px;
    line-height: 1.4;
    pointer-events: none;
}

/* ──────────────────────────────────────────
   Card Body
────────────────────────────────────────── */
.fpg-body {
    padding: 20px 22px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Meta row */
.fpg-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    font-size: 12px;
    color: var(--fpg-muted);
    line-height: 1;
}

.fpg-meta span + span::before {
    content: '•';
    display: inline-block;
    margin: 0 7px;
}

/* Title */
.fpg-title {
    font-family: 'Playfair Display', serif;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--fpg-text);
    margin: 0;
}

.fpg-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.fpg-title a:hover {
    color: var(--fpg-brown);
}

/* Excerpt */
.fpg-excerpt {
    font-size: 14px;
    line-height: 1.65;
    color: #555;
    margin: 0;
    flex: 1;
}

/* Read More */
.fpg-readmore {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--fpg-brown);
    text-decoration: none;
    margin-top: 4px;
    transition: gap 0.2s ease, color 0.2s ease;
}

.fpg-readmore:hover {
    color: var(--fpg-brown-dark);
    gap: 10px;
}

.fpg-readmore svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.fpg-readmore:hover svg {
    transform: translateX(3px);
}

/* ──────────────────────────────────────────
   No Results message
────────────────────────────────────────── */
.fpg-noresults {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 0;
    font-size: 15px;
    color: var(--fpg-muted);
    display: none;
}

.fpg-noresults.fpg-visible {
    display: block;
}

/* ──────────────────────────────────────────
   Pagination
────────────────────────────────────────── */
.fpg-pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 48px;
}

.fpg-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 4px;
    border: 1.5px solid var(--fpg-border);
    font-size: 13px;
    font-weight: 600;
    color: var(--fpg-brown);
    text-decoration: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.fpg-pagination .page-numbers:hover,
.fpg-pagination .page-numbers.current {
    background: var(--fpg-brown);
    border-color: var(--fpg-brown);
    color: #fff;
}

.fpg-pagination .page-numbers.dots {
    border-color: transparent;
    background: transparent;
    pointer-events: none;
}
