/* ── The landing popup (2026-10-10) ──────────────────────────────────────
   A notice flagged "Prikaži i kao skočni prozor" in the backoffice.

   Its own file, with its own colours, because two pages draw it: the site,
   through `_site_popup.html.twig`, and the backoffice's live preview on the
   notice form — whose stylesheet has none of the site's tokens. One file is
   what keeps the preview honest.

   A fixed width rather than a maximum (2026-10-10): sized to its content, a
   two-line notice made a box the width of its title. */
.sitepopup {
    --pp-surface: #ffffff;
    --pp-surface-alt: #f6f7f9;
    --pp-ink: #0f1729;
    --pp-ink-muted: #5c6780;
    --pp-brand: #0f4c81;
    --pp-brand-dark: #0a3760;
    --pp-radius: 14px;
    --pp-radius-sm: 10px;

    width: min(520px, calc(100vw - 32px));
    max-width: none;
    padding: 0;
    border: 0;
    border-radius: var(--pp-radius);
    background: var(--pp-surface);
    color: var(--pp-ink);
    font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.sitepopup::backdrop { background: rgba(15, 23, 42, 0.45); }

.sitepopup__card {
    position: relative;
    min-height: 200px;
    padding: 28px 28px 24px;
    border-top: 5px solid var(--pp-brand);
    border-radius: var(--pp-radius);
}

.sitepopup__kicker {
    margin: 0 0 8px;
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--pp-brand);
}

.sitepopup__title {
    margin: 0 36px 12px 0;
    font-size: 1.5rem;
    font-weight: 750;
    line-height: 1.25;
    color: var(--pp-ink);
}

.sitepopup__body {
    max-height: 40vh;
    overflow: auto;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--pp-ink-muted);
    overflow-wrap: anywhere;
}

.sitepopup__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-top: 22px;
}

/* "Zatvori" sits hard right, "Saznaj više" stays left.
   `margin-left: auto` on the button rather than `space-between` on the row,
   because the link is optional — a notice with no `popupLink` has only this
   button, and `space-between` would leave it on the left for those while the
   others had it on the right. Same corner every time, whatever the notice
   carries. */
.sitepopup__dismiss { margin-left: auto; }

.sitepopup__more,
.sitepopup__more:visited {
    display: inline-block;
    padding: 12px 22px;
    line-height: normal;
    border-radius: var(--pp-radius-sm);
    background: var(--pp-brand);
    color: #ffffff;
    font-size: 0.9375rem;
    font-weight: 700;
    text-decoration: none;
}

.sitepopup__more:hover { background: var(--pp-brand-dark); color: #ffffff; text-decoration: none; }

/* A real secondary button beside "Saznaj više" (2026-10-10): the same height
   and corners, outlined in the house blue, filled with a tint on hover. Was a
   bare grey word that read as fine print. */
.sitepopup__dismiss {
    display: inline-block;
    padding: 10.5px 20px;
    /* A whole pixel, so the border cannot be split across two rows of device
       pixels at different alpha. */
    border: 1px solid #b8cfe5;
    border-radius: var(--pp-radius-sm);
    background: #eaf2fa;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: normal;
    color: var(--pp-brand);
    cursor: pointer;
    transition: background-color .12s, border-color .12s;
}

/* ── Why hover does not recolour the border ───────────────────────────────

   Reported as "Zatvori has a double border", and under the mouse it did: the
   dialog autofocuses this button, so `:focus-visible` draws a brand-navy ring
   2px outside it, and hover used to paint the border brand-navy as well. Two
   navy rings, two pixels apart, reading as one doubled border rather than as a
   focus indicator.

   Hover now changes only the fill. The navy ring then means exactly one thing
   — this is where the keyboard is — which is what a focus ring is for, and the
   button still responds visibly to the pointer. */
.sitepopup__dismiss:hover { background: #dbe9f6; }
/* `outline-offset: 0`, so the ring sits against the button instead of two
   pixels off it. With an offset the white card shows through the gap, and a
   navy ring floating around a pale blue button reads as a detached second
   border — which is the same complaint as before, arriving by a different
   route. Flush, it reads as one thicker edge. */
.sitepopup__dismiss:focus-visible { outline: 2px solid var(--pp-brand); outline-offset: 0; }

.sitepopup__x {
    position: absolute;
    top: 14px;
    right: 14px;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: var(--pp-radius-sm);
    background: none;
    color: var(--pp-ink-muted);
    cursor: pointer;
}

.sitepopup__x:hover { background: var(--pp-surface-alt); color: var(--pp-ink); }

@media (max-width: 720px) {
    .sitepopup[open] {
        position: fixed;
        inset: auto 0 0;
        z-index: 50;
        width: 100%;
        margin: 0;
        border-radius: var(--pp-radius) var(--pp-radius) 0 0;
    }

    /* The shadow has to point *up*.
       `0 24px 60px` is right for a card floating in the middle of the screen
       and useless for a bar stuck to the bottom of it: the whole shadow is
       cast off the edge of the viewport, so the bar met the page on a hard
       white seam with nothing to lift it. Mobile also gets no backdrop — the
       controller calls `show()` rather than `showModal()` under 721px, by
       design, so the page stays usable behind it — which means this shadow is
       the only thing separating the two. */
    .sitepopup[open] {
        box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.26);
    }

    .sitepopup[open] .sitepopup__card { min-height: 0; padding: 18px 16px 16px; border-radius: var(--pp-radius) var(--pp-radius) 0 0; }
    .sitepopup[open] .sitepopup__title { font-size: 1.125rem; }
    .sitepopup[open] .sitepopup__body { max-height: 22vh; font-size: 0.875rem; }
}

/* The backoffice preview: the same card, drawn in the page rather than over it. */
.sitepopup--preview {
    position: static;
    display: block;
}
