/* Grid Layout - Fixed for Mobile */
.cases-grid {
    display: grid;
    /* Use a smaller min-width (280px) to prevent overflow on mobile devices */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

@media (max-width: 640px) {
    .cases-grid {
        /* Force single column layout on small screens */
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1rem 0;
    }

    /* Override global container padding for this page on mobile if needed */
    /* Note: We can't easily override global .container here without higher specificity or !important, 
       but fixing the grid columns usually solves the "cut off" issue. */
}

/* Card Styling - Updated to match "For Whom" aesthetics */
.case-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    /* Ensure clean white background and subtle shadow like screenshot */
    box-shadow: var(--shadow-soft);
}

.case-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-primary);
}

.case-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Updated Icon Style to match screenshot (Purple/Color circle) */
.case-icon {
    font-size: 2rem;
    /* Adjusted size */
    color: var(--accent-primary);
    line-height: 1;
    /* Optional: Add circle background if distinct style is needed, 
       but screenshot just showed colored icon. 
       If previous screenshot had a circle, we can add it. 
       Let's keep it simple but clean. 
    */
}

/* If user wants specific "purple circle" look, we can style it: */
/* .case-icon i { ... } */

.case-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.case-tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.case-title {
    font-size: 1.5rem;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 700;
    /* Ensure bold */
}

.case-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
    line-height: 1.6;
    font-size: 1.05rem;
    /* Readability */
}

.case-meta {
    margin-top: auto;
    padding-top: 1.5rem;
    /* Subtle separator or none? Screenshot has none but it separates "content" from "action". */
    /* border-top: 1px solid var(--border-color); */
    /* Let's remove the heavy border to match the cleaner look */
    border-top: none;
}

.case-goal {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
    background: var(--bg-secondary);
    /* Add subtle highlight box for goal? */
    padding: 1rem;
    border-radius: 8px;
}

.case-goal strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.25rem;
}

/* Ensure consistent button placement */
.case-card .btn-text {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--accent-primary);
    transition: gap 0.2s;
}

.case-card .btn-text:hover {
    gap: 0.75rem;
}