/*
 * The document register (M2-REGISTER): the head, the two fixed documents of 'Transparență decizională', the rows of a list
 * (one bordered block per record, as the prototype's register: the title as the row's heading, its badges, the year,
 * version, identifier and category, a short text) and the facts of a record page. The filter bar, the count, the empty state,
 * the pagination, the cards, the notices and the tags are the kit's (components.css). Values come from tokens.css; this
 * file holds no colour and no font size of its own.
 */

.register-head {
  margin-bottom: var(--spacing-32);
}

.register-head .lead {
  max-width: var(--size-44rem);
}

.register-head .record-badges {
  margin-top: var(--spacing-16);
}

.register-fixed {
  margin-bottom: var(--spacing-40);
}

.register-fixed h2 {
  margin-bottom: var(--spacing-16);
}

.register-fixed__list {
  margin: 0;
}

/* ---------- The rows of a list ---------- */

.record-rows {
  margin: 0;
  padding: 0;
  list-style: none;
  border: var(--border-width-1) solid var(--color-border);
  border-radius: var(--border-radius-16);
  background: var(--color-surface);
  overflow: hidden;
}

.record-row {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-8);
  padding: var(--spacing-24);
  min-width: 0;
}

.record-row + .record-row {
  border-top: var(--border-width-1) solid var(--color-border);
}

.record-row__title {
  margin: 0;
  font-size: var(--font-size-20);
  line-height: var(--line-height-28);
  font-weight: var(--font-weight-semibold);
  overflow-wrap: anywhere;
  hyphens: auto;
}

.record-row .tags {
  margin: 0;
}

.record-row__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-4) var(--spacing-8);
  margin: 0;
  font-size: var(--font-size-14);
  line-height: var(--line-height-20);
  color: var(--color-text-secondary);
  overflow-wrap: anywhere;
}

.record-row__text {
  margin: 0;
  overflow-wrap: anywhere;
}

.register-not-applicable {
  margin-bottom: var(--spacing-24);
}

@media (max-width: 639.98px) {
  .record-row {
    padding: var(--spacing-16);
  }
}

/* ---------- A record's page ---------- */

.register-archived {
  margin-bottom: var(--spacing-32);
}

.register-section + .register-section {
  margin-top: var(--spacing-40);
}

.register-section h2 {
  margin-bottom: var(--spacing-16);
}

.register-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--size-16rem)), 1fr));
  gap: var(--spacing-16) var(--spacing-24);
  margin: 0;
}

.register-facts > div {
  min-width: 0;
}

.register-facts dt {
  font-size: var(--font-size-14);
  line-height: var(--line-height-20);
  color: var(--color-text-secondary);
}

.register-facts dd {
  margin: var(--spacing-4) 0 0;
  font-weight: var(--font-weight-medium);
  overflow-wrap: anywhere;
}

.register-summary {
  margin-top: var(--spacing-24);
  max-width: var(--size-44rem);
}

.register-meta {
  margin-top: var(--spacing-40);
  margin-bottom: var(--spacing-32); /* LT-11 */
}

/* ---------- The fields of a category (REG2): the budget table, the notes under it ---------- */

.register-budget {
  margin-top: var(--spacing-24);
}

.register-budget caption {
  padding-bottom: var(--spacing-12);
  color: var(--color-text-secondary);
  font-size: var(--font-size-14);
  line-height: var(--line-height-20);
  text-align: left;
  caption-side: top;
}

/* a figure reads from the right edge in a table, as numbers do; a phone's card keeps its label and value apart */
.register-budget .register-figure {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.register-budget thead th:not(:first-child) {
  text-align: right;
}

.register-budget .register-figure[data-state="missing"] {
  color: var(--color-text-secondary);
}

.register-budget abbr {
  text-decoration: none;
}

.register-note {
  margin: var(--spacing-12) 0 var(--spacing-16);
  max-width: var(--size-44rem);
  font-size: var(--font-size-14);
  line-height: var(--line-height-20);
  color: var(--color-text-secondary);
}

@media (max-width: 639.98px) {
  /* components.css makes the table a block on a phone: a caption left as a table caption would shrink to one letter a line */
  .register-budget caption {
    display: block;
    width: auto;
  }

  .register-budget .register-figure,
  .register-budget thead th:not(:first-child) {
    text-align: left;
  }

  .register-budget .register-figure {
    justify-content: space-between;
  }

  .register-budget td[data-label]::before {
    flex: 1 1 auto;
  }
}

.register-section h3 {
  margin: var(--spacing-32) 0 var(--spacing-12);
}

/* ---------- The index 'Toate informațiile publice' (REG3): the shared hub cards, then the way to the whole register ---------- */

.register-index__all {
  margin-top: var(--spacing-32);
}
