/* ─────────────────────────────────────
   Category AJAX Filter — style.css
   Matches the clean card design in screenshot 2
───────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Poppins:wght@600;700&display=swap');

/* Wrapper */
.caf-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    font-family: inherit;
    box-sizing: border-box;
}

/* ── Filter bar ─────────────────────── */
.caf-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
}

.caf-tab {
    display: inline-flex;
    align-items: center;
    padding: 10px 22px;
    border-radius: 999px;
    border: 1.5px solid #d1d5db;
    background: #ffffff;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1;
}

.caf-tab:hover {
    border-color: #1e3a5f;
    color: #1e3a5f;
    background: #f0f4f8;
}

.caf-tab.active {
    background: #1e3a5f;
    border-color: #1e3a5f;
    color: #ffffff;
    font-weight: 600;
}

/* ── Grid ───────────────────────────── */
.caf-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    min-height: 200px;
    transition: opacity 0.2s ease;
}

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

@media (max-width: 1024px) {
    .caf-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .caf-grid { grid-template-columns: 1fr; }
    .caf-filter-bar { gap: 8px; }
    .caf-tab { font-size: 13px; padding: 8px 16px; }
}

/* ── Card ───────────────────────────── */
.caf-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.25s ease, transform 0.2s ease;
}

.caf-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    transform: translateY(-3px);
}

/* Thumbnail */
.caf-card__thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #dbeafe;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.caf-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.caf-card:hover .caf-card__thumb img {
    transform: scale(1.04);
}

.caf-card__thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #dbeafe;
}

.caf-bolt-icon {
    opacity: 0.75;
}

/* Body */
.caf-card__body {
    padding: 20px 22px 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 12px;
}

/* Badge */
.caf-badge {
    display: inline-block;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #0b3c5e;
    background: #EAF2FB;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    align-self: flex-start;
    line-height: 1.5;
}

/* Title */
.caf-card__title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: #1e3a5f;
    margin: 0;
}

.caf-card__title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s;
}

.caf-card__title a:hover {
    color: #2563eb;
}

/* Excerpt */
.caf-card__excerpt {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #6b7280;
    line-height: 1.65;
    margin: 0;
    flex: 1;
}

/* Meta row */
.caf-card__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #6b7280;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
    margin-top: 2px;
}

.caf-meta__read-time {
    display: flex;
    align-items: center;
    gap: 5px;
}

.caf-meta__read-time svg {
    flex-shrink: 0;
    color: #6b7280;
}

.caf-meta__dot {
    color: #d1d5db;
    font-size: 16px;
    line-height: 1;
}

/* Read more link */
.caf-read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #0b3c5e;
    background: #E8F0F6;
    text-decoration: none;
    margin-top: 4px;
    padding: 8px 16px;
    border-radius: 6px;
    align-self: flex-start;
    transition: background 0.2s ease, color 0.2s ease, gap 0.2s ease;
}

.caf-read-more:hover {
    background: #ff6e00;
    color: #ffffff;
    gap: 10px;
}
/* ── Spinner ────────────────────────── */
.caf-spinner {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 40px 0;
}

.caf-spinner.visible {
    display: flex;
}

.caf-spinner span {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1e3a5f;
    animation: caf-bounce 0.9s infinite ease-in-out;
    opacity: 0.7;
}

.caf-spinner span:nth-child(2) { animation-delay: 0.15s; }
.caf-spinner span:nth-child(3) { animation-delay: 0.30s; }

@keyframes caf-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40%           { transform: scale(1);   opacity: 1;   }
}

/* ── No results ─────────────────────── */
.caf-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
    font-size: 15px;
}

/* ── Card entrance animation ────────── */
@keyframes caf-fade-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.caf-card {
    animation: caf-fade-in 0.35s ease both;
}

/* ── Load More ──────────────────────── */
.caf-load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 48px;
}

.caf-load-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 40px;
    background: #ffffff;
    color: #1e3a5f;
    border: 2px solid #1e3a5f;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.caf-load-more-btn:hover:not(:disabled) {
    background: #1e3a5f;
    color: #ffffff;
    box-shadow: 0 4px 18px rgba(30, 58, 95, 0.25);
    transform: translateY(-2px);
}

.caf-load-more-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}

.caf-load-more-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
