main {
    display: flex;
    flex-direction: column;
    align-items: center;
}

article {
    width: 70vw;
    min-height: 65vh;
    display: flex;
    gap: 6%;
    align-items: start;
    margin: 2em;
}

#photo-gallery {
    display: flex;
    align-items: start;
    flex-wrap: wrap;
    gap: 1em;
    width: 60%;
}

#photo-gallery>div {
    flex: 0 0 100%;
    aspect-ratio: 3/2;
}

#photo-gallery>div[portrait] {
    flex: 0 0 calc(50% - 0.5em);
    aspect-ratio: 2/3;
}

#photo-gallery>div:only-child {
    flex: 0 0 100%;
}

#photo-gallery img {
    display: block;
    object-fit: cover;
    height: 100%;
    width: 100%;
    transition: filter 0.15s;
}

#photo-gallery img:hover {
    filter: brightness(0.85);
    cursor: zoom-in;
}

aside {
    font-size: 1.3em;
    position: sticky;
    top: 3em;
    width: 40%;
    align-self: flex-start;
}

aside p {
    white-space: pre-wrap;
}

dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.7);
    border: none;
    z-index: 1000;
}

dialog img {
    max-width: 80vw;
    max-height: 80vh;
    z-index: 1000;
}

dialog span {
    font-size: 2em;
    position: absolute;
    color: white;
}

@media (max-width: 1020px) {
    article {
        flex-direction: column;
        gap: 1em;
        margin: 1em;
        margin-top: 1.4em;
        width: 90vw;
    }

    #photo-gallery,
    aside {
        width: 100%;
    }

    #photo-gallery {
        display: flex;
        gap: 0.5em;
        flex-direction: row;
        flex-wrap: nowrap;
        height: calc(60vw);
        max-height: 40vh;
        overflow-x: scroll;

        /* Firefox */
        scrollbar-width: none;
    }

    #photo-gallery>div {
        flex: 0 0 0 !important;
        height: 100%;
    }

    #photo-gallery img {
        height: 100%;
        width: auto;
        transition: filter 0.15s;
    }

    #photo-gallery::-webkit-scrollbar {
        display: none;
        /* Safari and Chrome */
    }
}
