/*
    You're free to edit this as you like to make your own theme!
    (You don't need to customize every aspect of this to make your own theme, this is just a dictionary of every class/id to provide as many possible options.)

    --- Lightbox ---

    #lb - container for entire lightbox (image viewer)
    #lb_wrapper - wrapper for all lightbox contents, including navigation
    #lb_container - container for all lightbox contents

    #lb_exitButton - the button used to exit the lightbox, usually the entire background
    #lb_smallExitButton - the button used to exit the lightbox on small screens, usually an 'x' in the corner of the lightbox

    #lb_imageWrapper - wrapper for image and loading graphic/text
    #lb_image - the image viewed in the lightbox
    .lb-noframe - class for images where the 'noframe' attribute is active

    #lb_info - container for all info on the image
    #lb_desc - lightbox image description
    #lb_title - lightbox image title
    #lb_tags - lightbox image tags

    .lb-nav - lightbox navigation button
    #lb_prev - lightbox previous navigation button
    #lb_next - lightbox next navigation button

    #lb_loading - lightbox image loading element


    --- Gallery Grid ---

    .g-grid - element containing a gallery grid
    .g-fixedGrid - element containing a fixed gallery grid
    .g-justifiedGrid - element containing a justified gallery grid
    .g-justifiedGridRow - element for a row in a justified gallery grid

    .g-gridCell - a cell in the gallery grid
    .g-gridCellImage - the image in a grid cell
    .g-gridCellButton - the button in the grid cell that opens the lightbox (takes up the entire cell)
    .g-gridCellEffect - a helper element in the grid cell used for effects (ex. hover effects)
    .g-gridCellCaption - image caption in grid cell (only visible when 'captions' are enabled)
    .g-gridCellLoading - loading element in grid cell (does not appear for justified grids)

    .g-loading - text that appears while a grid is loading (justified grids only)
    .g-noframe - class for grid cells where the 'noframe' attribute is active
    .g-disabled - class for when accessing the lightbox is disabled in the grid
    .g-smallScreen - class for elements that are only visible on small screens
    .g-smallScreenHide - class for elements that are not visible on small screens
    .g-smallFillWidth - class that tells grid cell to fill the width of the screen on small screens when enabled

    .g-pageNav - container for page navigation
    .g-pageNavButton - navigation button for pages
    .g-pageNavNum - current page and total page count text
    .g-pageNavPrev - previous navigation button for pages
    .g-pageNavNext - next navigation button for pages

    .g-sifterWrapper - container for both filters and sorts
    .g-sifter - container for either filters/sorts
    .g-sifterName - name of sifter (either 'Filters' or 'Sort)

    .g-inputs - inputs for sifter
    .g-inputWrapper - wrapper for sifter input

    .g-filters - container for filter related elements
    .g-filterInput - input for filter (checkbox input)
    .g-filterInputOther - input for filter option for untagged images

    .g-sort - container for sort related elements
    .g-sortInput - input for sort (radio input)
    .g-sortInputAscending - ascending sort input
    .g-sortInputDescending - descending sort input
    .g-sortAlphabetical - class for when alphabetical sort is selected

*/

:root {
    --nav-width: 40px;
    --link-color: rgb(0, 238, 255);
    --link-hover-color: white;
}
:root:has(.lb-open) {
    overflow: hidden;
}
body {
    overflow-anchor: none;
}

@keyframes loading {
	0% {
		content: ".";
	}
    33% {
        content: "..";
    }
	66% {
		content: "...";
	}
    100% {
		content: ".";
	}
}

/* Lightbox */
#lb {
    display: none;
    position: fixed;
    overflow: hidden;

    top: 0;
    left: 0;
    z-index: 9999;

    width: 100%;
    height: 100%;

    background: linear-gradient(
        180deg,
        rgba(0, 167, 189, 0.3) 0%,
        rgba(12, 105, 51, 0.3) 100%
    );
    backdrop-filter: blur(5px);

    font-size: 1rem;
    font-family: "Segoe UI Semilight",Tahoma,sans-serif;
}
#lb a {
    color: var(--link-color);
}
#lb a:hover {
    color: var(--link-hover-color);
}
#lb_wrapper {
    position: fixed;
    display: flex;
    overflow: hidden;

    width: 100%;
    height: 100dvh;
}
#lb_container {
    display: flex;
    flex-grow: 1;
    flex-direction: column;
    justify-content: center;
    gap: 10px;

    margin: auto;
    padding: 20px;
    height: calc(100dvh - 40px);
}

/* Lightbox exit buttons */
#lb_exitButton {
    position: absolute;
    top: 0%;
    left: 0%;
    z-index: 0;

    cursor: auto !important;

    border-style: none;
    border-radius: 0%;
    background-color: transparent;

    padding: 0;
    height: 100dvh;
    width: 100%;
}
#lb_smallExitButton {
    display: none;
    position: absolute;
    top: 0%;
    right: 0%;
    z-index: 1000;

    height: 50px;
    width: 50px;

    color: rgb(85, 168, 85);

    font-size: 20px;
    background: linear-gradient(
        180deg,
        rgba(0, 52, 73, 0.767) 0%,
        rgba(1, 32, 30, 0.7) 100%
    );
    margin: 5px;
    border: 1px solid rgb(48, 130, 143);
    border-radius: 10px;
}
#lb_smallExitButton:before {
    content: "X";
}

/* Lightbox image */
#lb_imageWrapper {
    position: relative;
    width: fit-content;
    height: fit-content;
    margin: 0 auto;
    display: flex;
}
#lb_image {
    --border-width: 1px;
    --padding: 5px;

    position: relative;
    z-index: 1;

    object-fit: contain;
    image-rendering: auto;

    max-width: calc(100% - (var(--border-width) * 2 + var(--padding) * 2));
    max-height: calc(100% - (var(--border-width) * 2 + var(--padding) * 2));
    margin: auto;
    padding: var(--padding);

    box-sizing: content-box;
    border: var(--border-width) solid rgb(48, 130, 143);

    background: linear-gradient(
        180deg,
        rgba(0, 52, 73, 0.767) 0%,
        rgba(1, 32, 30, 0.7) 100%
    );
    box-shadow: inset 0px 0px 5px rgba(65, 74, 75, 0.8);
}
#lb_image.lb-noframe {
    border-color: transparent;
}

/* Lightbox info box */
#lb_info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 1;

    color: rgb(179, 226, 203);
    background: linear-gradient(
        180deg,
        rgba(1, 53, 73, 0.7) 0%,
        rgba(27, 75, 72, 0.7) 80%,
        rgba(20, 100, 95, 0.7) 100%
    );
    margin: 0 auto;
    padding: 1em 1em;

    box-sizing: border-box;

    border: 1px ridge rgb(37, 207, 170);
    border-radius: 10px;
    box-shadow: inset 0px -5px 10px rgb(3, 96, 112);
}
#lb_desc {
    padding: 0;
    margin: 0;
    line-height: 1.3rem;
    color: rgb(199, 221, 142);
}
#lb_desc code {
    font-size: 0.9em;
    font-family: monospace;
    padding: 0px 2px;
    background-color: rgb(10, 96, 122);
    color: #15fff3;
}
#lb_title {
    font-weight: bold;
    margin: 0;
    padding: 0;
    color: rgb(229, 243, 193);
}
#lb_tags {
    display: flex;
    gap: 5px;
    font-family: monospace;
    margin-bottom: 5px;
}
#lb_tags span {
    font-size: 0.85em;
    padding: 2px 5px;
    border-width: 1px;
    border-style: solid;
    color: rgb(147, 230, 224);
    border-color: rgb(81, 169, 180);
    background: linear-gradient(
        180deg,
        rgb(5, 112, 85) 0%,
        rgb(9, 61, 104) 100%
    );
    font-family: "Segoe UI Semilight",Tahoma,sans-serif;
}

@media screen and (max-width: 600px) {
    #lb_container {
        padding: 0;
        margin: 0;
        height: calc(100dvh);
    }
    #lb_image {
        margin: 0 auto;
        padding: 0px;
    }
    #lb_smallExitButton {
        display: block;
    }
}

/* Lightbox navigation */
.lb-nav {
    display: none;
    z-index: 1;
    cursor: pointer;

    color: rgb(127, 211, 194);
    background: linear-gradient(
        180deg,
        rgba(1, 53, 73, 0.7) 0%,
        rgba(27, 75, 72, 0.7) 80%,
        rgba(20, 100, 95, 0.7) 100%
    );
    backdrop-filter: brightness(60%);
    border: 1px solid rgb(0, 113, 121);
    border-radius: 10px;
    box-shadow: inset 0px 0px 5px rgba(100, 128, 131, 0.8);

    min-width: var(--nav-width);
    max-width: var(--nav-width);
    max-height: calc(100% - 10px);

    margin: auto 10px;
    height: 200px;

    font-family: monospace;
    font-size: 20px;
}
.lb-nav:hover, .lb-nav.lb-pressed {
    backdrop-filter: brightness(50%);
    transition: 0.1s;
    color: rgb(0, 255, 191);
    border-color: rgb(0, 155, 142);
    background: linear-gradient(
        180deg,
        rgba(0, 95, 133, 0.7) 0%,
        rgba(48, 134, 129, 0.7) 80%,
        rgba(32, 163, 154, 0.7) 100%
    );
}
.lb-nav:disabled {
    backdrop-filter: brightness(60%);
    color: rgb(122, 122, 122);
    border-color: rgb(100, 100, 100);
    background: linear-gradient(
        180deg,
        rgba(63, 63, 63, 0.6) 0%,
        rgba(61, 61, 61, 0.6) 80%,
        rgba(59, 59, 59, 0.6) 100%
    );
    box-shadow: inset 0px 0px 5px rgba(61, 61, 61, 0.8);
}
#lb_next::before {
    content: "▶";
}
#lb_prev::before {
    content: "◀";
}
@media screen and (max-width: 600px) {
    .lb-nav {
        position: absolute;
        border: none;
        backdrop-filter: none;

        height: 100%;
        margin: 0;
        border-radius: 0px !important;
        max-height: unset;
        box-shadow: none;
    }
    #lb_next {
        top: 0%;
        right: 0%;
        background: linear-gradient(
            90deg,
            rgba(0, 0, 0, 0) 0%,
            rgba(40, 255, 244, 0.3) 100%
        );
    }
    #lb_prev {
        top: 0%;
        left: 0%;
        background: linear-gradient(
            270deg,
            rgba(0, 0, 0, 0) 0%,
            rgba(40, 255, 244, 0.3) 100%
        );
    }
}

/* Lightbox loading */
#lb_loading {
    position: absolute;
    top: 0%;
    left: 0%;
    z-index: 0;

    opacity: 0;

    display: flex;
    justify-content: center;
    align-items: center;

    background: rgba(0, 0, 0, 0.5);
    width: 100%;
    height: 100%;

    border: 1px solid #2cac88;
    border-radius: 10px;

    box-sizing: border-box;
}
#lb_loading:before {
    content: "...";
    animation: loading 1s linear infinite;
}

/* Gallery grid */
.g-grid:empty {
    border: 1px dashed gray;
    height: 50px;
    font-family: "Segoe UI Semilight",Tahoma,sans-serif;
    border: 1px solid rgb(0, 136, 118);
    color: rgb(123, 255, 237);
}
.g-grid:empty:before {
    content: "Nothing here!";
    margin: auto;
    padding: 5px;
}
.g-grid a {
    color: var(--link-color);
}
.g-grid a:hover {
    color: var(--link-hover-color);
}
.g-loading {
    text-align: center;
}
.g-loading:after {
    content: "...";
    animation: loading 1s linear infinite;
}

/* Gallery grid cell */
.g-gridCell {
    position: relative;
    margin: 8px;
    transition: all 0.5s !important;
    display: flex;
}
.g-gridCellImage {
    order: 1;
    border-radius: 20px;
    border: 1px solid rgb(0, 255, 136);
}
.g-gridCellButton {
    order: 2;
    position: absolute;
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;
}
.g-gridCellButton:hover {
    cursor: pointer;
}
.g-gridCellEffect {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0%;
    left: 0%;
    order: 3;
    border-radius: 15px;
    box-shadow: inset 0px 0px 20px rgb(7, 255, 243);
}
.g-gridCellEffect, .g-image {
    transition: 0.5s ease !important;
}
.g-gridCell:hover {
    transform: translateY(-5px);
    transition: all 0s !important;
}
.g-gridCell:hover .g-gridCellEffect {
    transition: 0s ease !important;
    box-shadow: inset 0px 0px 20px rgb(7, 255, 243), inset 0px -5px 25px rgb(218, 255, 7);
}
.g-disabled img {
    opacity: 1 !important;
}
.g-disabled button {
    display: none;
}
.g-gridCellCaption {
    display: block;
    position: absolute;
    bottom: 0%;
    right: 0%;

    margin: 5px 5px;
    padding: 5px 8px;

    font-size: 0.9rem;
    font-family: "Segoe UI Semilight",Tahoma,sans-serif;

    border-radius: 10px;
    border: 1px solid rgb(70, 161, 85);
    background: linear-gradient(
        180deg,
        rgba(0, 52, 73, 0.9) 0%,
        rgba(1, 32, 30, 0.9) 100%
    );

    overflow: hidden;
    text-overflow: ellipsis;

    max-height: 100%;
    max-width: 100%;
}
.g-noframe .g-gridCellCaption {
    margin: 0;
}
.g-gridCellCaption a {
    display: inline-block;
    position: relative;
    z-index: 1;
}
.g-gridCellCaption code {
    font-size: 0.9em;
    background-color: rgb(10, 96, 122);
    color: #15fff3;
}
.g-gridCellCaption.g-smallScreen {
    display: none;
}

.g-gridCellLoading {
    position: absolute;
    top: 0%;
    left: 0%;
    z-index: -1;

    display: flex;
    justify-content: center;
    align-items: center;

    border: 1px solid gray;
    box-sizing: border-box;

    width: 100%;
    height: 100%;
}
.g-gridCellLoading:before {
    content: "...";
    animation: loading 1s linear infinite;
}

.g-gridCell.g-noframe .g-gridCellImage, .g-gridCell .g-gridCellEffect {
    border-color: transparent;
    box-shadow: none;
    border-radius: 20px;
}

@media screen and (max-width: 600px) {
    .g-gridCellCaption.g-smallScreen {
        display: block;
    }
    .g-fixedGrid .g-gridCell.g-smallFillWidth {
        width: 100% !important;
        height: unset !important;
    }
    .g-justifiedGridRow.g-smallFillWidth {
        flex-direction: column;
        max-height: unset !important;
        max-width: unset !important;
        height: unset !important;
    }
    .g-justifiedGridRow.g-smallFillWidth .g-gridCellImage {
        width: 100%;
    }
    .g-justifiedGridRow.g-smallFillWidth .g-gridCell {
        box-sizing: border-box;
        width: calc(100% - 16px);
    }
}

/* Gallery justified grid */
.g-justifiedGrid {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: safe center;
}
.g-justifiedGridRow {
    display: flex;
}
.g-justifiedGrid .g-gridCell {
    position: relative;
    max-height: 100%;
}
.g-justifiedGrid .g-gridCellButton {
    background: transparent;
    border-style: none;
    z-index: 1;
    top: 0%;
    left: 0%;
}
.g-justifiedGrid .g-gridCellImage {
    max-height: 100%;
}
.g-justifiedGrid .g-gridCellLoading {
    display: none;
}
.g-justifiedGrid.g-gridLoading:before {
    content: "Loading...";
}

/* Gallery fixed grid */
.g-fixedGrid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0em;
}
.g-fixedGrid .g-gridCell {
    display: inline;
}
.g-fixedGrid .g-gridCellImage {
    background: transparent;
    padding: 0px;
    margin: 0px;
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: auto;
    vertical-align: middle;
}
.g-fixedGrid .g-gridCellButton {
    display: inline;
    background: transparent;
    box-sizing: content-box;
    border-style: none;
    border-width: 0px;
}

/* Gallery pagination */
.g-pageNav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin: 10px;
    font-family: "Segoe UI Semilight",Tahoma,sans-serif;
    color: rgb(0, 230, 218);
}
.g-pageNavButton {
    margin: 0;
    cursor: pointer;
    border-radius: 100%;
    border: 1px solid green;
    color: rgb(0, 230, 218);
    background: linear-gradient(
        180deg,
        rgba(0, 156, 177, 0.767) 0%,
        rgba(0, 44, 41, 0.7) 100%
    );
}
.g-pageNavButton:disabled {
    color: rgb(151, 151, 151);
    border-color: gray;
    background: linear-gradient(
        180deg,
        rgba(167, 167, 167, 0.767) 0%,
        rgba(36, 36, 36, 0.7) 100%
    );
}
.g-pageNavButton:hover:not(:disabled) {
    background: linear-gradient(
        180deg,
        rgba(0, 156, 177, 0.9) 0%,
        rgba(0, 44, 41, 0.9) 100%
    );
}
.g-pageNavPrev:before {
    content: "<";
}
.g-pageNavNext:before {
    content: ">";
}

@media screen and (max-width: 600px) {
    .g-smallScreenHide {
        display: none;
    }
}

/* Gallery sifter */
.g-sifterWrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 10px;
    font-family: monospace;
    font-size: 1.1em;
}
.g-sifter {
    display: flex;
    align-items: center;
    font-family: "Segoe UI Semilight",Tahoma,sans-serif;
    font-size: 0.9em;
    color: cyan;
    accent-color: rgb(33, 216, 161);
}
.g-sifter span:not(.g-sifterName) {
    margin: 0px 5px;
}
.g-sifterName {
    display: inline-block;
    text-transform: uppercase;
    margin-right: 5px;
    color: rgb(0, 202, 209);
}
.g-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

/* Filters */
.g-filterInputOther:before {
    content: "N/A"
}

/* Sorts */
.g-sort span:not(.g-sifterName) {
    text-transform: capitalize;
}
.g-sortInputAscending:before {
    content: "ascending";
}
.g-sortInputDescending:before {
    content: "descending";
}
.g-sortAlphabetical .g-sortInputAscending:before {
    content: "A-Z";
}
.g-sortAlphabetical .g-sortInputDescending:before {
    content: "Z-A";
}
