/* ==========================================================================
   PROJECT DETAILS PAGE - DESKTOP OPTIMIZED
   ========================================================================== */

:root {
    --color-bg-dark: #0f0f0f;
    --color-bg-darker: #0a0a0a;
    --color-primary: #d4af37;
    --color-white: #ffffff;
    --color-text-secondary: rgba(255, 255, 255, 0.75);
}

/* --- Project Hero --- */
.project-hero {
    position: relative;
    height: 80vh;
    min-height: 600px;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    color: var(--color-white);
    padding-top: 80px;
}

.project-hero .video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.project-hero .video-overlay {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.6) 100%);
    z-index: 2;
}

.project-hero .container {
    padding-top: 4rem;
}

/* Back Link */
.back-link.absolute-top-left {
    position: absolute;
    top: 100px;
    left: 30px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 99px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.back-link.absolute-top-left:hover {
    color: var(--color-primary);
    background: rgba(255, 255, 255, 0.25);
    border-color: var(--color-primary);
    transform: translateX(-5px);
}

.back-link svg {
    width: 18px;
    height: 18px;
}

.hero-title {
    font-size: clamp(3rem, 5vw, 4.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(to bottom, #ffffff 0%, #f5f5f5 30%, #c0c0c0 50%, #e8e8e8 51%, #ffffff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.hero-subtitle {
    font-size: 1.35rem;
    color: #FFD700;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-badge {
    display: inline-block;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    padding: 0.5rem 1.5rem;
    border-radius: 99px;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #000;
}

/* Project Details Section */
.project-details-section {
    padding: 4rem 0;
    background: #0a0a0a;
}

.project-details-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.project-details-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 3rem;
    margin-top: 2rem;
}

/* Main Content */
.main-content {
    min-width: 0;
}

.section-block {
    background: var(--color-bg-dark);
    border-radius: 12px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(212, 175, 55, 0.1);
}

.block-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--color-white);
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 0.75rem;
    display: inline-block;
}

.rich-text {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--color-text-secondary);
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.15);
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(212, 175, 55, 0.05);
    border-color: var(--color-primary);
    transform: translateX(5px);
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-card {
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.95) 0%, rgba(30, 30, 30, 0.95) 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 15px rgba(212, 175, 55, 0.1);
    /* Subtle Gold Glow */
}

.sidebar-card h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #FFD700;
    /* Bright Gold */
    text-align: center;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    padding-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.summary-list {
    list-style: none;
    padding: 0;
    margin-bottom: 2rem;
}

.summary-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-list li:last-child {
    border-bottom: none;
}

.summary-list .label {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    /* High contrast white */
    font-weight: 500;
}

.summary-list .value {
    font-size: 1rem;
    color: #ffffff;
    /* Pure White */
    font-weight: 600;
    text-align: right;
}

.summary-list .accent-text {
    color: #FFD700;
    /* Bright Gold */
    font-size: 1.15rem;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.feature-icon-wrapper {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.1));
    border-radius: 8px;
    flex-shrink: 0;
}

.feature-icon-wrapper svg {
    width: 22px;
    height: 22px;
    stroke: var(--color-primary);
    stroke-width: 2.5;
}

.feature-item span {
    color: var(--color-white);
    font-size: 0.95rem;
    font-weight: 500;
}

/* Refined Gallery Grid (Desktop - Standard 3 col) */
.project-gallery-grid-refined {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1.5rem !important;
    margin-top: 1.5rem;
    width: 100% !important;
    max-width: 100% !important;
}

.gallery-item-refined {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    background: var(--color-bg-darker);
    border: 1px solid rgba(212, 175, 55, 0.1);
    transition: all 0.4s ease;

    /* MANDATORY ASPECT RATIO (Prompt 2) */
    aspect-ratio: 4 / 3 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    /* Critical for grid overflow fix */
}

.gallery-item-refined:hover {
    border-color: var(--color-primary);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.gallery-item-refined img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    /* CRITICAL: Prevents distortion */
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    max-width: 100% !important;
}

.gallery-item-refined:hover img {
    transform: scale(1.05);
}

.gallery-item-refined .overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

.gallery-item-refined:hover .overlay {
    opacity: 1;
}

/* Icon Box Style */
.gallery-item-refined .icon-box {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gallery-item-refined:hover .icon-box {
    transform: scale(1);
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #000;
}

/* Nav Hint - Removed (Prompt 3 says prevent horizontal scrolling completely) */
.gallery-nav-hint {
    display: none;
}

.mobile-scroll-hint {
    display: none;
}

/* Responsive */
@media (max-width: 968px) {
    .project-details-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        display: flex;
        flex-direction: column;
    }

    /* Reorder sections on mobile */
    #project-gallery {
        order: 1;
        /* Gallery first */
    }

    .sidebar {
        position: static;
        order: 3;
    }

    .section-block:not(#project-gallery) {
        order: 2;
    }

    /* Prompt 3: Mobile Vertical Stack (No Horizontal Scroll) */
    .project-gallery-grid-refined {
        /* Reset any flex/scroll logic */
        display: grid !important;
        overflow-x: visible !important;
        scroll-snap-type: none !important;
        padding-bottom: 0 !important;

        /* 2 Columns for Tablets/Large Mobiles */
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
        width: 100% !important;
    }

    .gallery-item-refined {
        /* Reset mobile width logic */
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        scroll-snap-align: none !important;
        height: auto !important;
        border-radius: 12px;

        /* Maintain Aspect Ratio */
        aspect-ratio: 4 / 3 !important;
    }

    /* Ensure styles are mobile friendly */
    .gallery-item-refined .overlay {
        opacity: 0;
    }

    .gallery-item-refined:active .overlay,
    .gallery-item-refined:focus .overlay {
        opacity: 1;
    }

    .gallery-item-refined .icon-box {
        transform: scale(1);
    }
}

@media (max-width: 500px) {

    /* Prompt 3: Single Column for very small screens */
    .project-gallery-grid-refined {
        grid-template-columns: 1fr !important;
    }

    .gallery-item-refined {
        aspect-ratio: 4 / 3 !important;
    }
}


@media (max-width: 640px) {
    .project-details-container {
        padding: 0 1rem;
    }

    .section-block {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .block-title {
        font-size: 1.35rem;
    }

    /* Clean up old overrides */

    .features-grid {
        grid-template-columns: 1fr;
    }

    .sidebar-card {
        padding: 1.5rem;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
        background: rgba(0, 0, 0, 0.5);
        /* Improved visibility on mobile */
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-close {
        top: 20px;
        right: 20px;
    }
}

/* ==========================================================================
   LIGHTBOX FIXES (AUTHORITATIVE)
   ========================================================================== */
.lightbox {
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    width: 90vw;
    height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-content img {
    /* FORCE FILL: width/height 100% of the 90vw/90vh container */
    /* object-fit: contain ensures aspect ratio is kept but image is MAXIMIZED */
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

/* Navigation Buttons - GLOBAL */
.lightbox-prev,
.lightbox-next,
.lightbox-close {
    position: absolute;
    z-index: 1001;
    /* Above image */
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    padding-bottom: 4px;
    /* Fix vertical alignment of arrow */
}

/* Specific Positioning */
.lightbox-close {
    top: 30px;
    right: 30px;
}

.lightbox-prev {
    top: 50%;
    left: 30px;
    transform: translateY(-50%);
}

.lightbox-next {
    top: 50%;
    right: 30px;
    transform: translateY(-50%);
}

/* Hover States (Highlight) */
.lightbox-prev:hover,
.lightbox-next:hover,
.lightbox-close:hover {
    background: #d4af37;
    /* Gold */
    color: #000;
    border-color: #d4af37;
    transform: translateY(-50%) scale(1.1);
    /* Maintain vertical center + scale */
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.lightbox-close:hover {
    transform: scale(1.1);
    /* No translateY for close button */
}

/* Mobile Adjustments */
@media (max-width: 768px) {

    .lightbox-prev,
    .lightbox-next {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
        background: rgba(0, 0, 0, 0.7);
        /* Darker on mobile for contrast */
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-close {
        top: 15px;
        right: 15px;
    }
}