/* ── sphinx_autodoc_pytest_fixtures ────────────────────────
 * Fixture card layout and index table.
 *
 * Badge colour tokens have moved to sab_palettes.css in
 * sphinx-ux-badges.  This file only contains fixture-card
 * layout rules and the index-table scroll wrapper.
 *
 * All rules land in @layer gp-sphinx so precedence is declarative
 * against Furo's @layer components.  Layer order is established in
 * gp-furo-theme/web/src/styles/index.css.
 * ────────────────────────────────────────────────────────── */

@layer gp-sphinx {

/* "fixture" keyword prefix — keep Furo's default keyword colour */
dl.py.fixture.gp-sphinx-api-container > dt.gp-sphinx-api-header .gp-sphinx-api-signature em.property {
  color: var(--color-api-keyword);
  font-style: normal;
}

/* Fixture cards keep their package-specific chrome while layout owns header
 * structure and positioning. */
dl.py.fixture.gp-sphinx-api-container > dt.gp-sphinx-api-header {
  background: var(--color-background-secondary);
  border-bottom: 1px solid var(--color-background-border);
  padding: 0.5rem 0.75rem;
}

/* Suppress module prefix (libtmux.pytest_plugin.) */
dl.py.fixture > dt .sig-prename.descclassname {
  display: none;
}

/* ── Fixture card treatment ──────────────────────────────── */
dl.py.fixture {
  border: 1px solid var(--color-background-border);
  border-radius: 0.5rem;
  padding: 0;
  margin-bottom: 1.5rem;
  overflow: visible;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

dl.py.fixture > dt {
  text-indent: 0;
  margin: 0;
  padding-left: 1rem;
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
  min-height: 2rem;
}

dl.py.fixture > dd {
  padding: 0.75rem 1rem;
  margin-left: 0 !important;
}

/* Metadata fields: compact grid — STANDALONE FALLBACK
 * These rules use a direct-child chain `> dd > dl.field-list` that
 * intentionally only fires when sphinx-autodoc-pytest-fixtures is
 * installed WITHOUT sphinx-ux-autodoc-layout. When the layout
 * package is present, _wrap_content_runs inserts a `<div
 * class="gp-sphinx-api-parameters">` between `<dd>` and
 * `<dl class="field-list">`, which breaks this direct-child path;
 * the authoritative styling for the transformed DOM lives in
 * `packages/sphinx-ux-autodoc-layout/.../layout.css`.
 *
 * Per CLAUDE.md "Package self-containment," this package's CSS must
 * render the classes its Python emits even when consumed alone. */
dl.py.fixture > dd > dl.field-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.25rem 1rem;
  border-top: 1px solid var(--color-background-border);
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}
dl.py.fixture > dd > dl.field-list > dt {
  grid-column: 1;
  font-size: var(--gp-sphinx-type-metadata);
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: var(--color-foreground-muted);
}
dl.py.fixture > dd > dl.field-list > dt .colon { display: none; }
dl.py.fixture > dd > dl.field-list > dd {
  grid-column: 2;
  margin-top: 0.25rem;
  margin-left: 0;
  font-size: var(--gp-sphinx-type-metadata);
  line-height: 1.5;
}

dl.py.fixture > dd > dl.field-list > dd > ul.simple {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0;
  margin-bottom: 0;
}

dl.py.fixture > dd > dl.field-list > dd > p,
dl.py.fixture > dd > dl.field-list > dd > ul.simple > li > p {
  margin: 0;
}

@media (max-width: 52rem) {
  dl.py.fixture > dd > dl.field-list {
    grid-template-columns: 1fr;
  }
  dl.py.fixture > dd > dl.field-list > dt,
  dl.py.fixture > dd > dl.field-list > dd {
    grid-column: 1;
  }
}

/* Suppress Rtype field-list on fixtures */
dl.py.fixture > dd > dl.field-list + dl.field-list {
  display: none;
}

/* Deprecated fixture muting (self-contained so this extension works
 * without sphinx-autodoc-api-style, which carries the same rule at
 * the more general dl.py scope). Fires when _directives.py appends
 * SAB.STATE_DEPRECATED ("gp-sphinx-badge--state-deprecated") to the
 * parent `desc` node of a fixture flagged with :deprecated:. */
dl.py.fixture.gp-sphinx-badge--state-deprecated > dt {
  opacity: 0.7;
}

/* Horizontal scroll wrapper for the fixture index table */
.gp-sphinx-pytest-fixtures__fixture-index .gp-sphinx-badge-group {
  display: inline-flex;
  gap: 0.3rem;
}

.gp-sphinx-pytest-fixtures__table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.gp-sphinx-pytest-fixtures__table-scroll table {
  min-width: 40rem;
  width: 100%;
}


}  /* end @layer gp-sphinx */
