/*
 * Privacy Notice and Terms of Use (page-legal.php), 2026 redesign, uniform
 * with the Contact page: the hero layout comes from newsletters.css
 * (.nlx-hero); this file styles the "At a glance" card, the sticky
 * "Contents" card and the text (block-editor content), plus the Board's
 * review notes. Body class legal-page.
 */

.lg-hero :focus-visible,
.lg-content :focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  box-shadow: none;
}

.lg-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Every page's hero button size: 54px, 48px on phones (site-wide uniformity review, 2026-10-29). */
.lg-hero-actions .pill-button {
  height: var(--ds-button-lg);
}

.lg-hero-actions svg {
  width: 16px;
  height: 16px;
}

/* "At a glance": icon rows in the frosted card (the design of the Contact page's former "Reach us directly" card). */
.lg-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 520px;
  padding: 28px;
  font-family: var(--font-ui);
}

.lg-card .glass-card-label {
  padding-bottom: 8px;
}

.lg-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 14px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, .7);
  color: var(--ink-strong);
}

a.lg-row {
  transition: background-color .15s ease, box-shadow .15s ease;
}

a.lg-row:hover {
  background: #fff;
  box-shadow: var(--shadow-card);
  color: var(--ink-strong);
}

.lg-row-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: var(--ds-icon-sm);
  height: var(--ds-icon-sm);
  border-radius: var(--radius-round);
  background: var(--purple);
  color: #fff;
}

.lg-row-icon.is-orange { background: var(--join); color: var(--night-deep); }
.lg-row-icon.is-cyan { background: var(--highlight); color: var(--night-deep); }

.lg-row-icon svg {
  width: 20px;
  height: 20px;
}

.lg-row-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.lg-row-text small {
  color: var(--muted-strong);
  font-size: var(--text-ui-2xs);
  font-weight: 600;
}

.lg-row-text b {
  font-size: var(--text-ui-md);
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* Text + Contents ------------------------------------------------------------- */
.lg-content {
  padding: 96px 0;
  background: #fff;
  color: var(--ink-strong);
  font-family: var(--font-ui);
}

.lg-layout {
  width: min(var(--max-wide), calc(100% - 42px));
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  align-items: start;
  gap: 72px;
}

.lg-layout.is-single {
  grid-template-columns: minmax(0, 860px);
}

/* Contents: a white card that stays in view below the bar. */
.lg-toc {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  max-height: calc(100vh - var(--header-height) - 48px);
  overflow-y: auto;
  padding: 24px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xl);
  background: #fff;
  box-shadow: var(--shadow-card);
}

.lg-toc h2 {
  margin: 0 0 14px;
  color: var(--purple);
  font-family: var(--font-ui);
  font-size: var(--text-ui-2xs);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.lg-toc ol {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: lg-toc;
}

.lg-toc li {
  counter-increment: lg-toc;
}

.lg-toc a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-ui);
  color: var(--ink-strong);
  font-size: var(--text-ui-sm);
  font-weight: 600;
  line-height: 1.4;
  transition: background-color .15s ease, color .15s ease;
}

.lg-toc a::before {
  content: counter(lg-toc, decimal-leading-zero);
  flex-shrink: 0;
  color: var(--purple);
  font-family: var(--font-display);
  font-size: var(--text-ui-2xs);
  font-weight: 700;
}

.lg-toc a:hover {
  background: var(--purple-wash-hover);
  color: var(--purple);
}

/* The section being read (legal.js): soft purple with the orange marker, as in the menus. */
.lg-toc a.is-current {
  background: var(--purple-wash);
  box-shadow: inset 3px 0 0 var(--join);
  color: var(--purple);
  font-weight: 700;
}

/* The text (block-editor content: headings, paragraphs, lists). */
.legal-copy {
  max-width: 860px;
  min-width: 0;
}

.legal-copy > h2 {
  margin: 0 0 14px;
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: var(--text-ui-panel);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
  scroll-margin-top: calc(var(--header-height) + 24px);
}

.legal-copy > h2:not(:first-child) {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--line-soft);
}

.legal-copy h3 {
  margin: 26px 0 10px;
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: var(--text-ui-step);
  font-weight: 700;
  line-height: 1.3;
}

.legal-copy p,
.legal-copy li {
  color: var(--muted-ui);
  font-size: var(--text-ui-md);
  line-height: 1.7;
}

.legal-copy p {
  margin: 0 0 14px;
}

.legal-copy strong {
  color: var(--ink-strong);
}

.legal-copy ul,
.legal-copy ol {
  margin: 0 0 14px;
  padding-left: 22px;
}

.legal-copy li + li {
  margin-top: 8px;
}

.legal-copy li::marker {
  color: var(--purple);
}

.legal-copy a {
  color: var(--purple);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Board review notes (editors only; removed for visitors in page-legal.php). */
.legal-copy .legal-note {
  margin: 12px 0 14px;
  padding: 15px 17px;
  border-left: 4px solid var(--orange);
  border-radius: 0 var(--radius-ui) var(--radius-ui) 0;
  background: var(--orange-tint);
  color: var(--ink-strong);
  font-size: var(--text-ui);
}

.legal-review {
  margin: 0 0 28px;
  padding: 14px 16px;
  border-radius: var(--radius-ui);
  background: var(--orange-tint);
  color: var(--ink-strong);
  font-size: var(--text-ui);
}

/* Responsive ------------------------------------------------------------------ */
@media (max-width: 1000px) {
  .lg-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .lg-toc {
    position: static;
    max-height: none;
  }
}

@media (max-width: 767px) {
  .lg-hero-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    width: 100%;
  }

  .lg-hero-actions .pill-button {
    justify-content: center;
    height: var(--ds-button-md);
  }

  .lg-card {
    padding: 20px;
  }

  .lg-row {
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-ui);
  }

  .lg-row-icon {
    width: 38px;
    height: 38px;
  }

  .lg-row-icon svg {
    width: 18px;
    height: 18px;
  }

  .lg-row-text b {
    font-size: var(--text-ui);
  }

  .lg-content {
    padding: 40px 0 44px;
  }

  .lg-toc {
    padding: 18px;
  }

  .legal-copy > h2 {
    font-size: var(--text-ui-step);
  }

  .legal-copy > h2:not(:first-child) {
    margin-top: 32px;
    padding-top: 28px;
  }

  .legal-copy h3 {
    font-size: var(--text-ui-lg);
  }

  .legal-copy p,
  .legal-copy li {
    font-size: var(--text-ui);
    line-height: 1.65;
  }
}
