/* ==========================================================
   AJAX Post Search and Filter — style.css  v2.9
   All values driven by CSS custom properties set from admin
   ========================================================== */

.apf-wrapper { font-family: inherit; }

/* ── Layout ── */
.apf-layout { display: flex; gap: 28px; align-items: flex-start; }

/* ── Sidebar ── */
.apf-sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--apf-sidebar-bg, #f8fafc);
    border-radius: 10px;
    padding: 18px;
    border: 1px solid var(--apf-card-border, #e2e8f0);
}

/* ── Search ── */
.apf-search-wrap { position: relative; }
.apf-search {
    width: 100%;
    padding: 9px 36px 9px 12px;
    border: 1px solid var(--apf-search-border, #cbd5e0);
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    outline: none;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
.apf-search:focus {
    border-color: var(--apf-accent, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.apf-search-icon {
    position: absolute; right: 10px; top: 50%;
    transform: translateY(-50%);
    font-size: 14px; opacity: .4; pointer-events: none;
}

/* ── Filters ── */
.apf-filters { margin-top: 18px; }
.apf-taxonomy-group { margin-bottom: 20px; }
.apf-tax-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: #94a3b8; margin-bottom: 10px; }

/* Custom checkbox */
.apf-check-label { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; font-size: 13px; color: #475569; cursor: pointer; }
.apf-check-label input[type="checkbox"] { display: none; }
.apf-checkbox-custom { width: 16px; height: 16px; border: 2px solid #cbd5e0; border-radius: 4px; flex-shrink: 0; position: relative; transition: border-color .15s, background .15s; }
.apf-check-label input:checked + .apf-checkbox-custom { background: var(--apf-accent, #3b82f6); border-color: var(--apf-accent, #3b82f6); }
.apf-check-label input:checked + .apf-checkbox-custom::after {
    content: ''; position: absolute;
    left: 3px; top: 0;
    width: 5px; height: 9px;
    border: 2px solid #fff; border-top: none; border-left: none;
    transform: rotate(45deg);
}
.apf-check-label:hover .apf-checkbox-custom { border-color: var(--apf-accent, #3b82f6); }
.apf-check-label:hover { color: #1e293b; }

.apf-show-more { display: inline-block; margin-top: 4px; color: var(--apf-accent, #3b82f6); cursor: pointer; font-size: 12px; font-weight: 600; }
.apf-show-more:hover { text-decoration: underline; }

/* ── Main posts area ── */
.apf-main { flex: 1; min-width: 0; }

/* ── Grid ── */
.apf-posts { display: grid; gap: 20px; }
.apf-posts.apf-cols-3 { grid-template-columns: repeat(3, 1fr); }
.apf-posts.apf-cols-2 { grid-template-columns: repeat(2, 1fr); }

/* ── Post card ── */
.apf-post {
    background: var(--apf-card-bg, #fff);
    border: var(--apf-card-border-width, 1px) solid var(--apf-card-border, #e2e8f0);
    border-radius: var(--apf-card-radius, 8px);
    box-shadow: var(--apf-card-shadow, 0 4px 16px rgba(0,0,0,.10));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}
.apf-post:hover { box-shadow: 0 8px 28px rgba(0,0,0,.14); transform: translateY(-3px); }

/* Thumbnail */
.apf-post-thumbnail { overflow: hidden; height: var(--apf-img-height, 200px); }
.apf-post-thumbnail a { display: block; height: 100%; }
.apf-post-thumbnail img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.apf-post:hover .apf-post-thumbnail img { transform: scale(1.05); }

/* Body */
.apf-post-body { padding: 16px; display: flex; flex-direction: column; flex: 1; }

/* Title */
.apf-post-title {
    font-size: var(--apf-title-size, 17px);
    font-weight: var(--apf-title-weight, bold);
    text-transform: var(--apf-title-transform, none);
    margin: 0 0 8px;
    line-height: 1.35;
}
.apf-post-title a { color: var(--apf-title-color, #1a202c); text-decoration: none; }
.apf-post-title a:hover { color: var(--apf-accent, #3b82f6); }

/* Excerpt */
.apf-post-excerpt {
    color: var(--apf-excerpt-color, #718096);
    font-size: var(--apf-excerpt-size, 14px);
    line-height: 1.65;
    flex-grow: 1;
    margin-bottom: 14px;
}
.apf-post-excerpt p { margin: 0; }

/* Read More */
.apf-read-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--apf-readmore-size, 13px);
    font-weight: var(--apf-readmore-weight, 600);
    text-transform: var(--apf-readmore-transform, none);
    color: var(--apf-readmore-color, #3b82f6);
    text-decoration: none;
    margin-top: auto;
}
.apf-read-more::after { content: '→'; transition: transform .15s; }
.apf-read-more:hover::after { transform: translateX(3px); }

/* No posts */
.apf-no-posts { color: #94a3b8; font-size: 15px; padding: 32px 0; text-align: center; grid-column: 1 / -1; }

/* ── Load More ── */
.apf-load-more-wrap { text-align: center; margin-top: 28px; }
.apf-load-more {
    padding: 11px 32px;
    background: var(--apf-btn-bg, #3b82f6);
    color: var(--apf-btn-color, #fff);
    border: var(--apf-btn-border-width, 0px) solid var(--apf-btn-border, #3b82f6);
    border-radius: var(--apf-btn-radius, 6px);
    font-size: var(--apf-btn-size, 14px);
    text-transform: var(--apf-btn-transform, none);
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s, transform .15s;
}
.apf-load-more:hover { opacity: .88; transform: translateY(-1px); }

/* ── Responsive ── */
@media (max-width: 960px) {
    .apf-posts.apf-cols-3 { grid-template-columns: repeat(2, 1fr); }
    .apf-sidebar { width: 200px; }
}
@media (max-width: 660px) {
    .apf-layout { flex-direction: column; }
    .apf-sidebar { width: 100%; }
    .apf-posts.apf-cols-3,
    .apf-posts.apf-cols-2 { grid-template-columns: 1fr; }
}
