/* ============================================================
   Portfolio Card Grid
   Add these rules to your main stylesheet (or @import this
   file from it). The selectors are scoped to .portfolio-grid
   and .project-card so they won't interfere with other pages.
   ============================================================ */

/* ── Intro text above the grid ─────────────────────────────── */
.portfolio-intro {
    max-width: 860px;
    margin: 0 auto 2.5rem;
    padding: 0 1rem;
}

.portfolio-intro h1 {
    /* inherits your existing h1 styles */
    margin-bottom: 0.75rem;
}

/* ── Grid container ─────────────────────────────────────────── */
.portfolio-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: 2rem;
    padding: 0 1rem 3rem;
    /* cards sit at ~280px wide; grid fills available space */
    justify-content: flex-start;
}

/* ── Individual card ────────────────────────────────────────── */
.project-card {
    /* Layout */
    display: flex;
    flex-direction: column;
    flex: 0 1 calc(33.333% - 1.25rem);   /* 3-up on wide viewports */
    min-width: 200px;

    /* Appearance */
    background: rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px 4px 10px 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;

    /* Smooth grow on hover */
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    transform-origin: center center;
    will-change: transform;
}

.project-card:hover {
    transform: scale(1.04);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
    /* Ensure hovered card sits on top of its neighbors */
    position: relative;
    z-index: 2;
}

/* ── Thumbnail image area ───────────────────────────────────── */
.card-image {
    width: 100%;
    aspect-ratio: 4 / 3;    /* consistent crop regardless of source size */
    overflow: hidden;
    background: #292929;    /* placeholder while image loads */
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    transition: opacity 0.2s ease;
}

/* Fade-in once loaded (works with loading="lazy") */
.card-image img[src] {
    opacity: 1;
}

/* ── Text area ──────────────────────────────────────────────── */
.card-body {
    padding: 0.75rem 0.9rem 0.9rem;
    flex: 1;                /* pushes body to fill remaining card height */
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.card-client {
    /* Keep consistent with site typography; adjust as needed */
    font-size: 1.1rem;
    font-style: normal;
    font-weight: 400;
    margin: 0;
    line-height: 1.3;
    color: #FFFFFF;
}

.card-desc {
    font-size: 0.95rem;
    margin: 0;
    color: #AAAAAA;
    line-height: 1.25;
}

/* ── Responsive breakpoints ─────────────────────────────────── */
@media (max-width: 1290px) {
    .project-card {
        flex: 0 1 calc(50% - 1.25rem);   /* 2-up */
    }
}


@media (max-width: 795px) {
    .portfolio-grid {
        gap: 0rem;
    }
    .project-card {
        flex: 0 1 100%;                       /* 1-up on very small screens */
    }
}
