/* ==============================
   BASE CONTAINER FIXES
   ============================== */
.elementor-widget-ifp_instagram_feed,
.elementor-widget-ifp_instagram_feed .elementor-widget-container {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* ==============================
   GRID LAYOUT
   ============================== */
.ifp-feed-grid {
    display: grid !important;
    gap: 25px !important;
    width: 100% !important;
}

.ifp-columns-2 { grid-template-columns: repeat(2, 1fr); }
.ifp-columns-3 { grid-template-columns: repeat(3, 1fr); }
.ifp-columns-4 { grid-template-columns: repeat(4, 1fr); }
.ifp-columns-5 { grid-template-columns: repeat(5, 1fr); }

.ifp-grid-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    object-fit: cover;
}

/* ==============================
   INSTAGRAM CARD LAYOUT
   ============================== */
.ifp-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e6e6e6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    padding-bottom: 15px;
}

/* Header */
.ifp-card-header {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #efefef;
}

.ifp-avatar img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
}

.ifp-username-wrap {
    margin-left: 12px;
    flex-grow: 1;
}

.ifp-username {
    font-size: 15px;
    font-weight: 600;
    color: #262626;
}

.ifp-subtext {
    font-size: 13px;
    color: #8e8e8e;
    margin-top: 2px;
}

/* View profile button */
.ifp-view-profile-btn {
    background: #0095f6;
    color: #fff;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}
.ifp-view-profile-btn:hover {
    background: #0077cc;
}

/* Media Image */
.ifp-card-media img.ifp-card-img {
    width: 100%;
    display: block;
    object-fit: cover;
}

/* Stats Section */
.ifp-card-stats {
    display: flex;
    gap: 12px;
    padding: 10px 15px;
    font-size: 14px;
}
.ifp-likes, .ifp-comments {
    color: #262626;
}

/* Caption */
.ifp-caption {
    padding: 0 15px;
    font-size: 14px;
    color: #333;
    margin-top: 3px;
}

/* Timestamp */
.ifp-timestamp {
    padding: 6px 15px;
    font-size: 12px;
    color: #8e8e8e;
    text-transform: uppercase;
}

/* Footer link */
.ifp-view-instagram {
    padding: 10px 15px;
}
.ifp-view-instagram a {
    color: #0095f6;
    font-size: 14px;
    text-decoration: none;
}
.ifp-view-instagram a:hover {
    text-decoration: underline;
}

/* ==============================
   SLIDER LAYOUT (SWIPER)
   ============================== */
.swiper {
    width: 100%;
}
.swiper-slide {
    width: auto;
}

/* ==============================
   INSTAGRAM-STYLE MINIMAL ARROWS
   ============================== */
.ifp-arrow {
    color: #fff !important;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(0,0,0,0.45);
    display: flex !important;
    justify-content: center;
    align-items: center;
    z-index: 12;
    transition: 0.2s ease;
}

.ifp-arrow:hover {
    background: rgba(0,0,0,0.65);
}

.swiper-button-prev.ifp-arrow,
.swiper-button-next.ifp-arrow {
    top: 45%;
}

/* Change arrow icon weight */
.swiper-button-prev::after,
.swiper-button-next::after {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 768px) {
    .ifp-feed-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .ifp-feed-grid {
        grid-template-columns: repeat(1, 1fr);
    }

    .ifp-view-profile-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Header layout wrapper */
.ifp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

/* Left side group */
.ifp-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Avatar */
.ifp-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
}

/* Username + subtext */
.ifp-user-info {
    line-height: 1.2;
}

.ifp-username-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ifp-username {
    font-size: 15px;
    font-weight: 600;
}

.ifp-subtext {
    font-size: 12px;
    color: #666;
}

/* Verified icon */
.ifp-verified-badge svg {
    width: 14px;
    height: 14px;
}

/* Right button */
.ifp-header-right .ifp-view-profile-btn {
    background: #0095F6;
    color: #fff !important;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.ifp-header-right .ifp-view-profile-btn:hover {
    background: #0077CC;
}
/* Force all cards to equal height */
.ifp-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e6e6e6;
}

/* Make image area fixed ratio */
.ifp-card-media {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.ifp-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Content wrapper grows evenly */
.ifp-card-content {
    padding: 12px 14px;
    flex-grow: 1; /* THIS MAKES HEIGHT EQUAL */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Caption styling */
.ifp-caption {
    margin-top: 10px;
    font-size: 13px;
    color: #444;
    line-height: 1.4;
    flex-grow: 1; /* Fills remaining space */
}

/* Time row */
.ifp-timestamp {
    font-size: 12px;
    color: #777;
    margin-top: 8px;
}

/* Footer button fixed at bottom */
.ifp-view-instagram {
    margin-top: auto;
    padding-top: 12px;
}

.ifp-view-instagram a {
    color: #0095F6;
    font-weight: 600;
    font-size: 13px;
}
