/* ============================================================
   NaiYao Systems — shared legal stylesheet
   (privacy.html and terms-of-service.html)
   Theme: deep forest green on a light mist surface
   ============================================================ */

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

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

body {
  font-size: 16px;
}

/* ---------- Base legal page surface ---------- */

.legal-page {
  background-color: #F2F6F2;
  color: #14211B;
  font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.75;
}

.legal-page a {
  color: #1D5C42;
  text-decoration: none;
}

.legal-page a:hover {
  text-decoration: underline;
}

/* ---------- Legal header (a <header> element, not a <section>) ---------- */

.legal-header {
  background-color: #0B2B1E;
  background-image: linear-gradient(135deg, #0B2B1E 0%, #113B2A 40%, #1D5C42 100%);
  padding: 56px 24px 48px;
  text-align: center;
}

.legal-header-inner {
  max-width: 860px;
  margin: 0 auto;
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  margin-bottom: 30px;
}

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

.legal-brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: #2F8A63;
  position: relative;
  flex: none;
}

.legal-brand-mark::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background-color: #FFFFFF;
}

.legal-brand em {
  font-style: normal;
  color: #B9E3CF;
}

.legal-header h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #FFFFFF;
  margin-bottom: 14px;
}

.legal-meta {
  font-size: 0.95rem;
  color: #B9E3CF;
}

/* ---------- Content container ---------- */

.legal-content {
  padding: 56px 0 72px;
}

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

/* Scope isolation: never let homepage section backgrounds leak here */
.legal-page .legal-content section {
  background-color: transparent !important;
}

/* ---------- Table of contents ---------- */

.legal-content .toc {
  background-color: #FFFFFF;
  border: 1px solid #D5E1D6;
  border-left: 4px solid #2F8A63;
  border-radius: 14px;
  padding: 26px 28px;
  margin-bottom: 40px;
}

.legal-content .toc h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #113B2A;
  margin-bottom: 16px;
}

.legal-content .toc ol {
  list-style: decimal;
  padding-left: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 28px;
}

.legal-content .toc a {
  color: #1D5C42;
  font-size: 0.95rem;
  font-weight: 500;
}

.legal-content .toc a:hover {
  color: #0B2B1E;
}

/* ---------- Article / sections ---------- */

.legal-article section {
  margin-bottom: 40px;
  padding-bottom: 8px;
  border-bottom: 1px solid #D5E1D6;
}

.legal-article section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.legal-article h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #113B2A;
  margin-bottom: 16px;
  padding-top: 8px;
  scroll-margin-top: 24px;
}

.legal-article h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1D5C42;
  margin: 20px 0 10px;
}

.legal-article p {
  color: #33443B;
  margin-bottom: 16px;
}

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

.legal-address {
  font-style: normal;
  line-height: 1.6;
  color: #14211B;
  background-color: #E8EFE8;
  border-radius: 12px;
  padding: 18px 22px;
  margin: 16px 0 20px;
}

/* ---------- Footer ---------- */

.legal-footer {
  background-color: #0B2B1E;
  padding: 28px 24px;
}

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

.legal-footer-inner p {
  font-size: 0.85rem;
  color: #8FB3A0;
}

.legal-footer-inner nav {
  display: flex;
  gap: 22px;
}

.legal-footer-inner a {
  font-size: 0.92rem;
  font-weight: 600;
  color: #B9E3CF;
}

.legal-footer-inner a:hover {
  color: #FFFFFF;
  text-decoration: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .legal-content .toc ol {
    grid-template-columns: 1fr;
  }

  .legal-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}
