/* ─────────────────────────────────────
   Results AJAX Filter — style.css v1.2.0
   Matches case study card design from screenshot
───────────────────────────────────── */

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

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

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

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

.raf-tab:hover {
    border-color: #1a6b3a;
    color: #1a6b3a;
    background: #f0fdf4;
}

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

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

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

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

/* ── Card ───────────────────────────── */
.raf-card {
    background: #ffffff;
    border-radius: 14px;
    /* Green top + left border matching screenshot */
    border: 1px solid #e5e7eb;
    border-top: 3px solid #2e7d32;
    border-left: 3px solid #2e7d32;
    padding: 22px 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: box-shadow 0.25s ease, transform 0.2s ease;
    animation: raf-fade-in 0.35s ease both;
    box-sizing: border-box;
}

.raf-card:hover {
    box-shadow: 0 8px 32px rgba(46, 125, 50, 0.12);
    transform: translateY(-3px);
}

/* ── Top row: badge + location ──────── */
.raf-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Achievement badge ──────────────── */
.raf-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    border-radius: 999px;
    padding: 4px 11px 4px 8px;
    line-height: 1.5;
    white-space: nowrap;
}

/* Green — satisfactory, passed, compliant etc */
.raf-badge--green {
    color: #166534;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
}

/* Blue — reduced, dropped */
.raf-badge--blue {
    color: #1e40af;
    background: #dbeafe;
    border: 1px solid #bfdbfe;
}

/* Orange — rebuilt, D&A, drug/alcohol */
.raf-badge--orange {
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fde68a;
}

/* Purple — other */
.raf-badge--purple {
    color: #5b21b6;
    background: #ede9fe;
    border: 1px solid #ddd6fe;
}

/* ── Location · Date ────────────────── */
.raf-loc-year {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #9ca3af;
    white-space: nowrap;
    margin-left: auto;
}

/* ── Card title ─────────────────────── */
.raf-card__title {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    color: #123c69;
    margin: 0;
}

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

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

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

/* ── Result highlight line ──────────── */
.raf-card__result {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #2e7d32;
    line-height: 1.5;
    margin: 0;
}

.raf-check-icon {
    flex-shrink: 0;
    margin-top: 1px;
    color: #2e7d32;
}

/* ── Services line ──────────────────── */
.raf-card__services {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
}

/* ── Spinner ────────────────────────── */
.raf-spinner {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 40px 0;
}

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

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

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

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

/* ── No results ─────────────────────── */
.raf-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
}

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

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

.raf-load-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 44px;
    background: #ffffff;
    color: #123c69;
    border: 2px solid #123c69;
    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;
}

.raf-load-more-btn:hover:not(:disabled) {
    background: #123c69;
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(18, 60, 105, 0.25);
    transform: translateY(-2px);
}

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

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