/* Shared Styles for ChoreTask static legal pages (/terms/, /pp/) */

:root {
  --ct-bg: #f4f6f8;
  --ct-surface: #ffffff;
  --ct-ink: #1e2a44;
  --ct-body: #4b5563;
  --ct-muted: #6b7280;
  --ct-teal: #00a8a8;
  --ct-teal-dark: #008f8f;
  --ct-teal-soft: rgba(0, 168, 168, 0.12);
  --ct-line: rgba(30, 42, 68, 0.1);
  --ct-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
  --ct-radius: 20px;
  --ct-header-h: 64px;
  --ct-focus: 0 0 0 3px rgba(0, 168, 168, 0.45);
  --ct-font: "Nunito", "Nunito Sans", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--ct-header-h) + 16px);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--ct-font);
  color: var(--ct-ink);
  background: var(--ct-bg);
  line-height: 1.7;
  font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--ct-teal-dark);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

a:hover {
  color: var(--ct-teal);
}

a:focus-visible {
  outline: none;
  box-shadow: var(--ct-focus);
  border-radius: 4px;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--ct-line);
  backdrop-filter: blur(10px);
}

.site-header__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 24px;
  min-height: var(--ct-header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-link:focus-visible {
  outline: none;
  box-shadow: var(--ct-focus);
  border-radius: 8px;
}

.logo {
  width: 148px;
  max-width: 42vw;
  height: auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--ct-teal-soft);
  color: var(--ct-teal-dark);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.back-link:hover {
  color: var(--ct-teal);
  opacity: 0.92;
}

.back-link:focus-visible {
  outline: none;
  box-shadow: var(--ct-focus);
}

/* —— Layout shell —— */
.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

.legal-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

/* —— Table of contents —— */
.toc {
  position: sticky;
  top: calc(var(--ct-header-h) + 16px);
  background: var(--ct-surface);
  border: 1px solid var(--ct-line);
  border-radius: var(--ct-radius);
  box-shadow: var(--ct-shadow);
  padding: 16px 14px 18px;
}

.toc__title {
  margin: 0 0 10px;
  padding: 0 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ct-teal-dark);
}

.toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: calc(100vh - var(--ct-header-h) - 80px);
  overflow-y: auto;
}

.toc__list a {
  display: block;
  padding: 7px 8px;
  border-radius: 8px;
  color: var(--ct-body);
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.35;
  text-decoration: none;
}

.toc__list a:hover {
  background: #f8fafb;
  color: var(--ct-ink);
}

.toc__list a:focus-visible {
  outline: none;
  box-shadow: var(--ct-focus);
}

/* —— Document —— */
.legal-doc {
  background: var(--ct-surface);
  border: 1px solid var(--ct-line);
  border-radius: var(--ct-radius);
  box-shadow: var(--ct-shadow);
  padding: clamp(22px, 4vw, 40px);
  max-width: 820px;
  width: 100%;
  justify-self: start;
}

.doc-intro {
  margin-bottom: 8px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--ct-line);
}

.doc-intro h1 {
  margin: 0 0 10px;
  font-size: clamp(1.75rem, 4vw, 2.15rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: var(--ct-ink);
}

.doc-meta {
  display: inline-flex;
  align-items: center;
  margin: 0 0 14px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--ct-teal-soft);
  color: var(--ct-teal-dark);
  font-size: 0.86rem;
  font-weight: 800;
}

.doc-lead {
  margin: 0;
  color: var(--ct-body);
  font-size: 1.02rem;
  line-height: 1.65;
  max-width: 42rem;
}

.legal-doc section {
  padding-top: 28px;
  margin-top: 8px;
  border-top: 1px solid var(--ct-line);
}

.legal-doc section:first-of-type {
  border-top: none;
  margin-top: 16px;
  padding-top: 20px;
}

.legal-doc h2 {
  margin: 0 0 12px;
  font-size: 1.2rem;
  line-height: 1.3;
  font-weight: 800;
  color: var(--ct-ink);
  letter-spacing: -0.01em;
  scroll-margin-top: calc(var(--ct-header-h) + 16px);
}

.legal-doc p {
  margin: 0 0 14px;
  color: var(--ct-body);
}

.legal-doc ul {
  margin: 0 0 16px;
  padding-left: 1.25rem;
  color: var(--ct-body);
}

.legal-doc li {
  margin: 0.45rem 0;
  padding-left: 0.15rem;
}

.legal-doc li::marker {
  color: var(--ct-teal);
}

.legal-doc strong {
  color: var(--ct-ink);
  font-weight: 800;
}

.callout {
  margin: 8px 0 0;
  padding: 18px 18px 16px;
  border-radius: 16px;
  border: 1px solid var(--ct-line);
  background: #f8fafb;
}

.callout--accent {
  border-left: 4px solid var(--ct-teal);
}

.callout h2 {
  margin-top: 0;
}

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

/* —— Footer —— */
.site-footer {
  border-top: 1px solid var(--ct-line);
  background: #ffffff;
  padding: 28px 24px 36px;
}

.site-footer__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.site-footer__brand {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--ct-ink);
}

.site-footer__tagline {
  margin: 0;
  color: var(--ct-muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.site-footer__links a {
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--ct-teal-dark);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

.site-footer__links a:hover {
  text-decoration: underline;
}

.site-footer__links a[aria-current="page"] {
  color: var(--ct-ink);
  font-weight: 800;
  text-decoration: none;
  pointer-events: none;
}

.site-footer__email {
  margin: 4px 0 0;
  font-size: 0.92rem;
  color: var(--ct-muted);
  font-weight: 600;
}

.site-footer__email a {
  font-weight: 700;
}

/* —— Responsive —— */
@media (max-width: 900px) {
  .legal-shell {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .toc {
    position: static;
  }

  .toc__list {
    max-height: none;
    display: grid;
    grid-template-columns: 1fr;
  }

  .legal-doc {
    max-width: none;
  }
}

@media (max-width: 620px) {
  .site-header__inner,
  .page,
  .site-footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .page {
    padding-top: 20px;
    padding-bottom: 36px;
  }

  .logo {
    width: 128px;
  }

  .back-link {
    padding: 8px 12px;
    font-size: 0.84rem;
  }

  .legal-doc {
    padding: 20px 18px;
    border-radius: 16px;
  }

  .doc-intro h1 {
    font-size: 1.6rem;
  }

  body {
    font-size: 16px;
  }
}
