/* ============================================
   Instagram Reels Carousel – Frontend Styles
   ============================================ */

.irc-section {
    padding: 40px 0;
    overflow: hidden;
}

.irc-heading {
    text-align: left;
    font-size: 1.4rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin: 0 0 24px 40px;
    font-weight: 400;
    color: #333;
}

/* Carousel wrapper */
.irc-carousel-wrapper {
    position: relative;
    padding: 0 40px;
}

.irc-carousel {
    overflow: hidden;
    width: 100%;
}

.irc-track {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    cursor: grab;
}

.irc-track.is-dragging {
    cursor: grabbing;
    transition: none;
}

/* Keep iframes from swallowing pointer events while dragging */
.irc-track.is-dragging iframe {
    pointer-events: none;
}

/* Slide */
.irc-slide {
    flex: 0 0 auto;
    width: calc((100% - 16px * 4) / 5);
    display: flex;
    flex-direction: column;
    user-select: none;
}

/* Embed container + Instagram overrides */
.irc-embed {
    width: 100%;
    min-height: 320px;
    border-radius: 8px;
    overflow: hidden;
}

.irc-embed .instagram-media,
.irc-embed .instagram-media-Rendered {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.irc-embed iframe {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 8px;
}

/* Fallback placeholder shown until the embed loads (or if JS is off) */
.irc-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    aspect-ratio: 9 / 16;
    padding: 16px;
    box-sizing: border-box;
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
}

.irc-fallback span {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
}

.irc-fallback em {
    font-size: 0.75rem;
    font-style: normal;
    opacity: 0.85;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Thumbnail slide (poster image + play overlay) */
.irc-fallback.irc-has-thumb {
    position: relative;
    padding: 0;
    background: #000;
}

.irc-fallback.irc-has-thumb .irc-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.irc-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    pointer-events: none;
}

.irc-fallback.irc-has-thumb:hover .irc-play {
    background: rgba(0, 0, 0, 0.75);
    transform: translate(-50%, -50%) scale(1.08);
}

/* Locally-hosted video player — fixed 9:16 box like the thumbnails,
   letterboxed so no content is cropped */
.irc-video {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 9 / 16;
    object-fit: contain;
    border-radius: 8px;
    background: #000;
}

/* Navigation arrows */
.irc-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s, box-shadow 0.2s, opacity 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    color: #333;
}

.irc-nav:hover {
    background: #f5f5f5;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.irc-nav:disabled {
    opacity: 0;
    pointer-events: none;
}

.irc-nav-prev {
    left: 4px;
}

.irc-nav-next {
    right: 4px;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1200px) {
    .irc-slide {
        width: calc((100% - 16px * 3) / 4);
    }
}

@media (max-width: 992px) {
    .irc-slide {
        width: calc((100% - 16px * 2) / 3);
    }
}

@media (max-width: 768px) {
    .irc-heading {
        margin-left: 16px;
        font-size: 1.1rem;
    }

    .irc-carousel-wrapper {
        padding: 0 16px;
    }

    .irc-slide {
        width: calc((100% - 12px) / 2);
    }

    .irc-track {
        gap: 12px;
    }

    .irc-nav {
        display: none;
    }
}

@media (max-width: 480px) {
    .irc-slide {
        width: 75%;
    }
}
