/* Admin overrides — Editor Mode step 5 + Faza 8 admin sidebar Dokumentacija link.
 *
 * Loaded on every admin page through a $config->styles->add() hook in
 * site/ready.php. PW core already adds `role-{name}` body classes, so we
 * can target `body.role-content-editor` directly.
 *
 *   - Hide Setup / Modules / Access primary nav items for content-editor
 *     role (already permission-gated; this is the visual belt-and-suspenders
 *     promised by the Editor Mode brief).
 *   - Style the injected "Dokumentacija" nav link.
 */

body.role-content-editor:not(.role-superuser) .pw-primary-nav > li > a[href*="/setup/"],
body.role-content-editor:not(.role-superuser) .pw-primary-nav > li > a[href*="/module/"],
body.role-content-editor:not(.role-superuser) .pw-primary-nav > li > a[href*="/access/"] {
    display: none !important;
}

.pw-primary-nav .pw-docs-link a::before {
    content: "📖 ";
    margin-right: 0.15rem;
}

/* AdminOnSteroids footer toggle (medkit "Disable/Enable AdminOnSteroids" + the
 * config cog next to it) is a developer convenience for turning AOS tweaks on/off.
 * Hide it from non-superusers so editors/clients don't see (or accidentally toggle)
 * it. The wrapping <p> holds both the toggle link and the cog. Superusers keep it. */
body:not(.role-superuser) p:has(> a.aos_toggle) {
    display: none !important;
}

/* Modal click-block fix. AdminThemeUikit's admin.css pins every dialog with
 *   .pw .ui-front:not(.ui-widget-overlay) { z-index: 101 !important }   (0,3,0)
 * while AdminOnSteroids raises the backdrop to
 *   .ui-widget-overlay.ui-front { z-index: 100980 !important }
 * The :not() excludes the overlay, so the backdrop (100980) ends up ABOVE the
 * dialog (101) and covers the whole modal — every click lands on the backdrop
 * (PageTable block add/edit, page-edit modals). Re-raise the dialog above the
 * backdrop with a selector specific enough (0,4,0) to beat admin.css. */
.pw .ui-dialog.ui-front:not(.ui-widget-overlay) {
    z-index: 101001 !important;
}
