/**
 * Instagram-style side-scrolling row. Card is a Reels/TikTok-style portrait
 * ratio on mobile/tablet (full 9/16), eased to a bigger, near-square 4/5
 * (+ a max-height safety cap) on desktop (>768px) — closer to Botble
 * Amerce's category-block cards, with autoplay + prev/next arrows engaging
 * at that same breakpoint (see video-carousel.js) — with object-fit:cover
 * on the thumbnail so a landscape YouTube thumbnail (hqdefault.jpg is 4:3)
 * still crops in nicely next to real Instagram content — the row reads as
 * one consistent shelf regardless of source aspect ratio. Card widths
 * (below) are percentages of the track itself, tuned so the row always
 * ends on a partial "peek" card rather than a clean edge.
 */
.vc-carousel-wrapper {
    width: 100%;
    overflow: hidden;
}

.vc-carousel-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 4px 16px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.vc-carousel-track::-webkit-scrollbar {
    height: 6px;
}

.vc-carousel-track::-webkit-scrollbar-thumb {
    background-color: var(--primary-color, #a0704a);
    border-radius: 3px;
    opacity: 0.5;
}

/* Card width is a % of the track's own width (not the viewport) at every
   breakpoint, tuned so the *next* card always peeks in at the right edge —
   a deliberate "there's more, keep scrolling" affordance instead of cards
   landing flush with the container edge. clamp()'s min/max keep it sane on
   unusually narrow/wide containers without changing the intended card
   count per row. */
.vc-card {
    position: relative;
    flex: 0 0 auto;
    width: clamp(230px, 80%, 320px);
    scroll-snap-align: start;
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* ~2 cards + a peek of the 3rd (large phones / small tablets). */
@media (min-width: 576px) {
    .vc-card {
        width: clamp(220px, 46%, 320px);
    }
}

/* Desktop (>768px): bigger cards, ~3-4 fit on screen + a peek of the next
   one. The max here is deliberately loose — at typical content-column
   widths (~1000-1300px) the 25% itself should govern, landing on a slim
   peek; the max only guards against unusually wide containers stretching
   cards too far. This breakpoint is also where autoplay + arrows (see
   video-carousel.js) engage — kept at exactly 769px so CSS and JS agree
   on what "desktop" means here. */
@media (min-width: 769px) {
    .vc-card {
        width: clamp(230px, 25%, 320px);
    }
}

.vc-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.vc-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    background: #1a1a1a;
    overflow: hidden;
}

/* Full 9/16 at desktop card widths reads as too narrow/tall a shelf — ease
   to a near-square 4/5 (+ a hard cap) so no single card dominates the
   viewport, and the row reads like Amerce's category block instead of a
   Reels strip. Placed after the base .vc-thumb-wrap rule above (same
   specificity — source order decides the winner, media query or not) so
   it actually overrides it at this breakpoint instead of silently losing
   the cascade tie. */
@media (min-width: 769px) {
    .vc-thumb-wrap {
        aspect-ratio: 4 / 5;
        max-height: 480px;
    }
}

/* Desktop-only: relative positioning anchor for the prev/next arrows
   below — scoped to this same breakpoint so mobile's wrapper is
   completely untouched (no positioning context change there at all). */
@media (min-width: 769px) {
    .vc-carousel-wrapper {
        position: relative;
    }
}

/* Prev/next arrows — hidden by default (mobile/tablet, ≤768px): this
   carousel stays swipe-only there, exactly as before. JS
   (video-carousel.js) only ever wires these up when the same >768px
   media query matches, so this display:none is belt-and-braces, not the
   only thing preventing them from doing anything on mobile. */
.vc-carousel-arrow {
    display: none;
}

@media (min-width: 769px) {
    .vc-carousel-arrow {
        display: flex;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
        width: 44px;
        height: 44px;
        align-items: center;
        justify-content: center;
        border: none;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.92);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
        cursor: pointer;
        padding: 0;
        transition: background 0.15s ease, transform 0.15s ease;
    }

    .vc-carousel-arrow:hover {
        background: #fff;
        transform: translateY(-50%) scale(1.06);
    }

    .vc-carousel-arrow svg {
        width: 20px;
        height: 20px;
        fill: none;
        stroke: var(--primary-color, #a0704a);
        stroke-width: 2.4;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .vc-carousel-arrow-prev {
        left: 8px;
    }

    .vc-carousel-arrow-next {
        right: 8px;
    }
}

.vc-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.vc-play-btn {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    padding: 0;
    transition: transform 0.15s ease, background 0.15s ease;
}

.vc-play-btn svg {
    width: 18px;
    height: 18px;
    margin-left: 3px;
    fill: var(--primary-color, #a0704a);
}

.vc-card:hover .vc-play-btn {
    transform: scale(1.08);
    background: #fff;
}

.vc-card-title {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 20px 10px 8px;
    font-size: 0.75rem;
    line-height: 1.25;
    color: #fff;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    pointer-events: none;
}

/* ── Instagram placeholder (no key-less thumbnail exists) — didora brand
   gradient instead of a blank/grey box, so it still looks intentional and
   premium in the shelf rather than "broken". ── */
.vc-card-ig-placeholder .vc-thumb-wrap {
    background: linear-gradient(160deg, var(--primary-color, #a0704a) 0%, var(--secondary-color, #c9a96e) 100%);
}

.vc-ig-placeholder-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    text-align: center;
}

.vc-ig-icon {
    width: 34px;
    height: 34px;
    stroke: #fff;
    opacity: 0.95;
}

.vc-ig-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* ── "Video not available" fallback (404 / YouTube's grey 120px stand-in) ── */
.vc-broken-state {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    text-align: center;
    font-size: 0.75rem;
    color: #cbd5e1;
    background: #262626;
}

.vc-card-broken {
    cursor: default;
}

.vc-card-broken .vc-play-btn {
    display: none;
}

/* ── Active embed (iframe / Instagram blockquote) fills the same box ── */
.vc-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Instagram's embed.js sets its own inline height on the iframe it creates
   (normally auto-resized via postMessage to fit the loaded post) — inside
   our fixed-ratio card that inline height is irrelevant and, in practice,
   the iframe often starts at a tiny transient height (seen: 2px) before
   any resize message arrives. Force it to fill the same absolute box the
   YouTube iframe uses instead of trusting Instagram's own sizing — a
   little crop/letterboxing on a Reel is a much better default than a
   near-invisible sliver. This targets both the pre-processed <blockquote>
   (brief fallback state) and the <iframe class="instagram-media">
   embed.js replaces it with. */
.vc-thumb-wrap .instagram-media,
.vc-thumb-wrap iframe.instagram-media {
    position: absolute !important;
    inset: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    border: 0 !important;
}

