/* RazomGroup legal and utility pages: privacy, terms, cookies, thanks, 404, server error pages. */

.legal { padding-block: clamp(48px, 8vw, 112px); container-type: inline-size; }
/* Single-column pages (thanks, 404, server error): <main class="legal container"> with direct children */
.legal > * + * { margin-top: var(--s-5); }
.legal .lead { max-width: 40rem; }
/* Thanks: h1 sized by the column, «отправлена» (7.6em) fits whole */
.legal > h1 { font-size: clamp(2.25rem, 12.5cqi, 7.5rem); }
.legal__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* --- Legal documents: <main class="legal"><div class="container"> head + (toc | body) --- */
.legal__head > p { max-width: 68ch; }
.legal__head > * + * { margin-top: var(--s-4); }
.legal__head h1 { font-size: var(--fs-h2); }
.legal__version {
  font-family: var(--font-label);
  font-size: var(--fs-small);
  color: var(--fg-muted);
}
.legal__note {
  padding: var(--s-4) var(--s-5);
  border-left: 4px solid var(--c-yellow);
  background: var(--c-paper-2);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: var(--fs-small);
}

.legal__layout {
  display: grid;
  gap: var(--s-7);
  margin-top: var(--s-7);
}

.legal__toc {
  padding: var(--s-5);
  border: 1.5px solid var(--c-ink);
  border-radius: var(--r-md);
}
.legal__toc ol {
  margin: 0;
  padding-left: var(--s-6);
  display: grid;
  gap: var(--s-1);
  font-size: var(--fs-small);
}
/* block links, symmetric padding: wrapped entries keep the same rhythm */
.legal__toc a {
  display: block;
  min-height: 44px;
  padding-block: 10px;
  line-height: 1.4;
}

.legal__body { max-width: 68ch; min-width: 0; font-size: 1.0625rem; }
.legal__section + .legal__section { margin-top: var(--s-8); }
.legal__section h2 {
  font-size: var(--fs-h3);
  line-height: 1.2;
  margin-bottom: var(--s-4);
  scroll-margin-top: var(--s-9);
}
.legal__section > * + * { margin-top: var(--s-4); }
.legal__section p { max-width: none; }
.legal__section ul { padding-left: var(--s-5); display: grid; gap: var(--s-2); }
.legal__section code { font-family: var(--font-label); font-size: .9em; overflow-wrap: anywhere; }

/* Tables: stacked label/value rows below 768px, a real table above */
:is(.legal__table, .cookie-table) {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-small);
}
:is(.legal__table, .cookie-table) caption {
  text-align: left;
  font-weight: 700;
  padding-bottom: var(--s-3);
}
:is(.legal__table, .cookie-table) thead {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
:is(.legal__table, .cookie-table) tr {
  display: block;
  padding: var(--s-4);
  border: 1.5px solid var(--c-ink);
  border-radius: var(--r-sm);
}
:is(.legal__table, .cookie-table) tr + tr { margin-top: var(--s-3); }
:is(.legal__table, .cookie-table) td {
  display: block;
  padding-block: var(--s-1);
  overflow-wrap: anywhere;
}
:is(.legal__table, .cookie-table) td::before {
  content: attr(data-label);
  display: block;
  font-family: var(--font-label);
  font-size: var(--fs-micro);
  color: var(--fg-muted);
}

@media (min-width: 768px) {
  :is(.legal__table, .cookie-table) thead {
    position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal;
  }
  :is(.legal__table, .cookie-table) { display: table; }
  :is(.legal__table, .cookie-table) tr { display: table-row; padding: 0; border: 0; border-radius: 0; }
  :is(.legal__table, .cookie-table) tr + tr { margin-top: 0; }
  :is(.legal__table, .cookie-table) th,
  :is(.legal__table, .cookie-table) td {
    display: table-cell;
    text-align: left;
    vertical-align: top;
    padding: var(--s-3) var(--s-4);
    border-bottom: 1.5px solid var(--c-ink);
    overflow-wrap: break-word; /* keeps min-content: «rg_consent» is not split */
  }
  /* the cookie table has 5 columns and long names: narrower gutters keep it inside the ≈600px column beside the TOC */
  .cookie-table :is(th, td) { padding-inline: var(--s-2); }
  :is(.legal__table, .cookie-table) code { overflow-wrap: break-word; }
  :is(.legal__table, .cookie-table) th {
    font-family: var(--font-label);
    font-size: var(--fs-micro);
    font-weight: 500;
    border-bottom-width: 3px;
  }
  :is(.legal__table, .cookie-table) td::before { content: none; }
}

@media (min-width: 1024px) {
  .legal__layout { grid-template-columns: 280px minmax(0, 1fr); gap: var(--s-8); align-items: start; }
  .legal__toc { position: sticky; top: var(--s-9); max-height: calc(100vh - var(--s-9) - var(--s-5)); overflow-y: auto; }
}

/* --- 404: huge Unbounded "404" with the logo's yellow dot as its period --- */
.not-found__code {
  display: flex;
  align-items: baseline;
  max-width: none;
  margin-bottom: var(--s-5);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(5rem, 28vw, 17rem);
  line-height: .85;
  letter-spacing: -0.04em;
}
.not-found__dot {
  flex: none;
  width: .17em;
  height: .17em;
  margin-left: .04em;
  border-radius: 50%;
  background: var(--c-yellow);
}
.legal--404 h1 { font-size: var(--fs-h2); }
