/* ============================================================
   Sino Peak Resources — Shared Legal Stylesheet
   Loaded by privacy.html and terms-of-service.html only.
   Theme: WARM-GOLD accent #D9A441 on LIGHT cream #F7F5F1
   ============================================================ */

.legal-page {
  background-color: #F7F5F1;
  color: #1A1A1A;
}

:root {
  --bg: #F7F5F1;
  --surface: #FFFFFF;
  --surface-alt: #EFE9DD;
  --surface-gold: #F1E3C3;
  --text: #1A1A1A;
  --text-soft: #4E463B;
  --muted: #6B6155;
  --accent: #D9A441;
  --accent-dark: #B8863B;
  --brown: #2A2115;
  --gold-deep: #8A6A1F;
  --line: #E4DCCB;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-size: 16px;
  font-family: var(--font-sans);
  line-height: 1.75;
  color: var(--text);
  background-color: var(--bg);
  overflow-x: hidden;
}

a {
  color: var(--gold-deep);
  text-decoration: none;
}

a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Legal header (a <header>, never a <section>) ---------- */
.legal-header {
  background: linear-gradient(135deg, #2A2115 0%, #43361F 55%, #5C440F 100%);
  border-bottom: 3px solid var(--accent);
  color: #FFFFFF;
  padding: 72px 0 56px;
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 36px;
}

.legal-brand:hover {
  color: var(--accent);
  text-decoration: none;
}

.legal-brand .badge {
  position: relative;
  width: 40px;
  height: 30px;
  display: inline-block;
}

.legal-brand .badge .pk {
  position: absolute;
  bottom: 0;
  width: 0;
  height: 0;
}

.legal-brand .badge .pk-far {
  left: 2px;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 16px solid var(--accent-light);
}

.legal-brand .badge .pk-mid {
  left: 13px;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-bottom: 26px solid var(--accent);
}

.legal-brand .badge .pk-near {
  left: 24px;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 14px solid #FFFFFF;
}

.legal-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: #FFFFFF;
  max-width: 760px;
}

.legal-sub {
  margin-top: 18px;
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Layout: TOC + content ---------- */
.legal-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 56px;
  align-items: start;
  padding-top: 56px;
  padding-bottom: 72px;
}

/* Table of contents */
.toc {
  position: sticky;
  top: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px 24px;
}

.toc-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--brown);
  margin-bottom: 14px;
}

.toc ol {
  list-style: none;
  counter-reset: toc;
}

.toc ol li {
  counter-increment: toc;
  margin-bottom: 8px;
}

.toc ol li a {
  display: flex;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.4;
  padding: 4px 0;
}

.toc ol li a::before {
  content: counter(toc, decimal-leading-zero);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-dark);
  letter-spacing: 0.04em;
}

.toc ol li a:hover {
  color: var(--brown);
  text-decoration: none;
}

/* Content area */
.legal-content {
  min-width: 0;
}

.legal-content .container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

.legal-content section {
  margin-bottom: 52px;
  scroll-margin-top: 24px;
}

.legal-content h2 {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.25;
  color: #2A2115;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
}

.legal-content h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: #2A2115;
  margin: 24px 0 12px;
}

.legal-content p {
  color: var(--text-soft);
  margin-bottom: 16px;
}

.legal-content ul,
.legal-content ol {
  margin: 0 0 18px 22px;
}

.legal-content ul li,
.legal-content ol li {
  color: var(--text-soft);
  margin-bottom: 10px;
}

.legal-content strong {
  color: var(--brown);
}

.legal-content .lead {
  font-size: 1.125rem;
  color: var(--text-soft);
  background: var(--surface);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 22px 26px;
  margin-bottom: 40px;
}

.legal-content .company-box {
  background: var(--surface-gold);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 22px 26px;
  margin-bottom: 24px;
}

.legal-content .company-box p {
  margin-bottom: 6px;
  color: var(--brown);
}

/* ---------- Scope isolation (defensive) ---------- */
.legal-page .legal-content section {
  background-color: transparent !important;
}

/* ---------- Legal footer ---------- */
.legal-footer {
  background: var(--brown);
  border-top: 3px solid var(--accent);
  padding: 36px 0;
  color: #D8CFBE;
}

.legal-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.legal-footer p {
  font-size: 0.875rem;
  color: #B6AA95;
}

.legal-footer .back-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9375rem;
  color: #F7F5F1;
  background: var(--accent);
  color: #1A1A1A;
  padding: 12px 22px;
  border-radius: 8px;
}

.legal-footer .back-home:hover {
  background: #C7933C;
  color: #1A1A1A;
  text-decoration: none;
}

.legal-footer .fb-links {
  display: flex;
  gap: 20px;
}

.legal-footer .fb-links a {
  font-size: 0.875rem;
  color: #D8CFBE;
}

.legal-footer .fb-links a:hover {
  color: var(--accent);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .toc {
    position: static;
  }
}

@media (max-width: 600px) {
  .legal-header {
    padding: 48px 0 40px;
  }
  .legal-content .container {
    padding: 0 20px;
  }
  .legal-footer .container {
    flex-direction: column;
    align-items: flex-start;
  }
}
