/* ==========================================================================
   Vaba TV Legal Document System
   Shared styling for Privacy Policy, Membership Agreement, Preliminary Agreement
   ========================================================================== */

:root {
  --brand: #E63946;
  --brand-dark: #C1121F;
  --bg: #ffffff;
  --bg-subtle: #f7f7f9;
  --text: #1b1d22;
  --text-muted: #5b5f6b;
  --border: #e5e6eb;
  --sidebar-bg: #fbfbfc;
  --card-bg: #ffffff;
  --code-bg: #f2f2f5;
  --shadow: 0 1px 3px rgba(20, 20, 30, 0.06), 0 1px 2px rgba(20, 20, 30, 0.08);
  --radius: 10px;
  --max-width: 880px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14151a;
    --bg-subtle: #1b1c22;
    --text: #eceef2;
    --text-muted: #a2a6b3;
    --border: #2c2e37;
    --sidebar-bg: #191a20;
    --card-bg: #1b1c22;
    --code-bg: #23242c;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  }
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-subtle: #f7f7f9;
  --text: #1b1d22;
  --text-muted: #5b5f6b;
  --border: #e5e6eb;
  --sidebar-bg: #fbfbfc;
  --card-bg: #ffffff;
  --code-bg: #f2f2f5;
}

:root[data-theme="dark"] {
  --bg: #14151a;
  --bg-subtle: #1b1c22;
  --text: #eceef2;
  --text-muted: #a2a6b3;
  --border: #2c2e37;
  --sidebar-bg: #191a20;
  --card-bg: #1b1c22;
  --code-bg: #23242c;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

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

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Document header ---------- */
.doc-header {
  max-width: var(--max-width);
  margin: 0 0 36px;
}

.doc-header h1 {
  font-size: 34px;
  line-height: 1.2;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.doc-header .doc-subtitle {
  color: var(--text-muted);
  font-size: 15px;
  margin: 0;
}

article.doc-body {
  max-width: var(--max-width);
}

.doc-body h2 {
  font-size: 21px;
  margin: 36px 0 14px;
}
.doc-body h2:first-of-type { margin-top: 8px; }
.doc-body p { margin: 0 0 14px; color: var(--text); }
.doc-body ul, .doc-body ol { margin: 0 0 14px; padding-left: 22px; }
.doc-body li { margin-bottom: 6px; }
.doc-body strong { color: var(--text); font-weight: 700; }
.doc-body em { color: var(--text-muted); font-style: italic; }
.doc-body a { text-decoration: underline; }

.doc-footer {
  max-width: var(--max-width);
  border-top: 1px solid var(--border);
  margin-top: 64px;
  padding-top: 24px;
  color: var(--text-muted);
  font-size: 13.5px;
}

.doc-footer a { font-weight: 600; }

/* ---------- Standalone document (no nav/sidebar) ---------- */
main.solo {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 64px 24px 100px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.back-link:hover { color: var(--brand); text-decoration: none; }

/* ---------- Home page ---------- */
main.home-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 90px;
}

.hero {
  text-align: center;
  padding: 76px 20px 56px;
}

.hero-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 22px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.hero h1 {
  font-size: 38px;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}

.hero p.lead {
  color: var(--text-muted);
  font-size: 16.5px;
  max-width: 520px;
  margin: 0 auto 34px;
}

.store-badges {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.store-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #16181d;
  color: #fff;
  border: 1px solid #16181d;
  border-radius: 10px;
  padding: 10px 18px;
  min-width: 190px;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.store-badge:hover { transform: translateY(-1px); opacity: 0.92; text-decoration: none; }
.store-badge svg { width: 24px; height: 24px; flex-shrink: 0; fill: #fff; }
.store-badge .badge-text { text-align: left; line-height: 1.25; }
.store-badge .badge-text .small { display: block; font-size: 10.5px; color: #c7c9cf; text-transform: uppercase; letter-spacing: 0.04em; }
.store-badge .badge-text .big { display: block; font-size: 15px; font-weight: 700; }

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 12px 0 20px;
}
.section-heading h2 { font-size: 20px; margin: 0; }
.section-heading span { color: var(--text-muted); font-size: 13.5px; }

.doc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 56px;
}

.doc-card {
  display: flex;
  flex-direction: column;
  min-height: 200px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 20px;
  color: var(--text);
}
.doc-card:hover { border-color: var(--brand); text-decoration: none; }

.doc-card h3 { font-size: 16px; margin: 0 0 6px; }
.doc-card p { font-size: 13.5px; color: var(--text-muted); margin: 0 0 14px; line-height: 1.5; }

.doc-card .doc-card-meta {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.doc-card .doc-card-meta .read-link { color: var(--brand); font-weight: 700; }

.home-footer {
  border-top: 1px solid var(--border);
  margin-top: 100px;
  padding-top: 22px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  main.solo { padding: 40px 20px 80px; }
  .doc-header h1 { font-size: 27px; }
  .doc-grid { grid-template-columns: 1fr; }
}
