:root {
    --primary-color: #1e3a8a;
    --accent-color: #f97316;
}
body {
    font-family: 'Inter', sans-serif;
    background: #fafafa;
}
.insta-nav {
    background: #fff;
    border-bottom: 1px solid #dbdbdb;
    padding: 12px 0;
}
.insta-nav .brand {
    font-weight: 800;
    color: var(--primary-color);
    font-size: 1.4rem;
    text-decoration: none;
}
.cat-pills {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 14px 0;
    scrollbar-width: thin;
}
.cat-pill {
    flex: 0 0 auto;
    border: 1px solid #dbdbdb;
    background: #fff;
    border-radius: 999px;
    padding: 7px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #262626;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}
.cat-pill:hover { border-color: var(--accent-color); }
.cat-pill.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}
.loc-filter select {
    border-radius: 8px;
    font-size: 0.85rem;
}
.empty-state { grid-column: 1 / -1; }
#loadMoreWrap, .load-sentinel { min-height: 1px; }
.loading-indicator { color: #8e8e8e; }

/* ---- 3-column profile grid (insta/business.php) ---- */
.insta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}
@media (min-width: 768px) {
    .insta-grid { gap: 24px; }
}
.insta-tile {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    cursor: pointer;
    background: #eee;
    border-radius: 4px;
}
@media (min-width: 768px) {
    .insta-tile { border-radius: 8px; }
}
.insta-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.insta-tile .overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.15s;
}
.insta-tile:hover .overlay { opacity: 1; }
.insta-tile .cat-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
}

/* ---- Single-column main feed (insta/index.php) ---- */
.insta-feed {
    max-width: 470px;
    margin: 0 auto;
}
.post-card {
    background: #fff;
    border: 1px solid #dbdbdb;
    border-radius: 8px;
    margin-bottom: 24px;
    overflow: hidden;
}
.post-card .post-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
}
.post-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    text-decoration: none;
}
.post-header .post-company {
    font-weight: 600;
    font-size: 0.9rem;
    color: #262626;
    text-decoration: none;
}
.post-header .post-company:hover { text-decoration: underline; }
.post-header .post-cat-badge {
    margin-left: auto;
    background: #f0f2f5;
    color: #555;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
}
.post-card .post-img-wrap {
    width: 100%;
    aspect-ratio: 4 / 5;
    background: #eee;
}
.post-card .post-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.post-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 14px 0 14px;
}
.post-actions button {
    background: none;
    border: none;
    font-size: 1.35rem;
    color: #262626;
    padding: 4px;
    line-height: 1;
    cursor: pointer;
}
.post-actions button:hover { color: var(--accent-color); }
.post-actions .post-detail-link {
    margin-left: auto;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-color);
    text-decoration: none;
}
.post-body { padding: 8px 14px 16px 14px; }
.post-like-count { font-weight: 600; font-size: 0.88rem; margin-bottom: 4px; }
.post-caption { font-size: 0.88rem; color: #262626; margin-bottom: 4px; }
.cap-company { font-weight: 600; margin-right: 5px; }
.post-comment-link { font-size: 0.82rem; color: #8e8e8e; text-decoration: none; display: block; margin-bottom: 3px; }
.post-time { font-size: 0.7rem; color: #a8a8a8; text-transform: uppercase; letter-spacing: 0.3px; }

/* ---- Business profile header (insta/business.php) ---- */
.biz-header {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 30px 0;
    flex-wrap: wrap;
}
.biz-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 2.2rem;
    flex-shrink: 0;
    overflow: hidden;
}
.biz-avatar img { width: 100%; height: 100%; object-fit: cover; }
.biz-stats { display: flex; gap: 30px; margin: 10px 0; }
.biz-stats .num { font-weight: 700; }

/* ---- Quick-view modal (shared) ---- */
.modal-post-img {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    background: #000;
}

/* ---- Mobile bottom tab bar (Instagram-style) ---- */
.mobile-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    background: #fff;
    border-top: 1px solid #dbdbdb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px calc(8px + env(safe-area-inset-bottom, 0px)) 14px;
}
.tabbar-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #262626;
    font-size: 1.35rem;
    text-decoration: none;
    padding: 4px 0;
}
.tabbar-item.active { color: var(--accent-color); }
.tabbar-plus {
    background: #262626;
    color: #fff !important;
    border-radius: 8px;
    font-size: 1.1rem;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    margin: 0 auto;
}
.tabbar-avatar-circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}
/* Room for the fixed bar so content doesn't hide behind it */
@media (max-width: 767.98px) {
    body { padding-bottom: 62px; }
}
.mobile-search-bar {
    display: none;
    padding: 0 0 12px 0;
}
.mobile-search-bar.open { display: flex; }
