.zbjb-thumb {
    position: relative;
    overflow: hidden;
}

.zbjb-overlay {
    pointer-events: none;
    position: absolute;
    inset: 0;
    z-index: 8;
}

.zbjb-badge {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: calc(100% - 8px);
    border-radius: 4px;
    overflow: hidden;
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.04em;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16);
}

.zbjb-badge.is-text {
    min-height: 24px;
    padding: 0 8px;
    white-space: nowrap;
}

.zbjb-badge.is-image img {
    display: block;
    position: static !important;
    inset: auto !important;
    max-width: 72px;
    max-height: 36px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.zbjb-badge.is-image {
    line-height: 0;
}

.zbjb-left {
    top: 0;
    left: 0;
    border-radius: 0 0 4px 0;
}

.zbjb-right {
    top: 0;
    right: 0;
    border-radius: 0 0 0 4px;
}

.zbjb-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1.5;
    font-weight: 600;
    text-align: center;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.posts-item:hover .zbjb-bottom,
.zbjb-thumb:hover .zbjb-bottom,
.posts-item:focus-within .zbjb-bottom {
    opacity: 1;
    transform: translateY(0);
}

/* Bottom alignment */
.zbjb-bottom.is-align-left  { justify-content: flex-start; text-align: left; }
.zbjb-bottom.is-align-right { justify-content: flex-end; text-align: right; }

/* Mobile visibility */
@media (max-width: 768px) {
    .zbjb-mobile-hide { display: none !important; }
}

/* Touch mode: always show bottom bar */
html.zbjb-touch-always .zbjb-bottom {
    opacity: 1;
    transform: translateY(0);
}

/* Tag scroll container */
.item-tags {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 1px;
}

.zbjb-tags-viewport {
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 80px;
}

.zbjb-tags-track {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    transition: transform 0.3s ease;
    will-change: transform;
}

.zbjb-tags-prev,
.zbjb-tags-next {
    flex-shrink: 0;
    padding: 0 8px;
    font-size: 12px;
    line-height: 24px;
    cursor: pointer;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    vertical-align: middle;
}
