﻿/* ## PROJECTS SECTION ## */

.projects-section {
    padding: 4rem 2rem;
    background: var(--bg);
}

.section-container {
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    align-items: start; /* This prevents short cards from stretching as much as long ones */
    gap: 2rem;
}

.project-card {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    /* aspect-ratio: 1/1; */
    height: 100%; /* Causes all cards in the same row to be the same height */
    transition: transform var(--transition), box-shadow var(--transition);
}

.project-card:hover {
    border-color: var(--accent); /* The border turns orange when you pass */
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(255, 80, 0, 0.15);
}

.project-card a {
    display: block;
    width: 100%;
    text-decoration: none;
}

.project-card a:hover .project-image {
    filter: brightness(1.1);
    transform: scale(1.02);
    transition: all 0.3s ease;
}

.project-name {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.project-desc {
    font-size: 0.95rem;
    opacity: 0.8;
    margin-bottom: 1.5rem;
    flex-grow: 1; /* Always push links to the bottom */
}

.project-image {
    width: 100%;
    height: 220px;        /* Fixed height for preview */
    object-fit: cover;    /* Crop the image to fill the space */
    object-position: top; /* Show top (crucial for code screenshots) */
    border-radius: 8px;
    margin-bottom: 1.5rem;
    cursor: zoom-in;
}

/* Internal links to the card */
.project-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: auto;
}

.project-links .link-primary {
    background: var(--accent);
    color: var(--bg);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;

    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 2;
}

.project-links .link-primary:hover {
    color: var(--text);

    .icon-itch {
        color: var(--text);
    }

    .arrow {
        stroke: var(--text);
    }
}

.project-links .link-secondary {
    background: var(--accent);
    color: var(--bg);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    justify-content: right;

    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 2;
}

.project-links .link-secondary:hover {
    color: var(--text);

    .arrow {
        stroke: var(--text);
    }
}

@media (max-width: 480px) {
    .projects-section { padding: 3rem 1.5rem; }
    .projects-grid { grid-template-columns: 1fr; }
}