/* case-studies.css */

/* ── Filter bar ───────────────────────────────────────────── */
.cs-filter {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin: 2.5rem 0;
}

.cs-filter-btn {
    padding: .45rem 1.1rem;
    border-radius: 50px;
    font-size: .78rem;
    font-weight: 600;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .2s;
    font-family: 'Inter', sans-serif;
}

.cs-filter-btn:hover,
.cs-filter-btn.active {
    border-color: var(--gold);
    color: var(--gold);
    background: var(--gold-dim);
}

/* ── Grid ─────────────────────────────────────────────────── */
.cs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

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

.cs-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-glow);
    box-shadow: 0 12px 48px rgba(212, 175, 55, .1);
}

/* ── Thumbnail — IMAGE FIX ────────────────────────────────── */
.cs-thumb {
    height: clamp(160px, 18vw, 220px);
    position: relative;
    /* anchor for absolute children */
    overflow: hidden;
    flex-shrink: 0;
}

/* Image fills the whole thumb area */
.cs-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Fallback placeholder when no image */
.cs-thumb-placeholder {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #0D1B2A, #1A2A4A);
}

/* Gradient overlay sits above image */
.cs-thumb-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
            rgba(8, 11, 18, .88) 0%,
            rgba(8, 11, 18, .3) 45%,
            transparent 100%);
    z-index: 1;
}

/* Badge sits above overlay */
.cs-badge-pos {
    position: absolute;
    bottom: 1.125rem;
    left: 1.125rem;
    z-index: 2;
}

/* ── Card body ────────────────────────────────────────────── */
.cs-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.cs-body h3 {
    color: var(--text-primary);
    font-size: 1.0625rem;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    margin-bottom: .5rem;
    line-height: 1.35;
}

.cs-body>p {
    font-size: .82rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 1.125rem;
    flex: 1;
}

/* ── Results row ──────────────────────────────────────────── */
.cs-results {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.125rem;
}

.cs-result {
    flex: 1;
    min-width: 0;
}

.cs-result strong {
    font-family: 'Playfair Display', serif;
    font-size: 1.375rem;
    background: var(--grad-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    line-height: 1.1;
    margin-bottom: .2rem;
}

.cs-result span {
    font-size: .68rem;
    color: var(--text-muted);
    line-height: 1.3;
    display: block;
}

/* ── Read more link ───────────────────────────────────────── */
.cs-link {
    font-size: .78rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: .04em;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    transition: gap .2s;
    text-decoration: none;
    margin-top: auto;
}

.cs-card:hover .cs-link {
    gap: .6rem;
}

/* ── Featured card (span 2) ───────────────────────────────── */
.cs-featured {
    grid-column: span 2;
}

.cs-featured .cs-thumb {
    height: clamp(200px, 25vw, 320px);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
    .cs-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cs-featured {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .cs-grid {
        grid-template-columns: 1fr;
    }

    .cs-featured {
        grid-column: span 1;
    }

    .cs-results {
        gap: .75rem;
    }

    .cs-result strong {
        font-size: 1.125rem;
    }
}