/* ==========================================================================
   PPCTrace - Legal Pages (Privacy Policy + Terms of Service)
   Shared stylesheet for long-form legal documents
   (Loads alongside common.css)
   ========================================================================== */

/* ==========================================================================
   Hero / Header strip
   ========================================================================== */
.legal-hero {
  padding: 56px 0 44px;
  background: linear-gradient(180deg, var(--bluelt) 0%, #fff 100%);
  border-bottom: 1px solid var(--border);
}
.legal-hero h1 {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 14px;
}
.legal-hero h1 span { color: var(--blue); }
.legal-hero-sub {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
  max-width: 620px;
  margin: 0;
}

/* meta row (effective date + updated) */
.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.legal-meta-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12.5px;
}
.legal-meta-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted2);
}
.legal-meta-val { color: var(--text); font-weight: 600; }

/* ==========================================================================
   Breadcrumb
   ========================================================================== */
.legal-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted2);
  margin-bottom: 18px;
}
.legal-breadcrumb a { color: var(--muted2); }
.legal-breadcrumb a:hover { color: var(--blue); }
.legal-breadcrumb-sep { color: var(--muted2); font-size: 10px; }
.legal-breadcrumb-current { color: var(--text); font-weight: 500; }

/* ==========================================================================
   Main Layout — TOC + Body
   ========================================================================== */
.legal-main { padding: 48px 0 80px; }

/* TOC sidebar */
.legal-toc-wrap {
  position: sticky;
  top: 78px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.legal-toc {
  background: var(--bluelt);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}
.legal-toc-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted2);
  margin-bottom: 12px;
}
.legal-toc-list { display: flex; flex-direction: column; }
.legal-toc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
  transition: color .15s, padding-left .15s;
}
.legal-toc-item:last-child { border-bottom: none; }
.legal-toc-item:hover {
  color: var(--blue);
  padding-left: 4px;
}
.legal-toc-num {
  font-size: 10px;
  font-weight: 800;
  color: var(--blue);
  background: var(--ba06);
  border: 1px solid var(--ba15);
  border-radius: 5px;
  padding: 2px 6px;
  min-width: 24px;
  text-align: center;
  flex-shrink: 0;
}

/* Mini contact card under TOC */
.legal-aside-cta {
  background: var(--blue);
  border-radius: 14px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.legal-aside-cta::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .1);
  pointer-events: none;
}
.legal-aside-cta-title {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 5px;
  position: relative;
  z-index: 1;
}
.legal-aside-cta-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, .6);
  margin-bottom: 14px;
  line-height: 1.55;
  position: relative;
  z-index: 1;
}
.legal-aside-cta-btn {
  display: block;
  text-align: center;
  background: #fff;
  color: var(--blue);
  font-size: 12.5px;
  font-weight: 700;
  padding: 9px;
  border-radius: 7px;
  position: relative;
  z-index: 1;
  transition: background .15s;
}
.legal-aside-cta-btn:hover { background: #f0f4ff; color: var(--blue); }

/* ==========================================================================
   Document Body
   ========================================================================== */
.legal-doc {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 40px;
  line-height: 1.75;
}

.legal-section { padding: 16px 0 24px; }
.legal-section + .legal-section {
  border-top: 1px solid var(--border);
  padding-top: 32px;
  margin-top: 8px;
}

/* Section heading with number badge */
.legal-section h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 14px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  scroll-margin-top: 78px; /* offset for sticky nav anchor jump */
}
.legal-section-num {
  font-size: 13px;
  font-weight: 800;
  color: var(--blue);
  background: var(--ba06);
  border: 1px solid var(--ba15);
  border-radius: 7px;
  padding: 3px 9px;
  flex-shrink: 0;
  letter-spacing: -.3px;
}

.legal-section h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 22px 0 10px;
  letter-spacing: -.2px;
}

.legal-section p {
  font-size: 14.5px;
  color: #2a3350;
  line-height: 1.75;
  margin-bottom: 14px;
}
.legal-section p:last-child { margin-bottom: 0; }

.legal-section a {
  color: var(--blue);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(24, 71, 194, .25);
  text-underline-offset: 3px;
  transition: text-decoration-color .15s;
}
.legal-section a:hover { text-decoration-color: var(--blue); }

.legal-section ul,
.legal-section ol {
  padding-left: 22px;
  margin-bottom: 16px;
}
.legal-section li {
  font-size: 14.5px;
  color: #2a3350;
  line-height: 1.75;
  margin-bottom: 8px;
}
.legal-section li::marker { color: var(--blue); font-weight: 700; }
.legal-section li strong { color: var(--text); font-weight: 700; }

/* Definition / key terms list */
.legal-deflist {
  list-style: none;
  padding: 0;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.legal-deflist li {
  padding: 12px 14px;
  background: var(--bluelt);
  border: 1px solid var(--border);
  border-radius: 9px;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}
.legal-deflist li::marker { content: ''; }
.legal-deflist li strong {
  display: block;
  color: var(--text);
  font-weight: 700;
  margin-bottom: 3px;
  font-size: 13.5px;
}

/* Highlight callout */
.legal-callout {
  background: var(--bluelt);
  border: 1px solid var(--ba15);
  border-left: 3px solid var(--blue);
  border-radius: 0 10px 10px 0;
  padding: 14px 18px;
  margin: 18px 0;
}
.legal-callout-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--blue);
  margin-bottom: 5px;
}
.legal-callout p {
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 0;
  line-height: 1.65;
}

/* Footer of doc — last updated card */
.legal-doc-footer {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 13px;
  color: var(--muted2);
}
.legal-doc-footer strong { color: var(--text); font-weight: 600; }
.legal-back-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--blue);
  background: var(--ba06);
  border: 1px solid var(--ba15);
  border-radius: 7px;
  padding: 7px 12px;
  transition: background .15s;
}
.legal-back-top:hover { background: var(--ba10); color: var(--blue); }

/* ==========================================================================
   Contact info row at bottom
   ========================================================================== */
.legal-contact-card {
  background: linear-gradient(135deg, var(--bluelt) 0%, #edf0ff 100%);
  border: 1px solid var(--ba15);
  border-radius: 14px;
  padding: 22px;
  margin-top: 28px;
}
.legal-contact-eyebrow {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--blue);
  margin-bottom: 8px;
}
.legal-contact-card h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -.3px;
}
.legal-contact-card p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 12px;
}
.legal-contact-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 13px;
}
.legal-contact-meta a {
  color: var(--blue);
  font-weight: 600;
}
.legal-contact-meta a:hover { text-decoration: underline; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 991px) {
  .legal-toc-wrap { position: static; }
  .legal-toc { padding: 16px 18px; }
  .legal-doc { padding: 28px; }
}

@media (max-width: 767px) {
  .legal-hero { padding: 40px 0 32px; }
  .legal-main { padding: 32px 0 60px; }
  .legal-doc { padding: 22px; }
  .legal-section h2 { font-size: 18px; }
  .legal-section p,
  .legal-section li { font-size: 14px; }
  .legal-meta { gap: 10px 16px; }
}
