/*
    ------------------------------------------------
    |                  Image Grid                  |
    ------------------------------------------------
*/

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(45%, 450px), 1fr));
    justify-content: center;

    margin: 0 auto;

    grid-gap: clamp(4px, 1vw, 32px);
}

.interactive-photo {
    position: relative;
    width: 100%;
}

.interactive-photo button {
    width: 100%;
    height: 100%;

    border: none;
    outline: none;
    background-color: transparent;
    border-radius: clamp(4px, 1vw, 24px);
    cursor: pointer;

    transition: box-shadow 250ms ease;
}

.interactive-photo img {
    width: 100%;
    height: 100%;

    object-fit: cover;
    display: block;
    border-radius: clamp(4px, 1vw, 24px);

    transition: 250ms ease;

    aspect-ratio: 240/135;
}

.interactive-photo figcaption {
    pointer-events: none;
    user-select: none;

    display: block;
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);

    opacity: 0;
    transition: 250ms ease;

    font-size: clamp(1rem, calc(1rem + 1vw), 2.5rem);
    white-space: nowrap;
    color: white;
}

.interactive-photo figcaption::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-color);

    transform: scaleX(0);
    transform-origin: center;
    transition: 375ms ease;
}

.interactive-photo:hover img,
.interactive-photo:focus-within img {
    filter: brightness(0.5);
}
.interactive-photo:hover figcaption,
.interactive-photo:focus-within figcaption {
    opacity: 1;
    top: 50%;
}
.interactive-photo:hover figcaption::after,
.interactive-photo:focus-within figcaption::after {
    transform: scaleX(1);
}
.interactive-photo:hover button,
.interactive-photo:focus-within button {
    box-shadow: 0 0 0 0.25rem var(--accent-color);
}

/*
    --------------------------------
    |           Lightbox           |
    --------------------------------
*/

#lightbox {
    z-index: 2;
    width: 75%;

    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    outline: none;
    border: none;

    background-color: transparent;
    overflow: visible;
}

#lightbox:hover {
    cursor: pointer;
}

#lightbox::backdrop {
    background-color: rgba(0, 0, 0, 0.75);

    width: 200%;
    height: 200%;
}

#lightbox figure img {
    object-fit: cover;
    margin: auto;
    display: block;

    border: 2px solid var(--accent-color);

    max-width: 75vw;
    max-height: 75vh;

    max-width: 75dvw;
    max-height: 75dvh;
}

#lightbox figure figcaption {
    color: white;

    margin: 1rem 0;

    width: 100%;
    text-align: center;
    font-size: clamp(1rem, calc(1rem + 1vw), 2.5rem);
}
