/* ==========================================================================
   legal.css - styling for SizeGlide's trust pages
   (privacy.html, terms.html, about.html, contact.html)

   Self-contained on purpose: the shared design system lives in site.css, which
   is loaded first on every page. Everything here either inherits the shared
   CSS variables (with safe fallbacks) or is scoped to the "lg-" prefix, so a
   change in site.css can never break these pages.

   Load order on legal pages:
     <link rel="stylesheet" href="/assets/css/site.css">
     <link rel="stylesheet" href="/assets/css/legal.css">
   ========================================================================== */

.lg-page {
  /* Tokens are taken from site.css when it defines them, so the four trust
     pages follow the shared design system automatically. Current mapping in
     site.css: --bg / --surface / --ink / --ink-2 / --line / --brand / --radius.
     The literal fallbacks only apply if site.css is missing. */
  --lg-bg: var(--bg, #ffffff);
  --lg-surface: var(--surface, #f7f8fa);
  --lg-ink: var(--ink, #101828);
  --lg-ink-2: var(--ink-2, var(--muted, #475467));
  --lg-line: var(--line, #e4e7ec);
  --lg-accent: var(--brand, var(--accent, #1d4ed8));
  --lg-radius: var(--radius, 10px);
  --lg-max: 60rem;

  margin: 0;
  background: var(--lg-bg);
  color: var(--lg-ink);
  font: 16px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

@media (prefers-color-scheme: dark) {
  .lg-page {
    --lg-bg: var(--bg, #0f1115);
    --lg-surface: var(--surface, #16181d);
    --lg-ink: var(--ink, #f2f4f7);
    --lg-ink-2: var(--ink-2, var(--muted, #98a2b3));
    --lg-line: var(--line, #262c36);
    --lg-accent: var(--brand, var(--accent, #9db4ff));
  }
}

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

/* The shell - site header, footer, container, breadcrumbs, skip link - is the
   same one index.html uses, styled by site.css. This file only styles the
   article column of the four trust pages, so the whole site looks identical. */
.lg-main {
  padding: 28px 0 72px;
}

.lg-col {
  max-width: 46rem;
  margin: 0 auto;
}

.lg-main > *:first-child { margin-top: 0; }

/* ---------- typography ---------- */

.lg-main h1 {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 8px 0 10px;
}

.lg-main h2 {
  font-size: 1.3rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 40px 0 10px;
  padding-top: 4px;
}

.lg-main h3 {
  font-size: 1.05rem;
  line-height: 1.35;
  margin: 26px 0 8px;
}

.lg-main p,
.lg-main li { color: var(--lg-ink); }

.lg-main ul,
.lg-main ol { padding-left: 1.35em; margin: 0 0 16px; }
.lg-main li { margin: 0 0 8px; }
.lg-main li > ul,
.lg-main li > ol { margin-top: 8px; }

.lg-main a {
  color: var(--lg-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lg-main strong { font-weight: 650; }

/* `.lg-main p` below is more specific than a bare class, so every muted-text
   rule here is scoped under .lg-main to win against it. */
.lg-main .lg-meta {
  font-size: 14px;
  color: var(--lg-ink-2);
  margin: 0 0 4px;
}

.lg-main .lg-lede {
  font-size: 1.06rem;
  color: var(--lg-ink-2);
  margin: 0 0 8px;
}

/* ---------- boxes ---------- */

.lg-card {
  background: var(--lg-surface);
  border: 1px solid var(--lg-line);
  border-radius: var(--lg-radius);
  padding: 18px 20px;
  margin: 24px 0;
}

.lg-card > *:first-child { margin-top: 0; }
.lg-card > *:last-child { margin-bottom: 0; }

.lg-card h2,
.lg-card h3 { margin-top: 0; padding-top: 0; }

.lg-tldr {
  border-left: 4px solid var(--lg-accent);
}

.lg-tldr ul { margin-bottom: 0; }

.lg-main .lg-note {
  font-size: 0.95rem;
  color: var(--lg-ink-2);
  border-left: 3px solid var(--lg-line);
  padding: 2px 0 2px 14px;
  margin: 20px 0;
}

.lg-toc {
  font-size: 15px;
}

.lg-toc ol {
  columns: 2;
  column-gap: 32px;
  margin: 8px 0 0;
  padding-left: 1.2em;
}

.lg-toc li { margin-bottom: 6px; break-inside: avoid; }

@media (max-width: 560px) {
  .lg-toc ol { columns: 1; }
}

/* ---------- tables ---------- */

.lg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  margin: 18px 0;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.lg-table thead th {
  text-align: left;
  font-weight: 650;
  background: var(--lg-surface);
  border-bottom: 1px solid var(--lg-line);
  padding: 10px 12px;
  white-space: nowrap;
}

.lg-table td {
  border-bottom: 1px solid var(--lg-line);
  padding: 10px 12px;
  vertical-align: top;
}

.lg-table tbody tr:last-child td { border-bottom: 0; }

.lg-table code {
  font-size: 0.92em;
  word-break: break-word;
  background: var(--lg-surface);
  border: 1px solid var(--lg-line);
  border-radius: 4px;
  padding: 1px 5px;
}

/* ---------- buttons ---------- */

.lg-btn {
  display: inline-block;
  appearance: none;
  border: 1px solid var(--lg-ink);
  background: var(--lg-ink);
  color: var(--lg-bg);
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
  border-radius: 8px;
  padding: 10px 16px;
  min-height: 44px;
  cursor: pointer;
  text-decoration: none;
}

.lg-btn:hover { opacity: 0.9; }

.lg-btn--ghost {
  background: transparent;
  color: var(--lg-ink);
  border-color: var(--lg-line);
}

/* ---------- steps / definition lists ---------- */

.lg-steps {
  counter-reset: lg-step;
  list-style: none;
  padding-left: 0;
}

.lg-steps li {
  counter-increment: lg-step;
  position: relative;
  padding-left: 40px;
  margin-bottom: 16px;
}

.lg-steps li::before {
  content: counter(lg-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--lg-line);
  background: var(--lg-surface);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--lg-ink-2);
}

/* ---------- contact bits ---------- */

.lg-main a.lg-email {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 650;
  padding: 10px 14px;
  border: 1px solid var(--lg-line);
  border-radius: 8px;
  background: var(--lg-surface);
  text-decoration: none;
  word-break: break-all;
}

.lg-kv {
  display: grid;
  grid-template-columns: minmax(9rem, 12rem) 1fr;
  gap: 8px 20px;
  margin: 16px 0;
}

.lg-kv dt { font-weight: 650; }
.lg-kv dd { margin: 0; color: var(--lg-ink-2); }

@media (max-width: 560px) {
  .lg-kv { grid-template-columns: 1fr; gap: 2px 0; }
  .lg-kv dd { margin-bottom: 10px; }
}

/* ---------- a11y ---------- */

.lg-page a:focus-visible,
.lg-page button:focus-visible {
  outline: 3px solid var(--lg-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .lg-page * { scroll-behavior: auto !important; }
}

/* Header parity on small screens: the shared header does not wrap, and these
   four pages carry three nav links where index.html carries two, so the spacing
   is tightened before it can overflow at 360-375px. Scoped to .lg-page, so the
   homepage and tool pages are unaffected. */
@media (max-width: 620px) {
  .lg-page .site-header__inner { gap: 6px; }
  .lg-page .site-nav { gap: 0; }
  .lg-page .site-nav a { padding: 6px 7px; font-size: 0.86rem; }
}
