main {
    position: relative;
    background-color: var(--white);
}

button#galleryToggle {
    height: 3em;
    width: 12em;

    font-family: Maragsa;
    font-size: 2rem;
    letter-spacing: 0.1em;
    color: var(--yellow);

    border: 0;
    border-radius: 1rem;

    background: var(--lightblue);

    cursor: pointer;

    z-index: 1;
    transform-origin: center !important;
    transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
button#galleryToggle:hover {
    transform: translate(-50%, 50%) scale(1.2);
}

article {
    padding: 0 !important;
}

article#articleGrid {
    display: grid;
    padding: 0;
    overflow: hidden;
}

.gridImage {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    object-fit: cover;
    outline: 0.5rem solid var(--white);
    outline-offset: -0.5rem;
    
    /* INITIAL */
    opacity: 0;
    transform: scale(0.8);
}

#articleGrid.loaded .gridImage {
    animation: fadeIn 500ms ease forwards;
    animation-delay: var(--delay);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1.0);
    }
}

.overlay {
    position: absolute;
    bottom: 0;
    height: calc(100vh - 5rem);
    width: 100%;
    background-color: rgba(256, 256, 256, 0.4);
    pointer-events: none;
}

button#galleryToggle {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform: translate(-50%, 50%);
}

/* The dark background overlay */
div#lightBox {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: -1; /* Keeps it behind the images and arrows */
}

/* Ensure arrows and scroller are clickable above the background */
.navButton, .imageScroller {
    z-index: 1; 
}

/* Position the slideshow over the whole screen */
section#slideshow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem; /* Adds a bit of space between arrows and the images */
    
    /* Adds the requested padding */
    padding: 3rem;
    box-sizing: border-box;

    /* Hidden by default */
    opacity: 0;
    visibility: hidden; 
    pointer-events: none;
    transition: opacity 200ms ease-in-out, visibility 200ms ease-in-out;
}

/* Class to toggle the slideshow on */
section#slideshow.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.navButton {
    height: 4rem;
    width: 2.5rem;
    padding: 0;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
    font-size: 2rem;
    color: white;
    background-color: transparent;
    border: 0;
    border-radius: 0.5rem;
    transition: background-color 200ms ease-in-out;
    cursor: pointer;
}

.navButton:hover {
    background-color: rgba(0, 0, 0, 0.4);
}

.imageScroller {
    position: relative;
    perspective: 175vw;
    height: 100%;
    flex: 1;
    /* Border removed */
}

.imageScroller div {
    position: absolute;
    display: flex;
    align-items: center;
    height: 100%;
    width: 40%;
    perspective: 150vw;
    overflow: hidden;
    transition: all 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

div.leftMost {
    left: 5%;
    transform: translateX(-50%) rotateY(-45deg);
    z-index: 1;

    pointer-events: none;
}

div.leftImage {
    left: 20%;
    transform: translateX(-50%) rotateY(-30deg);
    z-index: 2;
}

div.centerImage {
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

div.rightImage {
    left: 80%;
    transform: translateX(-50%) rotateY(30deg);
    z-index: 2;
}

div.rightMost {
    left: 95%;
    transform: translateX(-50%) rotateY(45deg);
    z-index: 1;

    pointer-events: none;
}

div.midImage img {
    scale: 1;
}

div.leftImage img, div.rightImage img {
    scale: 0.8;
}

div.farImg img {
    scale: 0.4;
    opacity: 0 !important;
    visibility: hidden;
}

.imageScroller div img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    opacity: 1;
    object-fit: cover;
    border-radius: 1rem;
    transition: scale 500ms cubic-bezier(0.22, 1, 0.36, 1), opacity 200ms ease-in-out;
}

.no-transition, .no-transition img {
    transition: none !important;
}