/* ==========================================================================
   Legal pages (build-legal-pages.mjs): the page's sections on the side of a
   readable column of text, then every legal document. Built on site.css.
   ========================================================================== */
.legal-hero .rb-page-title { font-size: clamp(38px, 4vw, 58px); }
.legal-section { padding-top: clamp(56px, 6vw, 88px); }
.legal-layout {
  display: grid; grid-template-columns: minmax(240px, 290px) minmax(0, 760px); justify-content: space-between; align-items: start;
  gap: clamp(40px, 6vw, 96px);
}

/* side: the page's sections, held in view */
.legal-aside { position: sticky; top: calc(var(--nav-h) + 28px); }
.legal-card { padding: 22px; border-radius: 22px; background: var(--rb-cream); border: 1px solid var(--rb-line); }
.legal-card .rb-card-label { margin-bottom: 10px; }
.legal-toc { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.legal-toc a {
  display: block; margin-inline: -10px; padding: 7px 10px; border-radius: 10px; font-size: 14.5px; line-height: 1.4;
  color: var(--fg-muted); text-decoration: none; transition: background-color .2s ease, color .2s ease;
}
.legal-toc a:hover { background: #fff; color: var(--ink); }
@media (prefers-reduced-motion: reduce) {
  .legal-docs a, .legal-docs a svg { transition: none; }
  .legal-docs a:hover { transform: none; }
}
.legal-toc a:focus-visible, .legal-docs a:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 1px; }

/* every document, after the text */
.legal-docs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.legal-docs a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 100%; padding: 18px 20px; border-radius: 18px;
  background: #fff; border: 1px solid var(--rb-line); color: var(--ink); font-size: 15.5px; font-weight: 500; line-height: 1.35; text-decoration: none;
  transition: border-color .25s ease, box-shadow .35s var(--rb-ease), transform .35s var(--rb-ease);
}
.legal-docs a svg { flex: none; color: var(--fg-muted); transition: transform .3s var(--rb-ease), color .2s ease; }
html[dir="rtl"] .legal-docs a svg { transform: scaleX(-1); }
.legal-docs a:hover { border-color: var(--rb-line-2); box-shadow: var(--rb-shadow); transform: translateY(-2px); }
.legal-docs a:hover svg { color: var(--primary); transform: translateX(3px); }
html[dir="rtl"] .legal-docs a:hover svg { transform: scaleX(-1) translateX(3px); }
.legal-docs a[aria-current="page"] { border-color: color-mix(in srgb, var(--rb-primary) 35%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rb-primary) 35%, transparent); }
.legal-docs a[aria-current="page"] svg { color: var(--primary); }

/* text */
.legal-body { min-width: 0; }
.legal-body section { margin: 0 0 36px; padding: 0 0 36px; border-bottom: 1px solid var(--rb-line); scroll-margin-top: calc(var(--nav-h) + 24px); }
.legal-body section:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.legal-body h2 {
  margin: 0 0 16px; font-family: var(--font-head); font-size: clamp(24px, 2.2vw, 30px); font-weight: 500;
  line-height: 1.25; letter-spacing: -0.005em; color: var(--ink);
}
html[dir="rtl"] .legal-body h2 { letter-spacing: 0; line-height: 1.45; }
.legal-body h3 { margin: 24px 0 10px; font-size: 18px; font-weight: 600; color: var(--ink); }
.legal-body p, .legal-body li { font-size: 17px; line-height: 1.7; color: var(--rb-text-soft); }
.legal-body p { margin: 0 0 14px; }
.legal-body p:last-child { margin-bottom: 0; }
.legal-body ul, .legal-body ol { margin: 0 0 16px; padding-inline-start: 22px; }
.legal-body li { margin: 6px 0; }
.legal-body li::marker { color: var(--primary); }
.legal-body a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }

.legal-table-wrap { margin: 4px 0 8px; border: 1px solid var(--rb-line-2); border-radius: 18px; overflow: hidden; }
.legal-table { width: 100%; border-collapse: collapse; }
.legal-table th, .legal-table td { padding: 14px 18px; border-top: 1px solid var(--rb-line); text-align: start; vertical-align: top; font-size: 15.5px; line-height: 1.55; }
.legal-table tr:first-child th, .legal-table tr:first-child td { border-top: 0; }
.legal-table th { width: 34%; background: var(--rb-cream); font-weight: 600; color: var(--ink); }
.legal-table td { color: var(--rb-text-soft); }

@media (max-width: 1100px) {
  .legal-docs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* one column: the page's sections before the text */
@media (max-width: 960px) {
  .legal-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .legal-aside { position: static; }
  .legal-docs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .legal-card { padding: 20px; }
  .legal-docs { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .legal-docs a { padding: 16px 18px; }
  .legal-body p, .legal-body li { font-size: 16px; }
  .legal-table, .legal-table tbody, .legal-table tr, .legal-table th, .legal-table td { display: block; width: auto; }
  .legal-table th { padding-bottom: 2px; border-top: 1px solid var(--rb-line); }
  .legal-table td { padding-top: 4px; border-top: 0; }
  .legal-table tr:first-child th { border-top: 0; }
}
