/* ============================================================
   SINAUMESYNC — Legal pages (Privacy Policy / Terms of Service)
   Loaded after main.css + home.css. Uses shared design tokens.
   ============================================================ */

/* ——— Breadcrumb ———————————————————————————————————————— */
.legal-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 14px;
}

.legal-breadcrumb a { color: var(--muted); transition: color var(--t); }
.legal-breadcrumb a:hover { color: var(--primary); }
.legal-breadcrumb-sep { color: var(--subtle); }
.legal-breadcrumb [aria-current="page"] { color: var(--text); }

/* ——— Hero (compact — ~40% shorter than a standard section-sm) ——— */
.legal-hero {
  padding: 32px 0 18px;
  border-bottom: 1px solid var(--border);
}

.legal-hero h1 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 800;
  letter-spacing: -.4px;
  line-height: 1.2;
  margin-bottom: 6px;
}

.legal-hero .legal-updated {
  color: var(--muted);
  font-size: .85rem;
}

/* ——— Layout ————————————————————————————————————————————— */
.legal-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 56px;
  padding: 40px 0 88px;
  align-items: start;
}

/* ——— Table of contents (desktop: sticky sidebar) —————————— */
.legal-toc {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 18px;
}

.legal-toc-title {
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
  text-align: left;
  cursor: default;
}

#legalTocList {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.legal-toc a {
  display: block;
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.4;
  padding: 4px 0;
  border-left: 2px solid transparent;
  padding-left: 10px;
  margin-left: -10px;
  transition: color var(--t), border-color var(--t);
}

.legal-toc a:hover { color: var(--text); border-color: var(--border-hover); }

/* ——— Reading body ——————————————————————————————————————— */
.legal-body {
  max-width: 720px;
  min-width: 0;
}

.legal-body > p.legal-intro {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.75;
  margin-bottom: 8px;
}

.legal-section {
  padding: 36px 0;
  border-bottom: 1px solid var(--border);
}

.legal-section:first-of-type { padding-top: 32px; }
.legal-section:last-child { border-bottom: none; padding-bottom: 0; }

.legal-section h2 {
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -.2px;
  margin-bottom: 18px;
  scroll-margin-top: calc(var(--nav-h) + 16px);
}

.legal-section p {
  margin-bottom: 16px;
  color: var(--text);
  line-height: 1.75;
}
.legal-section p:last-child { margin-bottom: 0; }

.legal-section ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 16px;
  padding-left: 4px;
}

.legal-section ul li {
  position: relative;
  padding-left: 20px;
  color: var(--text);
  line-height: 1.7;
}

.legal-section ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: var(--r-full);
  background: var(--primary);
}

.legal-section a { color: var(--primary); text-decoration: underline; text-decoration-color: rgba(233,123,44,.4); }
.legal-section a:hover { text-decoration-color: var(--primary); }

.legal-callout {
  background: var(--primary-dim);
  border: 1px solid rgba(233,123,44,.25);
  border-radius: var(--r-md);
  padding: 18px 20px;
  margin-bottom: 16px;
}

.legal-callout p { margin: 0; color: var(--text); font-size: .94rem; line-height: 1.7; }
.legal-callout strong { color: var(--primary); }

.legal-contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-top: 8px;
  margin-bottom: 16px;
}

.legal-contact-card p { margin-bottom: 4px; }
.legal-contact-card p:last-child { margin-bottom: 0; }
.legal-contact-card a { font-weight: 600; }

/* ——— Mobile: collapsible accordion TOC ————————————————— */
@media (max-width: 900px) {
  .legal-layout { grid-template-columns: 1fr; gap: 28px; }

  .legal-toc {
    position: static;
    padding: 16px 18px;
  }

  .legal-toc-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
    cursor: pointer;
  }

  .legal-toc-title::after {
    content: "\25BE";
    font-size: .9rem;
    color: var(--muted);
    transition: transform var(--t);
  }

  .legal-toc-title[aria-expanded="true"] { margin-bottom: 12px; }
  .legal-toc-title[aria-expanded="true"]::after { transform: rotate(180deg); }

  #legalTocList { display: none; }
  .legal-toc-title[aria-expanded="true"] + #legalTocList { display: flex; }
}

@media (max-width: 640px) {
  .legal-hero { padding: 26px 0 16px; }
  .legal-section { padding: 28px 0; }
}
