/* src/components/LegalDocument/LegalDocument.css */
/* Geometry from Privacy.dc.html / PrivacyMobile.dc.html (Consent and Terms
   share the same structure per the mockups). No separate tablet rule: at
   1024 the two-column grid simply reflows inside its 60px page margins
   (Privacy1024.dc.html renders the same markup, only narrower) — the single
   breakpoint below is the shared 767px one (../../../AGENTS.md contract 9).
   `main` carries no padding of its own (../../styles/base.css) — this page's
   own top/side/bottom inset lives here: mockup's hero section is
   `88px 60px 40px` and its TOC+sections one is `0 60px 96px`; since both
   sit inside this single wrapper, one `padding: 88px 60px 96px` reproduces
   both edges at once (the 40px gap between them is `.oj-legal__hero`'s own
   `margin-bottom` below, not this wrapper). */
.oj-legal {
  padding: 40px 20px 56px;
}

.oj-legal__hero {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 auto 24px;
  max-width: 1000px;
}

.oj-legal__title {
  margin: 0;
  font-size: 32px;
  line-height: 1.12;
  letter-spacing: -0.035em;
  /* "конфиденциальности" alone, at 320px (below the 390 control width, so
     not in any mockup), is wider than the column and has no soft-wrap
     point of its own — without this the word overflows past the column
     the way ordinary text wrap never would (item 3). */
  overflow-wrap: break-word;
}

.oj-legal__date {
  margin: 0;
  font-size: 15px;
  color: var(--oj-muted);
}

.oj-legal__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.oj-legal__toc {
  box-sizing: border-box;
  border: 1px solid var(--oj-border);
  border-radius: var(--oj-r-lg);
  background: var(--oj-surface);
  /* A closed `<details>` collapses its own box to the summary's height as
     part of its native rendering — the link list stays in normal flow
     underneath and, without this, would still paint past that collapsed
     box (`overflow: visible`'s default) instead of actually disappearing
     when a mobile reader taps `<summary>` to close it. */
  overflow: hidden;
}

.oj-legal__tocSummary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  font-family: var(--oj-font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--oj-navy);
  list-style: none;
  cursor: pointer;
}

.oj-legal__tocSummary::-webkit-details-marker {
  display: none;
}

.oj-legal__tocChevron {
  flex: none;
  width: 16px;
  height: 16px;
}

.oj-legal__tocLabel {
  display: none;
}

.oj-legal__tocNav {
  flex-direction: column;
  gap: 2px;
  padding: 0 10px 14px;
}

/* `display` scoped to the open state, not unconditional: an unscoped
   `display: flex` here is an *author* declaration, which always beats the
   UA stylesheet's non-important `details:not([open]) > * { display: none }`
   regardless of specificity — it would keep the link list visible even
   after tapping `<summary>` to close it at mobile, the one place the
   native toggle still runs (≥768px hides the summary instead, below). */
details[open] > .oj-legal__tocNav {
  display: flex;
}

.oj-legal__tocNav a {
  font-size: 16px;
  line-height: 1.4;
  color: var(--oj-text-2);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: var(--oj-r-sm);
}

.oj-legal__tocNav a:hover {
  background: var(--oj-surface-2);
}

.oj-legal__sections {
  display: flex;
  flex-direction: column;
  gap: 28px;
  /* a grid item's min-width is its content's by default — the policy's wide
     table would stretch the column past the screen instead of scrolling */
  min-width: 0;
}

.oj-legal__section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-margin-top: 16px;
}

.oj-legal__section h2 {
  margin: 0;
  font-family: var(--oj-font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--oj-navy);
}

.oj-legal__section p {
  margin: 0;
  font-family: var(--oj-font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  color: var(--oj-text-2);
}

/* The archive's documents (DECISIONS.md #53): the /legal lead under the H1,
   lists and tables (the policy's five-column one scrolls sideways on a phone
   rather than squeeze its cells). */
.oj-legal__subtitle {
  margin: 0;
  font-size: 18px;
  line-height: 1.45;
  color: var(--oj-text-2);
}

.oj-legal__intro {
  padding-bottom: 4px;
}

.oj-legal__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--oj-text-2);
}

.oj-legal__tableWrap {
  overflow-x: auto;
  border: 1px solid var(--oj-border);
  border-radius: var(--oj-r-sm);
}

.oj-legal__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.45;
  color: var(--oj-text-2);
}

/* three columns and more scroll sideways on a phone instead of squeezing */
.oj-legal__table--wide {
  min-width: 640px;
}

.oj-legal__table th,
.oj-legal__table td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--oj-border);
}

.oj-legal__table th {
  font-weight: 700;
  color: var(--oj-navy);
  background: var(--oj-surface-2);
}

.oj-legal__table tr:last-child td {
  border-bottom: none;
}

.oj-legal a {
  overflow-wrap: anywhere;
}

/* `/legal`: the numbered list of documents — sized like the home page's
   closed "Почему OctoJinn" rows (`HomeAdvantages.css`, owner 28.10), lines
   only between items, none above the first or below the last. */
.oj-legal__docs {
  display: flex;
  flex-direction: column;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.oj-legal__docs li {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: baseline;
  column-gap: 8px;
  padding: 18px 0;
}

.oj-legal__docs li + li {
  border-top: 1px solid var(--oj-border);
}

.oj-legal__docNum {
  font-family: var(--oj-font-display);
  font-weight: 600;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--oj-slate-300);
}

.oj-legal__docs a {
  font-family: var(--oj-font-display);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--oj-navy);
  text-decoration: none;
}

.oj-legal__docs a:hover {
  text-decoration: underline;
}

.oj-legal__langBar {
  margin: 0;
  padding: 10px 20px;
  font-size: 14px;
  text-align: center;
  color: var(--oj-text-2);
  background: var(--oj-surface-2);
}

@media (min-width: 768px) {
  .oj-legal {
    padding: 88px var(--oj-page-pad-desktop) 96px;
  }

  .oj-legal__hero {
    gap: 16px;
    margin-bottom: 40px;
  }

  .oj-legal__title {
    font-size: 56px;
    line-height: 1.1;
    letter-spacing: -0.04em;
  }

  .oj-legal__date {
    font-size: 17px;
  }

  .oj-legal__grid {
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 56px;
    align-items: start;
    max-width: 1000px;
    margin: 0 auto;
  }

  .oj-legal__toc {
    border: none;
    border-radius: 0;
    background: none;
    position: sticky;
    top: 24px;
    align-self: start;
  }

  .oj-legal__tocSummary {
    display: none;
  }

  .oj-legal__tocLabel {
    display: block;
    padding: 0 10px 8px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--oj-muted);
  }

  .oj-legal__tocNav {
    padding: 0;
  }

  .oj-legal__sections {
    gap: 40px;
    max-width: 700px;
  }

  .oj-legal__section {
    gap: 12px;
    scroll-margin-top: 24px;
  }

  .oj-legal__section h2 {
    font-size: 26px;
  }

  .oj-legal__section p {
    font-size: 18px;
    line-height: 1.6;
  }

  .oj-legal__subtitle {
    font-size: 21px;
  }

  .oj-legal__list {
    font-size: 18px;
    line-height: 1.6;
  }

  .oj-legal__table--wide {
    min-width: 0;
  }

  .oj-legal__table {
    font-size: 15px;
  }

  .oj-legal__docs li {
    grid-template-columns: 96px 1fr;
    align-items: center;
    padding: 24px 0;
  }

  .oj-legal__docNum {
    font-size: 40px;
  }

  .oj-legal__docs a {
    font-size: 24px;
  }
}

@media (min-width: 1280px) {
  .oj-legal__docs a {
    font-size: 27px;
  }
}

/* The page's top space: one value for every inner page (`--oj-page-top`,
   base.css; owner's call, 09.11). Last in the file so it outranks the
   breakpoint rules above. */
.oj-legal {
  padding-top: var(--oj-page-top);
}


/* the page's own style attributes, moved here by scripts/build/inlineStyles.mjs */

