/* VelChat profile media grid polish - performance first */

/* The Instagram profile used an explore-style mosaic (large 2nd/10th tile). On profiles this created
   visible holes and duplicate-looking side columns. Keep all profile media tiles uniform. */
.wo_user_profile .user_media_list_section,
.wo_user_profile .user_media_list_section.insta,
.wo_user_profile #photos-list.user_media_list_section.insta.profile,
.wo_user_profile #videos-list.user_media_list_section,
.wo_user_profile #reels-videos-list.user_media_list_section {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 3px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    clear: both !important;
}

.wo_user_profile .user_media_list_section .photo-data,
.wo_user_profile .user_media_list_section .video-data,
.wo_user_profile .user_media_list_section.insta .photo-data,
.wo_user_profile .user_media_list_section.insta .video-data,
.wo_user_profile .user_media_list_section.insta .photo-data:nth-child(2),
.wo_user_profile .user_media_list_section.insta .photo-data:nth-child(10),
.wo_user_profile .user_media_list_section_side .photo-data,
.wo_user_profile .user_media_list_section_side .photo-data:first-child {
    float: none !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    grid-column: auto !important;
    grid-row: auto !important;
    aspect-ratio: 1 / 1 !important;
    position: relative !important;
    overflow: hidden !important;
    border-radius: 0 !important;
    background: #111116 !important;
    contain: layout paint style;
    content-visibility: auto;
    contain-intrinsic-size: 130px 130px;
}

.wo_user_profile .user_media_list_section .photo-data > a,
.wo_user_profile .user_media_list_section .video-data > a,
.wo_user_profile .user_media_list_section.insta .photo-data > a,
.wo_user_profile .user_media_list_section.insta .video-data > a {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: 0 !important;
    padding-bottom: 0 !important;
    margin: 0 !important;
    aspect-ratio: 1 / 1 !important;
    overflow: hidden !important;
    border-radius: 0 !important;
    background: #111116 !important;
    box-shadow: none !important;
    position: relative !important;
    transform: translateZ(0);
}

.wo_user_profile .user_media_list_section .photo-data img,
.wo_user_profile .user_media_list_section .video-data img,
.wo_user_profile .user_media_list_section .video-data video,
.wo_user_profile .user_media_list_section.insta .photo-data img,
.wo_user_profile .user_media_list_section.insta .video-data img,
.wo_user_profile .user_media_list_section.insta .video-data video {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    border-radius: 0 !important;
    background: #000 !important;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.wo_user_profile .user_media_list_section .photo-data .ico,
.wo_user_profile .user_media_list_section .video-data .ico,
.wo_user_profile .user_media_list_section.insta .photo-data .ico,
.wo_user_profile .user_media_list_section.insta .video-data .ico {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 3 !important;
    padding: 8px !important;
    color: #fff !important;
    pointer-events: none !important;
}

.wo_user_profile .tag_profile_video_play {
    width: 34px !important;
    height: 34px !important;
}

/* Desktop can breathe a little more without changing the mobile Instagram feel. */
@media (min-width: 768px) {
    .wo_user_profile .user_media_list_section,
    .wo_user_profile .user_media_list_section.insta,
    .wo_user_profile #photos-list.user_media_list_section.insta.profile {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
        gap: 4px !important;
    }
}

/* On phones the sidebar preview gallery duplicates the real profile grid and wastes loading time.
   PHP also skips it for mobile; this keeps cached/older markup clean too. */
@media (max-width: 767px) {
    .wo_user_profile .user_media_list_section_side {
        display: none !important;
    }
    /* Do not force overflow:hidden on profile containers here.
       The profile avatar intentionally overlaps the cover with a negative margin on mobile. */
    .wo_user_profile .user_media_list_section,
    .wo_user_profile .user_media_list_section.insta {
        max-width: 100% !important;
    }
}

/* Keep the load-more area compact after grid items auto-load. */
.wo_user_profile .posts_load,
.wo_user_profile .posts_load #photos-list {
    min-height: 0 !important;
}
.wo_user_profile .load-more,
.wo_user_profile .tag_profile_auto_load {
    clear: both !important;
}
