/* ₊˚ ✧ ━━━━⊱ TABS ⊰━━━━ ✧ ₊˚ */
.g-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding-bottom: 4px;
    margin-bottom: 14px;
}

.g-tab {
    padding: 6px 16px;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -6px;
}

/* ₊˚ ✧ ━━━━⊱ FILTERING ⊰━━━━ ✧ ₊˚ */
.g-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
}

.g-filters select,
.g-filters input[type="text"] {
    padding: 6px 10px;
    border: 1px solid #444;
    border-radius: 4px;
}

.g-nsfw-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.g-filter-go {
    padding: 6px 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.g-filter-go:hover { background: #444; }

/* ₊˚ ✧ ━━━━⊱ GRID + MASONRY ⊰━━━━ ✧ ₊˚ */
.g-grid {
    columns: 4;
    column-gap: 16px;
}

.g-item:nth-child(n+9) {
    display: none;
}

.g-item {
    position: relative; 
    display: block;
    break-inside: avoid;
    margin-bottom: 16px;
    text-decoration: none;
}

.g-item img {
    width: 100%;
    height: auto;
    display: block;
}

.g-empty {
    text-align: center;
    padding: 40px;
}

/* ₊˚ ✧ ━━━━⊱ NSFW TABS, ONLY VISIBLE IN ADMIN ⊰━━━━ ✧ ₊˚ */
.g-nsfw {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #933;
    padding: 2px 8px;
    border-radius: 3px;
    z-index: 2;
}

.g-nsfw-inline {
    position: static;
    display: inline-block;
    margin-top: 8px;
}

/* ₊˚ ✧ ━━━━⊱ CLICKABLE LIGHTBOX ⊰━━━━ ✧ ₊˚ */
/* ── Lightbox ─────────────────────────────────────────────── */

.g-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, .92);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.g-lb-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

/* Box must be positioned + above the bg, or the dark layer
   paints over the image */
.g-lb-box {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 24px;
    max-width: 95vw;
    max-height: 92vh;
    padding: 20px;
    box-sizing: border-box;
}

/* THE FIX — this is the rule that actually caps the image */
.g-lb-box img {
    max-width: 70vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    user-select: none;
}

/* Info panel */
.g-lb-info {
    min-width: 200px;
    max-width: 280px;
    color: #ddd;
}

.g-lb-info h2 {
    margin: 0 0 8px;
    color: #fff;
    font-size: 24px;
    line-height: 1.2;
}

.g-lb-sub {
    margin: 0 0 4px;
    font-size: 13px;
    color: #aaa;
}

.g-lb-info p {
    font-size: 14px;
    line-height: 1.5;
    margin: 8px 0;
    color: #ccc;
}

.g-lb-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.g-lb-tags span {
    background: #333;
    color: #ccc;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
}

/* Close button */
.g-lb-x {
    position: absolute;
    top: 8px;
    right: 16px;
    z-index: 2;
    color: #fff;
    font-size: 32px;
    text-decoration: none;
    line-height: 1;
    padding: 6px;
    cursor: pointer;
}

.g-lb-x:hover {
    color: #ff5c5c;
}

/* Mobile */
@media (max-width: 700px) {
    .g-lb-box {
        flex-direction: column;
        padding: 12px;
    }

    .g-lb-box img {
        max-width: 100%;
        max-height: 60vh;
    }

    .g-lb-info {
        max-width: 100%;
    }
}