* {
    box-sizing: border-box;
}

body {
    color: whitesmoke;
    background-color: black;
    border: 2px solid whitesmoke;
    padding: 20px;
    font-family: 'Amatic SC';
    font-size: 1.7rem;
}

a {
    text-decoration: none;
    color: white;
}


/*==============================================================
    ADMIN BUTTON
==============================================================*/

.admin-button {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 9999;

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

    width: 48px;
    height: 48px;

    border-radius: 50%;

    background: rgba(255, 255, 255, .9);

    box-shadow: 0 3px 12px rgba(0, 0, 0, .25);

    transition: .2s;
}

.admin-button.hidden {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.admin-button:hover {
    transform: scale(1.08);
}

.admin-button img {
    width: 34px;
    height: 34px;
    display: block;
}


/*==============================================================
    MODAL
==============================================================*/

#modal {
    position: fixed;
    inset: 0;

    background: rgba(0, 0, 0, .85);

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

    opacity: 0;
    pointer-events: none;

    transition: opacity .4s ease;

    z-index: 999;
}

#modal.active {
    opacity: 1;
    pointer-events: auto;
}

#modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 20px;
}

#modal-img {
    max-width: 90vw;
    max-height: 85vh;

    transform: scale(.9);
    opacity: 0;

    transition:
        transform .4s ease,
        opacity .4s ease;
}

#modal.active #modal-img {
    transform: scale(1);
    opacity: 1;
}

#modal-description {
    color: white;

    font-size: 2rem;
    text-align: center;

    max-width: 80vw;
}


/*==============================================================
    IMAGE EFFECTS
==============================================================*/

.zoom {
    transition: transform .5s ease;
}

.zoom:hover {
    transform: scale(1.08);
}

.fade-in {
    opacity: 0;
    transition: opacity .8s ease;
}

.fade-in.is-visable {
    opacity: 1;
}


/*==============================================================
    GALLERY
==============================================================*/

#images-root {
    width: 100%;
    padding: 20px;

    display: flex;
    flex-direction: column;
    align-items: center;
}

.gallery-category {
    width: 100%;

    display: flex;
    flex-direction: column;

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

    margin-bottom: 80px;
}

.gallery-category h1 {
    width: 100%;

    text-align: center;

    font-size: 3rem;

    margin: 20px 0;
}


/*==============================================================
    GALLERY FLEX
==============================================================*/

.gallery-grid {
    border: 1px solid white;

    width: 100%;

    display: flex;
    flex-flow: row wrap;

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

    column-gap: 30px;
    row-gap: 55px;
}

.gallery-grid picture {
    padding: 15px;

    flex: 0 1 410px;

    width: 100%;
    max-width: 410px;
    min-width: 0;

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

    overflow: hidden;
}

.gallery-grid picture:nth-child(even) {
    margin-top: 35px;
}

.categories-container {
    border: 2px solid whitesmoke;

    padding: 10px;

    display: block;

    width: 100%;
    max-width: 380px;

    height: auto;

    object-fit: contain;
}


/*==============================================================
    LANDING
==============================================================*/

#landing-container {
    border: 10px solid blue;
    padding: 15px;
    height: 93vh;
}

#logo {
    position: fixed;

    top: 50%;
    left: 50%;

    height: 35vh;

    transform-origin: center;
}

#title {
    width: 100%;
}


/*==============================================================
    OLD FLEX SUPPORT
==============================================================*/

.flex {
    display: flex;

    flex-flow: row wrap;

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

    gap: 20px;

    padding: 10px;

    width: 90%;
}


/*==============================================================
    TOOLBAR
==============================================================*/

#toolbar {
    position: fixed;

    left: 0;
    bottom: 0;

    width: 100%;

    display: flex;

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

    padding: 12px 0;

    z-index: 1000;

    pointer-events: none;
}

.categories {
    width: 19vw;
    height: 40px;

    text-align: center;

    background-color: black;
    color: white;
}


/*==============================================================
    MEDIA QUERIES
==============================================================*/

@media (min-width: 1400px) {

    .gallery-grid {
        column-gap: 40px;
        row-gap: 60px;
    }

}

@media (max-width: 1399px) {

    .gallery-grid {
        column-gap: 35px;
        row-gap: 55px;
    }

}

@media (max-width: 1199px) {

    .gallery-grid {
        column-gap: 30px;
        row-gap: 50px;
    }

}

@media (max-width: 1100px) {

    body {
        padding: 15px;
    }

    .gallery-grid {
        column-gap: 25px;
        row-gap: 45px;
    }

    .gallery-grid picture {
        flex-basis: 340px;
        max-width: 340px;
    }

    .categories-container {
        max-width: 310px;
    }

    .gallery-category h1 {
        font-size: 2.5rem;
    }

    #modal-content {
        width: 100%;
        max-height: 92vh;
        padding: 20px;
    }

    #modal-img {
        max-width: 90vw;
        max-height: 60vh;
    }

}

@media (max-width: 767px) {

    body {
        padding: 10px;
    }

    .gallery-grid {
        gap: 30px;
    }

    .gallery-grid picture {
        flex: 0 1 100%;

        width: 100%;
        max-width: 410px;
    }

    .gallery-grid picture:nth-child(even),
    .gallery-grid picture:nth-child(3n) {
        margin-top: 0;
    }

    .categories-container {
        width: 90%;
        max-width: 380px;
    }

    .gallery-category h1 {
        font-size: 2.2rem;
    }

    #modal-content {
        width: 100%;
        max-height: 92vh;
        padding: 20px;
    }

    #modal-img {
        max-width: 92vw;
        max-height: 55vh;
    }

    #modal-description {
        position: relative;

        width: 90%;
        max-height: 120px;

        overflow-y: auto;

        overscroll-behavior: contain;

        padding-right: 8px;
        padding-bottom: 28px;

        font-size: 1.5rem;
        line-height: 1.25;

        mask-image:
            linear-gradient(
                to bottom,
                black 0%,
                black 72%,
                transparent 100%
            );

        -webkit-mask-image:
            linear-gradient(
                to bottom,
                black 0%,
                black 72%,
                transparent 100%
            );

        scrollbar-width: none;
    }

    #modal-description::-webkit-scrollbar {
        display: none;
    }

}

@media (max-width: 575px) {

    body {
        padding: 8px;
    }

    #images-root {
        padding: 8px;
    }

    .gallery-grid {
        gap: 22px;
    }

    .gallery-grid picture {
        padding: 8px;

        flex: 0 1 100%;

        width: 100%;
        max-width: 410px;
    }

    .categories-container {
        width: 95%;
    }

    .gallery-category h1 {
        font-size: 2rem;
    }

    #modal-img {
        max-height: 45vh;
    }

    #modal-title {
        font-size: 2rem;
    }

    #modal-description {
        max-height: 100px;

        font-size: 1.25rem;
        line-height: 1.25;
    }

    #modal-details {
        font-size: 1rem;
    }

}
