/*
 * Shared Phase 2 content primitives (market nav extension, UI-016 product
 * list, SourceLine DS-COMP-027, disclosure strip DS-COMP-030, pager). Frozen
 * design-system pair, VD-R4-02 press language: all colors/fonts/radii/
 * durations resolve through design tokens; 2px ink borders and the hard
 * offset shadow stay the only depth devices. Companions loaded after this
 * sheet: product-detail.css (UI-017) and article.css (UI-018..UI-021, UI-002).
 */
/* ---------- Market data nav dropdown (GlobalHeader extension) ---------- */

.nav-markets summary {
  border: 0;
  background: transparent;
  min-height: 2.75rem; /* contract minimumTargetPx: 44 */
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-2);
  color: var(--color-text);
  font-weight: var(--weight-medium);
}
.nav-markets summary:hover {
  color: var(--color-accent-text);
}
.nav-markets .menu-control-menu {
  left: 0;
  right: auto;
}
.menu-option-dim {
  color: var(--color-text-muted);
  cursor: default;
}
.menu-option-dim small {
  font-size: var(--text-caption);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 0 var(--space-2);
}

/* ---------- UI-016 product list ---------- */

.list-header {
  display: grid;
  gap: var(--space-2);
}
.list-header-meta {
  color: var(--color-text-muted);
  font-size: var(--text-label);
}
.list-controls {
  display: grid;
  gap: var(--space-2);
}
.list-result-count {
  margin: 0;
  font-size: var(--text-label);
}
.list-filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
/* The sidebar filter form stacks labelled rows; the inline sort form keeps
   its single-row flex treatment. */
.filter-drawer-panel .list-filter-form {
  display: grid;
  gap: var(--space-3);
  align-items: start;
}
.control-label {
  font-size: var(--text-label);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
}
.list-sort {
  min-height: 2.75rem; /* contract minimumTargetPx: 44 */
  padding: var(--space-2) var(--space-3);
  border: 2px solid var(--color-text);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: var(--text-label);
}
.list-sort:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}
.list-sort-note {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--text-caption);
}
.list-layout {
  display: grid;
  grid-template-columns: minmax(0, 17rem) minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
}
@media (max-width: 48rem) {
  .list-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
.list-aside {
  display: grid;
  gap: var(--space-4);
  align-content: start;
}
/* UI-016 filter drawer (320/390 drawer contract): the labelled summary is the
   toggle on narrow viewports (>=44px target); on the desktop sidebar the
   panel is permanently open and the toggle disappears. Toggling is the native
   details behaviour, so the drawer works without JavaScript. */
.filter-drawer-toggle {
  display: flex;
  align-items: center;
  min-height: 2.75rem; /* contract minimumTargetPx: 44 */
  padding: var(--space-2) var(--space-3);
  border: 2px solid var(--color-text);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--text-label);
  font-weight: var(--weight-medium);
  cursor: pointer;
}
.filter-drawer-toggle:hover {
  background: var(--color-accent-soft);
}
.filter-drawer-toggle::after {
  content: "";
  width: var(--space-2);
  height: var(--space-2);
  margin-left: auto;
  border-right: 2px solid var(--color-text);
  border-bottom: 2px solid var(--color-text);
  transform: rotate(45deg);
}
.filter-drawer[open] > .filter-drawer-toggle::after {
  transform: rotate(-135deg);
}
.filter-drawer-panel {
  display: grid;
  gap: var(--space-3);
  padding-top: var(--space-3);
}
@media (min-width: 48rem) {
  .filter-drawer-toggle {
    display: none;
  }
}
.filter-row-field {
  display: grid;
  gap: var(--space-1);
  font-size: var(--text-label);
  color: var(--color-text-muted);
}
/* Applied-filter chips (UX-008): current conditions stay visible with a
   one-click clear; the chip forms are shared with the blog filter rows.
   E1 finding 5: the row renders beside the drawer (visible right after
   套用篩選), each chip is a removal link carrying a visible ×. */
.filter-applied {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.filter-chip-x {
  margin-inline-start: var(--space-1);
}
.list-cards {
  display: grid;
  gap: var(--space-5);
}
.list-card {
  position: relative; /* anchors the stretched title link (whole-card click) */
  border: 2px solid var(--color-text);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  box-shadow: var(--shadow-press);
  padding: var(--space-5);
}
/* Whole-card click (E1 finding 4): the title link stretches over the card
   via its ::after, making the card body one primary link target that stays
   keyboard-accessible (the title link itself is unchanged). Nested
   interactive content (the source link, the 查看全部 button) sits above the
   stretch so each keeps its own target. */
.list-card-link::after {
  content: "";
  position: absolute;
  inset: 0;
}
.list-card .source-line-link,
.list-card .list-card-cta {
  position: relative;
  z-index: 1;
}
.list-card:hover .list-card-link {
  color: var(--color-accent-text);
}
.list-card-institution {
  margin: 0 0 var(--space-1);
  color: var(--color-accent-text);
  font-size: var(--text-label);
  font-weight: var(--weight-medium);
}
.list-card-name {
  margin: 0 0 var(--space-2);
  font-size: var(--text-heading-sm);
  line-height: var(--leading-heading);
}
.list-card-link {
  color: var(--color-text);
  text-decoration: none;
}
.list-card-link:hover {
  color: var(--color-accent-text);
}
.list-card-fields {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-6);
  margin-bottom: var(--space-2);
}
.list-card-field {
  font-size: var(--text-label);
}
.list-card-field-label {
  color: var(--color-text-muted);
}
.list-card-field-value {
  font-weight: var(--weight-semibold);
}
.list-card-offer {
  margin: 0 0 var(--space-1);
  font-size: var(--text-label);
}
.list-card-offer-until {
  color: var(--color-accent-text);
}
.list-card-cta {
  margin-top: var(--space-2);
}
.list-empty {
  display: grid;
  gap: var(--space-3);
  justify-items: start;
  border: 2px solid var(--color-text);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: var(--space-5);
}

/* ---------- DS-COMP-027 SourceLine (minimal provenance, DS-013) ---------- */

.source-line {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin: var(--space-3) 0 0;
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--text-caption);
}
.source-line-link {
  color: var(--color-accent-text);
}
.source-line-note {
  flex-basis: 100%;
}

/* ---------- DS-COMP-030 disclosure strip ---------- */

.disclosure-strip {
  margin: var(--space-5) 0 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: var(--text-caption);
}
.disclosure-strip-link {
  color: var(--color-accent-text);
}

/* ---------- Pagination (previous/next + mono indicator) ---------- */

/* Reference pagination: previous and next push to the band edges with the
   mono indicator between them. */
.pager {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
  margin: var(--space-6) 0 0;
}
.pg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem; /* reference pagination keeps the 44px button target */
  min-width: 9rem;
  padding: var(--space-2) var(--space-4);
  border: 2px solid var(--color-text);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--text-label);
  font-weight: var(--weight-medium);
  text-decoration: none;
}
.pg-btn:hover {
  background: var(--color-accent-soft);
}
.pg-btn:active {
  transform: translate(2px, 2px);
}
.pg-btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}
@media (max-width: 30rem) {
  .pg-btn {
    flex: 1 1 0;
    min-width: 0;
  }
}
.pg-indicator {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  color: var(--color-text-muted);
  padding: 0 var(--space-2);
}

/* ---------- UI-016 M11-B2 ledger list (frozen target 20260915-m11) ---------- */

.count-line { font-family: var(--font-mono); font-size: 0.8rem; color: var(--color-text-muted); margin-bottom: 1.2rem; }
.count-line b { color: var(--color-text); font-size: 1.5rem; font-variant-numeric: tabular-nums; }

/* The B2 filter grid: one labelled select per column cell, submitted as
   shareable GET parameters (UX-008). */
.filters {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-4);
  border: 1px solid var(--color-border);
  padding: var(--space-4) 1.2rem;
  margin-bottom: 1.6rem;
}
.filters label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: 0.3rem;
}
.filters select {
  width: 100%;
  font: inherit;
  font-size: 0.85rem;
  padding: 0.35rem 0.4rem;
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text);
}
.filter-actions { display: flex; align-items: end; gap: var(--space-2); }

/* The list band moved to product-rows.css (橫列式列表 2026-09-24): the row
   anatomy, media slots, key-fact pairs, offer/feature bands and the source
   line live there now. What stays here is the base institution-logo box the
   home author card (.apc-thumb--inst, article.css) and the detail head
   share with the list. */

/* Institution logo (owner round 2026-09-22): one uniform invisible
   footprint for every mark slot — stored logos and monogram fallbacks share
   the same 4.5×2.25rem box regardless of the logo's own aspect (object-fit
   contain centers the art inside it; a wide wordmark is never crushed, a
   square mark centers). No border, background, padding or radius: the box
   is an alignment box only, never a visible frame. The list rows override
   the footprint from product-rows.css. */
.inst-logo {
  box-sizing: border-box;
  display: block;
  flex: 0 0 auto;
  width: 4.5rem;
  height: 2.25rem;
  object-fit: contain;
}
.inst-logo--mono {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

/* Opaque (white-background) wordmarks on the dark canvas (owner round
   2026-09-23): a light rounded chip turns the unavoidable white rectangle
   into an intentional tile. Light theme keeps the borderless slot. */
[data-theme="dark"] .inst-logo--chip {
  background: #fff;
  border: 1px solid var(--color-dark-border);
  border-radius: 0.5rem;
  padding: 0.25rem 0.45rem;
}

@media (max-width: 1024px) {
  .filters { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .filters { grid-template-columns: 1fr; }
}

