/**
 * Legal pages only (privacy, terms).
 * Header/footer/nav: global.css + layout partials — do not duplicate here.
 */

.terms-hero,
.terms-body,
.terms-legal-cta {
  width: 100%;
  max-width: 100%;
}

.terms-legal-cta .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 22px;
  border-radius: 16px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 21px;
  letter-spacing: 0.28px;
  transition: transform 0.25s ease, background 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
}

.terms-legal-cta .btn-dark {
  background: var(--ink);
  color: #fff;
}

.terms-legal-cta .btn-dark:hover {
  background: #000;
  transform: translateY(-2px);
}

.terms-legal-cta .btn-outline {
  background: var(--paper);
  color: var(--accent-ink);
  border: 1px solid var(--rule-3);
  border-radius: 14px;
}

.terms-legal-cta .btn-outline:hover {
  border-color: var(--accent);
  background: var(--tint-soft);
}

/* Hero */
.terms-hero {
  padding: 48px 0 40px;
  text-align: center;
}

.terms-hero .eyebrow {
  margin-bottom: 28px;
}

.terms-hero h1 {
  font-family: var(--display);
  font-size: clamp(32px, 6vw, 78px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 auto 28px;
  max-width: 920px;
  color: var(--ink);
}

.terms-hero h1 .highlight {
  position: relative;
  display: inline-block;
  z-index: 0;
}

.terms-hero h1 .highlight::before {
  content: "";
  position: absolute;
  left: -8px;
  right: -8px;
  top: 10%;
  bottom: 6%;
  background: var(--accent);
  border-radius: 7px;
  transform: rotate(-1deg);
  z-index: -1;
}

.terms-hero h1 em {
  font-family: var(--sans);
  font-style: italic;
  font-weight: 600;
  color: var(--ink-2);
}

.terms-hero .lead {
  max-width: 663px;
  margin: 0 auto 32px;
  font-size: clamp(16px, 2.5vw, 19px);
  font-weight: 500;
  line-height: 1.6;
  color: var(--ink-2);
}

.terms-meta-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 20px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-full);
  box-shadow: var(--shadow-xs);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  max-width: 100%;
}

.terms-meta-pill .meta-dot {
  width: 4px;
  height: 4px;
  background: var(--ink-4);
  border-radius: 50%;
  flex-shrink: 0;
}

/* Layout */
.terms-body {
  padding: 32px 0 80px;
  width: 100%;
}

.terms-layout {
  display: grid;
  grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
  gap: 60px;
  align-items: start;
  width: 100%;
}

.terms-sidebar {
  position: sticky;
  top: 120px;
  min-width: 0;
}

.terms-sidebar .label {
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.98px;
  line-height: 16.5px;
  margin: 0 0 12px;
}

/* Wrapper injected by legal.js; display:contents keeps desktop layout unchanged */
.toc-scroll {
  display: contents;
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-link {
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  line-height: 21px;
  color: #666259;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.toc-link:hover {
  background: var(--tint-soft);
  color: var(--ink);
}

.toc-link.is-active,
.toc-link.is-active:hover {
  background: var(--tint);
  border-color: var(--accent);
  color: var(--ink);
}

.toc-link .num {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-4);
  flex-shrink: 0;
  min-width: 20px;
}

.toc-link.is-active .num {
  color: var(--accent-deep);
}

.terms-content {
  max-width: 720px;
  width: 100%;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.terms-content img,
.terms-content video,
.terms-content iframe {
  max-width: 100%;
  height: auto;
}

.terms-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.terms-content .wrap {
  max-width: none;
  padding: 0;
  margin: 0;
}

.legal-section {
  scroll-margin-top: 120px;
  padding-bottom: 48px;
  margin-bottom: 48px;
  border-bottom: 1.5px solid var(--rule-2);
}

.legal-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.legal-section-head {
  margin-bottom: 20px;
}

.legal-section .section-label {
  display: block;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.68px;
  line-height: 18px;
  color: var(--accent-deep);
  margin-bottom: 11px;
}

.legal-section h2 {
  font-family: var(--display);
  font-size: clamp(22px, 4vw, 29px);
  font-weight: 600;
  line-height: 1.15;
  color: #000;
  margin: 0;
}

.legal-prose {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.legal-prose p {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.58;
  color: var(--ink-2);
}

.legal-prose p strong {
  font-weight: 600;
}

.legal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legal-list li {
  position: relative;
  padding-left: 20px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.58;
  color: var(--ink-2);
}

.legal-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 11px;
  height: 11px;
  background: var(--accent);
  border-radius: 2px;
}

.legal-prose a,
.legal-list a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-prose a:hover,
.legal-list a:hover {
  color: var(--accent-deep);
}

.plain-english {
  margin-top: 16px;
  padding: 20px 20px 20px 23px;
  background: var(--tint-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 16px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 100%;
  box-sizing: border-box;
}

.plain-english .pe-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  line-height: 15px;
  color: var(--accent-deep);
}

.plain-english .pe-label::before {
  content: "";
  width: 11px;
  height: 11px;
  background: var(--accent-deep);
  border-radius: 2px;
  flex-shrink: 0;
}

.plain-english p {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.58;
  color: var(--ink-2);
}

/* Optional bottom CTA block inside CMS content */
.terms-legal-cta {
  background: var(--tint-soft);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 80px 0;
  text-align: center;
}

.terms-legal-cta h2 {
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 45px);
  font-weight: 600;
  line-height: 1.1;
  margin: 0 auto 20px;
  max-width: 807px;
  color: var(--ink);
}

.terms-legal-cta h2 em {
  font-family: var(--sans);
  font-style: italic;
  font-weight: 600;
}

.terms-legal-cta .lead {
  max-width: 663px;
  margin: 0 auto 32px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.74;
  letter-spacing: 0.4px;
  color: var(--ink-2);
  padding: 0 16px;
}

.terms-legal-cta .cta-btns {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 16px;
}

/* Tablet */
@media (max-width: 1100px) {
.terms-layout {
    grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
    gap: 40px;
  }

.terms-content {
    max-width: none;
  }
}

/* Mobile — stack sidebar TOC horizontally */
@media (max-width: 900px) {
.terms-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

.terms-sidebar {
    position: sticky;
    top: 100px;
    z-index: 5;
    background: var(--bg);
    padding-bottom: 8px;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
    overflow: visible;
  }

  .terms-sidebar .label {
    display: none;
  }

  .toc-scroll {
    display: block;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    margin: 0 calc(-1 * var(--gutter));
    padding: 0 var(--gutter) 8px;
    max-width: 100vw;
    scroll-behavior: smooth;
  }

  .toc-scroll::-webkit-scrollbar {
    display: none;
  }

  .toc-list {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
    width: max-content;
    min-width: min(100%, max-content);
    padding-right: var(--gutter);
  }

  .toc-link {
    white-space: nowrap;
    flex-shrink: 0;
  }

.toc-link.is-active {
    border: 1px solid var(--accent);
  }
}

/* Small phones */
@media (max-width: 760px) {
.terms-hero {
    padding: 32px 0 28px;
  }

.terms-hero h1 .highlight {
    white-space: normal;
  }

.terms-hero .lead {
    margin-bottom: 24px;
    padding: 0 4px;
  }

.terms-meta-pill {
    font-size: 12px;
    padding: 10px 16px;
    gap: 8px;
  }

.terms-body {
    padding-top: 16px;
    padding-bottom: 48px;
  }

.terms-sidebar {
    top: 100px;
  }

.legal-section {
    scroll-margin-top: 100px;
    padding-bottom: 32px;
    margin-bottom: 32px;
  }

.plain-english {
    padding: 16px 16px 16px 18px;
  }

.terms-legal-cta {
    padding: 48px 0;
  }

.terms-legal-cta .cta-btns {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
  }

.terms-legal-cta .cta-btns .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 380px) {
.toc-link {
    gap: 10px;
    padding: 8px 10px;
    font-size: 13px;
  }

.toc-link .num {
    min-width: 18px;
  }
}
