/* LovMap legal docs — shared styles */

:root {
  --brand: #ff6b35;
  --brand-dark: #e85a23;
  --brand-soft: rgba(255, 107, 53, 0.08);
  --bg: #fafafa;
  --card: #ffffff;
  --text: #1f2937;
  --text-strong: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --table-header: #f9fafb;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-hover: 0 10px 25px rgba(255, 107, 53, 0.15),
    0 4px 10px rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f0f;
    --card: #1a1a1a;
    --text: #e5e7eb;
    --text-strong: #f9fafb;
    --muted: #9ca3af;
    --border: #2a2a2a;
    --table-header: #1f1f1f;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 10px 25px rgba(255, 107, 53, 0.25),
      0 4px 10px rgba(0, 0, 0, 0.4);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* ============ Top nav ============ */

.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.85);
}

@media (prefers-color-scheme: dark) {
  .topnav {
    background: rgba(15, 15, 15, 0.85);
  }
}

.topnav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-strong);
  font-weight: 700;
  font-size: 1.05rem;
}

.topnav .brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--brand);
  border-radius: 8px;
  color: #000;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: -1px;
}

.topnav .back-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
}

.topnav .back-link:hover {
  color: var(--brand);
}

/* ============ Document header ============ */

.doc-header {
  margin: 16px 0 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.doc-header .eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.doc-header h1 {
  margin: 0 0 12px;
  font-size: 2rem;
  line-height: 1.2;
  color: var(--text-strong);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.doc-header .updated {
  font-size: 0.9rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ============ Body typography ============ */

article {
  font-size: 1rem;
}

article h2 {
  font-size: 1.5rem;
  margin: 48px 0 16px;
  color: var(--text-strong);
  font-weight: 700;
  letter-spacing: -0.01em;
  scroll-margin-top: 80px;
}

article h2:first-child {
  margin-top: 0;
}

article h3 {
  font-size: 1.15rem;
  margin: 32px 0 12px;
  color: var(--text-strong);
  font-weight: 600;
  scroll-margin-top: 80px;
}

article h4 {
  font-size: 1rem;
  margin: 24px 0 8px;
  color: var(--text-strong);
  font-weight: 600;
}

article p {
  margin: 0 0 16px;
}

article strong {
  color: var(--text-strong);
  font-weight: 600;
}

article a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

article a:hover {
  color: var(--brand-dark);
  text-decoration-thickness: 2px;
}

article ul,
article ol {
  margin: 0 0 16px;
  padding-left: 24px;
}

article li {
  margin-bottom: 8px;
}

article li::marker {
  color: var(--brand);
}

article hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

article blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  background: var(--brand-soft);
  border-left: 3px solid var(--brand);
  border-radius: 0 8px 8px 0;
  color: var(--text);
}

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

article code {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
  background: var(--brand-soft);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--brand-dark);
}

/* ============ Tables ============ */

article table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 0.95rem;
  background: var(--card);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

article thead {
  background: var(--table-header);
}

article th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-strong);
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  letter-spacing: 0.01em;
}

article td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

article tbody tr:last-child td {
  border-bottom: none;
}

article tbody tr:hover {
  background: var(--brand-soft);
}

/* ============ Callouts (custom) ============ */

.callout {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  background: var(--brand-soft);
  border-left: 3px solid var(--brand);
  border-radius: 0 8px 8px 0;
  margin: 24px 0;
}

.callout-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.callout-body {
  flex: 1;
}

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

/* ============ Footer ============ */

.doc-footer {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--muted);
}

.doc-footer p {
  margin: 4px 0;
}

.doc-footer a {
  color: var(--brand);
  text-decoration: none;
}

.doc-footer a:hover {
  text-decoration: underline;
}

/* ============ Index page ============ */

.index-header {
  text-align: center;
  margin: 48px 0;
}

.index-header .logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: var(--brand);
  border-radius: 20px;
  font-size: 32px;
  font-weight: 800;
  color: #000;
  letter-spacing: -2px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(255, 107, 53, 0.3);
}

.index-header h1 {
  color: var(--text-strong);
  font-size: 2rem;
  margin: 0 0 8px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.index-header p {
  color: var(--muted);
  font-size: 1rem;
  margin: 0;
}

.grid {
  display: grid;
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: var(--shadow);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--brand);
}

.card:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}

.card-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-strong);
}

.card-description {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

.card-meta {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-left: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ============ Mobile ============ */

@media (max-width: 640px) {
  .container {
    padding: 24px 16px 48px;
  }

  .topnav {
    padding: 12px 16px;
  }

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

  article h2 {
    font-size: 1.3rem;
    margin-top: 36px;
  }

  article h3 {
    font-size: 1.05rem;
  }

  article table {
    font-size: 0.85rem;
  }

  article th,
  article td {
    padding: 10px 12px;
  }

  .index-header {
    margin: 32px 0 40px;
  }

  .index-header .logo {
    width: 64px;
    height: 64px;
    font-size: 26px;
  }

  .index-header h1 {
    font-size: 1.6rem;
  }

  .card {
    padding: 20px;
  }

  /* Tables on mobile: allow horizontal scroll */
  article table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
