/* data-view.css — frontend-data-views (SP8) — the `.enr-dataview` root: its
   modifiers, the results-region busy state, the result-count primitive
   (`.enr-resultcount*`), the filter-drawer field grid (`.enr-dvfields`) and
   the component's `[hidden]` guard.

   Slot in base.html: after `css/framework/forms.css` (the last
   frontend-forms sheet) and before `data-table.css` — the rail/results
   region this sheet lays out nests the table/cards/feed sheets below it.

   Tokens only (--enroute-*, --bg-*, --fg-*, --border-*, --radius-*,
   --shadow-*, --space-*, --text-*, --focus-ring, --dur-*, --ease-*). No
   literals, no px spacing/radius/colour.

   Markup contract (docs/contracts/frontend-data-views-contract.md 1.0.0):
     <div class="enr-dataview enr-dataview--table enr-dataview--selectable"
          data-enr-dataview="<slug>" tabindex="-1">
       <div class="enr-dataview__rail" id="enr-dv-<slug>-rail">…</div>
       <div class="enr-dataview__results" id="enr-dv-<slug>-results"
            data-enr-dv-results aria-busy="false">…</div>
     </div>
   The six modifiers (`--table`/`--feed`, `--selectable`, `--unpaged`,
   `--client`, `--noswap`) are markers other sheets/JS key off; this sheet
   itself paints no per-modifier colour (architecture §4 `Surface` — the
   modifier is a hook, not a look). */

/* ---------------------------------------------------------------------
   Root — .enr-dataview*
   --------------------------------------------------------------------- */
.enr-dataview {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}
/* The root is a programmatic focus target only (`focus.js` restores focus
   here when the control that triggered a swap no longer exists) — it is
   never in the tab order and never shows a ring of its own. */
.enr-dataview:focus {
  outline: none;
}

/* .enr-dataview__rail is the OUTER wrapper `ui_data_rail` renders; the
   `.enr-rail` box itself (and everything inside it) is data-rail.css's. */
.enr-dataview__rail {
  min-width: 0;
}

/* ---------------------------------------------------------------------
   Results region — .enr-dataview__results
   --------------------------------------------------------------------- */
.enr-dataview__results {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
/* `swap.js` sets `aria-busy="true"` on this node for the lifetime of a
   fragment request (architecture §6 performance realization, L3) — a quiet
   dim, never a spinner overlay (no extra DOM the fragment would then have
   to reconcile). */
.enr-dataview__results[aria-busy="true"] {
  opacity: 0.6;
  transition: opacity var(--dur-fast) var(--ease-standard);
  pointer-events: none;
}

/* ---------------------------------------------------------------------
   Result count — .enr-resultcount* (`ui_data_count`)
   --------------------------------------------------------------------- */
.enr-resultcount {
  display: flex;
  align-items: baseline;
  gap: var(--space-1);
  font-size: var(--text-sm);
  color: var(--fg-2);
}
.enr-resultcount__num {
  font-weight: 700;
  color: var(--fg-1);
  font-variant-numeric: tabular-nums;
}
.enr-resultcount__label {
  color: var(--fg-3);
}

/* ---------------------------------------------------------------------
   Filter-drawer field grid — .enr-dvfields (`ui_data_filters`, `.fld`
   itself is shell.css's — this sheet only lays the groups out)
   --------------------------------------------------------------------- */
.enr-dvfields {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.enr-dvfields > [data-enr-dv-filter] {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* The consumer's own drawer content after the field grid (`drawer_extra`,
   frontend-data-views 2.1.0, mobile-calendar-feed D11) — a stack of plain
   links/controls, separated from the declared filters by a hairline. */
.enr-drawer__extra {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-1);
}

/* ---------------------------------------------------------------------
   [hidden] guard. `.enr-selbar` and `.enr-resultcount` are placed by the
   CONSUMER'S own page template, as siblings of `.enr-dataview`, not
   descendants of it (SP6+SP7 integration note 2: "the selbar node is
   outside the swap target") — so this guard cannot be scoped to
   `.enr-dataview` and still reach the bar. Each owning sheet below repeats
   the identical one-line rule for its own top-level hideable node (the
   same pattern `overlays.css` already uses for `.enr-modal`/`.enr-popover`)
   rather than one wide `[hidden]` rule matching every node in the page. */
[data-enr-dataview] [hidden],
[data-enr-dv-badge][hidden],
[data-enr-dv-clearall][hidden] {
  display: none !important;
}
