/* SZ Auction Book - front-end flipbook */

.szab-wrap {
    --szab-accent: #f97b26;
    --szab-accent-dark: #e06a16;
    --szab-ink: #1f2933;
    --szab-muted: #5a6775;
    --szab-line: #d8dee6;
    --szab-stage-1: #2b3340;
    --szab-stage-2: #161b22;
    --szab-radius: 10px;

    margin: 0 auto 2.5rem;
    max-width: 1180px;
}

.szab-title {
    margin: 0 0 1.1rem;
    text-align: center;
}

/* Visually hidden, still announced. */
.szab-sr {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

/* ---------------------------------------------------------------- stage */

.szab-stage {
    align-items: center;
    background: radial-gradient(ellipse at 50% 0%, var(--szab-stage-1), var(--szab-stage-2));
    border-radius: var(--szab-radius);
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    padding: 1.75rem 1rem;
    position: relative;
}

.szab-bookwrap {
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
}

.szab-book {
    margin: 0 auto;
    max-width: 1000px;
    outline: none;
}

.szab-book:focus-visible {
    box-shadow: 0 0 0 3px rgba(249, 123, 38, 0.6);
}

/* Lifts the book off the backdrop so it reads as a physical object. */
.szab-book .stf__parent {
    filter: drop-shadow(0 18px 32px rgba(0, 0, 0, 0.45));
}

/* DOM pages (HTML render mode), so they stay sharp on high-density screens. */
.szab-page {
    background: #fff;
    overflow: hidden;
}

.szab-page img {
    display: block;
    height: 100%;
    object-fit: contain;
    -webkit-user-select: none;
    user-select: none;
    width: 100%;
}

/* Before the library takes them over, keep the raw pages from flashing. */
.szab-book > .szab-page {
    position: absolute;
    visibility: hidden;
}

/* Centre gutter, only meaningful in two-page spreads. */
.szab-bookwrap::after {
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.22) 45%,
        rgba(0, 0, 0, 0.3) 50%,
        rgba(0, 0, 0, 0.22) 55%,
        rgba(0, 0, 0, 0) 100%
    );
    bottom: 0;
    content: "";
    left: 50%;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    transition: opacity 0.25s ease;
    width: 46px;
    z-index: 2;
}

.szab-wrap[data-orientation="landscape"] .szab-bookwrap::after {
    opacity: 1;
}

/* ---------------------------------------------------------- loading state */

.szab-loading {
    align-items: center;
    background: inherit;
    border-radius: var(--szab-radius);
    display: flex;
    inset: 0;
    justify-content: center;
    position: absolute;
    transition: opacity 0.3s ease;
    z-index: 5;
}

.szab-wrap.szab-ready .szab-loading {
    opacity: 0;
    pointer-events: none;
}

.szab-spinner {
    animation: szab-spin 0.9s linear infinite;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    border-top-color: var(--szab-accent);
    display: block;
    height: 34px;
    width: 34px;
}

@keyframes szab-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .szab-spinner { animation-duration: 2.4s; }
}

/* --------------------------------------------------------------- arrows */

.szab-arrow {
    align-items: center;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    flex: 0 0 auto;
    height: 46px;
    justify-content: center;
    padding: 0;
    transition: background 0.15s ease, opacity 0.15s ease;
    width: 46px;
    z-index: 3;
}

.szab-arrow svg {
    fill: none;
    height: 22px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 22px;
}

.szab-arrow:hover:not(:disabled) {
    background: var(--szab-accent);
    border-color: var(--szab-accent);
}

.szab-arrow:disabled {
    cursor: default;
    opacity: 0.25;
}

/* ------------------------------------------------------------ action bar */

.szab-bar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    margin-top: 1rem;
}

.szab-pager {
    align-items: center;
    display: flex;
    gap: 0.35rem;
}

.szab-iconbtn {
    align-items: center;
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--szab-muted);
    cursor: pointer;
    display: flex;
    height: 34px;
    justify-content: center;
    padding: 0;
    width: 34px;
}

.szab-iconbtn svg {
    fill: none;
    height: 18px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 18px;
}

.szab-iconbtn:hover:not(:disabled) {
    background: #eef1f5;
    color: var(--szab-ink);
}

.szab-iconbtn:disabled {
    cursor: default;
    opacity: 0.3;
}

.szab-jumpwrap {
    display: inline-flex;
}

.szab-jump {
    -moz-appearance: textfield;
    appearance: textfield;
    background: #fff;
    border: 1px solid var(--szab-line);
    border-radius: 6px;
    color: var(--szab-ink);
    font-size: 0.95rem;
    font-weight: 600;
    height: 34px;
    padding: 0 0.3rem;
    text-align: center;
    width: 3.4rem;
}

.szab-jump::-webkit-outer-spin-button,
.szab-jump::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.szab-jump:focus-visible {
    border-color: var(--szab-accent);
    outline: none;
}

.szab-total {
    color: var(--szab-muted);
    font-size: 0.95rem;
    padding-right: 0.15rem;
}

.szab-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.szab-btn {
    align-items: center;
    background: #fff;
    border: 1px solid var(--szab-line);
    border-radius: 6px;
    color: var(--szab-ink);
    cursor: pointer;
    display: inline-flex;
    font-size: 0.95rem;
    font-weight: 600;
    gap: 0.4rem;
    line-height: 1.2;
    padding: 0.6rem 1rem;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.szab-btn svg {
    fill: none;
    height: 17px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 17px;
}

.szab-btn:hover:not(:disabled) {
    border-color: #9aa5b1;
}

.szab-btn-primary {
    background: var(--szab-accent);
    border-color: var(--szab-accent);
    color: #fff;
}

.szab-btn-primary:hover:not(:disabled) {
    background: var(--szab-accent-dark);
    border-color: var(--szab-accent-dark);
    color: #fff;
}

.szab-btn:disabled {
    cursor: progress;
    opacity: 0.6;
}

.szab-status {
    color: var(--szab-muted);
    font-size: 0.9rem;
    margin: 0.6rem 0 0;
    min-height: 1.2em;
    text-align: right;
}

/* --------------------------------------------------------- page strip */

.szab-thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
}

.szab-thumb {
    background: none;
    border: 2px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    flex: 0 0 auto;
    line-height: 0;
    padding: 0;
    position: relative;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.szab-thumb img {
    border-radius: 3px;
    display: block;
    height: 86px;
    object-fit: cover;
    object-position: top center;
    width: auto;
}

.szab-thumb:hover {
    border-color: #9aa5b1;
    transform: translateY(-2px);
}

.szab-thumb.is-current {
    border-color: var(--szab-accent);
}

.szab-thumbnum {
    background: rgba(31, 41, 51, 0.78);
    border-radius: 3px;
    bottom: 4px;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    left: 4px;
    line-height: 1;
    padding: 2px 4px;
    position: absolute;
}

.szab-thumb.is-current .szab-thumbnum {
    background: var(--szab-accent);
}

.szab-empty {
    border: 1px dashed var(--szab-line);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

/* ------------------------------------------------------------ zoom view */

.szab-zoomer {
    background: #0d1117;
    display: flex;
    flex-direction: column;
    inset: 0;
    position: fixed;
    z-index: 99999;
}

/* Only go translucent where it can be blurred, so page text behind the
   overlay never stays legible. */
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .szab-zoomer {
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        background: rgba(13, 17, 23, 0.9);
    }
}

.szab-zoomer[hidden] {
    display: none;
}

.szab-zoomtop {
    align-items: center;
    color: #f3f5f7;
    display: flex;
    flex: 0 0 auto;
    justify-content: space-between;
    padding: 0.75rem 1rem;
}

.szab-zoomlabel {
    font-size: 0.95rem;
    font-weight: 600;
}

.szab-zoomclose {
    align-items: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    height: 38px;
    justify-content: center;
    padding: 0;
    width: 38px;
}

.szab-zoomclose svg {
    fill: none;
    height: 20px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 2;
    width: 20px;
}

.szab-zoomclose:hover {
    background: var(--szab-accent);
    border-color: var(--szab-accent);
}

.szab-zoomscroll {
    flex: 1 1 auto;
    overflow: auto;
    padding: 0 1rem 1.5rem;
    text-align: center;
    -webkit-overflow-scrolling: touch;
}

.szab-zoomimg {
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    height: auto;
    max-width: 100%;
    width: auto;
}

/* ------------------------------------------------------------ fullscreen */

.szab-wrap.szab-is-full {
    background: var(--szab-stage-2);
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: none;
    padding: 1rem 1.5rem;
}

.szab-wrap.szab-is-full .szab-title {
    color: #f3f5f7;
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
}

.szab-wrap.szab-is-full .szab-stage {
    flex: 1 1 auto;
    min-height: 0;
}

.szab-wrap.szab-is-full .szab-book {
    max-width: 1500px;
}

.szab-wrap.szab-is-full .szab-thumbs {
    display: none;
}

.szab-wrap.szab-is-full .szab-total,
.szab-wrap.szab-is-full .szab-status {
    color: #aab4c0;
}

.szab-wrap.szab-is-full .szab-iconbtn {
    color: #aab4c0;
}

.szab-wrap.szab-is-full .szab-iconbtn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* ------------------------------------- print view / no-JavaScript fallback */

.szab-printable {
    display: none;
}

/* If the flipbook library cannot load, fall back to a plain image gallery. */
.szab-fallback .szab-stage,
.szab-fallback .szab-bar,
.szab-fallback .szab-thumbs,
.szab-fallback .szab-status {
    display: none;
}

.szab-fallback .szab-printable {
    display: block;
}

.szab-fallback .szab-printable img {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    display: block;
    height: auto;
    margin: 0 auto 1.25rem;
    max-width: 100%;
}

@media (max-width: 700px) {
    .szab-stage {
        gap: 0.25rem;
        padding: 1rem 0.5rem;
    }

    .szab-arrow {
        height: 38px;
        width: 38px;
    }

    .szab-arrow svg {
        height: 18px;
        width: 18px;
    }

    .szab-bar {
        justify-content: center;
    }

    .szab-actions {
        justify-content: center;
        width: 100%;
    }

    .szab-status {
        text-align: center;
    }

    .szab-thumb img {
        height: 64px;
    }
}

/* Ctrl+P prints the full-resolution pages, one per sheet. */
@media print {
    .szab-stage,
    .szab-bar,
    .szab-thumbs,
    .szab-status,
    .szab-title,
    .szab-zoomer {
        display: none !important;
    }

    .szab-printable {
        display: block !important;
    }

    .szab-printable img {
        break-after: page;
        display: block;
        height: auto;
        page-break-after: always;
        width: 100%;
    }

    .szab-printable img:last-child {
        break-after: auto;
        page-break-after: auto;
    }
}
