/* ==========================================================================
   Lucky Bug Pet — legal stylesheet (privacy.html + terms-of-service.html)
   Light theme · matches the homepage cream background
   ========================================================================== */

:root {
  --bg: #F7F4EE;
  --bg-soft: #EFEAE0;
  --surface: #FFFFFF;
  --ink: #1B1B1A;
  --ink-soft: #45443E;
  --muted: #6C6A61;
  --accent: #0E7A64;
  --accent-dark: #0A5142;
  --accent-soft: #DCEBE4;
  --accent-ink: #FFFFFF;
  --forest: #14342C;
  --forest-soft: #1D463B;
  --forest-ink: #EAF2EE;
  --line: #E4DED2;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

* {
  box-sizing: border-box;
}

/* The legal pages load ONLY this stylesheet, so the body background must be
   defined here to keep headings and text readable. */
.legal-page {
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

.legal-page h1,
.legal-page h2,
.legal-page h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.2;
}

.legal-page h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  color: var(--forest-ink);
  margin: 0;
}

.legal-page h2 {
  font-size: 1.6rem;
  color: var(--ink);
  margin: 0 0 1rem;
  padding-top: 0.4rem;
}

.legal-page h3 {
  font-size: 1.2rem;
  color: var(--ink);
  margin: 1.4rem 0 0.6rem;
}

.legal-page p {
  color: var(--ink-soft);
  margin: 0 0 1.1rem;
}

.legal-page a {
  color: var(--accent-dark);
  text-decoration: none;
}

.legal-page a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Header — a <header> element with a solid gradient so the scope-isolation
   rule cannot clear its background.
   -------------------------------------------------------------------------- */

.legal-header {
  background: linear-gradient(135deg, var(--forest) 0%, var(--forest-soft) 55%, var(--accent-dark) 100%);
  color: var(--forest-ink);
  padding: 28px 24px 56px;
}

.legal-header-bar {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 40px;
}

.legal-brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--forest-ink);
  text-decoration: none;
}

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

.legal-home-link {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--forest-ink);
  border: 1px solid rgba(234, 242, 238, 0.4);
  border-radius: 999px;
  padding: 8px 18px;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.legal-home-link:hover {
  background: var(--forest-ink);
  color: var(--forest);
  text-decoration: none;
}

.legal-header-title {
  max-width: 800px;
  margin: 0 auto;
}

.legal-header-title h1 {
  color: var(--forest-ink);
}

.legal-updated {
  color: var(--accent-soft);
  font-size: 0.92rem;
  margin-top: 0.9rem;
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Content container — max-width must be centered with auto margins
   -------------------------------------------------------------------------- */

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

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

.toc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 28px;
  margin: -28px 0 44px;
  position: relative;
  box-shadow: 0 10px 30px rgba(20, 52, 44, 0.06);
}

.toc-title {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
}

.toc ol li {
  counter-increment: toc;
}

.toc ol li a {
  color: var(--ink-soft);
  font-size: 0.92rem;
  text-decoration: none;
  display: block;
  padding: 3px 0;
}

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

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

.legal-article {
  padding-bottom: 20px;
}

.legal-article section {
  padding: 20px 0 26px;
  border-bottom: 1px solid var(--line);
}

.legal-article section:last-of-type {
  border-bottom: none;
}

.legal-article section h2 {
  position: relative;
  padding-left: 22px;
}

.legal-article section h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.34em;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
}

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

.legal-footer {
  background: var(--forest);
  color: var(--forest-ink);
  text-align: center;
  padding: 32px 24px;
  margin-top: 40px;
}

.legal-footer p {
  color: var(--accent-soft);
  margin: 0 0 12px;
  font-size: 0.9rem;
}

.legal-footer-links {
  display: flex;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
}

.legal-footer-links a {
  color: var(--forest-ink);
  font-size: 0.9rem;
}

.legal-footer-links a:hover {
  color: var(--accent-soft);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Scope isolation — guarantee legal page sections are never polluted by
   homepage section styling (applies to body content only, never header/footer)
   -------------------------------------------------------------------------- */

.legal-page .legal-content section {
  background-color: transparent !important;
  color: var(--ink-soft) !important;
}

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

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

  .legal-header-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}
