/* ═══════════════════════════════════════════════
   AJAX Blog Filter — abf-style.css
   Aesthetic: Clean editorial / magazine style
═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── Variables ── */
:root {
    --abf-accent:       #2d6a4f;
    --abf-accent-light: #52b788;
    --abf-bg:           #ffffff;
    --abf-surface:      #f8f7f4;
    --abf-border:       #e8e4df;
    --abf-text:         #1a1a1a;
    --abf-text-muted:   #7a7570;
    --abf-radius:       12px;
    --abf-radius-sm:    6px;
    --abf-shadow:       0 2px 16px rgba(0,0,0,0.07);
    --abf-shadow-hover: 0 8px 32px rgba(0,0,0,0.13);
    --abf-font-head:    'DM Serif Display', Georgia, serif;
    --abf-font-body:    'DM Sans', system-ui, sans-serif;
    --abf-transition:   0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Wrapper ── */
.abf-wrapper {
    font-family: var(--abf-font-body);
    color: var(--abf-text);
    width: 100%;
}

/* ── Filter Bar ── */
.abf-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 36px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--abf-border);
    flex-wrap: wrap;
}

/* ── Select Wrapper ── */
.abf-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.abf-category-select {
    appearance: none;
    -webkit-appearance: none;
    background: var(--abf-bg);
    border: 2px solid var(--abf-border);
    border-radius: var(--abf-radius-sm);
    color: var(--abf-text);
    font-family: var(--abf-font-body);
    font-size: 0.92rem;
    font-weight: 500;
    padding: 11px 44px 11px 16px;
    cursor: pointer;
    min-width: 220px;
    transition: border-color var(--abf-transition), box-shadow var(--abf-transition);
    outline: none;
}

.abf-category-select:hover,
.abf-category-select:focus {
    border-color: var(--abf-accent);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.12);
}

.abf-select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--abf-text-muted);
    display: flex;
    align-items: center;
    transition: transform var(--abf-transition);
}

.abf-select-wrap:focus-within .abf-select-arrow {
    transform: translateY(-50%) rotate(180deg);
}

/* ── Results Count ── */
.abf-results-count {
    font-size: 0.85rem;
    color: var(--abf-text-muted);
    font-weight: 400;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

/* ── Grid ── */
.abf-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    min-height: 200px;
    position: relative;
}

@media (max-width: 900px) {
    .abf-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 580px) {
    .abf-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .abf-filter-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    .abf-category-select {
        min-width: 100%;
    }
}

/* ── Card ── */
.abf-card {
    background: var(--abf-bg);
    border: 1px solid var(--abf-border);
    border-radius: var(--abf-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--abf-shadow);
    transition: box-shadow var(--abf-transition), transform var(--abf-transition), border-color var(--abf-transition);

    /* Entry animation */
    opacity: 0;
    transform: translateY(16px);
    animation: abf-fadeup 0.4s ease forwards;
}

.abf-card:hover {
    box-shadow: var(--abf-shadow-hover);
    transform: translateY(-4px);
    border-color: rgba(45, 106, 79, 0.2);
}

/* stagger animation delays */
.abf-card:nth-child(1)  { animation-delay: 0.03s; }
.abf-card:nth-child(2)  { animation-delay: 0.07s; }
.abf-card:nth-child(3)  { animation-delay: 0.11s; }
.abf-card:nth-child(4)  { animation-delay: 0.15s; }
.abf-card:nth-child(5)  { animation-delay: 0.19s; }
.abf-card:nth-child(6)  { animation-delay: 0.23s; }
.abf-card:nth-child(7)  { animation-delay: 0.27s; }
.abf-card:nth-child(8)  { animation-delay: 0.31s; }
.abf-card:nth-child(9)  { animation-delay: 0.35s; }
.abf-card:nth-child(10) { animation-delay: 0.39s; }
.abf-card:nth-child(11) { animation-delay: 0.43s; }
.abf-card:nth-child(12) { animation-delay: 0.47s; }

@keyframes abf-fadeup {
    to { opacity: 1; transform: translateY(0); }
}

/* ── Card Image ── */
.abf-card-image-wrap {
    position: relative;
    display: block;
    overflow: hidden;
    text-decoration: none;
}

.abf-card-image {
    width: 100%;
    height: 210px;
    overflow: hidden;
    background: var(--abf-surface);
}

.abf-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.abf-card:hover .abf-card-image img {
    transform: scale(1.06);
}

/* ── Category Badge ── */
.abf-card-cat {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: var(--abf-accent);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 10px;
    border-radius: 4px;
    pointer-events: none;
}

/* ── Card Body ── */
.abf-card-body {
    padding: 22px 22px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* ── Title ── */
.abf-card-title {
    font-family: var(--abf-font-head);
    font-size: 1.15rem;
    font-weight: 400;
    line-height: 1.35;
    margin: 0 0 10px;
    color: var(--abf-text);
}

.abf-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color var(--abf-transition);
}

.abf-card-title a:hover {
    color: var(--abf-accent);
}

/* ── Excerpt ── */
.abf-card-excerpt {
    font-size: 0.875rem;
    color: var(--abf-text-muted);
    line-height: 1.65;
    margin: 0 0 18px;
    flex: 1;
}

/* ── Read More ── */
.abf-read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--abf-accent);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: gap var(--abf-transition), color var(--abf-transition);
    align-self: flex-start;
    margin-top: auto;
}

.abf-read-more svg {
    transition: transform var(--abf-transition);
    flex-shrink: 0;
}

.abf-read-more:hover {
    color: #1e4d37;
    gap: 10px;
}

.abf-read-more:hover svg {
    transform: translateX(3px);
}

/* ── Loader ── */
.abf-loader {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 60px 0;
}

.abf-loader.is-active {
    display: flex;
}

.abf-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--abf-border);
    border-top-color: var(--abf-accent);
    border-radius: 50%;
    animation: abf-spin 0.7s linear infinite;
}

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

/* ── No Results ── */
.abf-no-results {
    text-align: center;
    padding: 80px 20px;
    color: var(--abf-text-muted);
    grid-column: 1 / -1;
}

.abf-no-results-icon {
    margin-bottom: 16px;
    opacity: 0.35;
}

.abf-no-results p {
    font-size: 1rem;
    margin: 0;
}

/* ── Grid Fade Out (during loading) ── */
.abf-grid.is-loading {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
