/* ==========================================================
   JT MAISON — Projects List (Carousel) Widget
   ========================================================== */

.jtm-project-list {
    width: 100%;
    overflow: hidden;
}

.jtm-project-list__track {
    display: flex;
    flex-direction: column;
}

.jtm-project-list__item {
    position: relative;
    width: 100%;
    min-height: var(--desktop-height, 500px);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
    padding: 60px;
    box-sizing: border-box;
    text-decoration: none !important;
    overflow: hidden;
}

/* Hover effect on link */
a.jtm-project-list__item {
    transition: transform 0.3s ease;
}

/* Dark gradient from bottom */
.jtm-project-list__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70%;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0) 100%);
    z-index: 1;
    pointer-events: none;
}

.jtm-project-list__content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 800px;
    text-align: left;
}

/* Override any inherited text-align: center from Elementor parent containers */
.jtm-project-list__content *,
.jtm-project-list__title,
.jtm-project-list__desc,
.jtm-project-list__tag,
.jtm-project-list__btn {
    text-align: left !important;
}

.jtm-project-list__tag {
    font-family: var(--jtm-font-ui);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 6px 12px;
    margin-bottom: 16px;
    text-transform: uppercase;
}

/* Tag Styles */
.jtm-project-list__tag--light {
    background: var(--jtm-white);
    color: var(--jtm-dark);
}

.jtm-project-list__tag--dark {
    background: rgba(30,30,30,0.8);
    color: var(--jtm-white);
}

.jtm-project-list__title {
    font-family: var(--jtm-font-ui);
    font-size: clamp(28px, 4vw, 36px);
    font-weight: bold;
    color: var(--jtm-white);
    margin: 0 0 12px 0;
    line-height: 1.2;
    text-align: left !important;
}

.jtm-project-list .jtm-project-list__title,
.jtm-project-list .jtm-project-list__content h3 {
    text-align: left !important;
}

.jtm-project-list__desc {
    font-family: var(--jtm-font-ui);
    font-size: 13px;
    letter-spacing: 0.05em;
    color: var(--jtm-white);
    text-transform: uppercase;
    margin: 0;
    line-height: 1.4;
    opacity: 0.9;
}

.jtm-project-list__btn {
    font-family: var(--jtm-font-ui);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--jtm-white);
    text-transform: uppercase;
    margin-top: 24px;
    display: inline-block;
    
    /* Animation logic matching featured work */
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.jtm-project-list__item:hover .jtm-project-list__btn {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Mobile Carousel */
@media (max-width: 768px) {
    .jtm-project-list {
        padding: 40px 0; /* Some top/bottom padding to breathe */
    }

    .jtm-project-list__track {
        flex-direction: row;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        padding: 0;
    }
    
    .jtm-project-list__track::-webkit-scrollbar {
        display: none;
    }
    
    .jtm-project-list__item {
        flex: 0 0 100%;
        min-height: 450px !important; /* Standard height on mobile */
        scroll-snap-align: center;
        padding: 40px 32px;
        margin-right: 0;
        background-image: var(--bg-mobile) !important;
    }
    
    .jtm-project-list__item:last-child {
        margin-right: 24px; /* Space at end of scroll */
    }
    
    .jtm-project-list__overlay {
        height: 80%;
    }
    
    .jtm-project-list__content {
        align-items: flex-start;
        text-align: left;
    }

    .jtm-project-list__title {
        font-size: 24px;
        text-align: left !important;
        width: 100%;
    }
    
    .jtm-project-list__desc {
        font-size: 11px;
        text-align: left !important;
    }
    
    /* Always show link on mobile */
    .jtm-project-list__btn {
        opacity: 1;
        transform: translateY(0);
    }
    
    /* Navigation Arrows for Mobile */
    .jtm-project-list__arrows {
        display: flex !important;
        justify-content: center;
        align-items: center;
        gap: 32px;
        margin-top: 24px;
        padding: 0 24px;
    }
    
    .jtm-project-list__arrow {
        background: transparent;
        border: none;
        color: var(--jtm-dark, #000);
        cursor: pointer;
        padding: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: opacity 0.3s;
    }
    
    .jtm-project-list__arrow:hover {
        opacity: 0.6;
    }
}

.jtm-project-list__arrows {
    display: none; /* Hide on desktop by default */
}

.jtm-project-list__video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
}

/* Specific for Vimeo iframes to ensure they cover the area perfectly */
iframe.jtm-project-list__video--vimeo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 56.25vw; /* 16:9 ratio based on viewport width */
    min-height: 100vh;
    min-width: 177.77vh; /* 16:9 ratio based on viewport height */
    border: none;
    z-index: 0;
    pointer-events: none;
}
