/* ==========================================================
   Arraytics Use Case Marquee widget (pure CSS, no JS)
   Rows of image cards that scroll endlessly; each row is the
   same list printed N times and every copy slides -100% of its
   own width, so the loop is seamless.
   ========================================================== */
.tw-uc {
    --tw-uc-card-w: 376px;
    --tw-uc-gap: 16px;
    --tw-uc-row-gap: 16px;
    --tw-uc-duration: 60s;
    --tw-uc-radius: 16px;
    --tw-uc-ratio: 840 / 492;
    --tw-uc-fade: 0px;

    display: grid;
    row-gap: var(--tw-uc-row-gap);
    overflow: hidden;
    width: 100%;
}

.tw-uc--fade {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--tw-uc-fade), #000 calc(100% - var(--tw-uc-fade)), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 var(--tw-uc-fade), #000 calc(100% - var(--tw-uc-fade)), transparent 100%);
}

.tw-uc__row {
    display: flex;
    width: max-content;
}

.tw-uc__track {
    display: flex;
    flex-shrink: 0;
    gap: var(--tw-uc-gap);
    margin: 0;
    padding: 0 var(--tw-uc-gap) 0 0; /* trailing gap keeps the seam even */
    list-style: none;
    will-change: transform;
    animation: tw-uc-marquee var(--tw-uc-row-duration, var(--tw-uc-duration)) linear infinite;
}

.tw-uc__row--right .tw-uc__track {
    animation-direction: reverse;
}

.tw-uc--pause .tw-uc__row:hover .tw-uc__track {
    animation-play-state: paused;
}

@keyframes tw-uc-marquee {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-100%);
    }
}

/* Card */
.tw-uc__card {
    position: relative;
    flex-shrink: 0;
    width: var(--tw-uc-card-w);
    margin: 0;
    padding: 0;
    list-style: none;
    border-radius: var(--tw-uc-radius);
    overflow: hidden;
}

.tw-uc__link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.tw-uc__media {
    display: block;
    aspect-ratio: var(--tw-uc-ratio);
    overflow: hidden;
}

.tw-uc__media img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.tw-uc__card:hover .tw-uc__media img {
    transform: scale(var(--tw-uc-zoom, 1));
}

.tw-uc__overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* Label chip */
.tw-uc__chip {
    --tw-uc-chip-x: 12px;
    --tw-uc-chip-y: 12px;
    position: absolute;
    left: var(--tw-uc-chip-x);
    right: var(--tw-uc-chip-x);
    bottom: var(--tw-uc-chip-y);
    box-sizing: border-box;
    max-width: calc(100% - var(--tw-uc-chip-x) * 2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, translate 0.3s ease;
}

/* Visibility: show label only on card hover */
.tw-uc-chip-hover .tw-uc__chip {
    opacity: 0;
    translate: 0 10px;
}

.tw-uc-chip-hover .tw-uc__card:hover .tw-uc__chip,
.tw-uc-chip-hover .tw-uc__card:focus-within .tw-uc__chip {
    opacity: 1;
    translate: 0 0;
}

@media (hover: none) {
    .tw-uc-chip-hover .tw-uc__chip {
        opacity: 1;
        translate: 0 0;
    }
}

.tw-uc__chip-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 24px;
    line-height: 1;
}

.tw-uc__chip-icon img,
.tw-uc__chip-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Inline stroke-based SVG icons: keep shapes unfilled even if Icon Color sets fill */
.tw-uc__chip-icon--svg svg {
    fill: none !important;
}

.tw-uc__chip-text {
    margin: 0;
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive fallbacks (overridden by Elementor responsive controls) */
@media (max-width: 1024px) {
    .tw-uc {
        --tw-uc-card-w: 300px;
    }
    .tw-uc__chip {
        font-size: 16px;
        padding: 10px;
    }
}

@media (max-width: 767px) {
    .tw-uc {
        --tw-uc-card-w: 240px;
        --tw-uc-gap: 12px;
        --tw-uc-row-gap: 12px;
        --tw-uc-radius: 12px;
    }
    .tw-uc__chip {
        --tw-uc-chip-x: 10px;
        --tw-uc-chip-y: 10px;
        font-size: 14px;
        padding: 8px;
    }
    .tw-uc__chip-icon {
        width: 20px;
        height: 20px;
        font-size: 20px;
    }
}

/* Reduced motion: no animation, swipeable row instead */
@media (prefers-reduced-motion: reduce) {
    .tw-uc__row {
        width: auto;
        overflow-x: auto;
        padding: 0 16px;
    }
    .tw-uc__track {
        animation: none;
    }
    .tw-uc__track[aria-hidden="true"] {
        display: none;
    }
}
