/* Legal documents (app/templates/legal.php): a contents list beside one reading column. Phones first. */
/* The site-wide `overflow-x: hidden` makes the body a scroll box, which stops the contents list from sticking. */
body:has(.lg) {
  overflow-x: clip;
}
.lg {
  --lg-header: calc(3rem + 2 * clamp(0.75rem, 2vw, 1.5rem)); /* height of the fixed header */
  --lg-ink: var(--primary);
  --lg-text: #3f4258;
  --lg-muted: #5f6578;
  --lg-link: #0063a6;
  --lg-line: #dfe5ee;
  --lg-tint: #f5f7fa;
  position: relative;
  z-index: 1;
  padding: clamp(1.75rem, 4vw, 2.5rem) 1rem clamp(1.5rem, 4vw, 3rem);
  background-color: #fff;
}
html.dark-mode .lg {
  --lg-ink: #fafbfc;
  --lg-text: #d9dfe8;
  --lg-muted: #a9b4c4;
  --lg-link: var(--primaryLight);
  --lg-line: rgba(160, 200, 240, 0.18);
  --lg-tint: rgba(255, 255, 255, 0.05);
  background-color: var(--dark);
}
.lg-top,
.lg-layout {
  max-width: 49rem; /* the reading column: about 780px */
  margin: 0 auto;
}
.lg .cs-breadcrumbs {
  margin: 0 0 2rem;
}
.lg .cs-breadcrumbs ol {
  margin: 0;
}
.lg .cs-breadcrumbs li,
.lg .cs-breadcrumbs a {
  font-size: 0.8125rem;
  color: var(--lg-muted);
}

/* ------------------------------------------------------------------ text */
.lg p,
.lg-body li {
  margin: 0 0 1.125rem;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--lg-text);
  overflow-wrap: break-word;
}
.lg-body ul,
.lg-body ol {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
}
.lg-body li {
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}
.lg-body ul li {
  list-style: disc;
}
.lg-body li::marker {
  color: var(--secondary);
}
.lg strong {
  font-weight: 700;
  color: var(--lg-ink);
}
.lg-body a,
.lg-intro a {
  font-size: inherit;
  line-height: inherit;
  color: var(--lg-link);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.lg a:focus-visible,
.lg summary:focus-visible {
  outline: 3px solid var(--primaryLight);
  outline-offset: 3px;
}

/* ------------------------------------------------------------------ introduction */
.lg .lg-intro__title {
  margin: 0 0 1.25rem;
  font-size: clamp(1.875rem, 4.2vw, 2.75rem);
  line-height: 1.15;
  text-transform: uppercase;
  text-align: left;
  color: var(--lg-ink);
}
.lg .lg-intro__title::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 3px;
  margin-top: 1rem;
  background-color: var(--primaryLight);
}
.lg-intro p {
  font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
}
.lg p.lg-draft {
  padding: 0.875rem 1.125rem;
  border: 1px solid var(--lg-line);
  border-radius: 0.625rem;
  background-color: var(--lg-tint);
  font-size: 0.9375rem;
  line-height: 1.6;
}
.lg p.lg-date {
  margin-bottom: 0;
  font-size: 0.875rem;
  color: var(--lg-muted);
}

/* ------------------------------------------------------------------ sections */
.lg-body {
  min-width: 0;
}
.lg-body h2 {
  margin: 2.5rem 0 1.125rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--lg-line);
  font-size: clamp(1.5rem, 2.6vw, 1.875rem);
  line-height: 1.25;
  text-align: left;
  color: var(--lg-ink);
  scroll-margin-top: calc(var(--lg-header) + 1.5rem);
}
.lg-body h3 {
  margin: 1.75rem 0 0.625rem;
  font-size: 1.1875rem;
  line-height: 1.35;
  text-align: left;
  color: var(--lg-ink);
  scroll-margin-top: calc(var(--lg-header) + 1.5rem);
}
.lg-body h2:focus,
.lg-body h3:focus {
  outline: none; /* focus is moved here only so that keyboard users carry on from the chosen section */
}
.lg-body > :last-child {
  margin-bottom: 0;
}
/* Notes: points still to be confirmed. */
.lg-body blockquote {
  margin: 1.25rem 0 1.5rem;
  padding: 0.875rem 1.125rem;
  border-left: 3px solid var(--primaryLight);
  border-radius: 0 0.5rem 0.5rem 0;
  background-color: var(--lg-tint);
}
.lg-body blockquote p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.65;
}

/* ------------------------------------------------------------------ contents */
.lg-toc {
  margin: 2rem 0 0;
}
.lg-toc__panel {
  border: 1px solid var(--lg-line);
  border-radius: 0.75rem;
  background-color: var(--lg-tint);
}
.lg-toc__summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 3.25rem;
  padding: 0 1.125rem;
  list-style: none;
  cursor: pointer;
}
.lg-toc__summary::-webkit-details-marker {
  display: none;
}
.lg-toc__summary span {
  font-family: var(--headerFont);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lg-ink);
}
.lg-toc__summary::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border: solid var(--lg-link);
  border-width: 0 2px 2px 0;
  transform: translateY(-2px) rotate(45deg);
}
.lg-toc__panel[open] .lg-toc__summary::after {
  transform: translateY(2px) rotate(225deg);
}
.lg .lg-toc__list {
  margin: 0;
  padding: 0 1.125rem 0.75rem;
  list-style: none;
}
.lg .lg-toc__list li {
  margin: 0;
  list-style: none;
}
.lg .lg-toc__list a {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.25rem 0;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--lg-muted);
  text-decoration: none;
}
.lg .lg-toc__list a:hover {
  color: var(--lg-ink);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.lg .lg-toc__list a[aria-current] {
  font-weight: 600;
  color: var(--lg-ink);
}

@media only screen and (min-width: 64rem) {
  .lg {
    --lg-header: 6rem;
    padding-right: 1.5rem;
    padding-left: 1.5rem;
  }
  .lg-top,
  .lg-layout {
    max-width: 66rem;
  }
  .lg-layout {
    display: grid;
    grid-template-columns: 14rem minmax(0, 49rem);
    grid-template-rows: auto 1fr;
    column-gap: 3rem;
  }
  .lg-intro,
  .lg-body {
    grid-column: 2;
  }
  .lg-toc {
    grid-column: 1;
    grid-row: 1 / span 2;
    position: sticky;
    top: calc(var(--lg-header) + 2rem);
    align-self: start;
    margin: 0;
  }
  .lg-toc__panel {
    border: 0;
    border-radius: 0;
    background: none;
  }
  .lg-toc__summary {
    min-height: 0;
    padding: 0 0 0.875rem;
    cursor: default;
  }
  .lg-toc__summary::after {
    content: none;
  }
  .lg .lg-toc__list {
    position: relative;
    max-height: calc(100vh - var(--lg-header) - 7rem);
    overflow-y: auto;
    padding: 0;
    border-left: 1px solid var(--lg-line);
  }
  .lg .lg-toc__list a {
    min-height: 2rem; /* compact: the whole list fits beside the text */
    margin-left: -1px;
    padding: 0.25rem 0.25rem 0.25rem 1rem;
    border-left: 2px solid transparent;
    font-size: 0.8125rem;
  }
  .lg .lg-toc__list a:focus-visible {
    outline-offset: -3px;
  }
  .lg .lg-toc__list a[aria-current] {
    border-left-color: var(--primaryLight);
  }
}
