/* ==============================
   Swiper container
   ============================== */
.projects-swiper {
    position: relative;
    width: 100%;
    padding: 1rem 0 40px;
    overflow: hidden !important;
}

/* Wrapper – keep GPU acceleration for Firefox */
.projects-swiper .swiper-wrapper {
    display: flex;
    transform: translate3d(0, 0, 0);
    will-change: transform;
}

/* ==============================
   Slide (FIXED HEIGHT)
   ============================== */
.projects-swiper .swiper-slide {
    position: relative;

    /* FIX: remove aspect-ratio and use fixed height */
    height: 260px;

    overflow: hidden;
    border-radius: 8px;
    background: #f4f4f4;

    /* Rendering stability */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Tablet */
@media (min-width: 768px) {
    .projects-swiper .swiper-slide {
        height: 320px;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .projects-swiper .swiper-slide {
        height: 380px;
    }
}

/* ==============================
   Link fills slide
   ============================== */
.project-slide-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
    outline: none;
}

/* ==============================
   Image fills slide
   ============================== */
.projects-swiper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border: none;
}

/* ==============================
   Overlay
   ============================== */
.project-slide-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;

    padding: 24px 15px 18px;
    background: linear-gradient(
        to top,
        rgba(0,0,0,0.85) 0%,
        rgba(0,0,0,0.4) 50%,
        rgba(0,0,0,0) 100%
    );

    color: #fff;
    z-index: 2;
    pointer-events: none;
}

.project-slide-content h3 {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.2;
    font-weight: 600;

    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ==============================
   Arrows
   ============================== */
.projects-swiper .swiper-button-prev,
.projects-swiper .swiper-button-next {
    color: #fff !important;
    opacity: 1;
}

.projects-swiper .swiper-button-disabled {
    opacity: 0.3 !important;
    cursor: not-allowed;
}

/* ==============================
   Mobile tweaks
   ============================== */
@media (max-width: 767px) {
    .projects-swiper {
        padding-bottom: 50px;
    }

    .project-slide-content h3 {
        font-size: 1.1rem;
    }
}
