/* CallPing legal pages stylesheet — light theme.
 *
 * Implements docs/design/visual-refresh-spec.md §6.3.
 * Sourced via <link rel="stylesheet" href="/legal/legal.css"> from each
 * generated legal/*.html page. Tokens come from BRAND.md §5.1.
 */

/* ── Brand tokens (light theme — legal pages render light by default) ── */
:root {
  --cp-primary-from: #EAA944;
  --cp-primary: #DF7E21;
  --cp-primary-hover: #C66B14;
  --cp-primary-active: #A85A0F;
  --cp-accent: #FDBA56;
  --cp-primary-gradient: linear-gradient(45deg, #EAA944 0%, #DF7E21 100%);
  --cp-wordmark: #2D2D2D;

  --cp-bg: #F8FAFC;
  --cp-surface: #FFFFFF;
  --cp-surface-2: #F1F5F9;
  --cp-fg: #0F172A;
  --cp-muted: #64748B;
  --cp-border: rgba(15, 23, 42, 0.12);

  --cp-success: #15803D;
  --cp-warning: #B45309;
  --cp-danger: #B91C1C;
  --cp-info: #1D4ED8;

  --cp-font-sans: 'e-Ukraine', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --cp-font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Consolas, 'Liberation Mono', monospace;

  --cp-prose: 65ch;
}

/* ── Fonts (self-hosted from /fonts/) ─────────────────────────────────── */
@font-face {
  font-family: 'e-Ukraine';
  src: url('/fonts/e-Ukraine-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'e-Ukraine';
  src: url('/fonts/e-Ukraine-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'e-Ukraine';
  src: url('/fonts/e-Ukraine-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── Reset + body ────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html { scroll-behavior: smooth; }
body {
  font-family: var(--cp-font-sans);
  background: var(--cp-bg);
  color: var(--cp-fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Main column ────────────────────────────────────────────────────── */
/* Header is now provided by partials/nav.html (shared marketing chrome).
 * The legacy .cp-legal-header rules were removed when legal pages were
 * unified with the marketing chrome — see commit "unify legal pages with
 * marketing chrome".
 */

.cp-legal-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--cp-prose);
  margin: 0 auto;
  padding: 48px 24px;
}

/* ── Prose typography (BRAND.md §3.2 type scale) ───────────────────── */
.cp-prose { color: var(--cp-fg); font-size: 16px; }
.cp-prose h1 { font-size: 49px; line-height: 1.15; font-weight: 700; margin: 32px 0 16px; }
.cp-prose h2 { font-size: 31px; line-height: 1.25; font-weight: 700; margin: 40px 0 16px; }
.cp-prose h3 { font-size: 25px; line-height: 1.3; font-weight: 600; margin: 32px 0 12px; }
.cp-prose h4 { font-size: 20px; line-height: 1.4; font-weight: 500; margin: 24px 0 8px; }
.cp-prose p, .cp-prose li { margin-bottom: 12px; line-height: 1.7; }
.cp-prose ul, .cp-prose ol { padding-left: 24px; margin-bottom: 16px; }
.cp-prose a { color: var(--cp-info); text-decoration: underline; }
.cp-prose a:hover { color: var(--cp-primary-hover); }
.cp-prose strong { font-weight: 700; }
.cp-prose em { font-style: italic; }
.cp-prose blockquote {
  border-left: 4px solid var(--cp-primary);
  background: var(--cp-surface-2);
  padding: 16px 20px;
  margin: 16px 0;
  border-radius: 0 8px 8px 0;
  color: var(--cp-fg);
}
.cp-prose code {
  background: var(--cp-surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--cp-font-mono);
  font-size: 0.92em;
}
.cp-prose pre {
  background: var(--cp-surface-2);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
}
.cp-prose pre code {
  background: transparent;
  padding: 0;
  font-size: 0.92em;
}
.cp-prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 14px;
}
.cp-prose th, .cp-prose td {
  border: 1px solid var(--cp-border);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
.cp-prose th {
  background: var(--cp-surface-2);
  font-weight: 600;
}
.cp-prose hr {
  border: none;
  border-top: 1px solid var(--cp-border);
  margin: 24px 0;
}

*:focus-visible {
  outline: 2px solid var(--cp-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Mobile breakpoints ─────────────────────────────────────────────── */
@media (max-width: 1024px) { .cp-legal-main { padding: 32px 16px; } }
@media (max-width: 768px)  {
  .cp-prose h1 { font-size: 39px; }
  .cp-prose h2 { font-size: 25px; }
}
@media (max-width: 640px) {
  .cp-prose h1 { font-size: 31px; }
  .cp-prose h2 { font-size: 22px; }
  .cp-prose { font-size: 15px; }
}

/* ── Footer (replicated from website/index.html) ─────────────────────── */
.cp-footer {
  width: 100%;
  border-top: 1px solid var(--cp-border);
  margin-top: 64px;
  background: var(--cp-bg);
  color: var(--cp-muted);
}
.cp-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
}
.cp-footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-bottom: 40px;
}
@media (min-width: 640px)  { .cp-footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .cp-footer-grid { grid-template-columns: repeat(4, 1fr); } }
.cp-footer-heading {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cp-fg);
  margin-bottom: 16px;
}
.cp-footer ul { list-style: none; padding: 0; margin: 0; }
.cp-footer li { margin-bottom: 8px; font-size: 14px; }
.cp-footer a, .cp-link-button {
  color: var(--cp-muted);
  text-decoration: none;
  font-size: 14px;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.cp-footer a:hover, .cp-link-button:hover { color: var(--cp-fg); }
.cp-footer-bottom {
  border-top: 1px solid var(--cp-border);
  padding-top: 24px;
  display: flex;
  flex-direction: column-reverse;
  gap: 16px;
  justify-content: space-between;
  align-items: stretch;
}
@media (min-width: 640px) {
  .cp-footer-bottom { flex-direction: row; align-items: center; }
}
.cp-footer-copy { font-size: 12px; color: var(--cp-muted); }
.cp-footer-sep { margin: 0 8px; opacity: 0.5; }
.cp-footer-version {
  font-family: var(--cp-font-mono);
  opacity: 0.7;
}
.cp-footer-home { line-height: 0; opacity: 0.7; transition: opacity 0.2s; }
.cp-footer-home:hover { opacity: 1; }
.cp-footer-logo {
  height: 24px;     /* min 24px per BRAND.md §2.4 — must match partials/head.html */
  width: auto;
  aspect-ratio: 1080 / 340;
  display: block;
}
.cp-locale-badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--cp-border);
  border-radius: 4px;
  color: var(--cp-muted);
}

/* ── Print ──────────────────────────────────────────────────────────── */
@media print {
  .cp-legal-header,
  .cp-footer,
  #cp-cookie-banner,
  #cp-cookie-modal { display: none !important; }
  body { background: white; color: black; }
  .cp-legal-main { max-width: none; padding: 0; }
  .cp-prose a { color: black; text-decoration: underline; }
  .cp-prose a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #555;
  }
}
