.main-flexbox {
    display: flex;
    flex-flow: column nowrap;
    justify-content: center;
    align-items: center;
}

.flex-gallery {
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
    align-items: center;
    padding: 1rem 0;

    & div {
        margin: 1vw;
        background-color: var(--theme-background-colour);
        overflow: hidden;
    }

    /* Gallery Images */
    & img {
        object-fit: cover;
        transition: transform .3s linear;
    }

    & .image {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(0, 0, 0, 0);

        &:hover img {
            transform: scale(1.1);
        }

        &:hover .gallery-text {
            opacity: 0;
            z-index: -1;
        }
    }

    /* Gallery Landscapes and Portraits */
    & .landscape img,
    & .landscape {
        width: var(--landscape-width);
        height: var(--landscape-height);
        min-width: var(--landscape-min-width);
        min-height: var(--landscape-min-height);
        max-width: var(--landscape-max-width);
        max-height: var(--landscape-max-height);
    }

    & .portrait img,
    & .portrait {
        width: var(--portrait-width);
        height: var(--portrait-height);
        min-width: var(--portrait-min-width);
        min-height: var(--portrait-min-height);
        max-width: var(--portrait-max-width);
        max-height: var(--portrait-max-height);
    }

    /* Sorting images on orientation */
    & .portrait {
        order: -1;
    }

    /* Gallery Textboxes */
    & .text-container {
        background: rgba(0, 0, 0, 0);
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: justify;
        height: fit-content;
        min-height: auto;
    }

    & .text {
        font-size: min(calc(.5rem + 1vw), 1.2rem);
        font-family: var(--theme-text-font);
        max-width: 90%;
        max-height: 90%;
        height: fit-content;
    }

    & .gallery-text {
        position: absolute;
        opacity: .80;
        background-color: var(--theme-transparant-background-colour);
        top: 0;
        font-size: min(calc(.5rem + 2vw), 1.6rem);
        padding: 1vw;
        margin: 1vw;
        text-align: center;
        transition: .2s linear;
        user-select: none;
        z-index: 1;
    }

    & .text-link {
        filter: grayscale(20%);
    }

    /* motion accessability concerns */
    @media (prefers-reduced-motion: reduce) {
        & .text {
            transition: none;
        }

        & img {
            transition: none;

            &:hover {
                transform: none;
            }
        }
    }
}