.container {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
}

.projects-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.project-card {
    background: white;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    cursor: pointer;
}

/* .project-card:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
} */

.card-image {
    flex: 1;
    overflow: hidden;
    position: relative;
    max-height: 600px; /* cap so cards don't grow excessively on very tall screens */
}

/* Enforce 15:10 (3:2) aspect ratio using padding hack for better compatibility */
.card-image::before {
    content: "";
    display: block;
    padding-top: 66.66%;
}

.card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center; /* Center the image within the frame */
    transition: transform 0.5s ease;
}

.project-card:hover .card-image img {
    transform: scale(1.05);
}

.card-content {
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.card-header {
    flex-grow: 1;
}

.card-header h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #2c3e50;
    font-weight: 400;
}

.card-header p {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 20px;
    line-height: 1.7;
}

.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.category {
    background: #e9ecef;
    color: #495057;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 300;
}

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9); /* Slightly more transparent */
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.visible {
    opacity: 1;
    visibility: visible;
}
.lightbox-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    color: white;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1250;
}

.lightbox-title {
    font-size: 1.5rem;
    font-weight: 500;
}

.close-btn {
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    color: white;
    transition: transform 0.2s ease;
}

.close-btn:hover {
    transform: scale(1.1);
}
.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center main content */
    align-items: center;
    padding-top: 80px; /* Space for header */
    padding-bottom: 120px; /* Space for thumbnails */
}

.lightbox-image-container {
    flex-grow: 1; /* Allow container to fill space */
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.lightbox-frame {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 90vw;
    max-height: 70vh; /* Adjust height for title and thumbs */
    overflow: hidden;
}

.lightbox-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
/* Thumbnails Bar */
.lightbox-thumbnails {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px; /* Adjust height as needed */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.thumbnail-img {
    width: 70px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    filter: grayscale(80%);
}

.thumbnail-img:hover {
    border-color: #fff;
    filter: grayscale(0%);
}

.thumbnail-img.active {
    border-color: #fff;
    transform: scale(1.1);
    filter: grayscale(0%);
}
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: background 0.3s ease;
    z-index: 1200;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}
.image-counter {
    position: absolute;
    bottom: 110px; /* Above thumbnail bar */
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
}

@media (max-width: 992px) {
    .project-card {
        flex-direction: column;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        touch-action: manipulation;
    }
    .card-image {
        max-height: 500px;
    }
    
    .header h1 {
        font-size: 2.8rem;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 70px 20px;
    }
    .header h1 {
        font-size: 2.3rem;
    }
    .card-image {
        max-height: 400px;
    }
    .card-content {
        padding: 20px;
    }
    .lightbox-title {
        font-size: 1.2rem;
    }
    .lightbox-header {
        padding: 15px 20px;
    }
    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    .prev-btn {
        left: 10px;
    }
    .next-btn {
        right: 10px;
    }
    .lightbox-thumbnails {
        height: 80px;
        gap: 8px;
    }
    .thumbnail-img {
        width: 60px;
        height: 40px;
    }
    .image-counter {
        bottom: 90px;
    }
}