/* KUGI — legal page styles (Terms of Service, Privacy Policy).
   Requires base.css (loaded first). */

/* ---------- Policy header ---------- */
.policy-hero {
  padding: 56px 0 44px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
  position: relative; overflow: hidden;
}
.policy-hero::before {
  content: ''; position: absolute; inset: -40% 0 auto; height: 380px; pointer-events: none;
  background: radial-gradient(560px 260px at 20% 0%, rgba(7,220,46,0.10), transparent 70%);
}
.policy-hero .inner { position: relative; z-index: 2; max-width: 820px; }
.policy-crumb { font-size: 13px; color: var(--text-faint); margin-bottom: 18px; }
.policy-crumb a { color: var(--brand-deep); font-weight: 600; }
.policy-crumb a:hover { text-decoration: underline; }
.policy-eyebrow { color: var(--brand-deep); font-weight: 700; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 12px; }
h1.policy-title { font-size: clamp(34px, 5vw, 52px); font-weight: 900; letter-spacing: -0.035em; line-height: 1.05; }
.policy-tagline { color: var(--brand-deep); font-weight: 600; font-size: 17px; margin-top: 12px; }
.policy-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.policy-meta .pill {
  font-size: 13px; color: var(--text-dim);
  background: var(--surface); border: 1px solid var(--border);
  padding: 7px 14px; border-radius: 999px;
}
.policy-meta .pill b { color: var(--text); font-weight: 700; }

/* ---------- Policy layout ---------- */
.policy-layout {
  display: grid; grid-template-columns: 252px 1fr; gap: 60px;
  padding: 56px 0 110px; align-items: start;
}

/* Table of contents — capped and scrollable so it works at any length */
.toc { position: sticky; top: 100px; max-height: calc(100vh - 120px); overflow-y: auto; }
.toc h4 { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--text-faint); margin-bottom: 14px; padding-left: 12px; }
.toc ol { list-style: none; counter-reset: toc; display: flex; flex-direction: column; gap: 1px; }
.toc li { counter-increment: toc; }
.toc a {
  display: flex; gap: 10px; padding: 7px 12px; border-radius: 9px;
  color: var(--text-dim); font-size: 13px; line-height: 1.35;
  border-left: 2px solid transparent; transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.toc a::before { content: counter(toc); color: var(--text-faint); font-variant-numeric: tabular-nums; font-weight: 700; min-width: 16px; }
.toc a:hover { color: var(--text); background: var(--surface); }
.toc a.active { color: var(--brand-deep); background: var(--brand-dim); border-left-color: var(--brand); font-weight: 600; }
.toc a.active::before { color: var(--brand-deep); }

/* ---------- Prose ---------- */
.policy-content { max-width: 760px; }
.policy-content section { scroll-margin-top: 100px; margin-bottom: 48px; }
.policy-content section:last-of-type { margin-bottom: 0; }
.policy-content h2 {
  display: flex; align-items: center; gap: 14px;
  font-size: 23px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2;
  margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.policy-content h2 .num {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--ink); color: #ffffff;
  font-size: 14px; font-weight: 800;
}
.policy-content h3 { font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; margin: 26px 0 10px; color: var(--text); }
.policy-content p { color: var(--text-dim); font-size: 15.5px; line-height: 1.72; margin-bottom: 15px; }
.policy-content strong { color: var(--text); font-weight: 700; }
.policy-content a.inline { color: var(--brand-deep); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.policy-content ul { list-style: none; display: flex; flex-direction: column; gap: 11px; margin: 4px 0 18px; }
.policy-content ul li { position: relative; padding-left: 26px; color: var(--text-dim); font-size: 15.5px; line-height: 1.62; }
.policy-content ul li::before {
  content: ''; position: absolute; left: 5px; top: 10px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--ink);
}
.policy-content ul li strong { color: var(--text); }

/* ---------- Callouts ---------- */
.callout {
  background: var(--brand-dim);
  border: 1px solid rgba(7,220,46,0.22); border-left: 3px solid var(--brand);
  border-radius: 12px; padding: 16px 18px; margin: 18px 0;
  font-size: 15px; line-height: 1.65; color: var(--text);
}
.callout strong { color: var(--ink); }
.callout p { color: var(--text) !important; font-size: 15px !important; margin-bottom: 12px !important; }
.callout p:last-child { margin-bottom: 0 !important; }

/* Warning callout (health & safety) */
.callout.warn {
  background: var(--gold-dim);
  border-color: rgba(245,179,1,0.35); border-left-color: var(--gold);
}
.callout.warn .warn-label {
  display: inline-flex; align-items: center; gap: 7px;
  font-weight: 800; color: var(--gold-deep); text-transform: uppercase;
  letter-spacing: .05em; font-size: 12.5px; margin-bottom: 8px;
}

/* ---------- Data table ---------- */
.policy-table-wrap { overflow-x: auto; margin: 20px 0; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-card); }
table.policy-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 660px; }
.policy-table th {
  text-align: left; background: var(--bg-2); padding: 13px 16px;
  font-weight: 700; font-size: 12.5px; color: var(--text);
  text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border);
}
.policy-table td { padding: 13px 16px; border-bottom: 1px solid var(--border); color: var(--text-dim); vertical-align: top; line-height: 1.5; }
.policy-table tbody tr:last-child td { border-bottom: 0; }
.policy-table tbody tr:hover td { background: var(--surface); }
.policy-table td:first-child { font-weight: 700; color: var(--text); white-space: nowrap; }

/* ---------- Contact card ---------- */
.contact-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 16px; padding: 24px 26px; margin-top: 4px; }
.contact-card .cc-name { font-weight: 800; font-size: 16px; margin-bottom: 10px; }
.contact-card .cc-row { font-size: 15px; color: var(--text-dim); margin-bottom: 6px; }
.contact-card .cc-row:last-child { margin-bottom: 0; }
.contact-card .cc-row b { color: var(--text); font-weight: 700; }
.contact-card a { color: var(--brand-deep); font-weight: 600; }
.contact-card a:hover { text-decoration: underline; }

.policy-disclaimer {
  margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--border);
  font-size: 13.5px; font-style: italic; color: var(--text-faint); line-height: 1.6;
}

.back-to-top { display: inline-flex; align-items: center; gap: 7px; margin-top: 44px; font-size: 14px; font-weight: 600; color: var(--brand-deep); }
.back-to-top:hover { text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .policy-layout { grid-template-columns: 1fr; gap: 0; padding-top: 40px; }
  .toc {
    position: static; max-height: none; overflow: visible; margin-bottom: 40px;
    border: 1px solid var(--border); border-radius: 14px;
    padding: 18px 16px 16px; background: var(--bg-2);
  }
  .toc h4 { padding-left: 12px; }
}
@media (max-width: 560px) {
  .policy-hero { padding: 40px 0 32px; }
  .policy-content h2 { font-size: 20px; }
}
