.arest-scans {
    max-width: 100%;
}

.arest-document-scans {
    width: 100%;
    margin-bottom: 1rem;
}

.arest-document-scan-header {
    display: flex;
    flex-wrap: wrap;
}

.arest-document-scan-header p {
    flex: 0 0 100%;
}

.arest-scan-pagination {
    display: flex;
    flex: 0 0 auto;
    gap: 3px;
    margin-left: auto;
    margin-bottom: 1rem;
}

.arest-scan-pagination:empty {
    display: none;
}

.arest-scan-pagination-line {
    width: 12px;
    height: 2px;
    background: #b8b8b8;
}

.arest-scan-pagination-line.is-current {
    background: #777;
}

.arest-scan-carousel {
    position: relative;
    --arest-scan-edge-width: 4rem;
    --arest-scan-height: 350px;
}

.arest-document-scan-list {
    display: flex;
    gap: 1rem;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    scroll-behavior: smooth;
}

.arest-document-scan-list::-webkit-scrollbar {
    display: none;
}

.arest-document-scans-wrap .arest-document-scan-list {
    flex-wrap: wrap;
    overflow: visible;
}

.arest-document-scans-wrap .arest-scan-thumb {
    height: 350px;
}

.arest-scan-item {
    flex: 0 0 auto;
    min-width: 0;
    margin-bottom: 1rem;
}

.arest-scan-carousel .arest-scan-item {
    width: var(--arest-scan-width);
}

.arest-scan-thumb {
    display: block;
    width: auto;
    height: var(--arest-scan-height);
}

.arest-scan-link {
    flex-direction: column;
}

.arest-scan-carousel .arest-scan-link,
.arest-scan-carousel .arest-scan-thumb {
    width: 100%;
}

.arest-scan-carousel .arest-scan-thumb {
    object-fit: contain;
}

.arest-document-scans-wrap .arest-scan-link {
    width: min-content;
}

.arest-scan-caption {
    display: block;
    width: 100%;
    padding-top: 0.5rem;
    overflow-wrap: break-word;
    font-size: 1rem;
}

.arest-scan-carousel-control {
    position: absolute;
    z-index: 2;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--arest-scan-edge-width);
    height: var(--arest-scan-height);
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.arest-scan-carousel:hover .arest-scan-carousel-control:not([hidden]),
.arest-scan-carousel-control:focus-visible {
}

.arest-scan-carousel-control[hidden] {
    display: none;
}

.arest-scan-carousel-control img {
    display: block;
    width: 60px;
    max-width: 100%;
    height: 60px;
}

.arest-scan-carousel-prev {
    left: 0;
}

.arest-scan-carousel-next {
    right: 0;
}

.arest-scans template {
    display: none;
}

.pswp__arest-counter-edit-link {
    color: #fff;
    text-decoration: none;
    pointer-events: auto;
}

.pswp__arest-counter-edit-link:hover,
.pswp__arest-counter-edit-link:focus {
    color: #fff;
    text-decoration: none;
}

.pswp__arest-counter-separator {
    padding: 0 0.4em;
}

.pswp__arest-caption {
    position: absolute;
    z-index: 11;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    display: flex;
    justify-content: center;
    color: #fff;
    text-align: center;
    font-size: 1rem;
}

.pswp__arest-caption-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 41rem;
    padding: 0.5rem 0.75rem;
    border: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    line-height: 1.4;
    text-align: inherit;
}

.pswp__arest-caption-button:disabled {
    opacity: 1;
}

.pswp__arest-caption-button--interactive {
    cursor: pointer;
}

.pswp__arest-caption-button--interactive:hover,
.pswp__arest-caption-button--interactive:focus {
    text-decoration: underline;
}

.pswp__button--arest-transcription-icon {
    position: absolute;
    z-index: 11;
    width: 48px;
    height: 48px;
}

.pswp__button--arest-transcription-icon[hidden] {
    display: none;
}

.pswp__arest-transcription-icon-image {
    display: block;
    width: 48px;
    height: 48px;
}

.pswp__arest-transcription {
    position: absolute;
    z-index: 10;
    top: 0;
    right: 0;
    bottom: 7rem;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1.5rem 2rem;
    color: #f8f9fa;
    /*background: rgba(0, 0, 0, 0.9);*/
    background-color: black;
}

.pswp__arest-transcription[hidden] {
    display: none;
}

.pswp__arest-transcription-body {
    width: auto;
    max-height: 100%;
    overflow: auto;
    scrollbar-color: #707070 black;
    line-height: 1.4;
    align-self: flex-start;
    padding: 2rem;
    font-size: 1.1rem;
    position: relative;
}

.pswp__arest-transcription-body > * {
    margin-left: auto;
    margin-right: auto;
}

.pswp__arest-transcription-body > p {
    max-width: var(--arest-text-max-width);
}

.pswp__arest-transcription-body svg {
    display: block;
    width: calc(var(--arest-text-max-width) + 3rem);
    height: auto;
    margin-top: 0;
    padding-top: 0;
}

.pswp__arest-transcription-body p,
.pswp__arest-transcription-body > :last-child {
    margin-bottom: 0;
}

.pswp__arest-transcription-body a {
    color: inherit;
    text-decoration: underline;
}

.pswp__arest-transcription-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    width: 3rem;
    height: 3rem;
    padding: 0;
    border: 0;
    color: #fff;
    background: transparent;
    font: 300 2.5rem/1 sans-serif;
    cursor: pointer;
}

@media (max-width: 575.98px) {
    .arest-scans {
        display: block !important;
    }

    .arest-document-scan-list {
        gap: 0.5rem;
    }

    .arest-document-scans-wrap .arest-scan-item {
        flex-basis: calc(50% - 0.25rem);
    }

    .arest-document-scans-wrap .arest-scan-link,
    .arest-document-scans-wrap .arest-scan-thumb {
        width: 100%;
    }

    .arest-document-scans-wrap .arest-scan-thumb {
        height: auto;
    }

    .pswp__arest-caption {
        right: 0.5rem;
        bottom: 0.5rem;
        left: 0.5rem;
    }

    .pswp__arest-transcription {
        padding-right: 1rem;
        padding-left: 1rem;
    }
}
