.quiqqer-bricks-pdfPreview {
    --_aspectRatio: var(--aspectRatio, 210/297);
}

.quiqqer-bricks-pdfPreview :where(.container) {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 2rem;
    align-items: start;
}

.quiqqer-bricks-pdfPreview canvas {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    position: relative;
    z-index: 1;
}

.quiqqer-bricks-pdfPreview .skeleton-loader {
    position: absolute;
    inset: 0;
    z-index: 0;
}

/* preview */
.quiqqer-bricks-pdfPreview :where(.preview) {
    aspect-ratio: var(--_aspectRatio);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    position: relative;
}

.quiqqer-bricks-pdfPreview :where(.preview .btn) {
    --pos: -1.5rem;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 0;
    width: 3rem;
    z-index: 20; /* qui loader has z-index of 10 */
}

.quiqqer-bricks-pdfPreview :where(.preview .btn--prev) {
    left: var(--pos);
}

.quiqqer-bricks-pdfPreview :where(.preview .btn--next) {
    right: var(--pos);
}

@media screen and (hover: hover) {
    .quiqqer-bricks-pdfPreview :where(.container:not(:hover) .btn) {
        --pos: -1rem;
        opacity: 0;
    }
}

/* sheets */
.quiqqer-bricks-pdfPreview :where(.sheets) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: clamp(0.5rem, 4vw, 1rem);
}

.quiqqer-bricks-pdfPreview :where(.sheet) {
    aspect-ratio: var(--_aspectRatio);
    border: 1px solid var(--qui-colors-gray-200, #f2f2f2);
    border-radius: 6px;
    transition: outline 0.3s ease;
    cursor: pointer;
    position: relative;
    outline: 2px solid transparent;
}

.quiqqer-bricks-pdfPreview :where(.sheet):hover{
    border-color: var(--qui-colors-gray-500, #3a3a3a);
}

.quiqqer-bricks-pdfPreview :where(.sheet.active) {
    outline: 2px solid var(--qui-colors-primary, #111);
}

@media screen and (max-width: 767px) {
    .quiqqer-bricks-pdfPreview :where(.container) {
        grid-template-columns: 1fr;
    }

    .quiqqer-bricks-pdfPreview :where(.preview .btn) {
        --pos: 0.5rem;
        width: 2rem;
    }

    .quiqqer-bricks-pdfPreview :where(.sheets) {
        display: flex;
        flex-wrap: nowrap;
        overflow: auto;
        padding-block: 1rem;
        padding-inline: 2px; /* according to 2px outline for active sheet */
    }

    .quiqqer-bricks-pdfPreview :where(.sheet) {
        width: 50px;
        flex-shrink: 0;
    }
}