/* Team Rainbow Gallery */

.tr-gallery-test {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 28px;
    width: 100%;
    align-items: start;
}

/* Category panel */

.tr-gallery-test-categories {
    background: #f5f5f5;
    border: 1px solid #e2e2e2;
}

.tr-gallery-test-categories > strong {
    display: block;
    padding: 16px 16px 12px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    color: #263238;
}

.tr-gallery-test-categories ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tr-gallery-test-categories li {
    margin: 0;
    padding: 0;
    border-top: 1px solid #dedede;
}

.tr-gallery-category {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: 0;
    background: transparent;
    color: #263238;
    font: inherit;
    font-size: 14px;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
}

.tr-gallery-category:hover,
.tr-gallery-category:focus-visible {
    background: #e9e9e9;
}

.tr-gallery-category.is-active {
    background: #ffffff;
    font-weight: 700;
    border-left: 4px solid #4A90E2;
    padding-left: 12px;
}

/* Gallery */

.tr-gallery-content {
    min-width: 0;
}

.tr-gallery-test-images {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.tr-gallery-test-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 5px;
    background: #eeeeee;
}

.tr-gallery-test-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tr-gallery-test-images[aria-busy="true"] {
    opacity: 0.55;
    pointer-events: none;
}

.tr-gallery-empty {
    grid-column: 1 / -1;
    margin: 0;
}

/* Pagination */

.tr-gallery-pagination-wrap {
    margin-top: 20px;
}

.tr-gallery-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.tr-gallery-page {
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid #d6d6d6;
    border-radius: 4px;
    background: #ffffff;
    color: #263238;
    font: inherit;
    line-height: 32px;
    text-align: center;
}

button.tr-gallery-page {
    cursor: pointer;
}

button.tr-gallery-page:hover,
button.tr-gallery-page:focus-visible {
    background: #eeeeee;
}

.tr-gallery-page.is-current {
    background: #263238;
    border-color: #263238;
    color: #ffffff;
    font-weight: 700;
}

.tr-gallery-ellipsis {
    padding: 0 4px;
}

/* Tablet */

@media (max-width: 900px) {

    .tr-gallery-test {
        grid-template-columns: 190px minmax(0, 1fr);
        gap: 20px;
    }

    .tr-gallery-test-images {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobile */

@media (max-width: 650px) {

    .tr-gallery-test {
        grid-template-columns: 1fr;
    }

    .tr-gallery-test-images {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}

@media (max-width: 420px) {

    .tr-gallery-test-images {
        grid-template-columns: 1fr;
    }
}

/* Team Rainbow Gallery Lightbox */

.tr-gallery-lightbox-trigger {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.tr-gallery-lightbox-trigger img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.tr-gallery-lightbox-open {
    overflow: hidden;
}

.tr-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 60px 80px;
    background: rgba(0, 0, 0, 0.88);
}

.tr-gallery-lightbox.is-open {
    display: flex;
}

.tr-gallery-lightbox-content {
    max-width: 1200px;
    max-height: 90vh;
}

.tr-gallery-lightbox-content img {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.tr-gallery-lightbox-close,
.tr-gallery-lightbox-prev,
.tr-gallery-lightbox-next {
    position: fixed;
    border: 0;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    line-height: 1;
}

.tr-gallery-lightbox-close {
    top: 20px;
    right: 25px;
    font-size: 44px;
}

.tr-gallery-lightbox-prev,
.tr-gallery-lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    padding: 20px;
    font-size: 42px;
}

.tr-gallery-lightbox-prev {
    left: 15px;
}

.tr-gallery-lightbox-next {
    right: 15px;
}

.tr-gallery-lightbox button:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 4px;
}

@media (max-width: 650px) {

    .tr-gallery-lightbox {
        padding: 60px 45px;
    }

    .tr-gallery-lightbox-prev,
    .tr-gallery-lightbox-next {
        padding: 10px;
        font-size: 32px;
    }

    .tr-gallery-lightbox-prev {
        left: 3px;
    }

    .tr-gallery-lightbox-next {
        right: 3px;
    }
}

/* Gallery Subcategories */

.tr-gallery-test-categories .tr-gallery-subcategories {
    margin: 0;
    padding: 0;
    list-style: none;
    background: #fafafa;
}

.tr-gallery-test-categories .tr-gallery-subcategories li {
    border-top: 1px solid #e6e6e6;
}

.tr-gallery-category-sub {
    padding-left: 32px;
    font-size: 13px;
}

.tr-gallery-category-sub.is-active {
    padding-left: 28px;
}

.tr-gallery-category-child .tr-gallery-category-sub::before {
    content: "–";
    display: inline-block;
    margin-right: 7px;
    color: #777777;
}

/* Gallery Category Accordion */

.tr-gallery-category-parent-row {
    display: flex;
    align-items: stretch;
}

.tr-gallery-category-parent-filter {
    flex: 1 1 auto;
    min-width: 0;
}

.tr-gallery-subcategory-toggle {
    flex: 0 0 42px;
    width: 42px;
    padding: 0;
    border: 0;
    border-left: 1px solid #dedede;
    background: transparent;
    color: #263238;
    cursor: pointer;
    font-size: 18px;
}

.tr-gallery-subcategory-toggle::before {
    content: "▸";
}

.tr-gallery-subcategory-toggle[aria-expanded="true"]::before {
    content: "▾";
}

.tr-gallery-subcategory-toggle:hover,
.tr-gallery-subcategory-toggle:focus-visible {
    background: #e9e9e9;
}

.tr-gallery-subcategory-toggle:focus-visible {
    outline: 2px solid #4A90E2;
    outline-offset: -2px;
}

.tr-gallery-subcategories[hidden] {
    display: none !important;
}

/* Team Rainbow Gallery Colour Styling v1.1 */

/* Whole category panel */
.tr-gallery-test-categories {
    background: #ffffff;
    border: 1px solid #d8e1e8;
    border-radius: 6px;
    overflow: hidden;
}

/* Heading */
.tr-gallery-test-categories > strong {
    background: #263238;
    color: #ffffff;
    padding: 17px 16px;
    letter-spacing: 0.02em;
}

/* Main category rows */
.tr-gallery-test-categories > ul > li {
    background: #ffffff;
    border-top-color: #e3e8eb;
}

.tr-gallery-category {
    color: #263238;
    transition:
        background-color 0.15s ease,
        color 0.15s ease;
}

/* Hover */
.tr-gallery-category:hover,
.tr-gallery-category:focus-visible {
    background: #F0E1B4;
    color: #263238;
}

/* Currently selected category */
.tr-gallery-category.is-active {
    background: #4A90E2;
    color: #ffffff;
    border-left: 4px solid #263238;
    font-weight: 700;
}

/* Parent categories that contain children */
.tr-gallery-category-parent-row {
    background: #eef8fc;
}

/* Accordion arrow */
.tr-gallery-subcategory-toggle {
    background: #eef8fc;
    color: #263238;
    border-left-color: #d5e7ef;
}

.tr-gallery-subcategory-toggle:hover,
.tr-gallery-subcategory-toggle:focus-visible {
    background: #5BCEFA;
    color: #263238;
}

/* Child categories */
.tr-gallery-test-categories .tr-gallery-subcategories {
    background: #f7fcfe;
}

.tr-gallery-test-categories .tr-gallery-subcategories li {
    border-top-color: #deedf3;
}

.tr-gallery-category-sub {
    color: #37474f;
}

/* Selected child category */
.tr-gallery-category-sub.is-active {
    background: #4A90E2;
    color: #ffffff;
}

/* Dash before child category */
.tr-gallery-category-child .tr-gallery-category-sub::before {
    color: #4A90E2;
}

.tr-gallery-category-child .tr-gallery-category-sub.is-active::before {
    color: #ffffff;
}

/* Team Rainbow Mobile Category Menu v1.3 */

.tr-gallery-mobile-toggle {
    display: none;
}

@media (max-width: 900px) {

    .tr-gallery-test {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .tr-gallery-test-categories > strong {
        display: none;
    }

    .tr-gallery-mobile-toggle {
        display: flex;
        width: 100%;
        min-height: 50px;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 12px 16px;
        border: 0;
        background: #263238;
        color: #ffffff;
        font: inherit;
        font-size: 15px;
        font-weight: 700;
        text-align: left;
        text-transform: uppercase;
        letter-spacing: 0.02em;
        cursor: pointer;
    }

    .tr-gallery-mobile-toggle-icon::before {
        content: "▾";
        display: block;
        font-size: 18px;
        transition: transform 0.15s ease;
    }

    .tr-gallery-mobile-toggle[aria-expanded="true"]
    .tr-gallery-mobile-toggle-icon::before {
        transform: rotate(180deg);
    }

    .tr-gallery-test-categories > .tr-gallery-category-list {
        display: none;
    }

    .tr-gallery-test-categories.is-mobile-open >
    .tr-gallery-category-list {
        display: block;
    }

    .tr-gallery-test-categories {
        width: 100%;
    }
}
