html {
    min-height: 100%;
    width: 100%;
    /* TODO tweak as wanted */
    font-family: "PT Serif", serif;
    font-weight: 400;
    font-style: normal;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0px;
}

header {
    width: 100%;
}

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.2rem 0.5rem 0.8rem;
}

nav img#title-img {
    margin-top: 0.5rem;
    height: 50px;
}

nav div#nav-title-div {
    display: flex;
    align-items: center;
}

nav div#nav-content-div {
    margin-left: auto;
    display: flex;
    align-items: center;
}

nav ul {
    display: flex;
    list-style: none;
    margin: 0px;
    padding: 0px;
    gap: 1rem;
}

nav a {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

nav a:hover,
nav a:focus {
    text-decoration: underline;
}

nav a.active {
    text-decoration: underline;
    color: cornflowerblue;
}

#admin-upload-form {
    display: flex;
    flex-direction: column;
}

#galleries-preview-div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: 1rem;
    justify-content: center;
    width: 100%;
    padding: 0 1rem;
    box-sizing: border-box;
}

#galleries-preview-div p {
    margin: 0;
}

#galleries-preview-div a {
    text-decoration: underline;
    text-decoration-color: cornflowerblue;
    color: inherit;
    cursor: pointer;
    transition: color 0.2s ease, text-decoration-color 0.2s ease, filter 0.3s ease;
}

#galleries-preview-div a:hover,
#galleries-preview-div a:focus {
    text-decoration-color: black;
    filter: brightness(1.15);
}

.gallery-preview-card {
    width: 100%;
}

.gallery-preview-card a {
    display: flex;
    flex-direction: column;
}

.gallery-preview-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

#gallery-preview-card-collection {
    margin-bottom: 1rem;
}

/* TODO: might need tweak */
#gallery-title-h3 {
    font-family: "PT Serif", serif;
    font-weight: 400;
    font-style: normal;
    text-align: center;
    margin: 1rem 1rem 0;
}

.gallery {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
    width: 100%;
}

.masonry-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 0 0 auto;
    max-width: 100%;
}

.gallery-artwork-card {
    width: auto;
    margin: 0 1rem;
}

.gallery-artwork-card img {
    display: block;
    width: 100%;
    max-width: var(--art-width, 100%);
    height: auto;
}

.gallery-artwork-card img:hover,
.gallery-artwork-card img:focus {
    filter: brightness(1.15);
    cursor: pointer;
}

/* Alignment randomization */
.gallery-artwork-card.align-left {
    text-align: left;
}

.gallery-artwork-card.align-left img {
    margin-right: auto;
}

.gallery-artwork-card.align-center {
    text-align: center;
}

.gallery-artwork-card.align-center img {
    margin-left: auto;
    margin-right: auto;
}

.gallery-artwork-card.align-right {
    text-align: right;
}

.gallery-artwork-card.align-right img {
    margin-left: auto;
}

#contact-div {
    padding: 1rem;
    text-align: center;
}

#contact-email-p {
    margin: 0;
}

#contact-email-p a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: cornflowerblue;
    cursor: pointer;
    transition: text-decoration-color 0.2s ease;
}

#contact-email-p a:hover,
#contact-email-p a:focus {
    text-decoration-color: black;
}

#contact-img {
    display: block;
    width: calc(100% - 2rem);
    /* 1rem each side */
    max-width: 100%;
    height: auto;
    margin: 2rem 1rem 1rem 1rem;
}

.lightbox {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    background: white;
    padding: 1rem;
    box-sizing: border-box;
    z-index: 1000;
}

.lightbox.open {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

#lightbox-artwork-collection-anchor {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: cornflowerblue;
    cursor: pointer;
    transition: text-decoration-color 0.2s ease;
}

#lightbox-artwork-name {
    font-size: larger;
    font-weight: 600;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 999px;
    width: 36px;
    height: 36px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.lightbox img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

@media (min-width: 992px) {
    body {
        flex-direction: row;
    }

    header {
        width: 260px;
        min-height: 100vh;
    }

    nav {
        width: 100%;
        height: 100%;
        display: grid;
        grid-template-rows: auto auto;
        grid-template-columns: max-content;
        justify-content: center;
        align-content: flex-start;
    }

    nav div#nav-content-div {
        margin-left: 0;
        padding: 0;
        width: 100%;
        display: flex;
        justify-content: flex-start;
        align-items: flex-start;
    }

    nav img#title-img {
        height: 70px;
    }

    nav div#nav-title-div {
        width: 100%;
        justify-content: flex-start;
        padding: 2rem 0;
    }

    nav ul {
        flex-direction: column;
        width: 100%;
        align-items: flex-start;
        gap: 1rem;
    }

    main {
        flex: 1;
    }

    .gallery {
        margin: 2rem 0;
    }

    .gallery-artwork-card {
        margin: 0;
    }

    #galleries-preview-div {
        justify-content: left;
        margin: 2rem 0;
    }

    #contact-div {
        margin-top: 4rem;
    }

    .lightbox {
        padding: 7rem;
        background: rgba(0, 0, 0, 0.65);
    }

    .lightbox img {
        border: 48px solid #fff;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    }

    #lightbox-caption {
        margin-top: -3.9rem;
    }

    #lightbox-caption.no-artwork-name {
        margin-top: -3rem;
    }
}