/* Public gallery: 3 columns (Instagram / YouTube / TikTok) + shared modals */

.gallery-tri-layout {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 12px 2.5rem;
    box-sizing: border-box;
}

.gallery-tri-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

@media (max-width: 1100px) {
    .gallery-tri-grid {
        grid-template-columns: 1fr;
    }
}

.gallery-col {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.gallery-col-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #fdf2f8 0%, #fff 100%);
    border-bottom: 1px solid #f3e8ff;
    flex-shrink: 0;
}

.gallery-col-title {
    margin: 0;
    font-family: var(--font-display), Georgia, serif;
    font-size: 1rem;
    font-weight: 600;
    color: #831843;
}

.gallery-col-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    background: #f3f4f6;
    padding: 4px 8px;
    border-radius: 6px;
}

.gallery-col-expand {
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 10px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #db2777;
    cursor: pointer;
    white-space: nowrap;
}

.gallery-col-expand:hover {
    background: #fdf2f8;
}

.gallery-col-expand .chev {
    display: inline-block;
    margin-left: 4px;
    transition: transform 0.2s ease;
}

.gallery-col.collapsed .gallery-col-expand .chev {
    transform: rotate(-90deg);
}

.gallery-col-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 3200px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.25s ease;
}

.gallery-col.collapsed .gallery-col-body {
    max-height: 520px;
}

.gallery-col-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #9ca3af;
    font-size: 0.95rem;
}

/* ---------- Shared card actions (hearts / comments / share) ---------- */
.g-actions {
    display: flex;
    gap: 14px;
    padding: 8px 4px 4px;
}

.g-action-icon {
    cursor: pointer;
    width: 26px;
    height: 26px;
    stroke: #374151;
    stroke-width: 2;
    fill: none;
    transition: transform 0.12s ease;
}

.g-action-icon:active {
    transform: scale(1.08);
}

.g-action-icon.liked {
    fill: #ed4956;
    stroke: #ed4956;
}

.g-meta {
    padding: 0 4px 8px;
    font-family: var(--font-sans), system-ui, sans-serif;
    font-size: 0.9rem;
    color: #374151;
}

.g-likes {
    font-weight: 600;
    margin-bottom: 6px;
}

.g-caption {
    margin-bottom: 8px;
    line-height: 1.45;
}

.g-caption-user {
    font-weight: 600;
    margin-right: 6px;
    color: #111827;
}

.g-comments-preview {
    font-size: 0.85rem;
    color: #4b5563;
}

.g-comment-row {
    margin-bottom: 4px;
}

.g-view-comments {
    color: #6b7280;
    font-size: 0.82rem;
    cursor: pointer;
    margin: 6px 0 4px;
    display: inline-block;
}

.g-view-comments:hover {
    color: #db2777;
}

.g-add-comment {
    border-top: 1px solid #f3f4f6;
    padding: 10px 4px 4px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.g-comment-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.9rem;
    resize: none;
    min-height: 22px;
    max-height: 120px;
    font-family: var(--font-sans), system-ui, sans-serif;
}

.g-post-btn {
    border: none;
    background: none;
    color: #db2777;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    opacity: 0.45;
    padding: 4px 0;
}

.g-post-btn:not(:disabled) {
    opacity: 1;
}

/* ---------- Instagram column (images) ---------- */
.insta-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.insta-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
}

.insta-profile-pic {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    margin-right: 10px;
    object-fit: cover;
}

.insta-username {
    font-weight: 600;
    color: #111827;
    font-size: 0.88rem;
    font-family: var(--font-sans), system-ui, sans-serif;
}

.insta-media-wrap {
    position: relative;
    background: #f3f4f6;
    aspect-ratio: 1;
    overflow: hidden;
}

.insta-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ---------- YouTube column (long video) ---------- */
.yt-card {
    background: #0f0f0f;
    border-radius: 12px;
    overflow: hidden;
    color: #f9fafb;
    border: 1px solid #27272a;
}

.yt-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #18181b;
    border-bottom: 1px solid #27272a;
}

.yt-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #3f3f46;
}

.yt-channel {
    font-weight: 600;
    font-size: 0.9rem;
}

.yt-media-wrap {
    position: relative;
    background: #000;
    aspect-ratio: 16 / 9;
}

.yt-media {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.yt-below {
    padding: 10px 12px 12px;
    background: #18181b;
}

.yt-below .g-likes,
.yt-below .g-caption,
.yt-below .g-comments-preview {
    color: #e5e7eb;
}

.yt-below .g-caption-user {
    color: #fda4af;
}

.yt-below .g-view-comments {
    color: #a1a1aa;
}

.yt-below .g-view-comments:hover {
    color: #fda4af;
}

.yt-below .g-add-comment {
    border-top-color: #27272a;
}

.yt-below .g-comment-input {
    background: #27272a;
    color: #fafafa;
    border-radius: 8px;
    padding: 8px 10px;
}

.yt-below .g-post-btn {
    color: #f472b6;
}

.yt-below .g-action-icon {
    stroke: #e5e7eb;
}

/* ---------- TikTok column (short vertical video) ---------- */
.tt-card {
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    color: #fff;
    border: 1px solid #27272a;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0;
    max-width: 420px;
    margin: 0 auto;
}

.tt-media-wrap {
    position: relative;
    aspect-ratio: 9 / 16;
    max-height: min(72vh, 640px);
    background: #09090b;
}

.tt-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tt-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    padding: 12px 10px 16px;
    background: linear-gradient(90deg, #000 0%, #0a0a0a 100%);
    min-width: 52px;
}

.tt-rail .g-action-icon {
    stroke: #fff;
    width: 28px;
    height: 28px;
}

.tt-rail .g-action-icon.liked {
    fill: #fb7185;
    stroke: #fb7185;
}

.tt-meta {
    grid-column: 1 / -1;
    padding: 10px 12px 12px;
    font-size: 0.88rem;
    background: #09090b;
    border-top: 1px solid #27272a;
}

.tt-meta .g-likes {
    color: #fafafa;
}

.tt-meta .g-caption {
    color: #d4d4d8;
}

.tt-meta .g-caption-user {
    color: #fda4af;
}

.tt-meta .g-view-comments {
    color: #a3a3a3;
}

.tt-footer-comments {
    grid-column: 1 / -1;
    border-top: 1px solid #27272a;
    padding: 8px 10px 10px;
    background: #0a0a0a;
}

.tt-footer-comments .g-add-comment {
    border-top: none;
    padding-top: 0;
}

.tt-footer-comments .g-comment-input {
    background: #18181b;
    color: #fafafa;
    border-radius: 999px;
    padding: 8px 12px;
}

.tt-footer-comments .g-post-btn {
    color: #fb7185;
}

/* ---------- Comments modal ---------- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.comments-modal {
    background: white;
    width: 100%;
    max-width: 500px;
    height: 80vh;
    max-height: 640px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.cm-header {
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.cm-title {
    font-weight: 600;
    font-family: var(--font-sans), system-ui, sans-serif;
    font-size: 1rem;
    text-align: center;
    flex: 1;
}

.cm-close {
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    color: #374151;
    padding: 4px;
}

.cm-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
}

.cm-item {
    display: flex;
    margin-bottom: 14px;
    font-family: var(--font-sans), system-ui, sans-serif;
    font-size: 0.9rem;
}

.cm-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fce7f3;
    color: #9d174d;
    margin-right: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.cm-content {
    flex: 1;
    min-width: 0;
}

.cm-time {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 4px;
}

.cm-footer {
    border-top: 1px solid #e5e7eb;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.cm-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 4px;
    font-size: 0.95rem;
}

.cm-post-btn {
    color: #db2777;
    font-weight: 700;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}

#feed-loader {
    text-align: center;
    padding: 32px;
    color: #db2777;
    font-size: 1.5rem;
}

@keyframes gallery-spin {
    100% {
        transform: rotate(360deg);
    }
}

#feed-loader .spin {
    animation: gallery-spin 1s linear infinite;
    display: inline-block;
}
