/* ================================================================
   VIS — Video & Image Slider  |  v3.0.0  |  Powered by Swiper.js
   ================================================================ */

/* ── Wrapper ──────────────────────────────────────────────────── */
.vis-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 50px; /* space for pagination dots */
    box-sizing: border-box;
}

/* When no dots, remove bottom padding */
.vis-wrapper:not(:has(.swiper-pagination)) {
    padding-bottom: 0;
}

/* ── Swiper overrides ─────────────────────────────────────────── */
.vis-swiper {
    width: 100%;
    overflow: hidden; /* Swiper handles this, keep clean */
}

/* Equal-height slides */
.vis-swiper .swiper-wrapper {
    align-items: stretch;
}

.vis-swiper .swiper-slide {
    height: auto; /* let card fill naturally */
    box-sizing: border-box;
}

/* ── Card ─────────────────────────────────────────────────────── */
.vis-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: default;
}

.vis-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.14);
}

/* ── Thumbnail ────────────────────────────────────────────────── */
.vis-thumb-wrap {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: #111;
    flex-shrink: 0;
}

.vis-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.42s ease;
}

.vis-card:hover .vis-thumb-img {
    transform: scale(1.05);
}

/* ── Inline embed (video slide, no custom thumbnail) ─────────────── */
.vis-inline-embed {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.vis-inline-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ── Image link overlay ───────────────────────────────────────── */
.vis-img-link {
    position: absolute;
    inset: 0;
    z-index: 3;
    cursor: pointer;
}

/* ── Play button ──────────────────────────────────────────────── */
.vis-play-btn {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 2;
    transition: background 0.28s ease;
}

.vis-play-btn:hover {
    background: rgba(0, 0, 0, 0.62);
}

/* Transparent variant — image slides with video but icon hidden */
.vis-play-transparent {
    background: transparent !important;
}
.vis-play-transparent:hover {
    background: rgba(0, 0, 0, 0.18) !important;
}

/* Built-in SVG circle */
.vis-play-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid rgba(255, 255, 255, 0.55);
    border-radius: 50%;
    backdrop-filter: blur(6px);
    transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
    color: #fff;
    flex-shrink: 0;
}

.vis-play-btn:hover .vis-play-icon {
    transform: scale(1.12);
    background: rgba(255, 255, 255, 0.26);
    border-color: rgba(255, 255, 255, 0.9);
}

/* Custom image play button */
.vis-play-btn > img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.55));
    transition: transform 0.25s ease;
}

.vis-play-btn:hover > img {
    transform: scale(1.1);
}

/* ── Platform badge ───────────────────────────────────────────── */
.vis-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: 4px;
    pointer-events: none;
    z-index: 4;
    line-height: 1.4;
}

.vis-badge--youtube { background: rgba(220, 0, 0, 0.85);  color: #fff; }
.vis-badge--vimeo   { background: rgba(26, 183, 234, 0.85); color: #fff; }

/* RTL: badge on right */
[dir="rtl"] .vis-badge { left: auto; right: 10px; }

/* ── Card body ────────────────────────────────────────────────── */
.vis-card-body {
    padding: 14px 16px 16px;
    flex: 1;
}

.vis-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.45;
    color: #1a1a2e;
}

/* ================================================================
   NAVIGATION — Custom arrows (outside Swiper default)
   ================================================================ */
.vis-btn-prev,
.vis-btn-next {
    position: absolute;
    top: 50%;
    transform: translateY(calc(-50% - 25px)); /* offset for pagination */
    z-index: 20;
    background: #1a1a2e;
    border: none;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
    transition: background 0.22s ease, opacity 0.22s ease, transform 0.22s ease;
    outline: none;
}

.vis-btn-prev:hover,
.vis-btn-next:hover {
    background: #2d2d5e;
}

.vis-btn-prev:active,
.vis-btn-next:active {
    transform: translateY(calc(-50% - 25px)) scale(0.93);
}

.vis-btn-prev { left: -6px; }
.vis-btn-next { right: -6px; }

/* RTL: swap positions */
[dir="rtl"] .vis-btn-prev { left: auto; right: -6px; }
[dir="rtl"] .vis-btn-next { right: auto; left: -6px; }

.vis-btn-prev.swiper-button-disabled,
.vis-btn-next.swiper-button-disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* ================================================================
   PAGINATION — override Swiper defaults
   ================================================================ */
.vis-wrapper .swiper-pagination {
    bottom: 10px;
    position: absolute;
    left: 0;
    right: 0;
    text-align: center;
}

.vis-wrapper .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: #d1d5db;
    opacity: 1;
    border-radius: 8px;
    transition: background 0.28s ease, width 0.28s ease;
    display: inline-block;
    margin: 0 4px;
    cursor: pointer;
    border: none;
    padding: 0;
}

.vis-wrapper .swiper-pagination-bullet-active {
    background: #1a1a2e;
    width: 26px;
}

/* ================================================================
   LIGHTBOX MODAL
   ================================================================ */
.vis-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    align-items: center;
    justify-content: center;
}

.vis-modal.is-open {
    display: flex;
}

.vis-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: vis-fade 0.25s ease forwards;
    cursor: pointer;
}

.vis-modal-box {
    position: relative;
    z-index: 1;
    width: 92%;
    max-width: 960px;
    animation: vis-pop 0.32s cubic-bezier(0.34, 1.36, 0.64, 1) forwards;
}

.vis-modal-title {
    margin: 0 0 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 30px 0 0;
}

[dir="rtl"] .vis-modal-title { padding: 0 0 0 30px; }

.vis-modal-close {
    position: absolute;
    top: -6px;
    right: 0;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.2s, transform 0.2s;
    z-index: 10;
}

[dir="rtl"] .vis-modal-close { right: auto; left: 0; }

.vis-modal-close:hover {
    color: #fff;
    transform: rotate(90deg);
}

.vis-modal-frame {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 10px;
    background: #000;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
}

.vis-modal-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

/* ── Animations ───────────────────────────────────────────────── */
@keyframes vis-fade {
    from { opacity: 0; } to { opacity: 1; }
}

@keyframes vis-pop {
    from { opacity: 0; transform: scale(0.87) translateY(18px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .vis-btn-prev { left: 0; }
    .vis-btn-next { right: 0; }
    [dir="rtl"] .vis-btn-prev { left: auto; right: 0; }
    [dir="rtl"] .vis-btn-next { right: auto; left: 0; }
}

@media (max-width: 640px) {
    .vis-modal-box { width: 96%; }
}
