/* ============================================================
   Custom Instagram Feed — Dark Card Carousel
   ============================================================ */

:root {
    --cif-bg:          #111111;
    --cif-card-bg:     #1a1a1a;
    --cif-accent:      #ffffff;
    --cif-text:        #e8e8e8;
    --cif-muted:       #888888;
    --cif-border:      #2e2e2e;
    --cif-radius:      16px;
    --cif-gap:         20px;
    --cif-transition:  0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Wrapper ── */
.cif-carousel-wrapper {
    position: relative;
    width: 100%;
    padding: 20px 0 50px;
    overflow: hidden;
    background: transparent;
}

/* ── Track ── */
.cif-carousel {
    display: flex;
    gap: var(--cif-gap);
    transition: transform var(--cif-transition);
    will-change: transform;
    cursor: grab;
    user-select: none;
}

.cif-carousel.is-dragging {
    cursor: grabbing;
    transition: none;
}

/* ── Card ── */
.cif-card {
    flex: 0 0 calc((100% - var(--cif-gap) * 2) / 3);
    background: var(--cif-card-bg);
    border: 1px solid var(--cif-border);
    border-radius: var(--cif-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 24px rgba(0,0,0,0.45);
    transition: transform var(--cif-transition), box-shadow var(--cif-transition);
    text-decoration: none;
    cursor: pointer;
}

.cif-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}

/* ── Card Header ── */
.cif-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 10px;
}

.cif-ig-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cif-ig-icon svg {
    width: 100%;
    height: 100%;
}

.cif-account-info {
    display: flex;
    flex-direction: column;
}

.cif-account-name {
    font-family: 'Georgia', serif;
    font-weight: 700;
    font-size: 15px;
    color: var(--cif-accent);
    letter-spacing: 0.2px;
}

.cif-date {
    font-size: 11px;
    color: var(--cif-muted);
    margin-top: 2px;
}

.cif-ig-arrow {
    margin-left: auto;
    font-size: 16px;
    color: var(--cif-muted);
    transition: color 0.2s, transform 0.2s;
    line-height: 1;
}

.cif-card:hover .cif-ig-arrow {
    color: var(--cif-accent);
    transform: translate(2px, -2px);
}

/* ── Caption ── */
.cif-caption {
    padding: 4px 16px 14px;
    font-size: 13.5px;
    font-style: italic;
    line-height: 1.65;
    color: var(--cif-text);
    flex-grow: 1;
    font-family: 'Georgia', serif;
}

/* ── Image ── */
.cif-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #0a0a0a;
}

.cif-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.cif-card:hover .cif-image-wrap img {
    transform: scale(1.04);
}

.cif-image-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.cif-card:hover .cif-image-overlay {
    background: rgba(0,0,0,0.45);
}

.cif-view-btn {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    padding: 8px 18px;
    border: 2px solid #fff;
    border-radius: 30px;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-family: sans-serif;
}

.cif-card:hover .cif-view-btn {
    opacity: 1;
    transform: translateY(0);
}

/* ── Navigation Buttons ── */
.cif-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: #ffffff;
    color: #111;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.35);
    transition: background 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.cif-nav:hover {
    background: #e0e0e0;
    transform: translateY(-50%) scale(1.08);
}

.cif-prev { left: 6px; }
.cif-next { right: 6px; }

.cif-nav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ── Dots ── */
.cif-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.cif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cif-muted);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.25s, transform 0.25s;
}

.cif-dot.active {
    background: var(--cif-accent);
    transform: scale(1.3);
}

/* ── No posts message ── */
.cif-no-posts {
    text-align: center;
    padding: 40px;
    color: var(--cif-muted);
    font-style: italic;
}

/* ── Responsive ── */

/* Tablet: 2 cards */
@media (max-width: 1024px) {
    .cif-card {
        flex: 0 0 calc((100% - var(--cif-gap)) / 2);
    }
}

/* Mobile: 1 card */
@media (max-width: 640px) {
    .cif-card {
        flex: 0 0 100%;
    }
    .cif-nav {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }
}
