/* Tusiime Gallery – album grid + lightbox */

.tg-album_head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.tg-album_cats {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.tg-album_cat {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 999px;
    background: rgba(180, 62, 62, 0.08);
    color: #B43E3E;
    font-size: 13px;
    font-weight: 600;
}

.tg-album_title {
    margin: 0;
}

.tg-album_desc {
    margin: 10px 0 0;
    max-width: 640px;
    color: #6e6e76;
}

.tg-album_count {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    background: #f5f6f8;
    color: #2a2c33;
    font-weight: 600;
    white-space: nowrap;
}

.tg-album_count i {
    color: #B43E3E;
}

.tg-album_back {
    margin-top: 34px;
    text-align: center;
}

/* ── Grid ── */

.tg-grid {
    display: grid;
    gap: 10px;
}

.tg-cols-2 { grid-template-columns: repeat(2, 1fr); }
.tg-cols-3 { grid-template-columns: repeat(3, 1fr); }
.tg-cols-4 { grid-template-columns: repeat(4, 1fr); }

.tg-layout-masonry {
    grid-auto-rows: 8px;
}

.tg-item {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 10px;
    background: #eef0f3;
}

/* .tg-grid prefix outranks the theme's img:not([draggable]) { height: auto } */
.tg-grid .tg-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}

.tg-layout-grid .tg-item {
    aspect-ratio: 1 / 1;
}

.tg-item:hover img {
    transform: scale(1.05);
}

.tg-item_zoom {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 18, 24, 0.35);
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tg-item:hover .tg-item_zoom,
.tg-item:focus-visible .tg-item_zoom {
    opacity: 1;
}

@media (max-width: 991px) {
    .tg-cols-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 767px) {
    .tg-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }

    .tg-album_head {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* ── Load more ── */

.tg-more-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
}

.tg-more.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

.tg-progress {
    font-size: 13px;
    color: #8a8a92;
}

.tg-empty {
    text-align: center;
    padding: 40px;
    color: #888;
}

/* ── Lightbox ── */

.tg-lb {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.tg-lb.is-open {
    opacity: 1;
    visibility: visible;
}

.tg-lb-lock,
.tg-lb-lock body {
    overflow: hidden;
}

.tg-lb_backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 12, 16, 0.93);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.tg-lb_box {
    position: relative;
    margin: 0;
    max-width: min(1100px, 100%);
    max-height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    overflow: hidden;
    background: #15171c;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
    transform: scale(0.96) translateY(8px);
    transition: transform 0.25s ease;
}

.tg-lb.is-open .tg-lb_box {
    transform: scale(1) translateY(0);
}

.tg-lb_stage {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: min(680px, 86vw);
    min-height: 220px;
    max-height: calc(100vh - 150px);
}

.tg-lb_stage img {
    max-width: 100%;
    max-height: calc(100vh - 150px);
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

.tg-lb_bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 18px;
    background: #15171c;
    color: #fff;
}

.tg-lb_caption {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #e8e8ea;
    min-width: 0;
}

.tg-lb_caption.is-empty {
    visibility: hidden;
}

.tg-lb_counter {
    flex-shrink: 0;
    font-size: 12px;
    color: #9a9aa2;
    letter-spacing: 0.04em;
}

.tg-lb_close {
    position: absolute;
    top: 14px;
    right: 16px;
    z-index: 3;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.tg-lb_close:hover {
    background: #B43E3E;
    transform: rotate(90deg);
}

.tg-lb_nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease;
}

.tg-lb_nav:hover {
    background: #B43E3E;
}

.tg-lb_prev { left: 18px; }
.tg-lb_next { right: 18px; }

@media (max-width: 767px) {
    .tg-lb {
        padding: 0;
    }

    .tg-lb_box {
        width: 100%;
        height: 100%;
        max-height: none;
        border-radius: 0;
        justify-content: center;
    }

    .tg-lb_stage {
        min-width: 0;
        max-height: none;
        flex: 1;
    }

    .tg-lb_stage img {
        max-height: calc(100dvh - 90px);
    }

    .tg-lb_bar {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    .tg-lb_nav {
        width: 42px;
        height: 42px;
        background: rgba(0, 0, 0, 0.35);
    }

    .tg-lb_prev { left: 10px; }
    .tg-lb_next { right: 10px; }

    .tg-lb_close {
        top: max(10px, env(safe-area-inset-top));
        right: 12px;
        background: rgba(0, 0, 0, 0.45);
    }
}
