body {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.visual-gallery {
    display: flex;
    justify-self: center;
    justify-content: center;
    margin: 40px 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    justify-items: center;
    align-items: start;
    gap: min(70px, 3vw);
    width: 70%;
    margin: 0;
    margin-bottom: 20px;
}

.gallery-item {
    display: inline-block;
    width: 90%;
    height: auto;
    margin: 0;
    text-align: left;
    padding: 15px;    
    border-radius: 10px;
    box-shadow: 0 0px 8px rgba(0, 0, 0, 0.1);
}

.gallery-image-container {
    overflow: hidden;
    width: 100%;
    height: auto;
    margin-bottom: 20px;
    cursor: zoom-in;
}

.gallery-image-container:focus-visible {
    outline: 3px solid rgb(100, 100, 100);
    outline-offset: 3px;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    overflow: hidden;
    margin: 0;
    transition: all 0.3s ease;
}

.image-title {
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1;
    margin-bottom: 8px;
}

.visualarts-pagination {
    font-family: Gabarito, Arial, Helvetica, sans-serif;
    font-size: 20px;
    font-weight: 500;
    bottom: 100px;
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    gap: 50px;
    margin-top: 50px;
}

.visualarts-page a{
    background-color: none;
    color: rgb(184, 184, 184);
    position: relative;
    margin: 0;
    bottom: 30px;
    border: none;
    padding: 10px;
    transition: all 0.5s ease;
}

.visualarts-page a:hover {
    bottom: 35px;
    font-weight: 700;
    color: rgb(81, 81, 81);
    background: none;
    transition: all 0.5s ease;
}

.visualarts-page a.active {
    color: black;
    bottom: 30px;
    border: none;
}
.visualarts-page a.active:hover {
    bottom: 35px;
    font-weight: 700;
    color: rgb(63, 63, 63);
    transition: all 0.5s ease;
}


/* ---------- LIGHTBOX ---------- */

body.lightbox-open {
    overflow: hidden; /* stop the page scrolling behind the lightbox */
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 90px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.94);
    font-family: Gabarito, Arial, Helvetica, sans-serif;
    color: #fff;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.lightbox.open {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0s;
}

.lightbox-content {
    margin: 0;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.lightbox-image {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 170px);
    max-height: calc(100dvh - 170px);
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.lightbox-image.loaded {
    opacity: 1;
}

.lightbox-caption {
    margin-top: 18px;
    line-height: 1.35;
    color: rgb(215, 215, 215);
}

.lightbox-caption .image-title {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 6px;
}

.lightbox-counter {
    margin-top: 10px;
    font-size: 0.9rem;
    color: rgb(130, 130, 130);
}

.lightbox-close,
.lightbox-arrow {
    position: absolute;
    background: none;
    border: none;
    color: rgb(190, 190, 190);
    cursor: pointer;
    font-family: inherit;
    line-height: 1;
    padding: 12px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.lightbox-close:hover,
.lightbox-arrow:hover {
    color: #fff;
}

.lightbox-close:focus-visible,
.lightbox-arrow:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.lightbox-close {
    top: 16px;
    right: 24px;
    font-size: 3rem;
}

.lightbox-arrow {
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.6rem;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover {
    transform: translateY(-50%) translateX(-3px);
}

.lightbox-next:hover {
    transform: translateY(-50%) translateX(3px);
}

@media (prefers-reduced-motion: reduce) {
    .lightbox,
    .lightbox-image,
    .lightbox-close,
    .lightbox-arrow {
        transition: none;
    }
}

/* Phones: arrows move to the bottom so the image can use the full width */
@media ( max-width : 600px ) {
    .lightbox {
        padding: 0 12px;
    }

    .lightbox-image {
        max-height: calc(100vh - 230px);
        max-height: calc(100dvh - 230px);
    }

    .lightbox-close {
        top: 8px;
        right: 12px;
    }

    .lightbox-arrow {
        top: auto;
        bottom: 24px;
        transform: none;
    }

    .lightbox-prev {
        left: 24px;
    }

    .lightbox-next {
        right: 24px;
    }

    .lightbox-prev:hover,
    .lightbox-next:hover {
        transform: none;
    }
}


@media ( max-width : 450px ) {
    .visual-gallery {
        justify-self: center;
        width: 400px;
    }

    .gallery-grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 50px;
    }
    .gallery-item {
        justify-self: center;
        justify-content: center;
        width: 100%;
        height: auto;
    }
    .gallery-image-container {
        width: 100%;
        height: auto;
    }
}

@media ( min-width : 450.02px ) and ( max-width : 1000px ) {
    .visual-gallery {
        justify-content: center;
        justify-self: center;
        width: 100%;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        justify-content: center;
        gap: 60px;
    }
    .gallery-item {
        width: 100%;
        height: auto;
    }
    .gallery-image-container {
        width: 100%;
        height: auto;
    }
}
