/* --- In Personal Portfolio/component_stylings/latest-project.css --- */

#latest-project {
    max-width: 75rem; 
    min-height: 65rem;
}

#latest-project h2 {
    /* The main section header "Latest project." */
    text-align: left;
    width: 100%;
    max-width: 1100px; /* Match other sections' content width */
    margin-left: auto;
    margin-right: auto;
    padding: 0 2rem; /* Match section padding */
    font-size: 2.5rem;
    margin-bottom: 3rem; /* More space below header */
}

.project-container {
    background-color: rgba(27, 27, 29, 0.85);
    border-radius: 24px;
    display: grid;
    grid-template-columns: 1.2fr 1fr; /* Image column slightly larger */
    gap: 3rem;
    width: 100%;
    max-width: 1100px; /* Match other sections' content width */
    margin: 0 auto;
    text-align: left;
    align-items: center;
    padding: 2rem;
}

.project-image-container img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    /* A shadow that incorporates your --c-action color */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 
                0 4px 15px color-mix(in srgb, var(--c-action), transparent 80%);
    border: 1px solid color-mix(in srgb, var(--c-light), transparent 90%);
}

.project-details h3 {
    /* "Real Estate Platform" */
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    color: var(--c-action);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.project-details h4 {
    /* "CityMate" */
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5rem;
    color: #f5f5f5;
    margin-bottom: 1rem;
}

.project-details p {
    /* Description */
    color: var(--c-content);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.project-details h5 {
    /* "Developed with" / "Read more" */
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    color: #f5f5f5;
    font-size: 1rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.project-tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tech-pill {
    /* Styled like the pills in the example image */
    background-color: color-mix(in srgb, var(--c-light), transparent 90%);
    color: var(--c-content);
    padding: 0.5rem 1rem;
    border-radius: 99em;
    font-size: 0.85rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    border: 1px solid color-mix(in srgb, var(--c-light), transparent 85%);
}

.project-source-button {
    /* This is a light-themed button, like the example */
    display: inline-flex; /* To align icon and text */
    align-items: center;
    gap: 0.75rem;
    
    background-color: #f0f0f0;
    color: var(--c-bg); /* Dark text */
    
    padding: 0.85rem 1.75rem;
    border-radius: 99em;
    font-size: 0.9rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;

    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.project-source-button svg {
    fill: var(--c-bg); /* Dark icon */
    transition: fill 0.3s ease;
    width: 16px;
    height: 16px;
}

.project-source-button:hover {
    background-color: #ffffff;
    color: var(--c-bg);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2);
}

.tech-stack-toggle {
    display: none;
}

/* --- Responsive (Mobile) --- */
@media (max-width: 820px) {
    #latest-project h2 {
        text-align: center;
        margin-bottom: 2rem;
        font-size: 2rem;
    }
    
    .project-container {
        grid-template-columns: 1fr; /* Stack columns */
        gap: 2.5rem;
        text-align: center;
    }
    
    .project-details h3,
    .project-details h4 {
        text-align: center;
    }

    .project-tech-stack {
        justify-content: center;  /* Center the pills */
        max-height: 5.75rem;      /* This is just enough for 2 rows */
        overflow: hidden;         /* Hides the rest */
        transition: max-height 0.4s ease-in-out; /* Smooth animation */
    }

    /* ADD these new rules inside your @media (max-width: 820px) block */

    /* This class will be toggled by JavaScript */
    .project-tech-stack.is-expanded {
        max-height: 50rem; /* A large value to show all pills */
    }

    /* Hide the toggle button on desktop */
    .tech-stack-toggle {
        display: none;
    }

    /* Style the new "Show All" button for mobile */
    .tech-stack-toggle {
        display: block; /* Show it on mobile */
        width: 100%;
        text-align: center;
        background: none;
        border: none;
        padding: 0.75rem;
        margin-top: 0.5rem; /* Space it from the pills */
        color: var(--c-action);
        font-family: 'Montserrat', sans-serif;
        font-weight: 600;
        font-size: 0.9rem;
        cursor: pointer;
        border-radius: 8px;
        transition: background-color 0.2s ease;
    }

    .tech-stack-toggle:hover {
        background-color: color-mix(in srgb, var(--c-light) 10%, transparent);
    }

    /* Set the button text with CSS */
    .tech-stack-toggle::after {
        content: 'Show All (13)'; /* You have 13 pills */
    }

    .tech-stack-toggle.is-expanded::after {
        content: 'Show Less';
    }

    .project-details h5 {
        text-align: center;
        margin-top: 2rem;
    }

    .project-source-button {
        margin: 0 auto;
    }
}