/* Minimal, scoped styles for the Grtich Video Carousel widget */
.gritch-container {
    width: 100%;
    max-width: 1367px;
    /*     padding: 0 20px; */
    box-sizing: border-box;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
    position: relative;
}

.gritch-carousel {
    position: relative;
    width: 100%;
    height: 520px;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1367px;
    overflow: hidden;
    /* Prevent horizontal scroll from off-screen transforms */
}

.gritch-slide {
    position: absolute;
    /* Flexible width: scale with container but cap at a smaller percentage to fit 5 slides on wide screens */
    width: clamp(180px, 20%, 300px);
    height: 420px;
    border-radius: 20px;
    overflow: hidden;
    background: #000;
    box-shadow: 2px 1px 4.1px 0px #0000001C;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    user-select: none;
    -webkit-user-drag: none;
    /* CSS variable for drag offset - applied during mouse drag */
    --drag-offset: 0px;
}

/* Grab cursor on carousel track */
.gritch-carousel {
    cursor: grab;
}

/* Dragging state - disable transitions for smooth real-time movement */
.gritch-carousel.dragging {
    cursor: grabbing;
}

.gritch-carousel.dragging .gritch-slide {
    transition: none !important;
}

.gritch-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
    display: block;
}

.gritch-slide-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gritch-slide-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Remove overlay usage (title has been removed); keep space and centering consistent */

.gritch-slide.gritch-active {
    z-index: 10;
    transform: translateX(0) scale(1.1);
    filter: brightness(1);
}

.gritch-slide.gritch-prev {
    z-index: 5;
    /* closer offsets so two slides on each side are visible */
    transform: translateX(-60%) scale(0.92);
    filter: brightness(0.85);
}

.gritch-slide.gritch-next {
    z-index: 5;
    transform: translateX(60%) scale(0.92);
    filter: brightness(0.85);
}

.gritch-slide.gritch-far-prev {
    z-index: 1;
    transform: translateX(-120%) scale(0.78);
    filter: brightness(0.6);
    opacity: 0.9;
}

.gritch-slide.gritch-far-next {
    z-index: 1;
    transform: translateX(120%) scale(0.78);
    filter: brightness(0.6);
    opacity: 0.9;
}

.gritch-slide.gritch-hidden {
    opacity: 0;
    transform: scale(0.5);
    pointer-events: none;
}

/* Hide dots on desktop; show on mobile */
.gritch-dots {
    display: none;
    gap: 10px;
    margin-top: 40px;
    align-self: center;
    position: relative;
    z-index: 5;
    justify-content: center;
}

.gritch-dot {
    width: 8px;
    height: 8px;
    background: #ccc;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
}

.gritch-dot.active {
    background: #333;
    transform: scale(1.3);
}

.gritch-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gritch-modal.open {
    display: flex;
    opacity: 1;
}

.gritch-modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    aspect-ratio: 16/9;
    transform: scale(0.5);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gritch-modal.open .gritch-modal-content {
    transform: scale(1);
}

.gritch-modal video,
.gritch-modal iframe {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    border-radius: 15px;
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.1);
    border: none;
}

.gritch-close {
    position: absolute;
    top: -50px;
    right: 0;
    color: white;
    font-size: 35px;
    cursor: pointer;
}

/* Navigation arrows wrapper */
.gritch-nav-wrapper {
    position: absolute;
    bottom: -65px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 50px;
    z-index: 9;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* Navigation arrows - positioned at bottom */
.gritch-nav-wrapper .gritch-nav-prev,
.gritch-nav-wrapper .gritch-nav-next {
    position: absolute;
    width: 39px;
    height: 39px;
    margin: 0;
    padding: 0;
    z-index: 10;
    color: #EDEDE6;
    background: transparent;
    border: 1px solid #EDEDE6;
    border-radius: 50%;
    opacity: 1;
    pointer-events: auto;
    transition: all 0.3s ease;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gritch-nav-wrapper .gritch-nav-prev {
    left: -5px;
    transform: translateY(-50%);
}

.gritch-nav-wrapper .gritch-nav-next {
    right: 9px;
    transform: translateY(-50%);
}

.gritch-nav-wrapper .gritch-nav-prev:hover,
.gritch-nav-wrapper .gritch-nav-next:hover {
    border-color: rgb(0 0 0 / 30%);
    background: rgb(245 244 244 / 5%);
    color: rgb(0 0 0 / 30%);
}

.gritch-nav-wrapper .gritch-nav-prev:hover {
    transform: translateY(-50%) scale(1.1);
}

.gritch-nav-wrapper .gritch-nav-next:hover {
    transform: translateY(-50%) scale(1.1);
}

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

.gritch-nav-wrapper .gritch-nav-prev:disabled,
.gritch-nav-wrapper .gritch-nav-next:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.gritch-nav-wrapper .gritch-nav-prev svg,
.gritch-nav-wrapper .gritch-nav-next svg {
    width: 24px;
    height: 24px;
    display: block;
}

/* Responsive - Tablet (768px - 481px) */
@media (max-width: 767px) {
    .gritch-carousel {
        height: 300px;
    }

    .gritch-slide {
        width: clamp(180px, 35%, 280px);
        height: 320px;
    }

    .gritch-slide.gritch-active {
        transform: translateX(0) scale(1.05);
    }

    .gritch-slide.gritch-prev {
        transform: translateX(-75%) scale(0.85);
    }

    .gritch-slide.gritch-next {
        transform: translateX(75%) scale(0.85);
    }

    .gritch-slide.gritch-far-prev {
        transform: translateX(-140%) scale(0.7);
        opacity: 0.7;
    }

    .gritch-slide.gritch-far-next {
        transform: translateX(140%) scale(0.7);
        opacity: 0.7;
    }

    /* show dots on tablet/mobile */
    .gritch-dots {
        display: flex;
        margin-top: 20px;
    }

    .gritch-nav-wrapper {
        display: none;
    }
}

@media (max-width: 480px) {
    .gritch-slide {
        width: clamp(180px, 20%, 300px);
        height: 420px;
        border-radius: 20px;
    }

    .gritch-carousel {
        height: 330px;
    }

    .gritch-slide.gritch-prev {
        transform: translateX(-60%) scale(0.92);
    }

    .gritch-slide.gritch-next {
        transform: translateX(60%) scale(0.92);
    }

    .gritch-slide.gritch-far-prev {
        transform: translateX(-120%) scale(0.78);
    }

    .gritch-slide.gritch-far-next {
        transform: translateX(120%) scale(0.78);
    }

    .gritch-dots {
        display: flex;
        margin-top: 10px;
        gap: 8px;
        justify-content: center;
    }

    .gritch-nav-wrapper {
        display: none;
    }
}