/* ============================================================
   Shared styles — Privacy Policy & Terms of Service
   Palette sourced from app themeVars.ts
   WCAG 2.1 AA compliant
   ============================================================ */

/* --- Color tokens ----------------------------------------- */
:root {
  --primary: hsl(268, 87%, 55%);
  --secondary: hsl(268, 95%, 60%);
  --accent: hsl(268, 95%, 60%);
  --success: hsl(160, 84%, 55%);
  --error: hsl(0, 84%, 55%);
  --warning: hsl(38, 96%, 55%);
  --background: hsl(0, 0%, 98%);
  --surface: hsl(0, 0%, 95%);
  --text-primary: hsl(215, 28%, 17%);
  --text-secondary: hsl(215, 16%, 45%);
  --text-disabled: hsl(215, 16%, 65%);
  --border: hsl(210, 20%, 85%);
  --divider: hsl(210, 17%, 82%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: hsl(268, 75%, 65%);
    --secondary: hsl(268, 80%, 70%);
    --accent: hsl(268, 80%, 70%);
    --success: hsl(160, 65%, 60%);
    --error: hsl(0, 70%, 62%);
    --warning: hsl(38, 80%, 62%);
    --background: hsl(220, 15%, 10%);
    --surface: hsl(218, 12%, 16%);
    --text-primary: hsl(218, 15%, 90%);
    --text-secondary: hsl(218, 12%, 70%);
    --text-disabled: hsl(218, 8%, 48%);
    --border: hsl(218, 10%, 28%);
    --divider: hsl(218, 8%, 22%);
  }
}

/* --- Reset & base ----------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-primary);
  background-color: var(--background);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Skip-to-content -------------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--primary);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0 0 6px 6px;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 100;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 0;
}

/* --- Site header ------------------------------------------ */
.site-header {
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
}

.site-header__inner {
  max-width: 52rem;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-wrap: wrap;
}

/* Cross-page legal nav */
.legal-nav {
  margin-left: auto;
  display: flex;
  gap: 1.25rem;
}

.legal-nav a {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.legal-nav a:hover {
  color: var(--primary);
}

.legal-nav a[aria-current="page"] {
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--primary);
}

.legal-nav a:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 3px;
}
.site-header__logo {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-header__logo:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: 3px;
}

.site-header__separator {
  color: var(--text-disabled);
  user-select: none;
}

.site-header__page-title {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* --- Main layout ------------------------------------------ */
main {
  flex: 1;
  max-width: 52rem;
  width: 100%;
  margin-inline: auto;
  padding: 3rem 1.5rem 4rem;
}

/* --- Document header -------------------------------------- */
.doc-header {
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--divider);
}

.doc-header__eyebrow {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.doc-header h1 {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.doc-header__meta {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* --- Table of contents ------------------------------------ */
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 3rem;
}

.toc__title {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.875rem;
}

.toc ol {
  list-style: decimal;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.toc a {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 0.9375rem;
  color: var(--primary);
  text-underline-offset: 3px;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.15s ease;
}

.toc a:hover {
  text-decoration-color: var(--primary);
}

.toc a:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 3px;
}

/* --- Content sections ------------------------------------- */
.content-section {
  margin-bottom: 2.75rem;
}

.content-section h2 {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.875rem;
  scroll-margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* purple left-border accent on section headings */
.content-section h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1.1em;
  background: var(--primary);
  border-radius: 4px;
  flex-shrink: 0;
}

.content-section p {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

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

.content-section ul,
.content-section ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color: var(--text-primary);
}

.content-section li::marker {
  color: var(--primary);
}

/* --- Callout box ------------------------------------------ */
.callout {
  border-left: 4px solid var(--primary);
  background-color: hsl(268 87% 55% / 0.07);
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

@media (prefers-color-scheme: dark) {
  .callout {
    background-color: hsl(268 75% 65% / 0.1);
  }
}

.callout p {
  margin-bottom: 0;
  color: var(--text-primary);
}

/* --- Contact block ---------------------------------------- */
.contact-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
  margin-top: 1rem;
}

.contact-block p {
  margin-bottom: 0.25rem;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.contact-block strong {
  color: var(--text-primary);
}

.contact-block a {
  color: hsl(268, 55%, 68%);
  text-underline-offset: 3px;
}

@media (prefers-color-scheme: dark) {
  .contact-block a {
    color: hsl(268, 50%, 75%);
  }
}

.contact-block a:hover {
  color: var(--primary);
}

.contact-block a:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 3px;
}

/* --- Footer ----------------------------------------------- */
.site-footer {
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
}

.site-footer__inner {
  max-width: 52rem;
  margin-inline: auto;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.375rem 1.5rem;
}

.site-footer a {
  color: var(--primary);
  text-underline-offset: 2px;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.15s ease;
}

.site-footer a:hover {
  text-decoration-color: var(--primary);
}

.site-footer a:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 3px;
}

/* --- Responsive ------------------------------------------- */
@media (max-width: 640px) {
  body {
    font-size: 1rem;
  }

  main {
    padding: 2rem 1.25rem 3rem;
  }

  .doc-header {
    margin-bottom: 2rem;
  }

  .toc {
    padding: 1.25rem;
  }
}

/* --- Print ------------------------------------------------ */
@media print {
  body {
    font-size: 11pt;
    background: #fff;
    color: #000;
  }

  .skip-link,
  .site-footer,
  .toc {
    display: none;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #555;
  }
}

/* --- Reduced motion --------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .skip-link {
    transition: none;
  }
  .toc a,
  .site-footer a {
    transition: none;
  }
}
