/*
 * /legal/ — terms and conditions.
 *
 * Loads after webdev-base.css, which carries the subhero, the section shell
 * and the CTA band. Everything here is the reading layout: a sticky contents
 * list beside a column of long legal documents.
 *
 * The documents are long (the Managed Hosting terms alone run past 9,000
 * words), so the job of this sheet is readability: a comfortable measure,
 * quiet body text, clear document edges, and a contents list that stays in
 * reach.
 */

/* ---------- layout ---------- */

.wd-legal__layout {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 992px) {
  .wd-legal__layout {
    align-items: start;
    grid-template-columns: 260px minmax(0, 1fr);
  }
}

/* ---------- contents ---------- */

.wd-legal__toc {
  background: var(--wd-white);
  border: 1px solid var(--wd-grey-200);
  border-radius: var(--wd-radius-lg);
  padding: 1.25rem;
}

@media (min-width: 992px) {
  .wd-legal__toc {
    position: sticky;
    top: clamp(5rem, 10vw, 7rem);
  }
}

.wd-legal__tochead {
  color: var(--wd-grey-500);
  font-family: var(--wd-font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 0.75rem;
  text-transform: uppercase;
}

.wd-legal__toc ol {
  counter-reset: wd-legal;
  list-style: none;
  margin: 0;
  padding: 0;
}

.wd-legal__toc li {
  counter-increment: wd-legal;
  margin: 0;
}

.wd-legal__toc a {
  border-radius: var(--wd-radius-sm);
  color: var(--wd-charcoal-900);
  display: flex;
  font-family: var(--wd-font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  gap: 0.625rem;
  line-height: 1.35;
  padding: 0.5rem 0.625rem;
  text-decoration: none;
  transition: background-color var(--wd-duration), color var(--wd-duration);
}

.wd-legal__toc a::before {
  color: var(--wd-grey-500);
  content: counter(wd-legal, decimal-leading-zero);
  font-size: 0.75rem;
  font-weight: 700;
  padding-top: 0.15rem;
}

.wd-legal__toc a:hover,
.wd-legal__toc a:focus-visible {
  background: var(--wd-orange-050);
  color: var(--wd-orange-700);
}

.wd-legal__toc a:focus-visible {
  box-shadow: var(--wd-focus);
  outline: none;
}

.wd-legal__toc a[aria-current="true"] {
  background: var(--wd-orange-050);
  color: var(--wd-orange-700);
}

.wd-legal__toc a[aria-current="true"]::before {
  color: var(--wd-orange-600);
}

/* ---------- documents ---------- */

.wd-legaldoc {
  background: var(--wd-white);
  border: 1px solid var(--wd-grey-200);
  border-radius: var(--wd-radius-lg);
  margin: 0 0 clamp(1.25rem, 2.5vw, 2rem);
  padding: clamp(1.25rem, 3.5vw, 2.5rem);
  /* Anchor jumps from the contents must clear the sticky header. */
  scroll-margin-top: clamp(5rem, 12vw, 8rem);
}

.wd-legaldoc:last-child {
  margin-bottom: 0;
}

.wd-legaldoc > h2 {
  border-bottom: 1px solid var(--wd-grey-100);
  color: var(--wd-charcoal-950);
  font-family: var(--wd-font-sans);
  font-size: clamp(1.375rem, 2.4vw, 1.75rem);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 1.25rem;
  padding-bottom: 1rem;
}

/* Body copy: the legal text itself. Quiet, generous, a readable measure. */
.wd-legaldoc__body {
  color: var(--wd-slate-600);
  font-family: var(--wd-font-sans);
  font-size: 0.9375rem;
  line-height: 1.75;
  max-width: 78ch;
  overflow-wrap: anywhere;
}

.wd-legaldoc__body p {
  color: inherit;
  font-size: inherit;
  line-height: inherit;
  margin: 0 0 0.875rem;
}

.wd-legaldoc__body ul,
.wd-legaldoc__body ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.wd-legaldoc__body ul {
  list-style: disc;
}

.wd-legaldoc__body ol {
  list-style: decimal;
}

/* The source nests a clause's paragraphs inside list items; keep them tight. */
.wd-legaldoc__body li {
  color: inherit;
  margin: 0 0 0.375rem;
}

.wd-legaldoc__body li > p {
  margin-bottom: 0.375rem;
}

.wd-legaldoc__body b,
.wd-legaldoc__body strong {
  color: var(--wd-charcoal-900);
  font-weight: 600;
}

.wd-legaldoc__body a {
  color: var(--wd-orange-700);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.wd-legaldoc__body a:hover {
  color: var(--wd-orange-600);
}

.wd-legaldoc__top {
  border-top: 1px solid var(--wd-grey-100);
  font-family: var(--wd-font-sans);
  font-size: 0.875rem;
  margin: 1.5rem 0 0;
  padding-top: 1rem;
}

.wd-legaldoc__top a {
  color: var(--wd-grey-500);
  font-weight: 600;
  text-decoration: none;
}

.wd-legaldoc__top a:hover {
  color: var(--wd-orange-700);
}

/* Small screens: the contents becomes a compact two-column jump list. */
@media (max-width: 991.98px) {
  .wd-legal__toc ol {
    display: grid;
    gap: 0.25rem;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr));
  }
}
