/* Instagram Feed widget */
.widget_instagram_feed {
    background: #fff;
}

.instagram-feed-body {
    padding: 0 16px 16px;
}

.instagram-feed-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0 16px;
    border-bottom: 1px solid #ececec;
    margin-bottom: 12px;
}

.instagram-feed-avatar {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    background: #fafafa;
    border: 1px solid #dbdbdb;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.instagram-feed-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.instagram-feed-avatar-fallback {
    font-size: 24px;
    color: #c13584;
}

.instagram-feed-meta {
    flex: 1 1 auto;
    min-width: 0;
}

.instagram-feed-username {
    display: block;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    color: #262626;
    text-decoration: none;
    margin-bottom: 2px;
}

.instagram-feed-username:hover {
    color: #005331;
    text-decoration: none;
}

.instagram-feed-followers {
    font-size: 12px;
    font-weight: 500;
    color: #65676b;
    line-height: 1.3;
}

.instagram-feed-follow-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: 6px 12px;
    background: #005331;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.instagram-feed-follow-btn:hover {
    background: #003d24;
    color: #fff;
}

.instagram-feed-grid {
    display: grid;
    grid-template-columns: repeat(var(--instagram-feed-cols, 3), minmax(0, 1fr));
    gap: 3px;
}

.instagram-feed-grid-item {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    min-height: 60px;
    overflow: hidden;
    background: #f0f0f0;
    text-decoration: none;
}

.instagram-feed-grid-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.instagram-feed-grid-item:hover .instagram-feed-grid-img {
    transform: scale(1.04);
    opacity: 0.92;
}

.instagram-feed-empty {
    margin: 0;
    padding: 12px 0 4px;
    font-size: 13px;
    line-height: 1.5;
    color: #888;
    text-align: center;
}

.instagram-feed-empty a {
    color: #005331;
    text-decoration: none;
    font-weight: 600;
}

.instagram-feed-empty a:hover {
    text-decoration: underline;
}

/* Main content area — larger layout */
.main-content .widget_instagram_feed .instagram-feed-body {
    padding: 0 20px 20px;
}

.main-content .widget_instagram_feed .instagram-feed-header {
    gap: 16px;
    padding: 16px 0 20px;
}

.main-content .widget_instagram_feed .instagram-feed-avatar {
    width: 72px;
    height: 72px;
}

.main-content .widget_instagram_feed .instagram-feed-username {
    font-size: 20px;
}

.main-content .widget_instagram_feed .instagram-feed-followers {
    font-size: 14px;
}

.main-content .widget_instagram_feed .instagram-feed-follow-btn {
    min-width: 96px;
    padding: 7px 16px;
    font-size: 14px;
}

.main-content .widget_instagram_feed .instagram-feed-grid {
    gap: 4px;
}

.block-widget-instagram_feed {
    background: transparent;
    border: 0;
    margin-bottom: 0;
}

.block-widget-instagram_feed .home-widget-slot > .widget_instagram_feed {
    padding: 0;
}

.block-widget-instagram_feed .penci-block_content.home-widget-slot {
    padding-top: 0;
}

.block-homepage.block-widget-instagram_feed {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .instagram-feed-header {
        flex-wrap: wrap;
    }

    .instagram-feed-follow-btn {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .main-content .instagram-feed-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
