.fc-ig-gallery,
.fc-ig-gallery * {
    box-sizing: border-box;
}

.fc-ig-gallery {
    --fc-ig-columns: 3;
    --fc-ig-gap: 24px;
    --fc-ig-card-max-width: 420px;
    position: relative;
    width: 100%;
}

.fc-ig-track {
    gap: var(--fc-ig-gap);
}

.fc-ig-layout-grid .fc-ig-track {
    display: grid;
    grid-template-columns: repeat(var(--fc-ig-columns), minmax(0, 1fr));
    align-items: start;
}

.fc-ig-layout-stack .fc-ig-track {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--fc-ig-gap);
}

.fc-ig-layout-carousel {
    overflow: hidden;
    padding: 0 48px;
}

.fc-ig-layout-carousel .fc-ig-track {
    display: flex;
    transition: transform 350ms ease;
    will-change: transform;
}

.fc-ig-layout-carousel .fc-ig-post {
    flex: 0 0 calc((100% - (var(--fc-ig-gap) * (var(--fc-ig-carousel-per-view, 1) - 1))) / var(--fc-ig-carousel-per-view, 1));
}

.fc-ig-post {
    width: 100%;
    max-width: var(--fc-ig-card-max-width);
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
    line-height: 1.35;
}

.fc-ig-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    min-height: 58px;
}

.fc-ig-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1.5px solid currentColor;
    border-radius: 999px;
    overflow: hidden;
    flex: 0 0 auto;
}

.fc-ig-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.fc-ig-avatar svg {
    width: 24px;
    height: 24px;
}

.fc-ig-username {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .01em;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fc-ig-follow {
    appearance: none;
    border: 1px solid #5ebdea;
    color: #268ab9;
    background: transparent;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    padding: 5px 13px;
    line-height: 1;
    cursor: default;
}

.fc-ig-image-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.fc-ig-image-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: transparent;
    overflow: hidden;
}

.fc-ig-image-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fc-ig-actions {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px 16px 8px;
}

.fc-ig-icon {
    display: inline-flex;
    width: 25px;
    height: 25px;
    line-height: 1;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.fc-ig-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.fc-ig-save {
    margin-left: auto;
}

.fc-ig-body {
    padding: 0 16px 16px;
    font-size: 14px;
}

.fc-ig-likes {
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 500;
}

.fc-ig-heart-dot {
    font-size: 13px;
}

.fc-ig-caption {
    font-size: 14px;
    word-break: break-word;
}

.fc-ig-caption strong {
    font-weight: 700;
}

.fc-ig-hashtags {
    font-weight: 500;
}

.fc-ig-nav {
    position: absolute;
    top: 50%;
    z-index: 3;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,.16);
    background: #fff;
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,0,0,.14);
}

.fc-ig-prev { left: 4px; }
.fc-ig-next { right: 4px; }

.fc-ig-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    padding-top: 16px;
}

.fc-ig-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(0,0,0,.25);
    cursor: pointer;
}

.fc-ig-dot.is-active {
    background: rgba(0,0,0,.75);
}

@media (max-width: 767px) {
    .fc-ig-layout-grid .fc-ig-track {
        grid-template-columns: repeat(var(--fc-ig-columns, 1), minmax(0, 1fr));
    }

    .fc-ig-layout-carousel {
        padding-left: 34px;
        padding-right: 34px;
    }

    .fc-ig-layout-carousel .fc-ig-post {
        flex-basis: 100%;
    }

    .fc-ig-nav {
        width: 30px;
        height: 30px;
        font-size: 24px;
    }
}

/* Individual post carousel */
.fc-ig-image-wrap {
    position: relative;
}

.fc-ig-card-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 280ms ease;
    will-change: transform;
}

.fc-ig-card-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
}

.fc-ig-card-slide img {
    display: block;
    width: 100%;
    height: 100%;
}

.fc-ig-card-count {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.fc-ig-card-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,.88);
    color: #111;
    box-shadow: 0 3px 12px rgba(0,0,0,.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    opacity: .92;
}

.fc-ig-card-prev { left: 10px; }
.fc-ig-card-next { right: 10px; }

.fc-ig-card-dots {
    position: absolute;
    left: 50%;
    bottom: 10px;
    z-index: 2;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 7px;
    border-radius: 999px;
    background: rgba(0,0,0,.25);
}

.fc-ig-card-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255,255,255,.55);
}

.fc-ig-card-dot.is-active {
    background: #fff;
}

@media (hover: hover) {
    .fc-ig-image-wrap.has-card-carousel .fc-ig-card-nav {
        opacity: 0;
        transition: opacity 180ms ease;
    }

    .fc-ig-image-wrap.has-card-carousel:hover .fc-ig-card-nav {
        opacity: .92;
    }
}

/* Reel and Story formats */
.fc-ig-format-reel .fc-ig-image-wrap,
.fc-ig-format-story .fc-ig-image-wrap,
.fc-ig-media-reel,
.fc-ig-media-story {
    aspect-ratio: 9 / 16;
}

.fc-ig-format-story .fc-ig-post,
.fc-ig-format-reel .fc-ig-post {
    max-width: min(var(--fc-ig-card-max-width), 420px);
}

.fc-ig-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

.fc-ig-format-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 25px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(0,0,0,.68);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.fc-ig-format-badge .fc-ig-icon {
    width: 15px;
    height: 15px;
}

.fc-ig-play-overlay {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    transform: translate(-50%, -50%);
    width: 66px;
    height: 66px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(0,0,0,.48);
    color: #fff;
    pointer-events: none;
}

.fc-ig-play-overlay svg {
    width: 34px;
    height: 34px;
    margin-left: 4px;
}

.fc-ig-story-progress {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    z-index: 4;
    display: flex;
    gap: 4px;
}

.fc-ig-story-progress span {
    flex: 1 1 0;
    height: 3px;
    border-radius: 999px;
    background: rgba(255,255,255,.38);
    overflow: hidden;
}

.fc-ig-story-progress span::after {
    content: "";
    display: block;
    width: 0%;
    height: 100%;
    background: rgba(255,255,255,.95);
}

.fc-ig-story-progress span.is-active::after {
    width: 100%;
}

.fc-ig-format-story .fc-ig-format-badge {
    top: 18px;
}

.fc-ig-format-story .fc-ig-card-count {
    top: 42px;
}

.fc-ig-format-story .fc-ig-card-nav {
    background: rgba(0,0,0,.45);
    color: #fff;
}

/* Mixed-format sizing fixes */
.fc-ig-layout-grid .fc-ig-track,
.fc-ig-layout-stack .fc-ig-track {
    align-items: start;
}

.fc-ig-post.fc-ig-format-reel,
.fc-ig-post.fc-ig-format-story {
    max-width: min(var(--fc-ig-card-max-width), 420px);
}

.fc-ig-post.fc-ig-format-post .fc-ig-image-wrap {
    aspect-ratio: var(--fc-ig-post-ratio, inherit);
}

.fc-ig-card-slide-video {
    background: #000;
}

/* Force true vertical Reel/Story sizing even when Elementor prints inline responsive ratio CSS. */
.fc-ig-post.fc-ig-format-reel .fc-ig-image-wrap,
.fc-ig-post.fc-ig-format-story .fc-ig-image-wrap,
.fc-ig-post.fc-ig-format-reel .fc-ig-media-reel,
.fc-ig-post.fc-ig-format-story .fc-ig-media-story {
    aspect-ratio: 9 / 16 !important;
}

.fc-ig-post.fc-ig-format-reel .fc-ig-card-track,
.fc-ig-post.fc-ig-format-story .fc-ig-card-track,
.fc-ig-post.fc-ig-format-reel .fc-ig-card-slide,
.fc-ig-post.fc-ig-format-story .fc-ig-card-slide,
.fc-ig-post.fc-ig-format-reel .fc-ig-video,
.fc-ig-post.fc-ig-format-story .fc-ig-video {
    height: 100%;
}

/* Instagram Reels-style immersive overlay */
.fc-ig-post.fc-ig-format-reel {
    position: relative;
    background: #000;
}

.fc-ig-post.fc-ig-format-reel .fc-ig-image-wrap {
    position: relative;
    z-index: 1;
}

.fc-ig-post.fc-ig-format-reel .fc-ig-image-wrap::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 42%;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,0));
}

.fc-ig-post.fc-ig-format-reel .fc-ig-header {
    position: absolute;
    left: 14px;
    right: 76px;
    bottom: 86px;
    z-index: 5;
    padding: 0;
    min-height: 0;
    color: #fff;
    background: transparent;
    text-shadow: 0 2px 10px rgba(0,0,0,.55);
}

.fc-ig-post.fc-ig-format-reel .fc-ig-avatar {
    width: 34px;
    height: 34px;
    border: 2px solid rgba(255,255,255,.95);
    background: rgba(0,0,0,.25);
}

.fc-ig-post.fc-ig-format-reel .fc-ig-username {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.fc-ig-post.fc-ig-format-reel .fc-ig-follow,
.fc-ig-post.fc-ig-format-reel .fc-ig-more {
    display: none;
}

.fc-ig-post.fc-ig-format-reel .fc-ig-actions {
    position: absolute;
    right: 14px;
    bottom: 42px;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 17px;
    padding: 0;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,.65);
}

.fc-ig-post.fc-ig-format-reel .fc-ig-actions .fc-ig-icon {
    width: 30px;
    height: 30px;
}

.fc-ig-post.fc-ig-format-reel .fc-ig-actions .fc-ig-save {
    margin-left: 0;
}

.fc-ig-post.fc-ig-format-reel .fc-ig-body {
    position: absolute;
    left: 14px;
    right: 78px;
    bottom: 22px;
    z-index: 5;
    padding: 0;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,.65);
}

.fc-ig-post.fc-ig-format-reel .fc-ig-likes {
    display: none;
}

.fc-ig-post.fc-ig-format-reel .fc-ig-caption {
    color: #fff;
    font-size: 13px;
    line-height: 1.32;
}

.fc-ig-post.fc-ig-format-reel .fc-ig-caption strong {
    display: none;
}

.fc-ig-post.fc-ig-format-reel .fc-ig-hashtags {
    color: rgba(255,255,255,.86);
}

.fc-ig-post.fc-ig-format-reel .fc-ig-format-badge {
    top: 12px;
    left: 12px;
    background: rgba(0,0,0,.34);
}

.fc-ig-post.fc-ig-format-reel .fc-ig-card-count {
    top: 12px;
    right: 12px;
}

.fc-ig-post.fc-ig-format-reel .fc-ig-card-dots {
    bottom: auto;
    top: 12px;
    background: rgba(0,0,0,.25);
}

/* Reel overlay refinement */
.fc-ig-post.fc-ig-format-reel .fc-ig-header {
    bottom: 72px;
}

.fc-ig-post.fc-ig-format-reel .fc-ig-body {
    bottom: 20px;
}

.fc-ig-post.fc-ig-format-reel .fc-ig-actions,
.fc-ig-post.fc-ig-format-reel .fc-ig-actions .fc-ig-icon,
.fc-ig-post.fc-ig-format-reel .fc-ig-actions .fc-ig-icon svg,
.fc-ig-post.fc-ig-format-reel .fc-ig-actions .fc-ig-icon path,
.fc-ig-post.fc-ig-format-reel .fc-ig-actions .fc-ig-icon circle,
.fc-ig-post.fc-ig-format-reel .fc-ig-actions .fc-ig-icon rect {
    color: #fff !important;
    stroke: currentColor !important;
}

.fc-ig-post.fc-ig-format-reel .fc-ig-actions .fc-ig-icon path[fill="currentColor"],
.fc-ig-post.fc-ig-format-reel .fc-ig-actions .fc-ig-icon circle[fill="currentColor"],
.fc-ig-post.fc-ig-format-reel .fc-ig-actions .fc-ig-icon rect[fill="currentColor"] {
    fill: currentColor !important;
}

/* Video autoplay audio controls */
.fc-ig-audio-controls {
    display: flex;
    justify-content: center;
    padding: 10px 14px 14px;
    background: inherit;
}

.fc-ig-audio-toggle {
    appearance: none;
    border: 1px solid rgba(0,0,0,.18);
    background: rgba(255,255,255,.92);
    color: #111;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 7px 13px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.fc-ig-audio-toggle svg {
    width: 17px;
    height: 17px;
    display: block;
}

.fc-ig-audio-icon-on {
    display: none;
}

.fc-ig-audio-toggle.is-unmuted .fc-ig-audio-icon-on {
    display: inline-flex;
}

.fc-ig-audio-toggle.is-unmuted .fc-ig-audio-icon-off {
    display: none;
}

.fc-ig-post.fc-ig-format-reel .fc-ig-audio-controls,
.fc-ig-post.fc-ig-format-story .fc-ig-audio-controls {
    background: #000;
    padding-top: 11px;
}

.fc-ig-post.fc-ig-format-reel .fc-ig-audio-toggle,
.fc-ig-post.fc-ig-format-story .fc-ig-audio-toggle {
    border-color: rgba(255,255,255,.28);
    background: rgba(255,255,255,.10);
    color: #fff;
}

/* Keep the sound toggle outside the main vertical media view */
.fc-ig-post.fc-ig-format-reel,
.fc-ig-post.fc-ig-format-story {
    overflow: visible;
    padding-bottom: 50px;
}

.fc-ig-post.fc-ig-format-reel .fc-ig-image-wrap,
.fc-ig-post.fc-ig-format-story .fc-ig-image-wrap {
    overflow: hidden;
    background: #000;
}

.fc-ig-post.fc-ig-format-reel .fc-ig-audio-controls,
.fc-ig-post.fc-ig-format-story .fc-ig-audio-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 8;
    background: transparent;
    padding: 10px 0 0;
}

.fc-ig-post.fc-ig-format-reel .fc-ig-audio-toggle,
.fc-ig-post.fc-ig-format-story .fc-ig-audio-toggle {
    background: rgba(0,0,0,.72);
    color: #fff;
    border-color: rgba(255,255,255,.18);
    box-shadow: 0 6px 18px rgba(0,0,0,.15);
}

/* Reel audio control clearance: keep overlay content inside video and sound toggle below it */
.fc-ig-post.fc-ig-format-reel {
    padding-bottom: 58px;
}

.fc-ig-post.fc-ig-format-reel .fc-ig-header {
    bottom: 130px;
}

.fc-ig-post.fc-ig-format-reel .fc-ig-body {
    bottom: 78px;
}

.fc-ig-post.fc-ig-format-reel .fc-ig-actions {
    bottom: 100px;
}

.fc-ig-post.fc-ig-format-reel .fc-ig-audio-controls {
    bottom: 0;
    padding-top: 12px;
}

/* 1.6.0: wrapper-based card plus external controls */
.fc-ig-item {
    width: 100%;
    max-width: var(--fc-ig-card-max-width);
    margin-left: auto;
    margin-right: auto;
}

.fc-ig-item > .fc-ig-post {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

.fc-ig-layout-carousel .fc-ig-item {
    flex: 0 0 calc((100% - (var(--fc-ig-gap) * (var(--fc-ig-carousel-per-view, 1) - 1))) / var(--fc-ig-carousel-per-view, 1));
}

.fc-ig-item-format-reel,
.fc-ig-item-format-story {
    max-width: min(var(--fc-ig-card-max-width), 420px);
}

.fc-ig-item > .fc-ig-audio-controls {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: auto;
    padding: 12px 0 0;
    background: transparent;
}

.fc-ig-item-format-reel > .fc-ig-audio-controls,
.fc-ig-item-format-story > .fc-ig-audio-controls {
    background: transparent;
}

.fc-ig-post.fc-ig-format-reel,
.fc-ig-post.fc-ig-format-story {
    padding-bottom: 0;
}

/* Restore 1.5.1 Reel overlay positions now that the button is outside the card wrapper. */
.fc-ig-post.fc-ig-format-reel .fc-ig-header {
    bottom: 72px;
}

.fc-ig-post.fc-ig-format-reel .fc-ig-body {
    bottom: 20px;
}

.fc-ig-post.fc-ig-format-reel .fc-ig-actions {
    bottom: 42px;
}

@media (max-width: 767px) {
    .fc-ig-layout-carousel .fc-ig-item {
        flex-basis: 100%;
    }
}

/* Reel overlay spacing when description and/or hashtags are empty */
.fc-ig-post.fc-ig-format-reel.fc-ig-reel-short-caption .fc-ig-header {
    bottom: 56px;
}

.fc-ig-post.fc-ig-format-reel.fc-ig-reel-no-caption .fc-ig-header {
    bottom: 22px;
}

.fc-ig-post.fc-ig-format-reel.fc-ig-reel-no-caption .fc-ig-body {
    display: none;
}

/* Per-card image ratios for regular posts */
.fc-ig-gallery {
    --fc-ig-default-post-ratio: 1 / 1;
}

.fc-ig-post.fc-ig-format-post .fc-ig-image-wrap {
    aspect-ratio: var(--fc-ig-item-ratio, var(--fc-ig-default-post-ratio, 1 / 1));
}
