/* ==========================================================================
   Páginas legais — privacidade, termos de uso e cookies
   Used by politica-de-privacidade.html, termos-de-uso.html and
   politica-de-cookies.html (same layout, only the text changes).
   The documents link to each other in the summary ("outros documentos")
   and at the end ("próximo documento"), never as a menu at the top.
   ========================================================================== */

.legal {
  position: relative;
  width: 100%;
  min-width: 0;
  padding: 9.0278vw 2.7778vw 8.3333vw 3.4722vw;
  color: var(--color-black);
  background-color: var(--color-cream);
}

/* Section label, same style as the home labels ([ OPERAÇÃO SETORIZADA ]):
   not a link, so it never reads as a second menu */
.legal__label {
  width: fit-content;
  padding: 1.25vw 1.8056vw;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1.25vw;
  line-height: 1.1;
  letter-spacing: 0.275vw;
  background-color: var(--color-pink);
}

/* Title: DIN + the key word in Editorial, like the rest of the site */
.legal__title {
  margin: 2.7778vw 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 8.3333vw;
  line-height: 1.06;
  text-transform: uppercase;
}

.legal__title-accent {
  font-family: var(--font-serif);
  font-weight: 200;
  font-size: 0.8333em;
}

.legal__updated {
  margin: 1.3889vw 0 0;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1.25vw;
  line-height: 1.1;
  color: var(--color-red);
}

.legal__lead {
  width: 48.6111vw;
  margin: 3.4722vw 0 0;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 1.6667vw;
  line-height: 1.25;
}

/* Body: sticky summary on the left, text on the right */
.legal__body {
  display: grid;
  grid-template-columns: 22.9167vw minmax(0, 52.0833vw);
  gap: 6.9444vw;
  align-items: start;
  margin: 6.9444vw 0 0;
}

.legal__toc {
  position: sticky;
  top: calc(var(--header-height) + 2.7778vw);
}

.legal__toc-title {
  margin: 0 0 1.1111vw;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1.1111vw;
  line-height: 1.1;
  color: var(--color-red);
}

.legal__toc-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.legal__toc-link {
  display: flex;
  gap: 0.8333vw;
  padding: 0.5556vw 0.6944vw;
  font-family: var(--font-mono);
  font-size: 1.1111vw;
  line-height: 1.2;
  transition: background-color 0.3s ease;
}

.legal__toc-link::before {
  counter-increment: toc;
  content: counter(toc, decimal-leading-zero);
  color: var(--color-red);
}

.legal__toc-link:is(:hover, :focus-visible, .is-active) {
  background-color: var(--color-pink);
}

/* Other documents (under the summary) */
.legal__toc-title--docs {
  margin-top: 2.7778vw;
}

.legal__docs {
  margin: 0;
  padding: 0;
  list-style: none;
}

.legal__doc-link {
  display: inline-block;
  padding: 0.3472vw 0;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 1.25vw;
  line-height: 1.2;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.legal__doc-link:hover {
  color: var(--color-red);
}

/* Text */
.legal__section {
  scroll-margin-top: calc(var(--header-height) + 2.7778vw);
}

.legal__section + .legal__section {
  margin-top: 4.8611vw;
}

.legal__heading {
  margin: 0 0 1.6667vw;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.9167vw;
  line-height: 1.06;
  text-transform: uppercase;
}

.legal__number {
  display: block;
  margin: 0 0 0.6944vw;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1.1111vw;
  line-height: 1.1;
  color: var(--color-red);
}

.legal__article :is(p, li) {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 1.25vw;
  line-height: 1.5;
}

.legal__article p {
  margin: 0;
}

.legal__article p + p,
.legal__article p + ul,
.legal__article ul + p,
.legal__article p + .legal__table,
.legal__article .legal__table + p {
  margin-top: 1.1111vw;
}

.legal__article strong {
  font-weight: 700;
}

.legal__article a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.legal__article a:hover {
  color: var(--color-red);
}

/* Text-style button that reopens the cookie banner (js/modules/cookie-consent.js) */
.legal__inline-button {
  padding: 0;
  font-weight: 500;
  white-space: normal;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  user-select: auto;
}

.legal__inline-button:hover {
  color: var(--color-red);
}

.legal__article ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.legal__article li {
  position: relative;
  padding-left: 1.6667vw;
}

.legal__article li + li {
  margin-top: 0.5556vw;
}

.legal__article li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--color-red);
}

/* Next document, at the end of the text */
.legal__article .legal__next {
  display: block;
  margin: 6.9444vw 0 0;
  padding: 2.7778vw 0 0;
  border-top: 1px dotted var(--color-black);
  text-decoration: none;
}

.legal__next-label {
  display: block;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1.1111vw;
  line-height: 1.1;
  color: var(--color-red);
}

.legal__next-title {
  display: block;
  margin: 1.1111vw 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 5.5556vw;
  line-height: 1.06;
  transition: color 0.4s var(--ease-out-quint);
}

.legal__article .legal__next:hover {
  color: var(--color-black);
}

.legal__next:hover .legal__next-title {
  color: var(--color-red);
}

/* Information still to be filled in (company name, CNPJ, e-mail…) */
.legal__fill {
  padding: 0 0.2em;
  color: var(--color-black);
  background-color: var(--color-pink);
}

/* Cookie table */
.legal__table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 1.1111vw;
  line-height: 1.4;
}

.legal__table th {
  padding: 0.8333vw 0.8333vw 0.8333vw 0;
  font-family: var(--font-mono);
  font-weight: 500;
  text-align: left;
  border-bottom: 1px solid var(--color-black);
}

.legal__table td {
  padding: 0.8333vw 0.8333vw 0.8333vw 0;
  vertical-align: top;
  border-bottom: 1px dotted var(--color-black);
}

/* Mobile (Figma frame 440px: 1vw = 4.4px) */
@media (max-width: 767px) {
  .legal {
    padding: 23.8636vw 3.4091vw 18.1818vw;
  }

  .legal__label {
    padding: 4.5455vw 4.0909vw;
    font-size: 3.1818vw;
    letter-spacing: 0.7vw;
  }

  .legal__title {
    margin: 6.8182vw 0 0;
    font-size: 13.6364vw;
  }

  .legal__updated {
    margin: 3.6364vw 0 0;
    font-size: 3.1818vw;
  }

  .legal__lead {
    width: 100%;
    margin: 6.8182vw 0 0;
    font-size: 4.5455vw;
  }

  .legal__body {
    grid-template-columns: minmax(0, 1fr);
    gap: 10.2273vw;
    margin: 11.3636vw 0 0;
  }

  .legal__toc {
    position: static;
    padding: 4.5455vw 0;
    border-block: 1px dotted var(--color-black);
  }

  .legal__toc-title {
    margin: 0 0 3.1818vw;
    font-size: 3.1818vw;
  }

  .legal__toc-link {
    gap: 2.7273vw;
    padding: 1.8182vw 0;
    font-size: 3.6364vw;
  }

  .legal__toc-link:is(:hover, :focus-visible, .is-active) {
    background-color: transparent;
    color: var(--color-red);
  }

  .legal__toc-title--docs {
    margin-top: 6.8182vw;
  }

  .legal__doc-link {
    padding: 1.3636vw 0;
    font-size: 4.0909vw;
  }

  .legal__article .legal__next {
    margin: 15.9091vw 0 0;
    padding: 6.8182vw 0 0;
  }

  .legal__next-label {
    font-size: 3.1818vw;
  }

  .legal__next-title {
    margin: 3.1818vw 0 0;
    font-size: 11.3636vw;
  }

  .legal__section + .legal__section {
    margin-top: 12.5vw;
  }

  .legal__heading {
    margin: 0 0 4.5455vw;
    font-size: 9.0909vw;
  }

  .legal__number {
    margin: 0 0 2.2727vw;
    font-size: 3.1818vw;
  }

  .legal__article :is(p, li) {
    font-size: 16px;
  }

  .legal__article p + p,
  .legal__article p + ul,
  .legal__article ul + p,
  .legal__article p + .legal__table,
  .legal__article .legal__table + p {
    margin-top: 4.5455vw;
  }

  .legal__article li {
    padding-left: 6.3636vw;
  }

  .legal__article li + li {
    margin-top: 2.2727vw;
  }

  /* Table → one card per row, each cell with its column name (data-label) */
  .legal__table {
    font-size: 3.1818vw;
  }

  .legal__table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .legal__table :is(tbody, tr, td) {
    display: block;
  }

  .legal__table tr {
    padding: 3.6364vw 0;
    border-bottom: 1px dotted var(--color-black);
  }

  .legal__table td {
    display: grid;
    grid-template-columns: 25vw 1fr;
    gap: 2.7273vw;
    padding: 0;
    border: 0;
  }

  .legal__table td + td {
    margin-top: 1.8182vw;
  }

  .legal__table td::before {
    content: attr(data-label);
    font-family: var(--font-mono);
    font-weight: 500;
  }
}
