/**
 * @file
 * Progressive-enhancement CLS guard for field_group horizontal-tabs.
 *
 * horizontal-tabs.js (Drupal.behaviors.horizontalTabs, field_group contrib)
 * makes two DOM changes on attach that are both invisible pre-JS and only
 * take their final CSS effect once JS applies them — each is a distinct,
 * measured layout-shift source on /user/edit (RUM-flagged CLS):
 *
 * 1. [data-horizontal-tabs-list] renders as an empty <ul> with core's
 *    `.visually-hidden` (position: absolute, clipped, 1x1px — effectively
 *    zero footprint). JS populates it with <li> tab buttons and removes
 *    `visually-hidden`, turning it into a normal in-flow block. That
 *    insertion pushes every field below it down by the tab bar's height.
 * 2. Each tab pane <details> gets `.horizontal-tabs-pane` added by JS,
 *    which is how it picks up field_group's own
 *    `.horizontal-tabs-panes .horizontal-tabs-pane { padding: 0 1em; }`
 *    rule — pre-JS the pane has no horizontal padding at all, so every
 *    field inside it narrows by 2em (1em each side) the instant JS runs.
 *
 * Fix: reserve both up front so nothing moves when JS applies its classes.
 * `min-height` below is the *measured* rendered height of
 * `.horizontal-tabs-list` on /user/edit post-JS (see AUTOBUILD.md) — a
 * close approximation for other horizontal-tabs forms sitewide too, since
 * one row of tab buttons is a fairly constant height regardless of tab
 * count. The padding is copied verbatim from field_group's own rule so
 * pre- and post-JS geometry match exactly.
 *
 * `position` needs !important to beat core's own `!important` on that
 * same property in `.visually-hidden`; the rest of this rule outranks
 * core's on specificity alone, so no other !important is needed. `clip`
 * is left alone deliberately — it only applies to absolutely positioned
 * elements, so it becomes inert the moment `position` here goes static.
 */
[data-horizontal-tabs] [data-horizontal-tabs-list].visually-hidden {
  position: static !important;
  width: 100%;
  height: auto;
  min-height: 47.6px;
  visibility: hidden;
}

[data-horizontal-tabs-panes] > details {
  padding: 0 1em;
}
