/* ─────────────────────────────────────
   Category AJAX Filter — style.css v1.3.0
   Design: colored thumbs, green badges,
   Montserrat titles, Inter body
───────────────────────────────────── */

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

/* ── Wrapper ────────────────────────── */
.caf-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    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-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1;
}

.caf-tab:hover {
    border-color: #123c69;
    color: #123c69;
    background: #eef3f8;
}

.caf-tab.active {
    background: #123c69;
    border-color: #123c69;
    color: #ffffff;
    font-weight: 700;
}

/* ── 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;
    animation: caf-fade-in 0.35s ease both;
}

.caf-card:hover {
    box-shadow: 0 8px 32px rgba(18, 60, 105, 0.12);
    transform: translateY(-3px);
}

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

.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);
}

/* ── Colored thumb backgrounds per category slug ── */
/* These auto-cycle through a palette. Add more as needed. */
.caf-card__thumb[data-cat-slug="dot-audits"],
.caf-card__thumb[data-cat-slug="dot-audit"],
.caf-card__thumb[data-cat-slug="dot_audits"] {
    background: #1a3a6b;
}

.caf-card__thumb[data-cat-slug="csa-scores"],
.caf-card__thumb[data-cat-slug="csa_scores"] {
    background: #2e7d32;
}

.caf-card__thumb[data-cat-slug="dq-files"],
.caf-card__thumb[data-cat-slug="dq_files"] {
    background: #5f7d8c;
}

.caf-card__thumb[data-cat-slug="drug-alcohol"],
.caf-card__thumb[data-cat-slug="drug-and-alcohol"],
.caf-card__thumb[data-cat-slug="drug_alcohol"] {
    background: #7b3f6e;
}

.caf-card__thumb[data-cat-slug="compliance"] {
    background: #2563eb;
}

.caf-card__thumb[data-cat-slug="guides"] {
    background: #0891b2;
}

.caf-card__thumb[data-cat-slug="psp-reports"],
.caf-card__thumb[data-cat-slug="psp_reports"] {
    background: #b45309;
}

.caf-card__thumb[data-cat-slug="ticket-defense"],
.caf-card__thumb[data-cat-slug="ticket_defense"] {
    background: #7c3aed;
}

/* Placeholder (no featured image) */
.caf-card__thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #ffffff;
}

.caf-bolt-icon {
    color: #ffffff;
    opacity: 0.45;
}

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

/* ── Category badge ─────────────────── */
.caf-badge {
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 700;
    font-style: normal;
    line-height: 19px;
    color: rgb(46, 125, 50);
    background: #F1F8E9;
    border: none;
    border-radius: 4px;
    padding: 2px 10px;
    align-self: flex-start;
}

/* ── Post title ─────────────────────── */
.caf-card__title {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 700;
    font-style: normal;
    line-height: 19px;
    color: rgb(18, 60, 105);
    margin: 0;
}

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

.caf-card__title a:hover {
    color: #2e7d32;
}

/* ── Meta row ───────────────────────── */
.caf-card__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #6b7280;
    line-height: 1.5;
}

.caf-meta__dot {
    color: #d1d5db;
}

/* ── Excerpt ────────────────────────── */
.caf-card__excerpt {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    font-style: normal;
    line-height: 22px;
    color: rgb(55, 65, 81);
    margin: 0;
    flex: 1;
}

/* ── Read Article link ──────────────── */
.caf-read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    font-style: normal;
    line-height: 22px;
    color: rgb(18, 60, 105);
    text-decoration: none;
    margin-top: 4px;
    transition: color 0.2s ease, gap 0.2s ease;
}

.caf-read-more:hover {
    color: #2e7d32;
    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: #123c69;
    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-family: 'Inter', sans-serif;
    font-size: 15px;
}

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

/* ── 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;
    padding: 14px 44px;
    background: #ffffff;
    color: rgb(18, 60, 105);
    border: 2px solid rgb(18, 60, 105);
    border-radius: 999px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    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: rgb(18, 60, 105);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(18, 60, 105, 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;
}
