/* Projects Grid Styles */
.projects-grid {
    display: grid;
    gap: 25px;
    margin-bottom: 40px;
}

.projects-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.projects-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.projects-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.project-item {
    background: #fff;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.project-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.project-image-wrapper {
    position: relative;
    overflow: hidden;
    height: 250px;
}

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

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

.project-category {
    position: absolute;
    top: 20px;
    left: 20px;
    background: linear-gradient(135deg, #f4c430, #e6b229);
    color: #000;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(244, 196, 48, 0.4), 0 2px 4px rgba(0,0,0,0.1);
    border: 2px solid rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
    z-index: 2;
}

.project-info {
    padding: 25px;
    background: linear-gradient(to bottom, rgba(255,255,255,1), rgba(248,249,250,0.9));
    position: relative;
}

.project-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px !important;
    height: 3px;
    background: linear-gradient(90deg, #f4c430, #e6b229);
    border-radius: 2px;
}

.project-title {
    text-align: center;
    margin: 15px 0 12px 0;
    font-size: 26px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.project-excerpt {
    margin: 0;
    font-size: 15px;
    color: #5a6c7d;
    line-height: 1.6;
    font-weight: 400;
}

/* Project Gallery Grid Styles */
.project-gallery-grid,
.project-single-gallery .project-gallery-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.project-gallery-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.project-gallery-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.project-gallery-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.project-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #f5f5f5;
}

.project-gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.project-gallery-trigger {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.project-gallery-item:hover .project-gallery-trigger {
    transform: scale(1.05);
}

/* Lightbox Styles */
.project-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(5px);
}

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.lightbox-image-container {
    width: 90vw;
    height: 80vh;
    max-width: 1200px;
    max-height: 800px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: transparent;
    border-radius: 0;
    padding: 0;
}

.lightbox-image-container::-webkit-scrollbar {
    display: none;
}

.lightbox-slide {
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox-slide.is-active {
    display: flex;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0;
    box-shadow: none;
    display: block;
}

/* Control Buttons */
.lightbox-close {
    min-width: 44px;
    min-height: 44px;
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 0;
    color: white;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    z-index: 10001;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.lightbox-close::before,
.lightbox-close::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background: white;
    border-radius: 1px;
}

.lightbox-close::before {
    transform: rotate(45deg);
}

.lightbox-close::after {
    transform: rotate(-45deg);
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

.lightbox-prev,
.lightbox-next {
    min-width: 60px;
    min-height: 60px;
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    font-size: 28px;
    color: white;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 0;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s ease;
    border-radius: 50%;
    font-weight: bold;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    line-height: 1;
}

.lightbox-prev {
    right: 30px;
}

.lightbox-next {
    left: 30px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev:active,
.lightbox-next:active {
    transform: translateY(-50%) scale(0.95);
}

/* Counter */
.lightbox-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 16px;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    user-select: none;
}

/* Loading state */
.lightbox-image[src=""] {
    opacity: 0;
}

.lightbox-image {
    transition: opacity 0.3s ease;
}

/* Prevent body scroll when lightbox is open */
body.lightbox-open {
    overflow: hidden;
}

/* Mobile Responsive */
@media (max-width: 768px) {

    .projects-carousel-dots {
        display: flex;
        justify-content: center;
        gap: 10px;
        margin: 20px 0 40px;
    }

    .projects-carousel-dots .carousel-dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        border: none;
        background: rgba(128, 128, 128, 0.5);
        padding: 0;
        cursor: pointer;
        transition: transform 0.2s ease, background 0.2s ease;
    }

    .projects-carousel-dots .carousel-dot.active {
        background: #f4c430;
        transform: scale(1.2);
    }

    .projects-carousel-dots .carousel-dot:focus-visible {
        outline: 2px solid rgba(255, 255, 255, 0.9);
        outline-offset: 3px;
    }

/* Transform grid to horizontal carousel */
.projects-grid {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    gap: 40px;
    padding: 20px;
    margin: 0;
    justify-content: flex-start;
}

.projects-grid::-webkit-scrollbar {
    display: none;
}

.projects-grid .project-item {
    flex: 0 0 calc(100vw - 60px);
    width: calc(100vw - 60px);
    max-width: 450px;
    scroll-snap-align: center;
    position: relative;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.projects-grid .project-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(244, 196, 48, 0.05), rgba(230, 178, 41, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* Center the first project */
.projects-grid .project-item:first-child {
    margin-left: calc(50vw - 50% - 20px);
}

/* Center the last project */
.projects-grid .project-item:last-child {
    margin-right: calc(50vw - 50% - 20px);
}

.projects-grid .project-item:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), 0 8px 20px rgba(244, 196, 48, 0.15);
    border-color: rgba(244, 196, 48, 0.3);
    z-index: 2;
}

.projects-grid .project-item:hover::before {
    opacity: 1;
}

/* Enhanced mobile project info styling */
.projects-grid .project-info {
    padding: 25px;
    background: linear-gradient(to bottom, rgba(255,255,255,1), rgba(248,249,250,0.9));
    position: relative;
}

.projects-grid .project-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px !important;
    height: 3px;
    background: linear-gradient(90deg, #f4c430, #e6b229);
    border-radius: 2px;
}

.projects-grid .project-title {
    text-align: center;
    margin: 15px 0 12px 0;
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.projects-grid .project-excerpt {
    margin: 0;
    font-size: 15px;
    color: #5a6c7d;
    line-height: 1.6;
    font-weight: 400;
}

.projects-grid .project-category {
    position: absolute;
    top: 20px;
    left: 20px;
    background: linear-gradient(135deg, #f4c430, #e6b229);
    color: #000;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(244, 196, 48, 0.4), 0 2px 4px rgba(0,0,0,0.1);
    border: 2px solid rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
    z-index: 2;
}

    .projects-grid .project-item::before,
    .projects-grid .project-item:hover::before {
        display: none;
        opacity: 0;
    }

    .project-gallery-grid.columns-3,
    .project-gallery-grid.columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .project-gallery-trigger {
        height: 200px;
    }
    
    /* Increase image height for mobile carousel */
    .projects-grid .project-image-wrapper {
        height: 320px;
    }
    
    .lightbox-content {
        padding: 10px;
    }
    
    .lightbox-image-container {
        width: 95vw;
        height: 75vh;
    }
    
    .lightbox-prev,
    .lightbox-next {
        font-size: 20px;
        width: 50px;
        height: 50px;
        min-width: 50px;
        min-height: 50px;
    }
    
    .lightbox-prev {
        right: 15px;
    }
    
    .lightbox-next {
        left: 15px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 15px;
        width: 40px;
        height: 40px;
    }
    
    .lightbox-close::before,
    .lightbox-close::after {
        width: 16px;
        height: 2px;
    }
    
    .lightbox-counter {
        bottom: 20px;
        font-size: 14px;
        padding: 8px 16px;
    }
}

@media (max-width: 480px) {
    /* Enhanced mobile carousel for smaller screens */
    .projects-grid {
        gap: 30px;
        padding: 15px;
    }
    
    .projects-grid .project-item {
        flex: 0 0 calc(100vw - 40px);
        width: calc(100vw - 40px);
        max-width: 380px;
        background: linear-gradient(145deg, #ffffff, #f8f9fa);
        border-radius: 2px;
        overflow: hidden;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.8);
    }
    
    .projects-grid .project-item::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(45deg, rgba(244, 196, 48, 0.05), rgba(230, 178, 41, 0.1));
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }
    
    .projects-grid .project-item:hover {
        transform: translateY(-12px) scale(1.02);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), 0 8px 20px rgba(244, 196, 48, 0.15);
        border-color: rgba(244, 196, 48, 0.3);
    }
    
    .projects-grid .project-item:hover::before {
        opacity: 1;
    }
    
    /* Adjust centering for smaller screens */
    .projects-grid .project-item:first-child {
        margin-left: calc(50vw - 50% - 15px);
    }
    
    .projects-grid .project-item:last-child {
        margin-right: calc(50vw - 50% - 15px);
    }
    
    .project-image-wrapper {
        height: 280px;
        position: relative;
        overflow: hidden;
    }
    
    .project-image-wrapper::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
        transition: left 0.6s ease;
        z-index: 1;
    }
    
    .project-item:hover .project-image-wrapper::before {
        left: 100%;
    }
    
    /* Enhanced smaller mobile project styling */
    .projects-grid .project-info {
        padding: 25px;
        background: linear-gradient(to bottom, rgba(255,255,255,1), rgba(248,249,250,0.9));
        position: relative;
    }

    .projects-grid .project-info::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 80px !important;
        height: 3px;
        background: linear-gradient(90deg, #f4c430, #e6b229);
        border-radius: 2px;
    }

    .projects-grid .project-title {
        text-align: center;
        margin: 15px 0 12px 0;
        font-size: 28px;
        font-weight: 700;
        color: #2c3e50;
        line-height: 1.3;
        text-shadow: 0 1px 2px rgba(0,0,0,0.05);
    }

    .projects-grid .project-excerpt {
        margin: 0;
        font-size: 14px;
        color: #5a6c7d;
        line-height: 1.6;
        font-weight: 400;
    }

    .projects-grid .project-category {
        position: absolute;
        top: 20px;
        left: 20px;
        background: linear-gradient(135deg, #f4c430, #e6b229);
        color: #000;
        padding: 8px 16px;
        border-radius: 25px;
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1px;
        box-shadow: 0 4px 12px rgba(244, 196, 48, 0.4), 0 2px 4px rgba(0,0,0,0.1);
        border: 2px solid rgba(255,255,255,0.8);
        backdrop-filter: blur(10px);
        z-index: 2;
        animation: none;
    }

    .projects-grid .project-item::before,
    .projects-grid .project-item:hover::before {
        display: none;
        opacity: 0;
    }

    @keyframes pulse {
        0%, 100% { transform: scale(1); }
        50% { transform: scale(1.05); }
    }

    .project-gallery-trigger {
        height: 180px;
    }
    
    .lightbox-image-container {
        width: 98vw;
        height: 70vh;
    }
    
    .lightbox-prev,
    .lightbox-next {
        font-size: 18px;
        width: 45px;
        height: 45px;
        min-width: 45px;
        min-height: 45px;
    }
    
    .lightbox-counter {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* Animation for smooth transitions */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Focus styles for accessibility */
.lightbox-close:focus,
.lightbox-prev:focus,
.lightbox-next:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

body {
    overflow-x: hidden;
}

/* Force ALL accent bars to be exactly the same size and position */
.project-info::before,
.projects-grid .project-info::before,
.project-item .project-info::before,
.columns-2 .project-info::before,
.columns-3 .project-info::before,
.columns-4 .project-info::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 80px !important;
    height: 3px !important;
    background: linear-gradient(90deg, #f4c430, #e6b229) !important;
    border-radius: 2px !important;
    display: block !important;
    box-sizing: content-box !important;
}

/* Force ALL card images to be exactly the same height */
.project-image-wrapper,
.projects-grid .project-image-wrapper,
.project-item .project-image-wrapper,
.columns-2 .project-image-wrapper,
.columns-3 .project-image-wrapper,
.columns-4 .project-image-wrapper {
    height: 280px !important;
    position: relative !important;
    overflow: hidden !important;
}

.project-image-wrapper img,
.projects-grid .project-image-wrapper img,
.project-item .project-image-wrapper img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

.projects-carousel-dots {
    display: none;
}

.projects-carousel-dots.is-active {
    display: flex;
}
