/*******************************************************************************
    (3N) Gallery
*******************************************************************************/
#gallery {
    --accent-color: #474747;
    --dim-accent-color: #47474766;
    justify-content: center;
    background: var(--accent-color);
    z-index: 5;
}

/* Header ******************************************************************* */
#gallery-header {
    bottom: 55dvh;
    margin: 3dvh;
    z-index: 4;


    color: white;
    color: #ededed;
    filter: drop-shadow(1px 3px 5px var(--extra-dim-black));

    transition: opacity 0.75s ease;
}



/* Up Arrow *************************************************************** */
#gallery-arrow {
    background: var(--accent-color);
    box-shadow: 0 -1px 6px var(--dim-black) inset;
    z-index: 4;
    transition: 0.5s ease, opacity 0.75s ease;
}
#gallery-arrow-down {
    bottom: 1dvh;
    aspect-ratio: 1.5;
    height: 4.5dvh;
    z-index: 4;
    border: 2px dashed var(--dim-white);
    border-radius: 7.5dvh;
    transition: 0.5s ease, opacity 0.75s ease;
}
@media(hover: hover) and (pointer: fine) {
    #gallery-arrow:hover { box-shadow: 0 -1px 10px var(--dim-black) inset; }
    #gallery-arrow-down:hover {
        aspect-ratio: 2;
        height: 4dvh;
        background: #FFFFFF20;
    }
}

/* Mask Button ************************************************************** */
#gallery-button-container { filter: drop-shadow(1px 3px 5px var(--extra-dim-black)); }
#gallery-button {
    --mask-height: min(50dvh,90vw); /* use twice desired height */
    --mask-top: 45dvh;

    --clip-path:  url(#gallery-mask);
    --clip-path-fill:  url(#gallery-mask-fill);
    --background-image: url(../images/gallery/background.jpg);

    --tint: transparent;
    --zoomed-tint: #ffffff55;

    /* max-height: min(calc(var(--mask-height)/2), 45vw); */

    transition: 0.5s ease-out, opacity 0.75s ease;
}
.wide-mask { height: calc(0.5*var(--mask-height)); }
@media(hover: hover) and (pointer: fine) {
    .wide-mask:hover {
        top: calc(var(--mask-top) - 0.5dvh);
        height: calc(0.5*var(--mask-height) + 1dvh);
    }
}
.wide-mask > .button-mask { align-self: start; }
#gallery-button.zoomed {
    top: calc(var(--mask-top) - 2.375*var(--mask-height));
    height: calc(5.25*var(--mask-height));
}
#gallery-button.zoomed > .button-mask { height: calc(19*var(--mask-height)); }


/* Slideshow **************************************************************** */
/* Indexer */
#gallery-indexer {
    --slide-animation: running;
    position: absolute;
    left: 50vw;
    bottom: calc(2*var(--margin));
    z-index: 1;

    display: flex;
    flex-direction: row;
    gap: min(2dvh,10vw);

    transform: translateX(-50%);

    cursor: default;

    transition: opacity 0.75s ease;
}
#gallery-indexer > .index-bar {
    display: flex;
    align-items: end;
    aspect-ratio: 3 / 5;
    height: calc(var(--icon-size)*1.25);
    max-width: 10vw;
    margin: 0;
    padding: 0;
    cursor: pointer;
}
#gallery-indexer > .index-bar > span {
    width: 100%;
    height: 6%;
    background: var(--dim-white);
    border-radius: 3px;
    box-shadow: 1px 3px 5px var(--extra-dim-black);

    transition: 0.6s ease;
}
@media(hover: hover) and (pointer: fine) {
    #gallery-indexer > .index-bar:hover {
        --slide-animation: paused;
        /* height: 100%; */
    }
    #gallery-indexer > .index-bar:hover > span {
        height: 100%;
        background: white;
    }
}
#gallery-indexer > .index-bar > .active {
    height: 25%;
    background: white;
}
#gallery-indexer > .index-bar > .animate {
    animation: scaleDownHeight var(--slide-duration, 5s) linear 0s forwards;
    animation-play-state: var(--slide-animation);
}
@keyframes scaleDownHeight {
    8% { height: 100%; }
    100% { height: 6%; }
}



/*******************************************************************************
    Gallery Subsection
*******************************************************************************/
#gallery-subsection {
    --scroll-width: 0px; /* set in gallery.js */
    --scroll-speed: 120s;
    --animation-delay: 0s;

    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;

    transition: opacity 0.5s ease-out;
}

#gallery-close-button {
    position: absolute;
    aspect-ratio: 2;
    height: var(--icon-size);
    right: 0;
    top: 0;
    margin: var(--margin);

    background: var(--accent-color);
    border-radius: var(--icon-size);

    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--icon-size)/1.25);
    color: white;

    cursor: pointer;
    transition: transform 0.5s ease-out;
}
@media(hover: hover) and (pointer: fine) {
    #gallery-close-button:hover { transform: scale(1.1); }
}


/* Scroll Bar */
#carousel-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    position: absolute;
    bottom: 0;
    margin: calc(var(--margin)/2) 0;
    z-index: 6;
}
#carousel-toggle {
    height: calc(var(--icon-size)/2);
    margin: 0 calc(var(--margin)/2);

    color: var(--accent-color);

    border: 0;
    box-sizing: border-box;
    border-color: transparent transparent transparent var(--accent-color);
    background: transparent;
    cursor: pointer;

    transition: 0.2s ease;
}
#carousel-toggle.play {
    border-style: solid;
    border-width: calc(var(--icon-size)/4) 0 calc(var(--icon-size)/4) calc(var(--icon-size)/4*1.75);
}
#carousel-toggle.pause {
    border-style: double;
    border-width: 0 0 0 calc(var(--icon-size)/2);
}
#carousel-toggle:hover {
    transform: scale(1.1);
}
#scroll-bar {
    --height: calc(var(--icon-size)/2);
    display: flex;
    align-items: center;
    position: relative;
    height: calc(var(--icon-size)/2);
    padding: var(--margin) 0;
    cursor: pointer;
}
@media(hover: hover) and (pointer: fine) {
    #scroll-bar:hover > #scroll-pick-point { opacity: 1; }
}
#scroll-line {
    width: 60vw;
    height: 2px;
    background: var(--accent-color);
}
#scroll-point {
    --scroll: 0%;
    position: absolute;
    height: var(--height);
    aspect-ratio: 1;
    background: var(--accent-color);
    border-radius: 50%;
    left: calc(var(--scroll) - var(--height)/2);

    transition: left 2s ease;
}
.scrollPoint {
    animation: scrollPoint var(--scroll-speed) var(--animation-delay) linear infinite normal none var(--scroll-animation-state);
}
@keyframes scrollPoint {
    0% { left: calc(0px - var(--height)/2); opacity: 0; }
    1% { opacity: 1; }
    99% { opacity: 1; }
    100% { left: calc(100% - var(--height)/2); opacity: 0; }
}
#scroll-pick-point {
    opacity: 0;
    position: absolute;
    aspect-ratio: 1;
    height: var(--height);
    left: calc(var(--left) - var(--height)/2);

    border: 2px solid var(--accent-color);
    border-radius: 50%;
    pointer-events: none;
}

/* Carousel */
/* Photo reel *************************************************************** */
.gallery-scroll-wrapper {
    position: absolute;
    width: 100vw;
    height: 100dvh;

    overflow-y: visible;
    overflow-x: hidden;

    display: flex;
    align-items: center;
}
.grid {
    --scroll: 0px;
    position: absolute;
    height: calc(94dvh - 4*var(--margin));
    margin-top: 1dvh;

    display: flex;
    flex-direction: column;
    justify-content: space-around;

    transform: translateX(calc(100vw - var(--scroll)));

    transition: transform 2s ease;
}
.autoScroll {
    animation: autoScroll var(--scroll-speed) var(--animation-delay) linear infinite normal none var(--scroll-animation-state);
}
@keyframes autoScroll {
    0% { transform: translateX(100vw); }
    100% { transform: translateX(calc(100vw - var(--scroll-width))); }
}

.row {
    padding: 0;
    margin: 0;
    height: 30%;

    display: flex;
    flex-direction: row;
    object-fit: contain;
}
.row img {
    margin: 0 2rem 0 0;
    height: 100%;
    width: auto;

    align-self: flex-start;

    transition: 0.5s ease-out;

    box-shadow: 0 3px 20px var(--dim-black);
    border-radius: 2px;
}
@media(hover: hover) and (pointer: fine) {
    .row img:hover {
        cursor: pointer;
        filter: brightness(70%);
    }
}

.entry, .exit {
    display: flex;
    align-items: center;
    justify-content: space-around;
    position: absolute;
    width: 100vw;
    height: 75dvh;
}
.entry { left: -100vw; }
.exit { right: -100vw; }

.gallery-picture {
    display: none;
    width: 40vw;
    box-shadow: 0 3px 20px var(--dim-black);
    border-radius: 2px;
}
.svg-location-icon {
    display: inline-block;
    width: 24px;
}
.svg-location-icon > path {
    fill: var(--accent-color);
}
.gallery-name {
    width: auto;
    text-align: left;
}
.gallery-location {
    display: inline-block;
    position: static;
    width: auto;
    padding: 0 0.5em;
    text-align: left;
}
.gallery-location > b {
    text-transform: uppercase;
}
.gallery-caption {
    width: 27dvh;
    margin-top: 1dvh;
    color: black;
}

/* Media Queries */
/* 480 px */
@media (min-width:30rem) {
    .gallery-picture { display: block; }
    .gallery-caption { width: 35vh; }
}
/* 1040 px */
@media (min-width:60rem) {
    #insta-logo { left: calc(2*var(--margin)); }
    .svg-location-icon { width: 50px; }
    .gallery-caption { width: 60vh; }
    .gallery-location > b { font-size: 35px; }
}

/* Modal */
.image-modal {
    display: flex;
    justify-content: center;
    align-items: center;

    position: absolute;
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100dvh;
    z-index: 7;

    background: var(--dim-black);
    overflow: hidden;
    cursor: pointer;

    transition: opacity 0.5s ease-out;
}
.spot {
    position: absolute;
    width: 100vw;
    height: 100dvh;
    z-index: 4;
    background: radial-gradient(circle at center, transparent 50dvh, black 85dvh);
}
.modal-content {
    max-height: 75dvh;
    max-width: 100vw;
    box-shadow: 0 3px 30px var(--dim-black);
}
.close {
    position: absolute;
    right: 0;
    top: 0;
    aspect-ratio: 2;
    height: var(--icon-size);
    margin: calc(var(--margin) + 2dvh) calc(var(--margin));
    z-index: 6;
    line-height: 0;
    color: var(--dim-white);
    text-align: center;
    cursor: pointer;
    transition: color 0.5s ease;
}
@media(hover: hover) and (pointer: fine) {
    .close:hover {
        color: white;
    }
}