/* ============================================================================
   VRYNO STICKY PAGE HEADER
   ============================================================================
   The top navbar was already sticky, and list tables already pinned their own
   <thead>. The row in between -- the page title and its action buttons
   ("Macros", "+ Add Macro", Export, Manage Fields) -- scrolled away on every
   page in the product, so on a long list you lost both the name of what you
   were looking at and every control for it.

   This pins that row directly under the navbar. Geometry only: the offsets
   and the background colour are measured at runtime by
   assets/js/vryno-sticky-head.js and handed over as custom properties, so
   the bar matches the page's own ground in whichever theme is active rather
   than approximating it with a token that is close but not equal.
============================================================================ */

/* .vr-sticky-pagehead {
    position: sticky;
    top: var(--vr-nav-h, 57px);
    z-index: 99;
    background: var(--vr-pagehead-bg, var(--light, #f1f2f4));
    padding-block: 10px;
    margin-block-start: -10px;
} */

/* @media (max-height: 560px) {
    .vr-sticky-pagehead {
        position: static;
        box-shadow: none;
        padding-block: 0;
        margin-block-start: 0;
    }
} */

/* The list views' second bar -- the one holding the view name and the list's
   controls. The script sets its `top` to the measured height of the bar above
   it; these are the parts that do not depend on measurement. The background
   has to be stated because the rows scrolling underneath would otherwise read
   straight through it, and `--topbar-bg` is the same token the primary navbar
   uses, so the two read as one surface in both themes. */
.navbar-header.vr-sticky-subhead {
    position: sticky;
    z-index: 98;
    background: var(--topbar-bg);
}

/* Where a page pins its own table header too, that one stacks under the page
   header rather than over it. */
.vr-sticky-pagehead ~ * .vryno-list-table thead th,
.vr-sticky-pagehead ~ * table[data-vryno-list] thead th {
    z-index: 2;
}

/* Anchors inside a pinned header must clear it when jumped to. */
:target {
    scroll-margin-top: calc(var(--vr-nav-h, 57px) + var(--vr-pagehead-h, 0px) + 12px);
}

@media print {
    .vr-sticky-pagehead {
        position: static;
        box-shadow: none;
    }
}
