/* ======================================
   INSTAGRAM REELS CAROUSEL
   ====================================== */

/* Section wrapper */
.ig-section {
    background: linear-gradient(180deg, #f0f4f8 0%, #ffffff 40%, #f4f7fb 100%);
    padding: 80px 0 90px;
    overflow: hidden;
}

/* Header */
.ig-header {
    text-align: center;
    margin-bottom: 3rem;
}

.ig-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
    color: #fff;
    padding: 6px 18px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-bottom: 1rem;
}

.ig-brand-badge i {
    font-size: 1rem;
}

.ig-header .section-title {
    font-size: 2.4rem;
    color: #273329;
    margin-bottom: 0.6rem;
}

.ig-header .section-subtitle {
    color: #5a6a7e;
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ── Carousel outer ── */
.ig-carousel-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;
}

/* Navigation arrows */
.ig-arrow {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #406a00;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(64, 106, 0,0.15);
    transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    z-index: 2;
    position: relative;
    flex-shrink: 0;
}

.ig-arrow:hover {
    background: #406a00;
    color: #fff;
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(64, 106, 0,0.3);
}

.ig-arrow:disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

/* Viewport */
.ig-viewport {
    flex: 1;
    overflow: hidden;
    margin: 0 12px;
}

/* Track — horizontal flex, moves with translateX */
.ig-track {
    display: flex;
    gap: 18px;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    align-items: stretch;
}

/* Individual slide */
.ig-slide {
    flex: 0 0 calc((100% - 54px) / 4); /* 4 per view, 3 gaps of 18px */
    min-width: 0;
}

/* ── Reel Card ── */
.ig-reel-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    aspect-ratio: 9 / 16;
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    text-decoration: none;
    background: linear-gradient(155deg, #0a2d52 0%, #406a00 60%, #1a6ab0 100%);
    box-shadow: 0 8px 28px rgba(64, 106, 0,0.22);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    padding: 1.1rem;
    cursor: pointer;
}

/* Gradient variations — subtle visual rhythm */
.ig-slide:nth-child(3n+2) .ig-reel-card {
    background: linear-gradient(155deg, #081b2e 0%, #104c7e 55%, #1d6bab 100%);
}
.ig-slide:nth-child(3n) .ig-reel-card {
    background: linear-gradient(155deg, #0d2744 0%, #1260a0 55%, #2477b3 100%);
}

/* Decorative background orbs (fallback, hidden when thumbnail is loaded) */
.ig-reel-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 80% 15%, rgba(255,255,255,0.07) 0%, transparent 55%),
        radial-gradient(circle at 15% 80%, rgba(255,255,255,0.05) 0%, transparent 45%);
    pointer-events: none;
    transition: opacity 0.4s ease;
}

/* ── Thumbnail background layer ── */
.ig-reel-thumb-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.5s ease;
    border-radius: inherit;
    z-index: 0;
}

/* ── Dark gradient overlay over thumbnail ── */
.ig-reel-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.45) 0%,
        rgba(0,0,0,0.05) 35%,
        rgba(0,0,0,0.05) 60%,
        rgba(0,0,0,0.65) 100%
    );
    z-index: 1;
    opacity: 0;
    transition: opacity 0.5s ease;
    border-radius: inherit;
    pointer-events: none;
}

/* When thumbnail is loaded: show bg + overlay, hide orbs */
.ig-reel-card.has-thumb::before {
    opacity: 0;
}
.ig-reel-card.has-thumb .ig-reel-thumb-bg {
    opacity: 1;
}
.ig-reel-card.has-thumb .ig-reel-overlay {
    opacity: 1;
}

/* Keep inner content above layers */
.ig-reel-top,
.ig-reel-middle,
.ig-reel-bottom {
    position: relative;
    z-index: 2;
}

/* Hover lift */
.ig-reel-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 18px 44px rgba(64, 106, 0,0.35);
}

/* Thumbnail-loaded hover — slightly brighter */
.ig-reel-card.has-thumb:hover .ig-reel-thumb-bg {
    filter: brightness(1.08);
}

/* ── Card top: profile ── */
.ig-reel-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.ig-reel-profile {
    display: flex;
    align-items: center;
    gap: 7px;
}

.ig-reel-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.75rem;
    flex-shrink: 0;
    border: 1.5px solid rgba(255,255,255,0.3);
}

.ig-reel-profile span {
    color: rgba(255,255,255,0.9);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.ig-reel-badge {
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.85);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    border: 1px solid rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Card center: play button ── */
.ig-reel-middle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    position: relative;
    z-index: 2;
}

.ig-play-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 2px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
    animation: playPulse 3s ease-in-out infinite;
}

.ig-reel-card:hover .ig-play-btn {
    background: rgba(255,255,255,0.28);
    border-color: rgba(255,255,255,0.6);
    transform: scale(1.12);
    animation: none;
}

.ig-play-btn i {
    color: #fff;
    font-size: 1.2rem;
    margin-left: 3px; /* optical center for play triangle */
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}

@keyframes playPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.15); }
    50%       { box-shadow: 0 0 0 10px rgba(255,255,255,0); }
}

/* ── Card bottom: CTA ── */
.ig-reel-bottom {
    position: relative;
    z-index: 2;
}

.ig-reel-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.92);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.2);
    letter-spacing: 0.3px;
    transition: background 0.25s ease, color 0.25s ease;
    text-align: center;
}

.ig-reel-card:hover .ig-reel-cta {
    background: rgba(255,255,255,0.22);
    color: #fff;
    border-color: rgba(255,255,255,0.4);
}

.ig-reel-cta i {
    font-size: 0.8rem;
}

/* ── Dots navigation ── */
.ig-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 2rem;
}

.ig-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cdd5df;
    border: none;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease, width 0.25s ease;
    padding: 0;
    flex-shrink: 0;
}

.ig-dot.active {
    background: #406a00;
    width: 24px;
    border-radius: 4px;
}

.ig-dot:hover:not(.active) {
    background: #8aa8c8;
    transform: scale(1.2);
}

/* ── Follow CTA button ── */
.ig-follow-wrap {
    display: flex;
    justify-content: center;
    margin-top: 2.5rem;
}

.ig-follow-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 13px 34px;
    border-radius: 30px;
    text-decoration: none;
    letter-spacing: 0.2px;
    box-shadow: 0 6px 22px rgba(131,58,180,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
}

.ig-follow-btn i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.ig-follow-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(131,58,180,0.42);
    filter: brightness(1.08);
}

.ig-follow-btn:hover i {
    transform: rotate(8deg) scale(1.15);
}

/* ── Responsive ── */
@media (max-width: 1100px) {
    .ig-slide {
        flex: 0 0 calc((100% - 36px) / 3);
    }
}

@media (max-width: 768px) {
    .ig-section {
        padding: 60px 0 70px;
    }

    .ig-header .section-title {
        font-size: 1.9rem;
    }

    .ig-slide {
        flex: 0 0 calc((100% - 18px) / 2);
    }

    .ig-arrow {
        width: 38px;
        height: 38px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .ig-slide {
        flex: 0 0 100%;
    }

    .ig-arrow {
        display: none;
    }

    .ig-viewport {
        margin: 0;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .ig-viewport::-webkit-scrollbar {
        display: none;
    }

    .ig-track {
        transition: none;
    }

    .ig-slide {
        scroll-snap-align: center;
    }
}
