/* ============================================================
   GLightbox — custom Instagram-style right sidebar + masonry.
   Everything is prefixed with .glb- to avoid collisions with
   the existing site CSS.
   ============================================================ */

/* ---------- Layout: sidebar on desktop, stacked on mobile ---------- */

.glightbox-container .gslide-media {
    max-width: 100%;
}

/* Desktop: slide becomes flex row, image + sidebar */
@media (min-width: 1024px) {
    .glightbox-clean .gslide-description.glb-info,
    .glightbox-container .gslide-description.glb-info {
        background: #ffffff;
        color: #0f172a;
        padding: 0;
        width: 420px;
        max-width: 420px;
        min-height: 560px;
        max-height: 88vh;
        display: flex;
        flex-direction: column;
        border-radius: 0 12px 12px 0;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
        overflow: hidden;
    }

    .glightbox-clean .gslide-media {
        border-radius: 12px 0 0 12px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    }

    .glightbox-clean .gdesc-inner {
        padding: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
    }
}

/* Mobile: hide sidebar entirely, just show image */
@media (max-width: 1023.98px) {
    .glightbox-clean .gslide-description.glb-info,
    .glightbox-container .gslide-description.glb-info {
        display: none !important;
    }
    .glightbox-clean .gslide-media {
        margin: 0 auto;
    }
}

/* ---------- Sidebar inner structure ---------- */

.glb-info .glb-panel {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    color: #0f172a;
}

.glb-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
    flex: 0 0 auto;
}

.glb-panel-header .glb-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex: 0 0 auto;
    background: #f1f5f9;
}

.glb-panel-header .glb-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.glb-panel-header .glb-author {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

.glb-panel-header .glb-author-name {
    font-weight: 600;
    color: #0f172a;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 15px;
}

.glb-panel-header .glb-author-name:hover {
    color: #0ea5e9;
}

.glb-panel-header .glb-verify {
    color: #0ea5e9;
    font-size: 14px;
}

.glb-panel-header .glb-time {
    color: #64748b;
    font-size: 12px;
}

/* ---------- Scrollable content area ---------- */

.glb-panel-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 16px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.glb-panel-scroll::-webkit-scrollbar {
    width: 6px;
}

.glb-panel-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.glb-post-text {
    padding: 14px 0;
    color: #0f172a;
    font-size: 14px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.glb-post-text a {
    color: #0ea5e9;
    text-decoration: none;
}

.glb-post-text a:hover {
    text-decoration: underline;
}

.glb-post-text img {
    max-width: 22px;
    vertical-align: middle;
}

.glb-comments-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0 -16px;
}

.glb-comments-list {
    padding: 12px 0 8px;
}

/* ---------- Comment rows ---------- */

.glb-comment {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    align-items: flex-start;
}

.glb-comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex: 0 0 auto;
    background: #f1f5f9;
    display: block;
}

.glb-comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.glb-comment-body {
    min-width: 0;
    flex: 1 1 auto;
}

.glb-comment-head {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.glb-comment-user {
    font-weight: 600;
    color: #0f172a;
    text-decoration: none;
    font-size: 13px;
}

.glb-comment-user:hover {
    color: #0ea5e9;
}

.glb-comment-time {
    color: #94a3b8;
    font-size: 11px;
}

.glb-comment-text {
    color: #334155;
    font-size: 14px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    margin-top: 2px;
}

.glb-comment-text img {
    max-width: 22px;
    vertical-align: middle;
}

.glb-comment-image {
    margin-top: 6px;
    max-width: 100%;
    max-height: 180px;
    border-radius: 8px;
    object-fit: cover;
}

.glb-comments-empty {
    padding: 24px 0;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}

/* ---------- Action bar (fixed above input) ---------- */

.glb-panel-actions {
    flex: 0 0 auto;
    border-top: 1px solid #e5e7eb;
    padding: 10px 16px 4px;
    background: #ffffff;
}

.glb-action-row {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 22px;
    color: #0f172a;
}

.glb-action-btn {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: inherit;
    transition: transform .15s ease, color .15s ease;
}

.glb-action-btn:hover {
    transform: scale(1.08);
}

.glb-action-btn[disabled] {
    opacity: .45;
    cursor: not-allowed;
}

.glb-action-btn.is-liked {
    color: #ef4444;
}

.glb-action-share {
    margin-left: auto;
}

.glb-counts {
    font-size: 13px;
    color: #334155;
    padding: 6px 0 8px;
    display: flex;
    gap: 14px;
}

.glb-counts strong {
    color: #0f172a;
    font-weight: 600;
}

/* ---------- Comment input ---------- */

.glb-panel-input {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
}

.glb-comment-field {
    flex: 1 1 auto;
    border: 0;
    background: transparent;
    resize: none;
    outline: none;
    font: inherit;
    font-size: 14px;
    color: #0f172a;
    max-height: 90px;
    min-height: 22px;
    padding: 6px 0;
}

.glb-comment-field::placeholder {
    color: #94a3b8;
}

.glb-send-btn {
    background: none;
    border: 0;
    cursor: pointer;
    color: #0ea5e9;
    font-weight: 600;
    font-size: 14px;
    padding: 6px 8px;
    transition: opacity .15s ease;
}

.glb-send-btn:disabled {
    color: #cbd5e1;
    cursor: not-allowed;
}

.glb-loading {
    padding: 24px 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}

/* ---------- Share popover ---------- */

.glb-share-pop {
    position: absolute;
    bottom: 56px;
    right: 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    padding: 8px;
    display: none;
    gap: 4px;
    z-index: 10;
}

.glb-share-pop.is-open {
    display: flex;
}

.glb-share-pop a {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    text-decoration: none;
    transition: transform .15s ease;
}

.glb-share-pop a:hover {
    transform: scale(1.1);
}

/* Panel positioning for the share pop (relative context) */
.glb-info .glb-panel {
    position: relative;
}

/* ---------- Instagram-style nav arrows ----------
   The arrows live in the full-viewport .gcontainer, so their left/top are
   set in JS (positionArrows) against the current image's bounding box.
   This block only handles their appearance. */
.glightbox-clean .gnext,
.glightbox-clean .gprev {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.28);
    transition: background-color .15s ease, transform .15s ease;
}

.glightbox-clean .gnext:hover,
.glightbox-clean .gprev:hover {
    background-color: #ffffff;
    transform: scale(1.06);
}

.glightbox-clean .gnext svg,
.glightbox-clean .gprev svg {
    width: 16px;
}

.glightbox-clean .gnext path,
.glightbox-clean .gprev path {
    fill: #0f172a;
}

/* Hide an arrow when there is nowhere to go (gallery ends or single image) */
.glightbox-clean .gnext.disabled,
.glightbox-clean .gprev.disabled,
.gnext.glightbox-button-hidden,
.gprev.glightbox-button-hidden {
    opacity: 0 !important;
    pointer-events: none;
}

/* ============================================================
   Profile masonry gallery — pure CSS column layout.
   ============================================================ */

.profile-gallery {
    column-count: 3;
    column-gap: 10px;
    padding: 8px 0;
}

@media (max-width: 1023.98px) {
    .profile-gallery {
        column-count: 2;
    }
}

@media (max-width: 599.98px) {
    .profile-gallery {
        column-count: 1;
    }
}

.profile-gallery .profile-gallery-item {
    display: block;
    break-inside: avoid;
    margin: 0 0 10px 0;
    border-radius: 10px;
    overflow: hidden;
    cursor: zoom-in;
    position: relative;
    background: #f1f5f9;
    transition: transform .2s ease, box-shadow .2s ease;
    text-decoration: none;
}

.profile-gallery .profile-gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
}

.profile-gallery .profile-gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform .3s ease;
}

.profile-gallery .profile-gallery-item:hover img {
    transform: scale(1.03);
}

.profile-gallery-empty {
    padding: 24px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}
