.wvu-photo-album-viewer__grid {
    display: grid;
    grid-template-columns: repeat(var(--wvu-photo-columns, 3), minmax(0, 1fr));
    gap: 1rem;
}

.wvu-photo-album-viewer__item {
    aspect-ratio: 4 / 3;
    width: 100%;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: #e8e8e8;
    cursor: zoom-in;
}

.wvu-photo-album-viewer__item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 180ms ease;
}

.wvu-photo-album-viewer__item:hover img,
.wvu-photo-album-viewer__item:focus-visible img {
    transform: scale(1.03);
}

.wvu-photo-album-viewer__item:focus-visible {
    outline: 3px solid #0062a3;
    outline-offset: 3px;
}

.wvu-photo-album-viewer__dialog {
    width: fit-content;
    max-width: min(72rem, calc(100vw - 1rem));
    max-height: calc(var(--wvu-photo-viewport-height, 100dvh) - 1rem);
    padding: 0;
    overflow: hidden;
    overscroll-behavior: none;
    border: 0;
    border-radius: 0;
    color: #fff;
    background: #111;
    box-shadow: none;
}

.wvu-photo-album-viewer__dialog[open] {
    display: grid;
    grid-template-rows: auto auto;
    align-content: start;
}

.wvu-photo-album-viewer__dialog::backdrop {
    background: rgba(0, 0, 0, 0.88);
}

.wvu-photo-album-viewer__dialog:focus {
    outline: none;
}

.wvu-photo-album-viewer__media {
    position: relative;
    display: flex;
    align-items: flex-start;
    align-self: start;
    width: fit-content;
    height: fit-content;
    max-width: calc(100vw - 2.5rem);
    min-width: 0;
    min-height: 0;
    margin: 0.75rem 0.75rem 0;
    border: 3px solid #fff;
    background: transparent;
    box-sizing: border-box;
}

.wvu-photo-album-viewer__large-image {
    display: block;
    flex: 0 0 auto;
    width: auto;
    max-width: min(calc(70.5rem - 6px), calc(100vw - 2.5rem - 6px));
    height: auto;
    max-height: calc(var(--wvu-photo-viewport-height, 100dvh) - 8rem);
    object-fit: contain;
    background: transparent;
}

html.wvu-photo-album-viewer-open,
body.wvu-photo-album-viewer-open {
    overflow: hidden !important;
    overscroll-behavior: none;
}

body.wvu-photo-album-viewer-open {
    position: fixed;
    left: 0;
    width: 100%;
}

@media (hover: none) and (pointer: coarse) {
    .wvu-photo-album-viewer__dialog,
    .wvu-photo-album-viewer__media {
        touch-action: none;
    }
}

.wvu-photo-album-viewer__nav {
    position: absolute;
    z-index: 1;
    top: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 4rem;
    padding: 0;
    transform: translateY(-50%);
    appearance: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
    border: 0;
    border-radius: 0;
    color: #fff;
    background: transparent;
    font-family: inherit;
    font-size: 0;
    font-weight: 300;
    line-height: 1;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.wvu-photo-album-viewer__nav::before {
    content: '';
    display: block;
    width: 1rem;
    height: 1rem;
    border-top: 3px solid currentColor;
    border-right: 3px solid currentColor;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.95));
}

.wvu-photo-album-viewer__nav--previous::before {
    transform: rotate(-135deg);
}

.wvu-photo-album-viewer__nav--next::before {
    transform: rotate(45deg);
}

.wvu-photo-album-viewer__nav:hover,
.wvu-photo-album-viewer__nav:active,
.wvu-photo-album-viewer__nav:focus-visible {
    background: transparent;
    color: #fff;
    box-shadow: none;
}

.wvu-photo-album-viewer__nav:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.wvu-photo-album-viewer__nav--previous {
    left: 0.25rem;
}

.wvu-photo-album-viewer__nav--next {
    right: 0.25rem;
}

.wvu-photo-album-viewer__footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    margin-left: 0.75rem;
    margin-right: 0.75rem;
    background: transparent;
}

.wvu-photo-album-viewer__details {
    flex: 1 1 auto;
    min-width: 0;
}

.wvu-photo-album-viewer__title {
    margin: 0 !important;
    padding: 0 !important;
    color: #fff !important;
    font-family: inherit !important;
    font-size: 0.875rem !important;
    font-weight: var(--wvu-fw-bold, 700) !important;
    line-height: 1.35 !important;
}

.wvu-photo-album-viewer__description {
    margin: 0.125rem 0 0;
    color: #fff;
    font-size: 0.875rem;
    line-height: 1.35;
}

.wvu-photo-album-viewer__link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.125rem;
    color: #fff !important;
    font-size: 0.875rem;
    font-weight: var(--wvu-fw-bold, 700);
    line-height: 1.35;
    text-decoration: none;
}

.wvu-photo-album-viewer__link::after {
    position: static !important;
    align-self: center;
    margin: 0 !important;
    line-height: 1 !important;
    transform: none !important;
}

.wvu-photo-album-viewer__link[hidden] {
    display: none !important;
}

.wvu-photo-album-viewer__count {
    margin: 0.125rem 0 0;
    color: #aaa;
    font-size: 0.75rem;
    line-height: 1.3;
}

.wvu-photo-album-viewer__close {
    position: static !important;
    flex: 0 0 auto;
    align-self: flex-start;
    margin-left: auto !important;
    width: 2rem !important;
    height: 2rem;
    margin-top: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 0 !important;
    padding: 0;
    inset: auto !important;
    float: none !important;
    transform: none !important;
    border: 0;
    color: #fff;
    background: transparent;
    font-family: inherit;
    font-size: 2rem;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
}

.wvu-photo-album-viewer__close span {
    display: block !important;
}

.wvu-photo-album-viewer__close:hover {
    color: #fff;
}

.wvu-photo-album-viewer__close:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

@media (max-width: 767px) {
    .wvu-photo-album-viewer__grid {
        grid-template-columns: repeat(min(2, var(--wvu-photo-columns, 3)), minmax(0, 1fr));
    }

    .wvu-photo-album-viewer__nav {
        width: 2.5rem;
        font-size: 0;
    }
}

@media (max-width: 420px) {
    .wvu-photo-album-viewer__grid {
        grid-template-columns: 1fr;
    }
}
