/**
 * JEWTECH Instagram Feed - Frontend Styles
 * Clean, functional RTL Hebrew layout matching reference design
 */

.jt-ig-feed-wrap {
    direction: rtl;
    text-align: right;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    color: #1d2327;
}

.jt-ig-feed-wrap *,
.jt-ig-feed-wrap *::before,
.jt-ig-feed-wrap *::after {
    box-sizing: border-box;
}

/* Profile Header */
.jt-ig-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    margin-bottom: 24px;
    padding: 8px 4px;
    direction: rtl;
}

.jt-ig-avatar-link {
    display: block;
    flex-shrink: 0;
    width: 74px;
    height: 74px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background-color: #f0f0f1;
    text-decoration: none;
}

.jt-ig-avatar {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 50% !important;
    margin: 0 !important;
}

.jt-ig-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e5e7eb;
    color: #6b7280;
    font-weight: 700;
    font-size: 24px;
    text-transform: uppercase;
}

.jt-ig-user-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: right;
    gap: 4px;
    min-width: 0;
}

.jt-ig-fullname {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
    margin: 0;
}

.jt-ig-username-link {
    font-size: 14px;
    font-weight: 700;
    color: #111827 !important;
    text-decoration: none !important;
    line-height: 1.3;
    direction: ltr;
    unicode-bidi: embed;
    display: inline-block;
}

.jt-ig-username-link:hover {
    opacity: 0.75;
}

.jt-ig-counts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    font-size: 13.5px;
    color: #374151;
    margin: 2px 0;
}

.jt-ig-count-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.jt-ig-count-num {
    font-weight: 700;
    color: #111827;
}

.jt-ig-bio {
    font-size: 13.5px;
    color: #4b5563;
    line-height: 1.5;
    margin-top: 2px;
    white-space: pre-line;
    word-break: break-word;
}

/* Posts Grid */
.jt-ig-grid {
    display: grid;
    grid-template-columns: repeat(var(--jt-ig-cols-desktop, 3), minmax(0, 1fr));
    gap: var(--jt-ig-gap, 12px);
    width: 100%;
}

.jt-ig-item {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background-color: #f3f4f6;
    text-decoration: none !important;
    border-radius: 0;
}

.jt-ig-item img.jt-ig-media {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    transition: transform 0.3s ease, filter 0.3s ease;
    margin: 0 !important;
    border-radius: 0 !important;
}

.jt-ig-item:hover img.jt-ig-media {
    transform: scale(1.02);
    filter: brightness(0.94);
}

/* Subtle media type badge in top-right corner (like Instagram / reference screenshot) */
.jt-ig-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    pointer-events: none;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.35));
    line-height: 1;
}

.jt-ig-badge svg {
    width: 18px;
    height: 18px;
    fill: #ffffff;
    display: block;
}

/* Empty / Error state (only visible to admins) */
.jt-ig-empty-notice {
    padding: 24px;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    text-align: center;
    color: #4b5563;
    font-size: 14px;
    direction: rtl;
}

/* Responsive Breakpoints */
@media (max-width: 991px) {
    .jt-ig-grid {
        grid-template-columns: repeat(var(--jt-ig-cols-tablet, 3), minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .jt-ig-grid {
        grid-template-columns: repeat(var(--jt-ig-cols-mobile, 2), minmax(0, 1fr));
        gap: var(--jt-ig-gap-mobile, 8px);
    }

    .jt-ig-header {
        gap: 14px;
        margin-bottom: 18px;
    }

    .jt-ig-avatar-link {
        width: 60px;
        height: 60px;
    }

    .jt-ig-fullname {
        font-size: 15px;
    }

    .jt-ig-counts {
        gap: 12px;
        font-size: 12.5px;
    }
}
