/* =========================================================
   PuHu — legal.css
   Shared stylesheet for privacy.html and terms-of-service.html
   These pages load ONLY this stylesheet (never style.css).
   Dark theme matching the homepage: near-black #0B0E14,
   fiery orange-red accent, light text #E8EAED.
   ========================================================= */

:root {
  --bg: #0B0E14;
  --bg-soft: #10141D;
  --surface: #141926;
  --border: #232B3B;
  --border-soft: #1C2330;
  --text: #E8EAED;
  --muted: #B6BDCB;
  --muted-2: #8A93A6;
  --accent: #F0502E;
  --accent-2: #FF6B35;
  --accent-deep: #C43A1C;
  --grad-accent: linear-gradient(135deg, #C43A1C 0%, #F0502E 100%);
}

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

html {
  scroll-behavior: smooth;
}

/* Body scope: legal pages load only legal.css, so this sets the
   page background and text color to match the assigned dark theme. */
.legal-page {
  background-color: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ---------- Legal header ---------- */
/* This is a <header> element (never a <section>) with a solid
   gradient background so the scope-isolation rule never clears it. */
.legal-header {
  background: var(--grad-accent);
  border-bottom: 1px solid var(--border);
}

.legal-header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 24px 44px;
}

.legal-brand {
  display: inline-block;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #FFFFFF;
  margin-bottom: 22px;
}

.legal-brand:hover {
  text-decoration: none;
  color: #FFFFFF;
}

.legal-header h1 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.4px;
  color: #FFFFFF;
  margin-bottom: 14px;
}

.legal-meta {
  font-size: 15px;
  color: #FFE6DC;
}

/* ---------- Content ---------- */
.legal-content {
  padding: 56px 0 64px;
}

/* Scope isolation: guarantee homepage section styling can never
   paint dark backgrounds over legal page section content. */
.legal-page .legal-content section {
  background-color: transparent !important;
}

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

/* ---------- Table of contents ---------- */
.toc {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 30px;
  margin-bottom: 48px;
}

.toc h2 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-2);
  margin-bottom: 18px;
}

.toc ol {
  list-style: none;
  counter-reset: toc;
  columns: 2;
  column-gap: 36px;
}

.toc li {
  counter-increment: toc;
  margin-bottom: 10px;
  break-inside: avoid;
}

.toc a {
  display: block;
  font-size: 15px;
  color: var(--muted);
  transition: color 0.2s ease;
}

.toc a:hover {
  color: var(--accent-2);
  text-decoration: none;
}

.toc a::before {
  content: counter(toc, decimal-leading-zero) ". ";
  font-weight: 700;
  color: var(--accent);
}

/* ---------- Sections ---------- */
.legal-content section {
  margin-bottom: 44px;
  padding-top: 8px;
}

.legal-content h2 {
  font-size: 24px;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.legal-content h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-2);
  margin: 22px 0 10px;
}

.legal-content p {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 16px;
}

.legal-content ul {
  list-style: disc;
  padding-left: 24px;
  margin-bottom: 16px;
}

.legal-content ul li {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 8px;
}

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

.legal-address-block {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
  margin: 18px 0 8px;
}

.legal-address-block p {
  margin-bottom: 6px;
  font-size: 15px;
}

.legal-address-block p:last-child {
  margin-bottom: 0;
}

.back-home {
  display: inline-block;
  margin-top: 8px;
  padding: 11px 22px;
  border-radius: 10px;
  background: var(--grad-accent);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 700;
}

.back-home:hover {
  text-decoration: none;
}

/* ---------- Footer ---------- */
.legal-footer {
  background-color: #07090D;
  border-top: 1px solid var(--border-soft);
}

.legal-footer-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.legal-footer p {
  font-size: 14px;
  color: var(--muted-2);
}

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

.legal-footer-links a {
  font-size: 14px;
  color: var(--muted);
}

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

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .toc ol {
    columns: 1;
  }
  .legal-header-inner {
    padding: 36px 20px 32px;
  }
  .legal-content {
    padding: 40px 0 48px;
  }
  .legal-footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
