/*
 * RangeXT landing: legal pages (/privacy-policy/, /terms-conditions/). Loaded after css/site.css.
 * .rx-legal is a 1200px column inside .rx-legal-wrap, which gives the old pages' gutters and top space.
 */

/* ── Legal pages (Privacy Policy, Terms and Conditions): header, "On this page" list beside the
   text on desktop (above it on smaller screens), numbered sections, provider table. ── */
/* The old theme's content column: 40px below the header, 6% side gutters up to 60px. */
.rx-legal-wrap { padding: 40px min(6vw, 60px) 0; }

.rx-legal {
  --rx-legal-sticky: calc(var(--rx-header-h) + 5px); /* top of the sticky "On this page" list: clears the fixed header */
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 48px) 0 clamp(64px, 7vw, 112px);
}
.rx-legal-head { max-width: 860px; margin-bottom: clamp(32px, 4vw, 56px); padding-bottom: clamp(24px, 3vw, 36px); border-bottom: 1px solid var(--rx-line); }
.rx-legal .rx-legal-title {
  margin: 0;
  padding: 0;
  color: var(--rx-ink);
  font-size: clamp(36px, 4.2vw, 60px);
  line-height: 1.08;
  font-weight: 500;
  letter-spacing: -0.03em;
}
.rx-legal .rx-legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 28px;
  margin: 18px 0 0;
  padding: 0;
  color: #5c636b;
  font-size: 15px;
  line-height: 1.5;
}

/* Section links jump straight to the section (as on the old pages), without site.css's smooth scroll. */
html:has(.rx-legal) { scroll-behavior: auto; }

.rx-legal-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
@media only screen and (min-width: 1000px) {
  .rx-legal-layout { grid-template-columns: 250px minmax(0, 1fr); gap: clamp(48px, 5vw, 88px); align-items: start; }
  .rx-legal-toc {
    position: sticky;
    top: var(--rx-legal-sticky);
    max-height: calc(100vh - var(--rx-legal-sticky) - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* On this page */
.rx-legal .rx-legal-toc-title {
  margin: 0 0 12px;
  padding: 0;
  color: var(--rx-green-ink);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.rx-legal .rx-legal-toc ol { margin: 0; padding: 0; list-style: none; }
.rx-legal .rx-legal-toc li { margin: 0; padding: 0; list-style: none; }
.rx-legal .rx-legal-toc a {
  display: flex;
  gap: 8px;
  padding: 6px 0 6px 14px;
  border-left: 2px solid var(--rx-line);
  color: var(--rx-text);
  font-size: 14px;
  line-height: 1.45;
  text-decoration: none;
}
.rx-legal .rx-legal-toc a:hover { border-left-color: var(--rx-green); color: var(--rx-ink); }
/* Inset: the sticky list scrolls, so an outer ring would be clipped at its edges. */
.rx-legal .rx-legal-toc a:focus-visible { outline: 2px solid var(--rx-navy); outline-offset: -2px; }
.rx-legal-toc .rx-legal-num { flex: 0 0 auto; min-width: 1.6em; color: var(--rx-green-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
@media only screen and (max-width: 999px) {
  .rx-legal-toc { padding: 20px 22px; border-radius: 15px; background: var(--rx-green-soft); }
  /* Darker than --rx-green-ink, which is 4.38:1 on the green card; this is 5.4:1. */
  .rx-legal .rx-legal-toc-title,
  .rx-legal-toc .rx-legal-num { color: #466f1e; }
  .rx-legal .rx-legal-toc ol { columns: 2; column-gap: 28px; }
  .rx-legal .rx-legal-toc li { break-inside: avoid; }
  .rx-legal .rx-legal-toc a { padding: 5px 0; border-left: 0; }
}
@media only screen and (max-width: 599px) {
  .rx-legal .rx-legal-toc ol { columns: 1; }
  .rx-legal .rx-legal-toc a { text-wrap: balance; } /* no one-word last lines ("…Your Personal / Data") */
}

/* Document */
.rx-legal-doc { max-width: 780px; min-width: 0; }
/* html already has scroll-padding-top: var(--rx-header-h) (site.css), so a section only needs
   5px of breathing room below the header. */
.rx-legal-section { scroll-margin-top: 5px; }
.rx-legal-section + .rx-legal-section { margin-top: 44px; padding-top: 44px; border-top: 1px solid var(--rx-line); }
.rx-legal-doc h3[id] { scroll-margin-top: 5px; }
.rx-legal .rx-legal-doc h2 {
  margin: 0 0 18px;
  padding: 0;
  color: var(--rx-ink);
  font-size: clamp(22px, 1.9vw, 28px);
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.rx-legal .rx-legal-doc h3 {
  margin: 30px 0 10px;
  padding: 0;
  color: var(--rx-ink);
  font-size: 18px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.rx-legal .rx-legal-doc h2 + h3 { margin-top: 22px; }
.rx-legal-doc .rx-legal-num { color: var(--rx-green-ink); font-variant-numeric: tabular-nums; }
/* Text lines stop at about 80 characters; headings and the provider table keep the full column. */
.rx-legal .rx-legal-doc :is(p, ul) { max-width: 37.5em; }
.rx-legal .rx-legal-doc p {
  margin: 0 0 14px;
  padding: 0;
  color: var(--rx-text);
  font-size: 17px;
  line-height: 1.72;
  overflow-wrap: break-word; /* the plain-text support@ address is wider than a 360px column */
}
/* The address is 345px wide. From 378px to 394px it runs at most 13px into the 22–24px gutter
   instead, as before, rather than breaking off its last letter onto a line of its own. */
@media (min-width: 378px) and (max-width: 394px) {
  .rx-legal .rx-legal-doc p { overflow-wrap: normal; }
}
.rx-legal .rx-legal-doc ul { margin: 0 0 18px; padding: 0; list-style: none; }
.rx-legal .rx-legal-doc ul li {
  position: relative;
  margin: 0;
  padding: 0 0 0 22px;
  color: var(--rx-text);
  font-size: 17px;
  line-height: 1.65;
  list-style: none;
}
.rx-legal .rx-legal-doc ul li + li { margin-top: 8px; }
.rx-legal-doc ul li:before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rx-green);
}
.rx-legal .rx-legal-doc strong { color: var(--rx-ink); font-weight: 700; }
.rx-legal .rx-legal-doc a { color: var(--rx-blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.rx-legal .rx-legal-doc a:hover { color: var(--rx-navy); }
.rx-legal .rx-legal-doc a:focus-visible { outline: 2px solid var(--rx-navy); outline-offset: 2px; }
.rx-legal .rx-legal-doc .rx-legal-note { margin: 18px 0; padding: 16px 20px; border-left: 3px solid var(--rx-green); border-radius: 0 10px 10px 0; background: var(--rx-green-soft); }
.rx-legal .rx-legal-section > :last-child { margin-bottom: 0; }

/* Service provider table (Privacy Policy, section 8.1). */
.rx-legal-table-wrap { margin: 22px 0; }
.rx-legal-table { width: 100%; margin: 0; border: 0; border-collapse: collapse; background: transparent; table-layout: fixed; }
.rx-legal-table thead,
.rx-legal-table tbody,
.rx-legal-table tr { background: transparent; }
.rx-legal-table th,
.rx-legal-table td {
  padding: 14px 14px 14px 0;
  border: 0;
  border-top: 1px solid var(--rx-line);
  background: transparent;
  color: var(--rx-text);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 400;
  text-align: left;
  vertical-align: top;
}
.rx-legal-table thead th {
  padding-top: 0;
  padding-bottom: 10px;
  border-top: 0;
  color: var(--rx-green-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.rx-legal-table tbody th { color: var(--rx-ink); font-weight: 700; }
@media only screen and (min-width: 1200px) {
  .rx-legal-table th:last-child,
  .rx-legal-table td:last-child { width: 28%; padding-right: 0; }
  .rx-legal-table th:nth-child(3),
  .rx-legal-table td:nth-child(3) { width: 15%; }
}
/* Below 1200px the text column is too narrow for five columns: one card per provider, values labelled. */
@media only screen and (max-width: 1199px) {
  .rx-legal-table,
  .rx-legal-table tbody,
  .rx-legal-table tr,
  .rx-legal-table th,
  .rx-legal-table td { display: block; width: auto; }
  .rx-legal-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .rx-legal-table tr { padding: 18px 20px; border: 1px solid var(--rx-line); border-radius: 14px; background: #fff; }
  .rx-legal-table tr + tr { margin-top: 14px; }
  .rx-legal-table tbody th,
  .rx-legal-table td { padding: 0; border: 0; font-size: 15px; }
  .rx-legal-table tbody th { margin-bottom: 10px; font-size: 16px; }
  .rx-legal-table td + td { margin-top: 10px; }
  .rx-legal-table td:before {
    /* Visual only: screen readers already announce the column header. The first line is the
       fallback for browsers without the alt-text syntax. */
    content: attr(data-label);
    content: attr(data-label) / "";
    display: block;
    margin-bottom: 2px;
    color: var(--rx-green-ink);
    font-size: 12px;
    line-height: 1.4;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
}
@media (forced-colors: active) {
  .rx-legal-doc ul li:before { background: CanvasText; }
}
@media print {
  .rx-legal-toc { display: none; }
  .rx-legal-layout { display: block; }
}
