/*
 * Legal page layout (ADR 0021).
 *
 * Loaded only by the pages the API renders from the Plutus registry, on top
 * of css/site.css, with a cache buster of its own like css/product-page.css:
 * the legal pages can change shape without touching the stylesheet link
 * every other page carries.
 *
 * A legal text is read, not scanned: one column, a measure of about 72
 * characters, the site's light weight and generous leading, and tables that
 * scroll inside the page rather than push it sideways.
 */

/* ── Hero ── */

.legal-hero {
  grid-template-columns: minmax(0, 1fr);
  padding-bottom: 1rem;
}

.legal-hero .section-title {
  max-width: 24ch;
  text-wrap: balance;
}

.legal-document__meta,
.legal-list__meta {
  color: #64748b;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legal-document__meta {
  margin: 0.75rem 0 0;
}

/* ── The text ── */

.legal-document {
  max-width: 72ch;
  font-size: 1.02rem;
  font-weight: 300;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.legal-document__note {
  margin: 0 0 2rem;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--primary);
  background: var(--surface-container-low);
  font-size: 0.95rem;
  font-weight: 400;
}

.legal-document h2,
.legal-document h3,
.legal-document h4,
.legal-document h5,
.legal-document h6 {
  margin: 2.4rem 0 0.8rem;
  font-family: var(--heading);
  font-weight: 600;
  line-height: 1.25;
}

.legal-document h2 {
  font-size: 1.5rem;
}

.legal-document h3 {
  font-size: 1.2rem;
}

.legal-document h4,
.legal-document h5,
.legal-document h6 {
  font-size: 1.02rem;
}

.legal-document p {
  margin: 0 0 1.1rem;
}

.legal-document ul,
.legal-document ol {
  margin: 0 0 1.1rem;
  padding-left: 1.5rem;
}

.legal-document li {
  margin: 0.35rem 0;
}

.legal-document li > ul,
.legal-document li > ol {
  margin: 0.35rem 0 0;
}

.legal-document blockquote {
  margin: 0 0 1.1rem;
  padding: 0.5rem 1rem;
  border-left: 3px solid var(--surface-container-highest);
  color: var(--on-surface-variant);
}

.legal-document hr {
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid var(--surface-container-high);
}

.legal-document code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--surface-container-low);
  font-family: var(--mono);
  font-size: 0.9em;
}

.legal-document pre {
  overflow-x: auto;
  padding: 1rem;
  border-radius: 8px;
  background: var(--surface-container-low);
}

.legal-document pre code {
  padding: 0;
  background: none;
}

.legal-document a {
  color: var(--primary-dark);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.legal-table {
  margin: 0 0 1.4rem;
  overflow-x: auto;
}

.legal-table table {
  width: 100%;
  min-width: 32rem;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.legal-table th,
.legal-table td {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--surface-container-highest);
  text-align: left;
  vertical-align: top;
}

.legal-table th {
  background: var(--surface-container-low);
  font-weight: 600;
}

/* ── The index ── */

.legal-list {
  max-width: 60rem;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--surface-container-high);
  list-style: none;
}

.legal-list__group {
  margin: 2rem 0 0.75rem;
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legal-list__item {
  border-bottom: 1px solid var(--surface-container-high);
}

.legal-list__link {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1.5rem;
  padding: 1.1rem 0;
  color: inherit;
  text-decoration: none;
}

.legal-list__link:hover .legal-list__title,
.legal-list__link:focus-visible .legal-list__title {
  color: var(--primary-dark);
}

.legal-list__title {
  font-family: var(--heading);
  font-size: 1.1rem;
  font-weight: 600;
}

.legal-list__meta {
  align-self: center;
}
