/* ============================================================
   THE TURN GROUP - LEGAL POLICIES PAGE
   File: assets/css/_legal_page.css
   Namespace: .lg-wrap
   Palette: Indigo #4f46e5 + Slate #475569 + Amber #f59e0b accent
   Layout: Two-column desktop (content left, sticky TOC right)
            Single-column mobile (TOC collapses to top accordion)
   ============================================================ */

:root {
  --lg-ink: #0f172a;
  --lg-ink-2: #334155;
  --lg-muted: #64748b;
  --lg-bg: #ffffff;
  --lg-bg-2: #f8fafc;
  --lg-bg-3: #f1f5f9;
  --lg-line: #e2e8f0;
  --lg-line-2: #cbd5e1;
  --lg-brand: #4f46e5;
  --lg-brand-2: #6366f1;
  --lg-brand-3: #818cf8;
  --lg-accent: #f59e0b;
  --lg-accent-2: #d97706;
  --lg-ok: #10b981;
  --lg-danger: #ef4444;
  --lg-radius: 10px;
  --lg-radius-sm: 6px;
}

.lg-wrap {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--lg-ink);
  background: var(--lg-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Section reset ---------- */
.lg-wrap .lg-section {
  padding-top: 60px;
  padding-bottom: 60px;
  padding-left: max(24px, calc((100vw - 1240px) / 2));
  padding-right: max(24px, calc((100vw - 1240px) / 2));
  position: relative;
}

.lg-wrap .lg-section--tight { padding-top: 36px; padding-bottom: 36px; }

/* ---------- Hero ---------- */
.lg-hero {
  background:
    radial-gradient(900px 500px at 12% 0%, rgba(99,102,241,0.18) 0%, transparent 55%),
    radial-gradient(700px 400px at 95% 100%, rgba(245,158,11,0.12) 0%, transparent 60%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #312e81 100%);
  color: #fff;
  padding-top: 90px;
  padding-bottom: 90px;
  position: relative;
  overflow: hidden;
}

.lg-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
}

.lg-hero-inner {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: center;
}

.lg-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(245,158,11,0.18);
  border: 1px solid rgba(245,158,11,0.4);
  color: #fcd34d;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.lg-hero h1 {
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
  color: #fff;
}

.lg-hero h1 .lg-hl {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 60%, #6366f1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lg-hero .lg-lede {
  font-size: 1.15rem;
  color: #cbd5e1;
  max-width: 640px;
  margin: 0 0 26px;
}

.lg-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.lg-hero-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  color: #e2e8f0;
  font-size: 0.85rem;
  font-weight: 600;
  backdrop-filter: blur(6px);
}

.lg-hero-meta-pill svg { width: 14px; height: 14px; }

/* Hero right card - "this document" */
.lg-hero-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--lg-radius);
  padding: 28px;
  backdrop-filter: blur(10px);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.5);
}

.lg-hero-card h2 {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fcd34d;
  margin: 0 0 14px;
}

.lg-hero-card-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.lg-hero-card-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.93rem;
  color: #e2e8f0;
}

.lg-hero-card-list li::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
}

/* ---------- Two-column layout ---------- */
.lg-layout {
  background: var(--lg-bg-2);
  padding-top: 56px;
  padding-bottom: 80px;
}

.lg-layout-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  align-items: start;
}

.lg-content {
  background: #fff;
  border: 1px solid var(--lg-line);
  border-radius: var(--lg-radius);
  padding: 8px 44px 56px;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}

/* ---------- Right sticky TOC ---------- */
.lg-toc {
  position: sticky;
  top: 120px;
  background: #fff;
  border: 1px solid var(--lg-line);
  border-radius: var(--lg-radius);
  padding: 22px 20px;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}

.lg-toc h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lg-brand);
  margin: 0 0 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--lg-line);
}

.lg-toc h2 svg {
  width: 16px;
  height: 16px;
}

.lg-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: lgtoc;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lg-toc ol li {
  counter-increment: lgtoc;
  padding: 0;
  margin: 0;
  list-style: none;
}

.lg-toc ol li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  color: var(--lg-ink-2);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--lg-radius-sm);
  transition: all 0.15s ease;
  position: relative;
  border-left: 2px solid transparent;
}

.lg-toc ol li a::before {
  content: counter(lgtoc, decimal-leading-zero);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--lg-muted);
  background: var(--lg-bg-3);
  padding: 2px 6px;
  border-radius: 4px;
  flex: none;
  min-width: 26px;
  text-align: center;
  letter-spacing: 0.04em;
}

.lg-toc ol li a:hover {
  background: var(--lg-bg-2);
  color: var(--lg-brand);
  border-left-color: var(--lg-brand);
}

.lg-toc ol li a:hover::before {
  background: var(--lg-brand);
  color: #fff;
}

.lg-toc-foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--lg-line);
  font-size: 0.78rem;
  color: var(--lg-muted);
  line-height: 1.5;
}

.lg-toc-foot a {
  color: var(--lg-brand);
  font-weight: 600;
  text-decoration: none;
}

.lg-toc-foot a:hover { text-decoration: underline; }

/* Mobile TOC toggle (hidden on desktop) */
.lg-toc-mobile-toggle {
  display: none;
}

/* ---------- Article content ---------- */
.lg-article {
  font-size: 1rem;
  color: var(--lg-ink-2);
}

.lg-article section[id] {
  padding-top: 56px;
  margin-top: -28px;
  scroll-margin-top: 100px;
}

.lg-article section[id]:first-of-type {
  padding-top: 36px;
}

.lg-article h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--lg-ink);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.lg-article h2 .lg-num {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--lg-brand) 0%, var(--lg-brand-3) 100%);
  color: #fff;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 10px -2px rgba(79,70,229,0.4);
}

.lg-article .lg-sub {
  display: block;
  font-size: 0.82rem;
  color: var(--lg-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0 0 20px 50px;
}

.lg-article h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--lg-ink);
  margin: 24px 0 8px;
}

.lg-article p {
  margin: 0 0 14px;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--lg-ink-2);
}

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

.lg-article ul li,
.lg-article ol li {
  margin-bottom: 6px;
  line-height: 1.65;
}

.lg-article ul li::marker { color: var(--lg-brand); }
.lg-article ol li::marker { color: var(--lg-brand); font-weight: 700; }

.lg-article strong {
  color: var(--lg-ink);
  font-weight: 700;
}

.lg-article a {
  color: var(--lg-brand);
  text-decoration: underline;
  text-decoration-color: rgba(79,70,229,0.3);
  text-underline-offset: 3px;
  font-weight: 500;
}

.lg-article a:hover { text-decoration-color: var(--lg-brand); }

.lg-article hr {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--lg-line) 50%, transparent 100%);
  margin: 40px 0 0;
}

/* Callout boxes inside article */
.lg-callout {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(79,70,229,0.06) 0%, rgba(245,158,11,0.04) 100%);
  border-left: 4px solid var(--lg-brand);
  border-radius: var(--lg-radius-sm);
  margin: 18px 0 22px;
}

.lg-callout--warn {
  background: linear-gradient(135deg, rgba(245,158,11,0.1) 0%, rgba(239,68,68,0.04) 100%);
  border-left-color: var(--lg-accent);
}

.lg-callout svg {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--lg-brand);
  margin-top: 2px;
}

.lg-callout--warn svg { color: var(--lg-accent-2); }

.lg-callout-body {
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--lg-ink-2);
}

.lg-callout-body strong { color: var(--lg-ink); }

/* Definition list for refund table style */
.lg-deflist {
  margin: 12px 0 18px;
  border: 1px solid var(--lg-line);
  border-radius: var(--lg-radius-sm);
  overflow: hidden;
}

.lg-deflist-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  border-top: 1px solid var(--lg-line);
}

.lg-deflist-row:first-child { border-top: 0; }

.lg-deflist-key {
  padding: 12px 16px;
  background: var(--lg-bg-3);
  font-weight: 700;
  color: var(--lg-ink);
  font-size: 0.92rem;
}

.lg-deflist-val {
  padding: 12px 16px;
  font-size: 0.94rem;
  color: var(--lg-ink-2);
}

/* Contact card at bottom of article */
.lg-contact-card {
  margin-top: 40px;
  padding: 28px;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 60%, #f59e0b 130%);
  border-radius: var(--lg-radius);
  color: #fff;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
  align-items: center;
}

.lg-contact-card h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 6px;
}

.lg-contact-card p {
  color: rgba(255,255,255,0.92);
  font-size: 0.95rem;
  margin: 0;
}

.lg-contact-card-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lg-contact-card-actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.15s ease;
}

.lg-contact-card-actions a:hover {
  background: rgba(255,255,255,0.22);
}

.lg-contact-card-actions a.lg-cta-primary {
  background: #fff;
  color: var(--lg-brand);
  border-color: #fff;
}

.lg-contact-card-actions a.lg-cta-primary:hover {
  background: #f8fafc;
}

.lg-contact-card-actions svg {
  width: 16px;
  height: 16px;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .lg-hero-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .lg-layout-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .lg-toc {
    position: relative;
    top: auto;
    order: -1;
    padding: 16px;
  }

  .lg-toc-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    color: var(--lg-brand);
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .lg-toc-mobile-toggle svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
  }

  .lg-toc[data-collapsed="true"] .lg-toc-mobile-toggle svg {
    transform: rotate(-90deg);
  }

  .lg-toc[data-collapsed="true"] h2,
  .lg-toc[data-collapsed="true"] ol,
  .lg-toc[data-collapsed="true"] .lg-toc-foot {
    display: none;
  }

  .lg-toc h2 {
    margin-top: 14px;
  }

  .lg-content {
    padding: 8px 22px 40px;
  }

  .lg-contact-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .lg-wrap .lg-section { padding-top: 40px; padding-bottom: 40px; }
  .lg-hero { padding-top: 60px; padding-bottom: 60px; }
  .lg-content { padding: 8px 16px 32px; }
  .lg-article h2 { font-size: 1.4rem; }
  .lg-article h2 .lg-num { width: 32px; height: 32px; font-size: 0.85rem; }
  .lg-article .lg-sub { margin-left: 44px; }
  .lg-deflist-row { grid-template-columns: 1fr; }
  .lg-deflist-key { border-bottom: 1px solid var(--lg-line); }
}

/* ============================================================
   Print buttons (hero card + sticky TOC)
   ============================================================ */
.lg-print-btn,
.lg-toc-print-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 10px 16px;
  background: var(--lg-accent, #ff6b00);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font: 600 0.92rem/1 'Inter', system-ui, sans-serif;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}
.lg-print-btn:hover,
.lg-toc-print-btn:hover {
  background: #e95f00;
  transform: translateY(-1px);
}
.lg-print-btn:focus-visible,
.lg-toc-print-btn:focus-visible {
  outline: 3px solid rgba(255, 107, 0, 0.4);
  outline-offset: 2px;
}
.lg-toc-print-btn {
  width: 100%;
  justify-content: center;
  margin-top: 16px;
  margin-bottom: 16px;
}

/* ============================================================
   Print styles - clean PDF-friendly output
   ============================================================ */
@media print {
  /* Hide chrome */
  header, nav, footer,
  .tg-header, .tg-footer,
  .tg-nav, .tg-mobile-nav,
  .lg-toc-mobile-toggle,
  .lg-print-btn, .lg-toc-print-btn,
  .lg-hero-meta, .lg-hero-eyebrow {
    display: none !important;
  }
  /* TOC: collapse to inline summary at top */
  .lg-toc {
    position: static !important;
    page-break-after: always;
  }
  .lg-toc ol {
    columns: 2;
  }
  /* Single column article */
  .lg-layout-inner {
    grid-template-columns: 1fr !important;
    display: block !important;
  }
  .lg-content {
    padding: 0 !important;
    max-width: 100% !important;
  }
  /* Black text on white for print readability */
  .lg-wrap, .lg-article, .lg-article p, .lg-article li {
    color: #000 !important;
    background: #fff !important;
  }
  .lg-article h2, .lg-article h3 {
    color: #000 !important;
    page-break-after: avoid;
  }
  .lg-article section {
    page-break-inside: avoid;
  }
  a, a:visited {
    color: #000 !important;
    text-decoration: underline;
  }
  /* Show URL next to external links */
  .lg-article a[href^="mailto:"]:after,
  .lg-article a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #444;
  }
  .lg-hero {
    padding: 0 0 16pt !important;
    border-bottom: 1px solid #000;
  }
  .lg-hero-card {
    border: 1px solid #aaa;
  }
  /* Avoid page break inside deflists */
  .lg-deflist-row {
    page-break-inside: avoid;
  }
  @page {
    margin: 0.6in 0.6in 0.7in 0.6in;
  }
}
