/* ==========================================================================
   COMPONENTS · DOSSIER — the reader's PERSISTED shortlist behind a free
   account: the countries and factors worth returning to. Save & resume only —
   no sharing, no social. It reads as a filed folder of the record (a sunken
   deckle ground, ruled rows), deliberately distinct from the transient galley
   of the comparison tray. It can SEED the tray ("compare my Dossier") and a
   tray pick can be SAVED into it. Composes op-btn, op-badge, op-empty.
   New component (clean-room s3); merge candidate. ITCSS: 06-components.
   ========================================================================== */

.op-dossier {
  background: var(--surface-sunken);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  padding: var(--space-md) var(--space-md) var(--space-lg);
}

/* — The folder head: title + saved tally + the seed-the-tray action — */
.op-dossier__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2xs) var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 2px solid var(--rule-strong);
}
.op-dossier__title {
  font-family: var(--font-reading);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
}
.op-dossier__tally {
  font-family: var(--font-data);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--text-secondary);
}

/* the standing free-account / save-and-resume line under the head */
.op-dossier__note {
  font-family: var(--font-furniture);
  font-size: var(--text-2xs);
  color: var(--text-muted);
  margin-top: var(--space-2xs);
}

/* — A filed section (Countries / Factors) — */
.op-dossier__section { margin-top: var(--space-lg); }
.op-dossier__section-label {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  font-family: var(--font-furniture);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: var(--space-2xs);
}
.op-dossier__section-count {
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--text-muted);
}

/* — A filed row: the same identity↔escorted-score pairing as a listing row,
     plus a saved date and a remove control. Ruled like a contents list. — */
.op-dossier__list { list-style: none; margin: 0; padding: 0; }
.op-dossier__row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: var(--space-sm);
  padding-block: var(--space-xs);
  border-bottom: 1px solid var(--rule);
}
.op-dossier__row:first-child { border-top: 1px solid var(--rule); }

.op-dossier__identity { min-width: 0; }
.op-dossier__name {
  font-family: var(--font-reading);
  font-weight: var(--weight-medium);
  color: var(--text);
  text-decoration: none;
}
.op-dossier__name:hover { color: var(--accent); text-decoration: underline; text-decoration-color: var(--link-underline); text-underline-offset: 0.18em; }
.op-dossier__iso,
.op-dossier__cat {
  display: block;
  font-family: var(--font-furniture);
  font-size: var(--text-3xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
}
.op-dossier__iso { font-family: var(--font-data); }

.op-dossier__saved {
  font-family: var(--font-data);
  font-size: var(--text-3xs);
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--text-muted);
  white-space: nowrap;
}
.op-dossier__remove {
  padding: 0.2em 0.4em;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-data);
  font-size: 1em;
  line-height: 1;
  color: var(--text-muted);
  transition: var(--transition-ink);
}
.op-dossier__remove:hover { color: var(--accent); }
.op-dossier__remove:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

@media (max-width: 40rem) {
  .op-dossier__row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "identity remove"
      "score    saved";
    gap: var(--space-2xs) var(--space-sm);
  }
  .op-dossier__identity { grid-area: identity; }
  .op-dossier__score    { grid-area: score; }
  .op-dossier__saved    { grid-area: saved; align-self: center; }
  .op-dossier__remove   { grid-area: remove; justify-self: end; }
}
