.gorgomish-friends {
    font-family: 'Vazirmatn', system-ui, -apple-system, sans-serif;
    color: #1e293b;
    max-width: 980px;
    margin: 0 auto;
    padding: 24px 16px 64px;
}
.gf-header { text-align: center; margin-bottom: 28px; }
.gf-header h1 { font-size: 28px; font-weight: 800; margin: 0 0 8px; background: linear-gradient(135deg,#10b981,#3b82f6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gf-header p { color: #64748b; font-size: 14px; margin: 0; }

/* ---- Instagram-style explore grid ---- */
.gf-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.gf-grid > .gorgomish-loading,
.gf-grid > .gorgomish-empty { grid-column: 1 / -1; }

.gf-tile {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 0;
    border: 0;
    margin: 0;
    background: #f1f5f9;
    overflow: hidden;
    cursor: pointer;
    font-family: inherit;
    border-radius: 4px;
    transition: transform .15s ease;
}
.gf-tile:focus { outline: 2px solid #3b82f6; outline-offset: 2px; }
.gf-tile:active { transform: scale(.98); }
.gf-tile-img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform .3s ease;
}
.gf-tile:hover .gf-tile-img { transform: scale(1.05); }
.gf-tile-fallback {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 8px; padding: 12px; text-align: center;
    background: linear-gradient(135deg,#a7f3d0,#bfdbfe);
    color: #0f172a;
}
.gf-tile-fallback-icon { font-size: 28px; line-height: 1; }
.gf-tile-fallback-title { font-size: 13px; font-weight: 700; line-height: 1.4; -webkit-line-clamp: 3; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }

.gf-tile-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    gap: 18px; color: #fff; font-weight: 700; font-size: 14px;
    background: rgba(15,23,42,.55);
    opacity: 0; transition: opacity .2s ease;
    pointer-events: none;
}
.gf-tile:hover .gf-tile-overlay,
.gf-tile:focus-visible .gf-tile-overlay { opacity: 1; }
.gf-tile-stat { display: inline-flex; align-items: center; gap: 6px; }
.gf-tile-ic { display: inline-flex; font-size: 18px; }

/* ---- Modal popup ---- */
.gf-modal {
    position: fixed; inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.gf-modal[hidden] { display: none !important; }
.gf-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(15,23,42,.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.gf-modal-box {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 640px;
    max-height: 92vh;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 30px 60px -20px rgba(0,0,0,.45);
    display: flex; flex-direction: column;
    overflow: hidden;
    animation: gf-modal-in .25s cubic-bezier(.34,1.2,.64,1);
}
@keyframes gf-modal-in {
    from { opacity: 0; transform: scale(.95) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.gf-modal-close {
    position: absolute; top: 10px; left: 10px;
    width: 36px; height: 36px; border-radius: 50%;
    border: 0; cursor: pointer;
    background: rgba(15,23,42,.85); color: #fff;
    font-size: 22px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    z-index: 2; transition: background .15s, transform .15s;
    font-family: inherit;
}
.gf-modal-close:hover { background: #ef4444; transform: rotate(90deg); }
.gf-modal-body { overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.gf-modal-body .gf-post {
    border: 0; border-radius: 0; box-shadow: none;
}
body.gf-modal-open { overflow: hidden; }

.gf-post {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,.04); transition: transform .2s, box-shadow .2s;
}
.gf-post:hover { box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.gf-post-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.gf-avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#a7f3d0,#bfdbfe); font-size: 20px; }
.gf-meta { display: flex; flex-direction: column; }
.gf-meta strong { font-size: 14px; font-weight: 700; }
.gf-meta span { font-size: 12px; color: #94a3b8; }

.gf-media { width: 100%; background: #f1f5f9; }
.gf-media img { width: 100%; height: auto; display: block; max-height: 720px; object-fit: cover; }

.gf-body { padding: 14px 16px 4px; }
.gf-title { margin: 0 0 8px; font-size: 17px; font-weight: 800; }
.gf-desc { margin: 0; font-size: 14px; line-height: 1.8; color: #334155; }

.gf-actions { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid #f1f5f9; }
.gf-actions button,
.gf-actions .gf-cmt-info {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
    font-family: inherit; font-size: 14px; font-weight: 600;
    background: transparent; border: none; cursor: pointer; padding: 6px 10px; border-radius: 8px;
    color: #475569; transition: background .15s, color .15s, transform .15s;
}
.gf-actions .gf-cmt-info { cursor: default; }
.gf-actions button:hover { background: #f1f5f9; }
.gf-actions button:active { transform: scale(.95); }
.gf-like .gf-heart { font-size: 20px; line-height: 1; color: #cbd5e1; transition: color .2s, transform .2s; }
.gf-like.is-liked .gf-heart { color: #ef4444; transform: scale(1.15); }
.gf-like.is-liked { color: #ef4444; }

.gf-comments { padding: 0 16px 16px; border-top: 1px solid #f1f5f9; }
.gf-comments-list { padding: 12px 0; display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow-y: auto; }
.gf-comment { background: #f8fafc; border-radius: 10px; padding: 10px 12px; }
.gf-c-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.gf-c-head strong { font-size: 13px; font-weight: 700; }
.gf-c-head span { font-size: 11px; color: #94a3b8; }
.gf-comment p { margin: 0; font-size: 13px; line-height: 1.7; color: #334155; word-wrap: break-word; }
.gf-no-cmt { color: #94a3b8; font-size: 13px; text-align: center; padding: 12px 0; }

.gf-comment-form { display: grid; gap: 8px; padding-top: 8px; }
.gf-comment-form input, .gf-comment-form textarea {
    font-family: inherit; font-size: 14px; padding: 10px 12px;
    border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; color: #1e293b; resize: vertical;
}
.gf-comment-form input:focus, .gf-comment-form textarea:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.gf-comment-form button {
    font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
    background: linear-gradient(135deg,#3b82f6,#2563eb); color: #fff;
    border: none; padding: 10px 16px; border-radius: 10px; justify-self: end;
}
.gf-comment-form button:hover { box-shadow: 0 4px 12px rgba(59,130,246,.4); }
.gf-comment-form button:disabled { opacity: .6; cursor: not-allowed; }
.gf-msg { font-size: 13px; min-height: 18px; }
.gf-msg.success { color: #10b981; }
.gf-msg.error   { color: #ef4444; }

@media (max-width: 640px) {
    .gorgomish-friends { padding: 16px 8px 48px; }
    .gf-header h1 { font-size: 22px; }
    .gf-grid { gap: 3px; }
    .gf-tile { border-radius: 2px; }
    .gf-tile-overlay { opacity: 1; background: linear-gradient(to top, rgba(15,23,42,.65), rgba(15,23,42,0) 55%); align-items: flex-end; justify-content: flex-start; padding: 8px 10px; gap: 12px; font-size: 12px; }
    .gf-tile-ic { font-size: 14px; }
    .gf-tile-fallback-title { font-size: 12px; }
    .gf-modal { padding: 0; align-items: stretch; }
    .gf-modal-box { max-width: 100%; max-height: 100vh; border-radius: 0; }
    .gf-post { border-radius: 0; border: 0; }
    .gf-title { font-size: 15px; }
    .gf-body, .gf-comments { padding-left: 12px; padding-right: 12px; }
}
