.masonry {
    column-count: 3;
    column-gap: 1rem;
}

.masonry img {
    width: 100%;
    display: block;
    margin-bottom: 1rem;
    cursor: pointer;
    break-inside: avoid;

}

.gallery-modal .modal-header {
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-around;
}

.gallery-modal .modal-header .modal-title {
    flex: 1;
}

.gallery-modal button.close {
    padding: 0;
    cursor: pointer;
    background: 0 0;
    border: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 21px;
    font-weight: 700;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;

    font-size: 21px;
    font-weight: 700;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    filter: alpha(opacity=20);
    opacity: .2;
}

.gallery-modal button.close:focus,
.gallery-modal button.close:hover {
    color: #000;
    text-decoration: none;
    cursor: pointer;
    filter: alpha(opacity=50);
    opacity: .5;
}

/* Modal sizing */
.gallery-modal .modal-dialog {
    width: 75vw;
    max-width: 75vw;
    margin: 5vh auto;
}

.gallery-modal .modal-body {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Image scaling */
.gallery-modal .modal-img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;

    opacity: 1;
    transition: opacity 0.25s ease-in-out;
}
.gallery-modal .modal-img.fading {
  opacity: 0;
}

/* Arrow buttons */
.gallery-modal .arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.85);
    border: none;
    font-size: 2rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-radius: 4px;
    z-index: 10;
}

.gallery-modal .arrow.prev {
    left: 1rem;
}

.gallery-modal .arrow.next {
    right: 1rem;
}