/* Project Details Page Styles */

.project-detail-container {
    max-width: 1400px;
    margin: 130px auto 40px;
    padding: 0 20px;
    min-height: 60vh;
}

.back-link-container {
    margin-bottom: 20px;
    width: 100%;
    display: flex;
    justify-content: flex-start;
    /* Ensure left alignment */
    text-align: left;
}

/* Back Link Button */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.75rem 1.5rem;
    border-radius: 0;
    background: transparent;
    color: var(--accent-color, #FF7900);
    border: 1px solid var(--accent-color, #FF7900);
    text-decoration: none;
    font-weight: 400;
    transition: all 0.3s ease;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
}

.back-link:hover {
    background-color: var(--accent-color, #FF7900);
    color: white;
    box-shadow: none;
    transform: none;
}

/* New Grid Layout Styles */

/* 1. Header Section (Top Centered) */
.project-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.project-title {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 10px;
    color: #1a1a1a;
    line-height: 1.2;
}

.project-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    color: #666;
    font-size: 0.95rem;
}

.meta-item i {
    margin-right: 5px;
    color: var(--accent-color, #A67C52);
}

/* 2. Main Content Grid (Vertical Stack) */
.project-main-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    width: 100%;
}

/* Desktop Layout - Keep centered but limit width */
@media (min-width: 1024px) {
    .project-main-grid {
        /* No grid here anymore, just vertical stack */
        max-width: 800px;
        margin: 0 auto;
    }

    .project-thumbnails-column {
        /* Reset sidebar behavior */
        position: static;
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
        width: 100%;
    }
}

/* Media Column (Slideshow) */
.project-media-column {
    width: 100%;
    min-width: 0;
}

/* Thumbnails Column */
.project-thumbnails-column {
    width: 100%;
}

.thumbnails-container {
    display: grid;
    /* Adjust minmax to control thumbnail size */
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    width: 100%;
}

.thumbnail-wrapper {
    aspect-ratio: 1;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 0;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.thumbnail-wrapper.active {
    border-color: var(--accent-color, #A67C52);
}

.thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.thumbnail-wrapper:hover .thumbnail-image {
    transform: scale(1.1);
}

/* Main Image Container adjustments */
.main-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background-color: #f7f7f7;
    overflow: hidden;
    border-radius: 0;
    touch-action: pan-y;
    /* Removed margin-bottom since gap handles it now */
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
    cursor: zoom-in;
}

.main-image.portrait {
    object-fit: contain;
    background-color: transparent;
}

/* Navigation Buttons override */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent !important;
    border: none !important;
    outline: none !important;
    padding: 20px;
    /* Larger hit area */
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white !important;
    font-size: 3rem;
    /* Larger, bolder looking arrow */
    font-weight: bold;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
    /* Subtle shadow for contrast, not a box */
    transition: all 0.3s ease;
    z-index: 10;
}

.nav-btn:hover {
    color: #FF7900 !important;
    /* Orange on hover */
    background: transparent !important;
    box-shadow: none;
    transform: translateY(-50%) scale(1.2);
    /* Scale up on hover */
}

.nav-btn:focus {
    outline: none;
}

.nav-btn.prev {
    left: 10px;
}

.nav-btn.next {
    right: 10px;
}

.image-counter {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 12px;
    border-radius: 0;
    font-size: 0.9rem;
}



/* Lightbox overlay for full screen view */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 20000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 30px;
    left: 30px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
    cursor: pointer;
    z-index: 99999;
    padding: 10px 20px;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.lightbox-close:hover {
    background-color: var(--accent-color, #FF7900);
    border-color: var(--accent-color, #FF7900);
    color: white;
    box-shadow: 0 6px 15px rgba(255, 121, 0, 0.4);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    z-index: 1010;
    opacity: 0.7;
    transition: all 0.3s;
    padding: 20px;
}

.lightbox-nav:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav.prev {
    left: 20px;
}

.lightbox-nav.next {
    right: 20px;
}

@media (max-width: 768px) {
    .project-detail-container {
        margin-top: 120px;
        /* Increased to clear the fixed header and prevent blocking content */
        position: relative;
        padding: 0 20px;
    }

    .project-title {
        font-size: 1.8rem;
        word-wrap: break-word;
        /* Prevent overflow on long titles */
    }

    .nav-btn {
        width: 40px;
        /* Slightly larger for touch targets */
        height: 40px;
        background: rgba(0, 0, 0, 0.3) !important;
        /* Slight background for visibility */
        border-radius: 50%;
    }

    .main-image-container {
        aspect-ratio: auto;
        /* Let image dictate height or 4/3 */
        min-height: 250px;
    }

    .main-image {
        /* Ensure image fits well */
        object-fit: contain;
        background: #f5f5f5;
    }

    /* Position "Back to Our Work" button more reliably */
    .back-link-container {
        position: relative;
        /* Keep in flow, don't absolute position over header */
        top: auto;
        right: auto;
        margin-bottom: 1rem;
        z-index: 10;
        width: 100%;
        text-align: left;
    }

    .back-link {
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
        background: white;
        display: inline-flex;
    }
}

/* =========================================
   Comparison Slider Styles
   ========================================= */


/* Add a simple wiggle keyframe if needed, but JS animation allows easier interruption */