.quqii-feed-profile { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.quqii-feed-profile img { width: 56px !important; height: 56px !important; min-width: 56px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.quqii-feed-profile-info h3 { font-size: 1rem; font-weight: 700; margin: 0 0 .15rem; }
.quqii-feed-followers { font-size: .82rem; color: #666; }
.quqii-feed-followers strong { color: #111; }

/* Enables container queries below: the grid reacts to the widget's own
   rendered width (correct in a narrow sidebar even on a wide viewport),
   not just the browser window. */
.quqii-feed {
    container-type: inline-size;
    container-name: quqii-feed;
}

.quqii-feed-grid {
    display: grid;
    grid-template-columns: repeat(var(--quqii-feed-cols, 3), 1fr);
    gap: var(--quqii-feed-gap, 0.25rem);
}

/* Viewport-width fallback for browsers without container query support. */
@media (max-width: 700px) {
    .quqii-feed-grid {
        grid-template-columns: repeat(min(2, var(--quqii-feed-cols, 3)), 1fr);
        /* Smaller tiles on mobile — the configured gap looks proportionally
           larger there, so scale it down instead of keeping it fixed. */
        gap: calc(var(--quqii-feed-gap, 0.25rem) / 2);
    }
}
@media (max-width: 500px) {
    .quqii-feed-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* Container-width version — takes over automatically where supported,
   reacting to the feed's actual width instead of the whole viewport. */
@container quqii-feed (max-width: 700px) {
    .quqii-feed-grid {
        grid-template-columns: repeat(min(2, var(--quqii-feed-cols, 3)), 1fr);
        gap: calc(var(--quqii-feed-gap, 0.25rem) / 2);
    }
}
@container quqii-feed (max-width: 500px) {
    .quqii-feed-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}

.quqii-feed-item {
    --quqii-feed-inset: 1.25rem; /* shared left/right inset for the overlay text and the bottom icon row */
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: var(--quqii-feed-radius, 4px);
    background: #eee;
    display: block;
    text-decoration: none;
}
.quqii-feed-item img,
.quqii-feed-item video {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .2s;
}
.quqii-feed-item video { cursor: pointer; }

/* ── Carousel / Sidecar ── */
.quqii-feed-slides {
    display: flex;
    width: 100%; height: 100%;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.quqii-feed-slides::-webkit-scrollbar { display: none; }
.quqii-feed-slide {
    flex: 0 0 100%;
    height: 100%;
    scroll-snap-align: start;
    position: relative;
}
.quqii-feed-slide img,
.quqii-feed-slide video {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.quqii-feed-slide video { cursor: pointer; }
.quqii-feed-slide .quqii-feed-badge { pointer-events: none; }

.quqii-feed-dots {
    position: absolute; bottom: 14px; left: 50%;
    transform: translateX(-50%);
    display: flex; gap: 4px;
    pointer-events: none;
}
.quqii-feed-dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,.5);
    transition: background .2s;
    flex-shrink: 0;
}
.quqii-feed-dot.active { background: #fff; }

.quqii-feed-badge {
    position: absolute; top: 6px; right: 8px;
    color: #fff; font-size: .8rem;
    text-shadow: 0 1px 3px rgba(0,0,0,.6);
    pointer-events: none;
    transition: opacity .2s;
}
.quqii-feed-item.playing .quqii-feed-badge { opacity: 0; }
.quqii-feed-badge svg { display: block; width: 16px; height: 16px; fill: transparent; }

/* ── Play button — large, centered over the video/thumbnail ── */
.quqii-feed-play-badge {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
    transition: opacity .2s;
}
.quqii-feed-play-badge svg { display: block; width: 48px; height: 48px; fill: #fff; filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }
.quqii-feed-item.playing .quqii-feed-play-badge { opacity: 0; }

/* ── Bottom icon row (info, likes, Instagram link) — aligned on the
   same baseline so they visually sit in one line. ── */
.quqii-feed-bottom-left {
    position: absolute; bottom: 8px; left: var(--quqii-feed-inset, 1.25rem);
    z-index: 2;
    height: 15px; line-height: 1;
    display: flex; align-items: center; gap: 8px;
}

.quqii-feed-likes {
    display: inline-flex; align-items: center; gap: 4px;
    height: 15px; line-height: 1; /* without this the inherited theme
       line-height (not the icon) determines the box height, throwing
       off alignment with the other icons in the row */
    color: #fff; font-size: .75rem; font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,.6);
    pointer-events: none;
}
.quqii-feed-likes svg { display: block; width: 13px; height: 13px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }

.quqii-feed-ig-link {
    position: absolute; bottom: 8px; right: var(--quqii-feed-inset, 1.25rem);
    width: 15px; height: 15px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; opacity: .85; line-height: 1;
    transition: opacity .2s;
}
.quqii-feed-ig-link:hover { opacity: 1; }
.quqii-feed-ig-link:hover svg { fill:rgba(0, 0, 0, 0.2); }
.quqii-feed-ig-link svg { display: block; width: 15px; height: 15px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); fill: transparent; }

.quqii-feed-ig-btn {
    display: inline-block;
    padding: .45rem 1.1rem;
    background: #e1306c;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.4;
    transition: background .15s;
}
.quqii-feed-ig-btn:hover { background: #c0254f; color: #fff; }

/* ── Post wrapper (image + optional caption) ── */
.quqii-feed-post { display: flex; flex-direction: column; }

/* ── Caption below ── */
.quqii-feed-caption--below {
    font-size: .8rem;
    color: #374151;
    line-height: 1.45;
    margin: 1em 0 0;
    padding: 0 1em;
}

/* ── Caption overlay (click-to-reveal only — covers the full image).
   No automatic :hover reveal: it would otherwise sit on top of the
   image while the visitor tries to swipe a carousel or start a video. ── */
.quqii-feed-caption--overlay {
    position: absolute;
    inset: 0;
    z-index: 1; /* stays below .quqii-feed-bottom-left (z-index: 2) so the toggle button and likes remain clickable/visible while the overlay is open */
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: rgba(var(--quqii-feed-overlay-color, 0, 0, 0), var(--quqii-feed-overlay-alpha, .7));
    color: #fff;
    font-size: .92rem;
    line-height: 1.5;
    /* Extra bottom padding (base clearance + the configurable grid gap) so
       the text never sits on top of the info/likes icons in that corner. */
    padding: 1.25rem var(--quqii-feed-inset, 1.25rem) calc(2.75rem + var(--quqii-feed-gap, 0.25rem)) var(--quqii-feed-inset, 1.25rem);
    box-sizing: border-box;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.4) transparent;
}
.quqii-feed-caption--overlay p {
    margin: 0;
    margin-top: auto; /* bottom-anchors short text; long text still scrolls from the top */
}
.quqii-feed-caption--overlay::-webkit-scrollbar { width: 4px; }
.quqii-feed-caption--overlay::-webkit-scrollbar-thumb { background: rgba(255,255,255,.4); border-radius: 2px; }
.quqii-feed-item.quqii-feed-show-caption .quqii-feed-caption--overlay {
    opacity: 1;
    pointer-events: auto;
}

/* ── Caption toggle button — same plain-icon style as the other overlay
   icons (no button background), just a tappable info glyph. ── */
.quqii-feed-caption-toggle {
    -webkit-appearance: none;
    appearance: none;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    cursor: pointer;
    opacity: .85;
    transition: opacity .2s;
}
.quqii-feed-caption-toggle:hover,
.quqii-feed-item.quqii-feed-show-caption .quqii-feed-caption-toggle {
    opacity: 1;
}
.quqii-feed-caption-toggle svg {
    display: block;
    width: 14px;
    height: 14px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.5));
    fill: transparent; /* guards against themes that reset SVG fill globally */
}

.quqii-feed-error { color: #c00; font-size: .875rem; }

.quqii-feed-notice {
    font-size: .875rem;
    color: #6b7280;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: .75rem 1rem;
    margin: 0;
}
.quqii-feed-notice--pending {
    color: #92400e;
    background: #fffbeb;
    border-color: #fde68a;
}
