/* ============================================
   Instagram Feed Section
   ============================================ */

/* Section Container */
.instagram-feed-section {
    position: relative;
    background-color: var(--brand-primary-color);
    padding: 90px 0 80px;
    overflow: hidden;
}

.instagram-feed-section::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(191, 150, 91, 0.06);
    pointer-events: none;
}

/* Section Header */
.instagram-feed-section .sec-title {
    text-align: center;
    margin-bottom: 40px;
}

.instagram-feed-section .sec-title h2 {
    color: var(--brand-white-color);
    font-size: 36px;
    font-weight: 700;
    font-family: 'Playfair Display', serif;
    letter-spacing: 0.5px;
}

.instagram-feed-section .sec-title .border-shape {
    position: relative;
    width: 48px;
    height: 2px;
    background-color: var(--brand-secondary-color);
    margin: 14px auto 0;
    display: block;
}

/* ─── Profile Header Card ─── */
.ig-profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0 auto 36px;
    padding: 18px 28px;
    background: var(--brand-white-color);
    border-radius: 14px;
    max-width: 520px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transition: all 0.35s ease;
}

.ig-profile-header:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 44px rgba(0, 0, 0, 0.18);
}

.ig-profile-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid var(--brand-secondary-color);
    padding: 2px;
    flex-shrink: 0;
    background: #fff;
}

.ig-profile-info {
    flex: 1;
    min-width: 0;
}

.ig-profile-name {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    font-family: 'Poppins', sans-serif;
    margin: 0 0 1px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ig-profile-name .ig-verified {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ig-profile-name .ig-verified svg {
    width: 16px;
    height: 16px;
}

.ig-profile-handle {
    font-size: 12px;
    color: #8e8e8e;
    font-family: 'Poppins', sans-serif;
    margin: 0;
}

.ig-profile-follow-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 22px;
    background: linear-gradient(135deg, var(--brand-secondary-color), #d4a85a);
    color: var(--brand-white-color);
    border: none;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
}

.ig-profile-follow-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(191, 150, 91, 0.45);
    background: linear-gradient(135deg, #d4a85a, var(--brand-secondary-color));
    color: var(--brand-white-color);
}

.ig-profile-follow-btn i {
    font-size: 15px;
}

/* ─── Grid Layout ─── */
.ig-feed-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    max-width: 900px;
    margin: 0 auto;
}

/* ─── Feed Item ─── */
.ig-feed-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    background: rgba(255,255,255,0.06);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transition: box-shadow 0.35s ease, transform 0.35s ease;
}

.ig-feed-item:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,0.22);
    transform: translateY(-4px);
}

.ig-feed-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.55s cubic-bezier(0.25,0.46,0.45,0.94), filter 0.35s ease;
    display: block;
}

.ig-feed-item:hover img {
    transform: scale(1.06);
    filter: brightness(0.65);
}

/* Overlay */
.ig-feed-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: linear-gradient(
        180deg,
        rgba(5,80,140,0.05) 0%,
        rgba(5,80,140,0.55) 100%
    );
    z-index: 2;
}

.ig-feed-item:hover .ig-feed-overlay {
    opacity: 1;
}

.ig-feed-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--brand-white-color);
    font-size: 15px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    text-shadow: 0 1px 4px rgba(0,0,0,0.35);
}

.ig-feed-stat i {
    font-size: 17px;
}

/* Carousel / Video Badge */
.ig-feed-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    color: var(--brand-white-color);
    font-size: 17px;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.45));
}

/* Loading Skeleton */
.ig-feed-item.skeleton {
    background: linear-gradient(
        110deg,
        rgba(255,255,255,0.04) 8%,
        rgba(255,255,255,0.09) 18%,
        rgba(255,255,255,0.04) 33%
    );
    background-size: 200% 100%;
    animation: igShimmer 1.5s linear infinite;
    border-radius: 14px;
}

@keyframes igShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Error State */
.ig-feed-error {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255,255,255,0.6);
    font-family: 'Poppins', sans-serif;
}

.ig-feed-error i {
    font-size: 40px;
    margin-bottom: 16px;
    display: block;
    color: var(--brand-secondary-color);
}

.ig-feed-error p {
    font-size: 15px;
    margin: 0;
}

/* ─── View More CTA ─── */
.ig-feed-cta {
    text-align: center;
    margin-top: 36px;
}

.ig-feed-cta a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 34px;
    border: 1.5px solid rgba(255,255,255,0.35);
    border-radius: 50px;
    color: var(--brand-white-color);
    font-size: 14px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
    transition: all 0.35s ease;
    background: transparent;
}

.ig-feed-cta a:hover {
    background: var(--brand-white-color);
    border-color: var(--brand-white-color);
    color: var(--brand-primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(255,255,255,0.15);
}

.ig-feed-cta a i {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.ig-feed-cta a:hover i {
    transform: translateX(3px);
}


/* ============================================
   Instagram Post Modal / Popup
   ============================================ */

.ig-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s ease;
    background: rgba(0,0,0,0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ig-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.ig-modal-backdrop.active .ig-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.ig-modal {
    position: relative;
    display: flex;
    width: 100%;
    max-width: 950px;
    max-height: 85vh;
    background: var(--brand-white-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0,0,0,0.4);
    transform: scale(0.92) translateY(20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25,0.46,0.45,0.94);
}

/* Close Button */
.ig-modal-close {
    position: absolute;
    top: -44px;
    right: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--brand-white-color);
    font-size: 28px;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 10;
}

.ig-modal-close:hover {
    transform: rotate(90deg);
}

/* Image Side */
.ig-modal-image {
    flex: 1.2;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    position: relative;
    overflow: hidden;
}

.ig-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Detail Side */
.ig-modal-detail {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 400px;
    min-width: 320px;
}

/* Modal Header */
.ig-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #efefef;
}

.ig-modal-header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--brand-secondary-color);
    padding: 1.5px;
    flex-shrink: 0;
}

.ig-modal-header-info {
    flex: 1;
    min-width: 0;
}

.ig-modal-header-name {
    font-size: 14px;
    font-weight: 700;
    color: #262626;
    font-family: 'Poppins', sans-serif;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ig-modal-header-name .ig-verified-sm {
    width: 14px;
    height: 14px;
}

.ig-modal-header-name .ig-verified-sm svg {
    width: 14px;
    height: 14px;
}

.ig-modal-header-location {
    font-size: 11px;
    color: #8e8e8e;
    margin: 0;
    font-family: 'Poppins', sans-serif;
}

.ig-modal-follow-btn {
    padding: 6px 18px;
    background: var(--brand-primary-color);
    color: var(--brand-white-color);
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.ig-modal-follow-btn:hover {
    background: var(--brand-secondary-color);
    color: var(--brand-white-color);
}

/* Modal Caption / Body */
.ig-modal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    border-bottom: 1px solid #efefef;
}

.ig-modal-caption {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.ig-modal-caption-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    margin-top: 2px;
}

.ig-modal-caption-content {
    flex: 1;
    min-width: 0;
}

.ig-modal-caption-text {
    font-size: 14px;
    color: #262626;
    line-height: 1.6;
    font-family: 'Open Sans', sans-serif;
    margin: 0;
    word-wrap: break-word;
}

.ig-modal-caption-text strong {
    font-weight: 700;
    color: #262626;
    font-family: 'Poppins', sans-serif;
}

.ig-modal-caption-text .ig-hashtag {
    color: var(--brand-primary-color);
    font-weight: 500;
}

.ig-modal-caption-time {
    font-size: 11px;
    color: #8e8e8e;
    margin-top: 8px;
    font-family: 'Poppins', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Modal Actions */
.ig-modal-actions {
    padding: 12px 20px;
    border-bottom: 1px solid #efefef;
}

.ig-modal-action-icons {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
}

.ig-modal-action-icons button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #262626;
    font-size: 22px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.ig-modal-action-icons button:hover {
    color: var(--brand-secondary-color);
    transform: scale(1.15);
}

.ig-modal-action-icons button.ig-liked {
    color: #ed4956;
}

.ig-modal-action-icons .ig-action-spacer {
    margin-left: auto;
}

.ig-modal-likes {
    font-size: 14px;
    font-weight: 700;
    color: #262626;
    font-family: 'Poppins', sans-serif;
    margin: 0;
}

/* Modal Footer */
.ig-modal-footer {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ig-modal-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--brand-primary-color), #0a6eb5);
    color: var(--brand-white-color);
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
    transition: all 0.3s ease;
    justify-content: center;
    cursor: pointer;
}

.ig-modal-link:hover {
    background: linear-gradient(135deg, #0a6eb5, var(--brand-primary-color));
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(5,80,140,0.35);
    color: var(--brand-white-color);
}

.ig-modal-link i {
    font-size: 16px;
}

.ig-modal-share {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #dbdbdb;
    border-radius: 10px;
    background: transparent;
    color: #262626;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.ig-modal-share:hover {
    border-color: var(--brand-secondary-color);
    color: var(--brand-secondary-color);
}

/* Modal Scrollbar */
.ig-modal-body::-webkit-scrollbar {
    width: 4px;
}
.ig-modal-body::-webkit-scrollbar-track {
    background: transparent;
}
.ig-modal-body::-webkit-scrollbar-thumb {
    background: #dbdbdb;
    border-radius: 4px;
}


/* ============================================
   Responsive – Instagram Feed
   ============================================ */

/* Tablet */
@media only screen and (max-width: 991px) {
    .instagram-feed-section {
        padding: 70px 0 60px;
    }

    .ig-feed-grid {
        gap: 10px;
        max-width: 600px;
    }

    .ig-feed-item {
        border-radius: 10px;
    }

    /* Modal → stacked */
    .ig-modal {
        flex-direction: column;
        max-width: 520px;
        max-height: 92vh;
    }

    .ig-modal-image {
        flex: none;
        min-height: 260px;
        max-height: 42vh;
    }

    .ig-modal-detail {
        max-width: 100%;
        min-width: auto;
    }

    .ig-modal-body {
        max-height: 180px;
    }

    .ig-modal-close {
        top: 10px;
        right: 10px;
        background: rgba(0,0,0,0.55);
        border-radius: 50%;
        width: 34px;
        height: 34px;
        font-size: 22px;
    }

    .ig-modal-close:hover {
        transform: rotate(90deg) scale(1.05);
    }
}

/* Mobile */
@media only screen and (max-width: 767px) {
    .instagram-feed-section {
        padding: 60px 0 50px;
    }

    .instagram-feed-section .sec-title {
        margin-bottom: 28px;
    }

    .instagram-feed-section .sec-title h2 {
        font-size: 26px;
    }

    /* Profile header stacks */
    .ig-profile-header {
        flex-wrap: wrap;
        gap: 10px;
        padding: 14px 18px;
        border-radius: 12px;
        max-width: 100%;
        margin-bottom: 24px;
    }

    .ig-profile-avatar {
        width: 44px;
        height: 44px;
    }

    .ig-profile-name {
        font-size: 14px;
    }

    .ig-profile-follow-btn {
        width: 100%;
        justify-content: center;
        padding: 10px 20px;
        border-radius: 8px;
    }

    /* Grid */
    .ig-feed-grid {
        gap: 6px;
        max-width: 100%;
    }

    .ig-feed-item {
        border-radius: 6px;
    }

    .ig-feed-stat {
        font-size: 11px;
        gap: 3px;
    }

    .ig-feed-stat i {
        font-size: 13px;
    }

    .ig-feed-overlay {
        gap: 14px;
    }

    /* CTA */
    .ig-feed-cta {
        margin-top: 28px;
    }

    .ig-feed-cta a {
        padding: 11px 26px;
        font-size: 13px;
    }

    /* Modal */
    .ig-modal {
        max-width: 100%;
        border-radius: 12px;
    }

    .ig-modal-image {
        min-height: 220px;
        max-height: 38vh;
    }

    .ig-modal-body {
        max-height: 140px;
        padding: 14px;
    }

    .ig-modal-header {
        padding: 12px 14px;
    }

    .ig-modal-actions {
        padding: 10px 14px;
    }

    .ig-modal-footer {
        padding: 12px 14px;
        flex-direction: column;
    }

    .ig-modal-link {
        width: 100%;
    }

    .ig-modal-share {
        width: 100%;
        border-radius: 8px;
    }
}

/* Small phones */
@media only screen and (max-width: 380px) {
    .ig-feed-grid {
        gap: 4px;
    }

    .ig-feed-item {
        border-radius: 4px;
    }

    .ig-feed-overlay {
        gap: 8px;
    }

    .ig-feed-stat {
        font-size: 10px;
    }

    .ig-feed-stat i {
        font-size: 12px;
    }
}
