/*
 * NESI Project Highlights Slider Styles
 */

.our-work-section {
    padding: clamp(72px, 8vw, 112px) 0 clamp(96px, 10vw, 128px);
    text-align: center;
    background: linear-gradient(180deg, #f4f8fb 0%, #ffffff 100%);
}

.our-work-section .container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.our-work-header {
    width: 100%;
    padding: 0 clamp(24px, 5vw, 72px);
    margin: 0 0 clamp(32px, 4vw, 48px);
}

.our-work-section .section-subtitle {
    color: #005eb8;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.our-work-section .section-title {
    color: #1f2a37;
    font-size: clamp(34px, 4vw, 46px);
    font-weight: 700;
    margin: 0;
}

/* Slider Wrapper */
.nesi-slider-wrapper {
    --slides-to-show: 3;
    --slide-gap: clamp(20px, 2.5vw, 32px);
    --control-offset: clamp(28px, 6vw, 96px);
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0 var(--control-offset);
    display: grid;
    gap: clamp(32px, 4vw, 48px);
}

.nesi-slider-viewport {
    overflow: hidden;
    width: 100%;
    padding: 20px 40px;
    background: #F3F3F3;
}

/* Slider container for all slides */
.nesi-slider {
    display: flex;
    gap: var(--slide-gap);
    transition: transform 0.6s ease;
}

.nesi-slider--no-transition {
    transition: none !important;
}

/* Individual Slide */
.nesi-slide {
    flex: 0 0 calc((100% - (var(--slides-to-show) - 1) * var(--slide-gap)) / var(--slides-to-show));
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.18);
}

.nesi-slide-link {
    display: block;
    text-decoration: none;
    color: inherit;
    position: relative;
    height: 100%;
}

.nesi-slide-link:focus-visible {
    outline: 3px solid rgba(8, 119, 180, 0.9);
    outline-offset: -4px;
}

.nesi-slide img {
    display: block;
    width: 100%;
    height: clamp(280px, 32vw, 360px);
    object-fit: cover;
}

/* Caption Overlay */
.nesi-slide-caption {
    position: absolute;
    inset: auto 0 0 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.82) 92%);
    color: #fff;
    padding: 18px 20px 16px;
    text-align: left;
    font-size: 16px;
    line-height: 1.4;
}

/* Navigation Arrows */
.slider-arrow {
    --translate-x: 0;
    position: absolute;
    top: 50%;
    transform: translate(var(--translate-x), -50%);
    background-color: #ffffff;
    border: 2px solid #0877b4;
    color: #0877b4;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.slider-arrow:hover {
    transform: translate(var(--translate-x), -50%) scale(1.05);
}

.prev-arrow {
    left: var(--control-offset);
    --translate-x: -160%;
}

.next-arrow {
    right: var(--control-offset);
    --translate-x: 160%;
}

/* Navigation Bars */
.slider-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 0;
    margin-top: 32px;
}

.dot {
    cursor: pointer;
    height: 6px;
    width: clamp(30px, 9vw, 60px);
    background-color: #d5d9df;
    border-radius: 999px;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.dot.active {
    background-color: #0877b4;
}

/* Modal */
.nesi-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.nesi-modal.is-active {
    display: flex;
}

.nesi-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.78);
}

.nesi-modal-dialog {
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 30px 64px rgba(15, 23, 42, 0.4);
    max-width: min(1040px, 92vw);
    max-height: 92vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.nesi-modal-image {
    width: 100%;
    height: auto;
    max-height: calc(92vh - 120px);
    object-fit: contain;
    background: #0f172a;
}

.nesi-modal-caption {
    margin: 0;
    padding: 20px 28px 28px;
    font-size: 18px;
    font-weight: 600;
    color: #1f2a37;
    text-align: left;
}

.nesi-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(8, 119, 180, 0.92);
    color: #ffffff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.nesi-modal-close:hover,
.nesi-modal-close:focus {
    background: #065f92;
    outline: none;
}

body.nesi-modal-open {
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .our-work-section {
        padding: 72px 0 100px;
    }
}

@media (max-width: 1024px) {
    .our-work-header {
        margin-bottom: clamp(28px, 6vw, 40px);
    }

    .nesi-slider-wrapper {
        --slides-to-show: 2;
        --control-offset: clamp(24px, 7vw, 88px);
    }
}

@media (max-width: 768px) {
    .our-work-section .section-title {
        font-size: 30px;
    }

    .nesi-slider-wrapper {
        --slides-to-show: 1;
        --control-offset: clamp(20px, 9vw, 60px);
    }

    .slider-arrow {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .prev-arrow {
        --translate-x: -140%;
    }

    .next-arrow {
        --translate-x: 140%;
    }
}

@media (max-width: 560px) {
    .our-work-section {
        padding: 40px 0 56px;
    }

    .dot {
        width: 56px;
    }

    .nesi-modal-dialog {
        max-height: 88vh;
    }

    .nesi-modal-image {
        max-height: calc(88vh - 108px);
    }
}