/* ==========================================================================
   Legal pages (Privacy Policy, Terms of Use)
   The About-Us banner with a row of facts, then the document: numbered section
   cards with a contents list beside them that stays in view while reading.
   Laid out in flow so the document can be any length. Desktop 1440 canvas,
   mobile 402 canvas.
   ========================================================================== */

/* clip rather than hidden: it still trims the wide banner artwork but, unlike hidden,
   does not make the page a scroll box, so the contents list can stick while reading */
.page--legal { height: auto; overflow: clip; background: #f5f5f5; }
.page--legal > section { position: relative; width: 1440px; }

/* Banner (About Us pattern): heading and description centred against each other */
.banner { min-height: 420px; padding: 144px 112px 56px 76px; display: grid; align-content: start; align-items: center; grid-template-columns: 640px 493px; column-gap: 119px; overflow: hidden; background: var(--navy); color: var(--white); }
.banner__lines { position: absolute; width: 720px; height: 1616px; pointer-events: none; }
.banner__lines--r { left: 720px; top: -564px; }
.banner__lines--l { left: 0; top: -604px; }
.banner__title { position: relative; font-size: 56px; line-height: 1; font-weight: 500; overflow-wrap: anywhere; }   /* as typed: "Terms of Use" */
.banner__sub { position: relative; font-size: 24px; line-height: 28px; color: var(--steel); overflow-wrap: anywhere; }
.banner__facts { position: relative; grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px 40px; margin: 48px 0 0; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.14); }
.banner__facts div { display: grid; gap: 2px; }
.banner__facts dt { font-size: 11.5px; line-height: 16px; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.5); }
.banner__facts dd { margin: 0; font-size: 15px; line-height: 20px; font-weight: 600; overflow-wrap: anywhere; }

/* Document */
.legal { isolation: isolate; padding: 72px 76px 120px; color: var(--black); overflow-wrap: anywhere; }
.legal__layout--with-contents { display: grid; grid-template-columns: 250px minmax(0, 1fr); column-gap: 64px; align-items: start; }
.legal__doc { display: grid; gap: 14px; min-width: 0; }

/* Contents: numbered links that stay in view beside the document */
.legal-contents { position: sticky; top: 96px; padding: 24px 14px; border-radius: 28px; background: var(--white); box-shadow: 0 8px 16px rgba(0,0,0,.04); }   /* a card, like the sections, held just below the 72px sticky navigation */
.legal-contents__toggle { display: none; }
.legal-contents__title { margin-bottom: 12px; padding: 0 12px; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: rgba(0,0,0,.48); }
.legal-contents__list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }   /* numbered by the spans, not the list */
.legal-contents__list a {
  display: flex; align-items: baseline; gap: 12px; padding: 7px 12px; border-radius: 12px;
  font-size: 14px; line-height: 1.35; color: rgba(0,0,0,.68);
  transition: background-color var(--dur, 220ms) var(--ease, ease), color var(--dur, 220ms) var(--ease, ease);
}
.legal-contents__list a span { min-width: 18px; font-size: 11.5px; font-weight: 600; color: var(--blue); font-variant-numeric: tabular-nums; }
.legal-contents__list a:hover { background: #f5f5f5; color: var(--black); }
.legal-contents__list a.is-current { background: rgba(23,123,235,.08); color: var(--black); }
.legal-contents__list a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Numbered section cards */
.legal__intro { font-size: 18px; line-height: 28px; margin-bottom: 10px; }
.legal__section { padding: 40px; border-radius: 28px; background: var(--white); box-shadow: 0 8px 16px rgba(0,0,0,.04); scroll-margin-top: 24px; }
.legal__section h2 { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; font-size: 24px; line-height: 32px; font-weight: 600; }
.legal__number { flex: none; position: relative; top: -2px; padding: 4px 10px; border-radius: 100px; background: rgba(23,123,235,.1); font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .08em; color: var(--blue); font-variant-numeric: tabular-nums; }
.legal__section h3 { font-size: 20px; line-height: 28px; font-weight: 600; margin: 24px 0 8px; }

/* Rich text inside the cards and the introduction */
.legal__copy { color: rgba(0,0,0,.72); }
.legal__copy p, .legal__copy li { max-width: 68ch; }
.legal__section p { font-size: 17px; line-height: 28px; margin-bottom: 12px; }
.legal__section ul, .legal__section ol { margin: 0 0 12px; font-size: 17px; line-height: 28px; }
.legal__copy strong { font-weight: 600; color: var(--black); }
.legal__copy ul { display: grid; gap: 8px; padding: 0; list-style: none; }
.legal__copy ul > li { position: relative; padding-left: 20px; }
.legal__copy ul > li::before { content: ""; position: absolute; left: 2px; top: .72em; width: 6px; height: 6px; border-radius: 2px; background: var(--blue); transform: rotate(45deg); }
.legal__copy ol { list-style: decimal; padding-left: 21px; }
.legal__copy li p, .legal__copy li ul, .legal__copy li ol { margin-bottom: 0; }
.legal__copy > :last-child { margin-bottom: 0; }
.legal__copy a { color: var(--blue); text-decoration: underline; text-underline-position: from-font; }
.legal__intro p + p, .legal__meta p + p { margin-top: 16px; }
.legal__meta { margin-top: 18px; text-align: center; font-size: 13px; line-height: 20px; color: rgba(0,0,0,.48); }

/* The "Contact details card" merge tag (spans, so it is valid inside the editor's paragraph) */
.legal__copy p:has(> .legal-contact) { max-width: none; }
.legal-contact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; margin-top: 6px; padding: 22px 24px; border-radius: 20px; background: #f5f5f5; color: var(--black); }
.legal-contact__company { grid-column: 1 / -1; font-size: 17px; font-weight: 600; }
.legal-contact__item { display: block; font-size: 16px; line-height: 24px; overflow-wrap: anywhere; }
.legal-contact__label { display: block; font-size: 11.5px; line-height: 16px; letter-spacing: .18em; text-transform: uppercase; color: rgba(0,0,0,.48); }
.legal-contact a { color: inherit; text-decoration: none; }
.legal-contact a:hover { color: var(--blue); }

/* Footer in flow */
.page--legal .footer { position: relative; bottom: auto; height: 658px; }
.page--legal .footer-m { position: relative; left: auto; bottom: auto; margin: 0 auto; }
.footer-spacer { height: 98px; }

/* ==========================================================================
   Mobile
   ========================================================================== */
@media (max-width: 899px) {
  .page--legal > section { width: 402px; }
  .banner { min-height: 308px; padding: 132px 32px 40px; grid-template-columns: minmax(0, 1fr); gap: 36px; }
  /* The lines keep their desktop size so the spacing matches; the banner clips the overflow. */
  .banner__lines--r { left: 50%; }
  .banner__lines--l { left: calc(50% - 720px); }
  .banner__tagline { position: absolute; left: 0; top: 68px; width: 100%; font-size: 12px; line-height: 16px; text-align: center; text-transform: capitalize; white-space: nowrap; }
  .banner__title { font-size: 24px; }
  .banner__sub { font-size: 14px; line-height: 18px; }
  .banner__facts { gap: 12px 24px; margin-top: 0; padding-top: 16px; }
  .banner__facts dt { font-size: 10px; line-height: 14px; }
  .banner__facts dd { font-size: 13px; line-height: 18px; }

  .legal { padding: 32px 24px 72px; }
  .legal__layout--with-contents { grid-template-columns: minmax(0, 1fr); row-gap: 14px; }

  /* Contents fold into a button; html.is-mobile (set by scale.js) means the script is there to open it */
  .legal-contents { position: static; padding: 6px 8px; border-radius: 24px; }
  .legal-contents__title { display: none; }
  .legal-contents__toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 12px; font-size: 16px; line-height: 20px; font-weight: 600; color: var(--black); }
  .legal-contents__toggle::after { content: "+"; font-size: 20px; font-weight: 400; color: var(--blue); }
  .legal-contents__toggle[aria-expanded="true"]::after { content: "\2212"; }
  .is-mobile .legal-contents:not(.is-open) .legal-contents__list { display: none; }
  .legal-contents__list { padding-bottom: 6px; }

  .legal__section { padding: 24px 20px; border-radius: 24px; }
  .legal__section h2 { gap: 10px; margin-bottom: 10px; font-size: 20px; line-height: 26px; }
  .legal__number { top: -1px; padding: 3px 8px; font-size: 11px; }
  .legal__section h3 { font-size: 16px; line-height: 20px; margin: 16px 0 6px; }
  .legal__intro { font-size: 15px; line-height: 24px; }
  .legal__section p, .legal__section ul, .legal__section ol { font-size: 15px; line-height: 24px; margin-bottom: 10px; }
  .legal__copy ul > li { padding-left: 17px; }
  .legal__copy ol { padding-left: 17px; }
  .legal-contact { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 18px 20px; }
  .legal-contact__item { font-size: 15px; line-height: 22px; }
  .legal__meta { margin-top: 14px; font-size: 12px; line-height: 16px; }
  .footer-spacer { height: 56px; }
}
