/* Legal pages /privacy and /terms (web-spec W06). Shared by both: pageCss 'legal'. Tokens only. */

/* Contents column x 120-342 (222) and text x 438-1128 (690): flex with a 96 gap inside the 1200 container. */
.legal {
  display: flex;
  gap: 96px;
  align-items: flex-start;
}

.legal__text {
  flex: 0 1 690px;
  min-width: 0;
}

.legal__h1 {
  margin: 0;
}

.legal__updated {
  margin: 8px 0 0;
}

/* ---------- Contents ---------- */

.legal-toc {
  position: sticky;
  top: 24px;
  flex: 0 0 222px;
  padding-top: 8px;
}

.legal-toc__title {
  margin: 0 0 4px;
}

.legal-toc__link {
  display: flex;
  align-items: center;
  min-height: 40px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition);
}

.legal-toc__link:hover {
  color: var(--ink);
}

.legal-toc__link[aria-current='location'] {
  color: var(--accent-text);
}

/* Below 1024 the contents collapse into one 48 row above the text. */
.legal-toc-m {
  display: none;
}

@media (max-width: 1023px) {
  .legal {
    display: block;
  }

  .legal-toc {
    display: none;
  }

  .legal-toc-m {
    display: block;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--line);
  }

  .legal-toc-m summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    cursor: pointer;
    list-style: none;
    font-size: 13px;
    line-height: 18px;
    font-weight: 700;
  }

  .legal-toc-m summary::-webkit-details-marker {
    display: none;
  }

  .legal-toc-m summary::after {
    content: '';
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-right: 2px solid var(--text-secondary);
    border-bottom: 2px solid var(--text-secondary);
    transform: rotate(45deg);
    transition: transform var(--transition);
  }

  .legal-toc-m[open] summary::after {
    transform: rotate(-135deg);
  }

  .legal-toc-m nav {
    padding-bottom: 8px;
  }
}

/* ---------- Text ---------- */

.legal-h2 {
  position: relative;
  margin: 48px 0 12px;
  scroll-margin-top: 24px;
}

/* The # link sits 24 to the left of the heading and shows on hover and focus. */
.legal-anchor {
  position: absolute;
  left: -24px;
  min-width: 20px;
  color: var(--text-secondary);
  text-decoration: none;
  opacity: 0;
  transition: opacity var(--transition);
}

.legal-h2:hover .legal-anchor,
.legal-anchor:focus-visible {
  opacity: 1;
}

@media (max-width: 1023px) {
  .legal-anchor:not(:focus-visible) {
    display: none;
  }

  .legal-anchor {
    left: 0;
    position: static;
    margin-right: 8px;
  }
}

.legal-h3 {
  margin: 32px 0 8px;
  font-size: 17px;
  line-height: 22px;
  font-weight: 700;
}

.legal-p {
  margin: 0 0 16px;
  font-size: 17px;
  line-height: 28px;
}

.legal-note {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 24px;
  color: var(--text-secondary);
}

.legal-note:last-child {
  margin-bottom: 0;
}

.legal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 16px;
  padding-left: 24px;
  font-size: 17px;
  line-height: 28px;
}

ul.legal-list {
  list-style: disc;
}

ol.legal-list {
  list-style: decimal;
  font-variant-numeric: tabular-nums;
}

.legal-list + .legal-note {
  margin-top: 16px;
}

.legal-list li {
  padding-left: 4px;
}

.legal-list li::marker {
  color: var(--text-secondary);
}

/* ---------- Table ---------- */

.legal-table {
  width: 100%;
  margin: 0 0 16px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 24px;
  text-align: left;
}

.legal-table thead th {
  padding: 8px 16px 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
}

.legal-table tbody th,
.legal-table td {
  padding: 10px 16px 10px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 400;
  vertical-align: top;
}

.legal-table th:first-child {
  width: 180px;
}

.legal-table th:last-child,
.legal-table td:last-child {
  width: 160px;
  padding-right: 0;
}

@media (max-width: 599px) {
  .legal-table th:first-child {
    width: 110px;
  }

  .legal-table th:last-child,
  .legal-table td:last-child {
    width: 96px;
  }
}

/* Phones: the text starts under the cobalt header, so the page adds its own top space. */
@media (max-width: 767px) {
  .legal {
    padding-top: 24px;
  }

  .legal-h2 {
    margin-top: 40px;
  }
}
