/* Portal tabs (see public/js/portal-tabs.js). Loaded only on pages that have a tab bar.
   Every page keeps its own tab look; this only adds the sliding highlight and the hidden rules. */

[data-ptabs] { position: relative; }
[data-ptabs] [role="tab"] { position: relative; z-index: 1; transition: color .25s ease-out; }

/* the one highlight per bar; script gives it the active tab's colour, corners and position */
.ptab-hl { position: absolute; left: 0; top: 0; z-index: 0; width: 0; height: 0; background: #2563eb;
           pointer-events: none; will-change: transform, width, height; }

/* once the highlight is under the active tab, the tab's own solid background steps aside (no script: it stays solid) */
[data-ptabs].has-hl [role="tab"][aria-selected="true"],
[data-ptabs].has-hl [role="tab"][aria-selected="true"]:hover { background: transparent !important; border-color: transparent !important; box-shadow: none !important; }

/* The hidden attribute must always win: the portal's .btn / panel rules set `display`, which beats it. */
[data-ptab-panel][hidden], [data-ptabs] [hidden] { display: none !important; }

[data-ptabs] [role="tab"]:focus-visible { outline: 3px solid rgba(37, 99, 235, .45); outline-offset: 2px; }

.ptab-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
    [data-ptabs] [role="tab"], .ptab-hl { transition: none !important; }
}
