/* Inline PDF rendering (assets/js/pdf-embed.js) + Gutenberg file-block
   styling for transferred posts. */

/* Preview window: the pages stack inside a scrollable box (max ~¾ of the
   viewport) instead of being listed down the whole post. A one-page PDF
   shrinks the box to its own height. */
.sf-pdf {
    margin: 1.5rem 0 1rem;
    max-height: min(75vh, 760px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1rem;
    background: var(--sf-color-sky, #eef4f8);
    border: 1px solid color-mix(in srgb, var(--sf-color-navy, #15283d) 15%, transparent);
}
.sf-pdf__page {
    display: block;
    width: 100%;
    height: auto;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.12);
}
.sf-pdf__page + .sf-pdf__page {
    margin-top: 1rem;
}

/* File block chrome: navy "Preuzmi" button in theme style. The raw file-name
   title link (e.g. "dopunski_rad") is hidden — the inline PDF render below
   already shows the document, so the button is the only control we keep. */
.wp-block-file {
    margin: 1.5rem 0;
    /* Flex column so the Preuzmi button can be ordered below the rendered
       PDF (the file-block markup puts it above the embed). */
    display: flex;
    flex-direction: column; /* children keep full width; only the button is start-aligned */
}
.wp-block-file > a:not(.wp-block-file__button) {
    display: none;
}
.wp-block-file .wp-block-file__button {
    order: 99;
    align-self: flex-start;
    margin-top: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0;
    padding: 0.5rem 1.75rem;
    background: var(--sf-color-navy, #15283d);
    color: #fff;
    border-radius: 0;
    /* !important: the post-prose link styling underlines every <a> in the
       body at higher cascade priority; the button must stay clean. */
    text-decoration: none !important;
    transition: opacity 0.15s ease;
}
.wp-block-file .wp-block-file__button:hover {
    opacity: 0.85;
    color: #fff;
}
