/* 
    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(240, 255, 156);
    --link-hover-color: white;
    --border-image: url('/assets/pink-border.png');
    --border-width: 18px;
}
: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: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);

    font-family: monospace;
    font-size: 1rem;
    background: linear-gradient(
        180deg,
        rgba(255, 157, 76, 0.3) 0%,
        rgba(255, 164, 220, 0.3) 100%
    );
}
#lb a {
    color: var(--link-color);
}
#lb a:hover {
    color: var(--link-hover-color);
    
}
#lb_wrapper {
    position: fixed;
    display: flex;
    overflow: hidden;

    width: calc(100% - 10px);
    height: 100dvh;
    padding: 0px 5px;
}
#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;

    font-size: 20px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: linear-gradient(
        180deg,
        rgba(255, 185, 128, 0.5) 0%,
        rgba(255, 164, 220, 0.5) 100%
    );
    color: rgb(255, 255, 255);
    border-radius: 100%;
    margin: 5px;
}
#lb_smallExitButton:before {
    content: "X";
}

/* Lightbox image */
#lb_imageWrapper {
    position: relative;
    width: fit-content;
    height: fit-content;
    margin: 0 auto;
    display: flex;
}
#lb_image {
    position: relative;
    z-index: 1;

    object-fit: contain;
    image-rendering: auto;

    max-width: calc(100% - (var(--border-width) * 2));
    max-height: calc(100% - (var(--border-width) * 2));
    margin: auto;
    
    box-sizing: content-box;
    border: var(--border-width) solid transparent;
    border-image: var(--border-image) 18 round;

    aspect-ratio: unset !important;
}
#lb_image.lb-noframe {
    border: 0px solid transparent;
    border-image: unset;
}

/* Lightbox info box */
#lb_info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 1;

    color: white;
        background: linear-gradient(
        180deg,
        rgba(255, 185, 128, 0.8) 0%,
        rgba(255, 164, 220, 0.8) 100%
    );
    margin: 8px auto;
    padding: 0px 16px;

    border: 1px dashed white;
    box-sizing: border-box;
    font-family: Georgia, 'Times New Roman', Times, serif;
}
#lb_info:before {
    content: "❁✿❀❁✿❀";
    transform: translateY(-12px);
    text-align: center;
    height: 10px;
    letter-spacing: 10%;
}
#lb_info:after {
    content: "❁✿❀❁✿❀";
    transform: translateY(-2px);
    text-align: center;
    height: 10px;
    letter-spacing: 4px;
}
#lb_desc {
    padding: 0;
    margin: 0;
    line-height: 1.3rem;
    color: white;
    letter-spacing: 1px;
}
#lb_title {
    font-weight: bold;
    margin: 0;
    padding: 0;
    letter-spacing: 1px;
}
#lb_tags {
    display: flex;
    gap: 5px;
    font-family: monospace;
    margin-bottom: 5px;
}
#lb_tags span {
    font-size: 0.85em;
    border-width: 1px;
    border-style: solid;
    font-family: serif;
    letter-spacing: 1px;
    text-transform: lowercase;
    color: rgb(255, 253, 223);
    border-color: rgba(255, 251, 193, 0.4);
    background: rgba(245, 174, 187, 0.8);
    border-radius: 6px;
    padding: 2px 8px;
}
#lb_desc code {
    font-size: 0.9em;
    font-family: monospace;
    background-color: rgba(198, 56, 169, 0.43);
    color: #ffff15;
    padding: 0px 2px;
}

@media screen and (max-width: 600px) {
    #lb_container {
        padding: 0;
        margin: 0;
        height: calc(100dvh);
    }
    #lb_image {
        margin: 0 auto;
    }
    #lb_smallExitButton {
        display: block;
    }
}

/* Lightbox navigation */
.lb-nav {
    display: none;
    z-index: 1;
    cursor: pointer;

    color: rgb(255, 228, 154);
    background: linear-gradient(
        180deg,
        rgba(255, 185, 128, 0.5) 0%,
        rgba(255, 164, 220, 0.5) 100%
    );
    backdrop-filter: brightness(60%);
    border: 1px dashed rgba(255, 255, 255, 0.5);

    min-width: var(--nav-width);
    max-width: var(--nav-width);
    margin: auto 5px;
    height: 300px;
    max-height: calc(100% - 10px);
    
    font-size: 2em;
    writing-mode: vertical-rl;
    text-orientation: upright;
}
.lb-nav:hover, .lb-nav.lb-pressed {
    backdrop-filter: brightness(50%);
    transition: 0.1s;
    color: white;
    background: linear-gradient(
        180deg,
        rgba(255, 185, 128, 0.7) 0%,
        rgba(255, 164, 220, 0.7) 100%
    );
    border-style: solid;
}
.lb-nav:disabled {
    backdrop-filter: brightness(60%);
    background: rgba(0, 0, 0, 0.486);
    color: rgba(255, 192, 203, 0.6);
    border-color: rgba(255, 192, 203, 0.6);
    border-style: solid;
}
#lb_prev {
    border-top-left-radius: 15px;
    border-bottom-left-radius: 15px;
}
#lb_next {
    border-top-right-radius: 15px;
    border-bottom-right-radius: 15px;
}
#lb_prev:before {
    content: '✽⊰✽';
}
#lb_next: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;
        color: pink;
    }
    #lb_next {
        top: 0%;
        right: 0%;
        background: linear-gradient(
            90deg,
            rgba(0, 0, 0, 0) 0%,
            rgba(255, 202, 228, 0.5) 100%
        );
    }
    #lb_prev {
        top: 0%;
        left: 0%;
        background: linear-gradient(
            270deg,
            rgba(0, 0, 0, 0) 0%,
            rgba(255, 202, 228, 0.5) 100%
        );
    }
}

/* Lightbox loading */
#lb_loading {
    position: absolute;
    top: 0%;
    left: 0%;
    z-index: 0;

    opacity: 0;

    display: flex;
    justify-content: center;
    align-items: center;

    width: 100%;
    height: 100%;

    border: var(--border-width) solid transparent;
    border-image: var(--border-image) 18 round;

    box-sizing: border-box;
}
#lb_loading:after {
    content: "";
    background: rgba(255, 101, 155, 0.5);
    width: 100%;
    height: 100%;
}
#lb_loading:before {
    position: absolute;
    content: "...";
    animation: loading 1s linear infinite;
}

/* Gallery grid */
.g-grid:empty {
    height: 50px;
    font-family: Georgia, 'Times New Roman', Times, serif;
    border: 1px solid pink;
    color: rgb(255, 231, 235);
}
.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: 5px;
    border: var(--border-width) solid transparent;
    border-image: var(--border-image) 18 round;
    image-rendering: pixelated;
    box-sizing: border-box;
    transition: transform 0.5s, filter 0.5s !important;
    filter: drop-shadow(5px 5px 0px rgba(109, 15, 96, 0.5));
    display: flex;
}
.g-gridCell > * {
    image-rendering: auto;
}
.g-gridCell:hover {
    transform: rotateZ(3deg);
    transition: transform 0s !important;
    filter: drop-shadow(0px 0px 10px rgb(255, 175, 244)) drop-shadow(5px 5px 0px rgba(109, 15, 96, 0.5));
}
.g-gridCell:hover .g-gridCellImage {
    filter: sepia(100%) saturate(312%) hue-rotate(287deg) brightness(100%) contrast(100%);
}
.g-gridCell.g-noframe {
    border: none;
}
.g-gridCellImage {
    order: 1;
}
.g-gridCellButton {
    order: 2;
    position: absolute;
    padding: 0;
    margin: 0;
    z-index: 1;
    width: calc(100% + (var(--border-width) * 2));
    height: calc(100% + (var(--border-width) * 2));
    transform: translate(- var(--border-width), - var(--border-width));
}
.g-gridCellButton:hover {
    cursor: pointer;
}
.g-gridCellEffect {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0%;
    left: 0%;
    mix-blend-mode: multiply;
    order: 3;
    display: none;
}
.g-gridCellEffect, .g-image {
    transition: 0.5s ease !important;
}
.g-gridCell:hover .g-gridCellEffect {
    transition: 0s ease !important;
    box-shadow: inset 10px 10px 40px rgb(46, 46, 46);
}
.g-disabled img {
    opacity: 1 !important;
}
.g-disabled button {
    display: none;
}
.g-gridCellCaption {
    display: block;
    position: absolute;
    bottom: 0%;
    right: 0%;
    z-index: 1;

    margin: 2px;
    padding: 5px 10px;
    background: linear-gradient(
        180deg,
        rgba(255, 179, 116, 0.8) 0%,
        rgba(255, 175, 224, 0.8) 100%
    );
    color: white;

    font-family: Georgia, 'Times New Roman', Times, serif;
    font-size: 0.8em;
    letter-spacing: 0.5px;
    text-shadow: 0px 0px 1px rgb(255, 245, 188);

    border-radius: 10px;

    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;
    color: var(--link-color);
    z-index: 1;
}
.g-gridCellCaption a:hover {
    color: var(--link-hover-color);
    z-index: 1;
}
.g-gridCellCaption code {
    background-color: rgba(198, 56, 169, 0.43);
    color: #ffff15;
}
.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;
}

@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% - 10px);
    }
}

/* 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%;
    box-sizing: content-box;
}
.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;
    border: 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: monospace;
    color: rgb(242, 255, 172);
}
.g-pageNavButton {
    margin: 0;
    cursor: pointer;
    background: linear-gradient(
        180deg,
        rgb(255, 202, 161) 0%,
        rgb(255, 177, 226) 100%
    );
    border-radius: 40%;
    padding: 2px 5px;
    border-style: none;
    color: rgb(255, 255, 255);;
    box-shadow: 2px 2px 0px rgba(109, 15, 96, 0.5);
}
.g-pageNavButton:disabled {
    background: rgba(128, 128, 128, 0.5);
    color: rgba(255, 255, 255, 0.5);
}
.g-pageNavButton:hover:not(:disabled) {
    color: rgb(255, 154, 201);
    background: linear-gradient(
        180deg,
        rgb(255, 238, 225) 0%,
        rgb(255, 228, 245) 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: Georgia, 'Times New Roman', Times, serif;
    font-size: 0.8em;
    letter-spacing: 1px;
    
    color: rgb(255, 192, 239);
    accent-color: rgb(255, 192, 239);;
}
.g-sifter span:not(.g-sifterName) {
    margin: 0px 5px;
}
.g-sifterName {
    display: inline-block;
    text-transform: uppercase;
    color: rgb(236, 197, 111);
    margin-right: 5px;
}
.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";
}