.project-details {
    max-height: 0;
    overflow: hidden;
    opacity: 0;

    padding: 0;
    margin-top: 0;
    border-width: 0;
    border-style: solid;
    border-color: rgb(229 231 235);
    background-color: transparent;

    transition: max-height 0.35s ease,
    opacity 0.2s ease,
    padding 0.2s ease,
    margin-top 0.2s ease,
    border-width 0.2s ease,
    background-color 0.2s ease;
}

.project-details.active {
    max-height: 2000px;
    opacity: 1;
    padding: 1rem 1.5rem; /* ~p-6 */
    margin-top: 0;
    border-width: 0 1px 1px 1px;
    background-color: rgb(249 250 251); /* gray-50 */
}

/* Smaller "View Details" row */
.project-toggle {
    padding: 0.45rem 0.75rem;
    font-size: 0.75rem;
    line-height: 1rem;
    cursor: pointer;
}

.expand-arrow {
    transition: transform 0.2s ease;
}

.expand-arrow.rotated {
    transform: rotate(180deg);
}

.project-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* --- THUMBNAIL GRID --- */
.thumbnail-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    cursor: zoom-in;
    transition: opacity 0.2s, transform 0.2s;
    background-color: #fff;
}

.thumbnail:hover {
    opacity: 0.85;
    transform: scale(1.02);
    border-color: #d1d5db;
}

/* Zoomable behavior */
.zoomable-image {
    cursor: zoom-in;
}

@media (max-width: 767px) {
    .thumbnail {
        width: 64px;
        height: 64px;
        cursor: default;
    }
}

/* --- OVERLAY --- */
.image-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.image-overlay.active {
    opacity: 1;
    visibility: visible;
}

.image-overlay img {
    max-width: 92vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.overlay-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: white;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background-color: rgba(0, 0, 0, 0.5);
    transition: background-color 0.2s ease;
}

.overlay-close:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

h1, h2, h3 { letter-spacing: -0.03em !important; }

/* Ensure names never overflow */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Line clamping for descriptions */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}