/* The site's PDF viewer (JS/pdf-viewer.js): pages drawn on the page
   itself, and the pop-up used for newsletters, partner flyers and
   competition timetables. */

/* On the page - defaults for a page that doesn't style its own. */
.pdf-viewer-page {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
    background: #ffffff;
}

.pdf-viewer-message {
    padding: 30px 0;
    text-align: center;
    color: #a0a0a0;
}

/* Pop-up */

.pdf-lightbox[hidden] {
    display: none;
}

.pdf-lightbox {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    z-index: 1000;
    padding: 24px;
    box-sizing: border-box;
}

.pdf-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 12, 0.92);
}

.pdf-lightbox-dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: min(900px, 100%);
    max-height: 100%;
}

.pdf-lightbox-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.pdf-lightbox-title {
    margin: 0;
    font-size: 1rem;
    color: #d4a017;
    overflow-wrap: anywhere;
}

.pdf-lightbox-close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.pdf-lightbox-close:hover,
.pdf-lightbox-close:focus-visible {
    border-color: #d4a017;
}

.pdf-lightbox-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
    flex: 1 1 auto;
}

/* A picture flyer: the whole thing fits on screen, with Open full size for
   zooming in. */
.pdf-lightbox-image {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 150px);
    max-height: calc(100dvh - 150px);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.pdf-lightbox-image[hidden] {
    display: none;
}

/* The pages, stacked and scrolling. A one-page PDF fits on screen like a
   picture instead. */
.pdf-lightbox-pages {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-height: calc(100vh - 150px);
    max-height: calc(100dvh - 150px);
    overflow-y: auto;
}

.pdf-lightbox-pages[hidden] {
    display: none;
}

.pdf-lightbox-page {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    background: #ffffff;
}

.pdf-lightbox-pages.is-single {
    overflow: visible;
}

.pdf-lightbox-pages.is-single .pdf-lightbox-page {
    width: auto;
    max-width: 100%;
    max-height: calc(100vh - 150px);
    max-height: calc(100dvh - 150px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.pdf-lightbox-loading {
    padding: 20px;
    color: #a0a0a0;
    text-align: center;
}

.pdf-lightbox-missing {
    padding: 40px 20px;
    color: #a0a0a0;
    font-style: italic;
    text-align: center;
}

.pdf-lightbox-missing[hidden] {
    display: none;
}

.pdf-lightbox-full {
    color: #d4a017;
    font-size: 0.9rem;
    font-weight: 600;
}

.pdf-lightbox-full[hidden] {
    display: none;
}

@media (max-width: 480px) {
    .pdf-lightbox {
        padding: 14px;
    }
}
