/* =============================================================================
   LEGAL.CSS — Yurbi Legal Pages
   Used by: /legal/, /terms/, /privacy-policy/, /legal/license/
   Depends on: global.css (design tokens must be loaded first)
   ============================================================================= */


/* =============================================================================
   LEGAL HERO — navy header with title and meta
   ============================================================================= */

.legal-hero {
  background: var(--navy);
  padding: 56px 0 48px;
  border-bottom: 3px solid var(--blue);
}

.legal-hero-inner {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--s-6);
}

.legal-crumb {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-5);
  font-size: var(--t-sm);
  font-weight: var(--w-medium);
}

.legal-crumb a {
  color: var(--on-dark-link);
  text-decoration: none;
}

.legal-crumb a:hover { color: var(--on-dark); text-decoration: underline; }

.legal-crumb-sep {
  color: var(--on-dark-head);
  font-size: var(--t-caption);
}

.legal-crumb-current {
  color: var(--on-dark-sec);
}

.legal-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  background: rgba(0, 95, 172, 0.25);
  border: 1px solid rgba(0, 95, 172, 0.4);
  color: var(--on-dark-badge);
  font-size: var(--t-label);
  font-weight: var(--w-bold);
  text-transform: uppercase;
  letter-spacing: var(--ls-widest);
  padding: 4px 10px;
  border-radius: var(--r-full);
  margin-bottom: var(--s-4);
}

.legal-badge svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.legal-hero h1 {
  font-size: var(--t-hero-page);
  font-weight: var(--w-xbold);
  color: var(--on-dark);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  margin-bottom: var(--s-5);
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4) var(--s-6);
  font-size: var(--t-sm);
  color: var(--on-dark-sec);
}

.legal-meta-item {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.legal-meta-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--on-dark-head);
}


/* =============================================================================
   LEGAL CONTENT AREA
   ============================================================================= */

.legal-content {
  background: var(--bg);
  padding: var(--s-16) 0 var(--s-20);
}

.legal-content-inner {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--s-6);
}

/* Two-column layout: TOC sidebar + prose */
.legal-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--s-16);
  align-items: start;
}

@media (max-width: 860px) {
  .legal-layout {
    grid-template-columns: 1fr;
  }

  .legal-toc {
    display: none;
  }
}


/* =============================================================================
   TABLE OF CONTENTS — sticky sidebar
   ============================================================================= */

.legal-toc {
  position: sticky;
  top: calc(var(--header-h) + var(--s-6));
}

.legal-toc-label {
  font-size: var(--t-caption);
  font-weight: var(--w-bold);
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
  color: var(--text-muted);
  margin-bottom: var(--s-3);
}

.legal-toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.legal-toc-list a {
  display: block;
  font-size: var(--t-sm);
  font-weight: var(--w-medium);
  color: var(--text-muted);
  text-decoration: none;
  padding: 5px var(--s-3);
  border-radius: var(--r-sm);
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  line-height: var(--lh-snug);
}

.legal-toc-list a:hover {
  color: var(--blue);
  background: var(--bg-subtle);
  border-left-color: var(--blue);
}

.legal-toc-list a.active {
  color: var(--blue);
  background: var(--blue-soft);
  border-left-color: var(--blue);
  font-weight: var(--w-semibold);
}


/* =============================================================================
   LEGAL PROSE — main content
   ============================================================================= */

.legal-prose {
  min-width: 0;
}

.legal-prose h2 {
  font-size: var(--t-2xl);
  font-weight: var(--w-bold);
  color: var(--text);
  letter-spacing: var(--ls-snug);
  line-height: var(--lh-snug);
  margin-top: var(--s-12);
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-3);
  border-bottom: 2px solid var(--border-sub);
  scroll-margin-top: calc(var(--header-h) + var(--s-6));
}

.legal-prose h2:first-child {
  margin-top: 0;
}

.legal-prose h3 {
  font-size: var(--t-xl);
  font-weight: var(--w-bold);
  color: var(--text);
  margin-top: var(--s-8);
  margin-bottom: var(--s-3);
  scroll-margin-top: calc(var(--header-h) + var(--s-6));
}

.legal-prose p {
  font-size: var(--t-base);
  color: var(--text-sec);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--s-4);
}

.legal-prose p:last-child { margin-bottom: 0; }

.legal-prose ul,
.legal-prose ol {
  font-size: var(--t-base);
  color: var(--text-sec);
  line-height: var(--lh-relaxed);
  margin: var(--s-3) 0 var(--s-5) var(--s-6);
}

.legal-prose li {
  margin-bottom: var(--s-2);
}

.legal-prose a {
  color: var(--blue);
  text-decoration: none;
  font-weight: var(--w-semibold);
}

.legal-prose a:hover { text-decoration: underline; }

/* Prevent prose link color from overriding button styles */
.legal-prose .btn,
.legal-prose .btn:hover {
  text-decoration: none;
  color: inherit;
}

.legal-prose .btn-primary,
.legal-prose .btn-primary:hover {
  color: #fff;
}

.legal-prose .btn-outline,
.legal-prose .btn-outline:hover {
  color: var(--blue);
}

.legal-prose strong {
  font-weight: var(--w-semibold);
  color: var(--text);
}

.legal-prose code {
  font-family: var(--mono);
  font-size: var(--t-caption);
  background: var(--bg-subtle);
  border: 1px solid var(--border-sub);
  border-radius: var(--r-sm);
  padding: 2px 6px;
  color: var(--text-sec);
  white-space: nowrap;
}


/* =============================================================================
   CALLOUTS — uses global .callout variants plus legal-specific
   ============================================================================= */

.legal-prose .callout {
  margin: var(--s-6) 0;
  font-size: var(--t-base);
}

.legal-note {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: var(--r-md);
  padding: var(--s-4) var(--s-5);
  margin: var(--s-6) 0;
  font-size: var(--t-base);
  color: var(--text-sec);
  line-height: var(--lh-relaxed);
}

.legal-note strong {
  display: block;
  color: var(--text);
  margin-bottom: var(--s-1);
}

.legal-warn {
  background: #FFF8E6;
  border: 1px solid #F0D080;
  border-left: 3px solid #D4A017;
  border-radius: var(--r-md);
  padding: var(--s-4) var(--s-5);
  margin: var(--s-6) 0;
  font-size: var(--t-base);
  color: #5C4A00;
  line-height: var(--lh-relaxed);
}

.legal-warn strong {
  display: block;
  color: #3D3000;
  margin-bottom: var(--s-1);
}


/* =============================================================================
   LEGAL HUB — index page cards
   ============================================================================= */

.legal-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--s-6);
  margin-top: var(--s-8);
}

.legal-hub-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  text-decoration: none;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.legal-hub-card:hover {
  box-shadow: var(--sh-md);
  border-color: var(--blue);
  transform: translateY(-2px);
}

.legal-hub-card-icon {
  width: 40px;
  height: 40px;
  background: var(--blue-soft);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--blue);
}

.legal-hub-card-icon svg {
  width: 20px;
  height: 20px;
}

.legal-hub-card-title {
  font-size: var(--t-card);
  font-weight: var(--w-bold);
  color: var(--text);
  line-height: var(--lh-snug);
}

.legal-hub-card-desc {
  font-size: var(--t-sm);
  color: var(--text-muted);
  line-height: var(--lh-normal);
  flex: 1;
}

.legal-hub-card-link {
  font-size: var(--t-sm);
  font-weight: var(--w-semibold);
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: var(--s-1);
  margin-top: auto;
}

.legal-hub-card-link svg {
  width: 14px;
  height: 14px;
}


/* =============================================================================
   CONTACT CARD — bottom of legal pages
   ============================================================================= */

.legal-contact {
  margin-top: var(--s-16);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-6) var(--s-8);
  display: flex;
  align-items: flex-start;
  gap: var(--s-5);
}

.legal-contact-icon {
  width: 40px;
  height: 40px;
  background: var(--blue-soft);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--blue);
}

.legal-contact-icon svg { width: 20px; height: 20px; }

.legal-contact-body p {
  font-size: var(--t-sm);
  color: var(--text-muted);
  margin-bottom: var(--s-2);
}

.legal-contact-body a {
  font-size: var(--t-base);
  font-weight: var(--w-semibold);
  color: var(--blue);
  text-decoration: none;
}

.legal-contact-body a:hover { text-decoration: underline; }

.legal-contact-address {
  font-size: var(--t-caption);
  color: var(--text-muted);
  margin-top: var(--s-2);
  line-height: var(--lh-normal);
}

@media (max-width: 560px) {
  .legal-contact {
    flex-direction: column;
    padding: var(--s-5) var(--s-5);
  }
}


/* =============================================================================
   TOC SCROLL SPY — JS-driven active state
   ============================================================================= */

/* Active TOC state handled via JS adding .active class */


/* =============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================= */

@media (max-width: 640px) {
  .legal-hero { padding: 40px 0 32px; }
  .legal-hero h1 { font-size: var(--t-4xl); }
  .legal-content { padding: var(--s-10) 0 var(--s-16); }
  .legal-prose h2 { font-size: var(--t-xl); margin-top: var(--s-10); }
  .legal-hub-grid { grid-template-columns: 1fr; }
}
