/* ======= general ======= */

main {
    display: grid;
    width: 100%;
    grid-template-columns: 200px 1200px 200px;
    grid-template-rows: 900px;
    column-gap: 50px;
    row-gap: 10px;
    justify-content: center;
    margin: 0 auto;
}

/* ======= photogallery ======= */

#photocontainer {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0 auto;
    grid-column: 2;
    grid-row: 1;
    height: 850px;
}

#photogrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    height: 800px;
    align-content: start;
}

.thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    cursor: pointer;
    border: 1px solid #000000;
    justify-self: center;
    align-self: center;
    /*box-shadow: 3px 3px #000;*/
}

.thumb:hover {
    outline: 1px dashed #ffffff;
}

#overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
    z-index: 999;
}

#overlay.visible {
    display: flex;
}

#overlay-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

/* ======= pages ======= */

#pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

#pagination button:disabled {
    opacity: 0.3;
}

#page-label {
    min-width: 50px;
    text-align: center;
}

@media (max-width: 768px) {
    main {
        display: flex;
        flex-direction: column;
        align-content: center;
        justify-content: center;
        gap: 15px;
    }

    main h2, main .simplecontainer {
        position: relative;
        left: 0;
        right: 0;
        bottom: 0;
        align-self: center;
        height: fit-content;
    }

    #photocontainer {
        width: 95%;
        height: fit-content;
        margin-bottom: 15px;
    }

    #photogrid {
        height: fit-content;
    }
}