/* Legal Page Polish - Premium Typography & Layout System */

:root {
  /* Colors - Refined Palette */
  --bg: #FFFDF7;           /* soft cream */
  --card: #FFFFFF;
  --text: #1E1E1E;
  --muted: #5C5C5C;
  --accent: #A8E6CF;       /* mint */
  --accent-ink: #102E24;   /* dark mint for links */
  --accent-border: #158CEE; /* brand blue for accents */
  --border: #EEE;
  --border-light: #F2F2F2;
  --card-bg: #FBFBFB;

  /* Type Scale - Fluid Responsive */
  --h1: clamp(28px, 3.5vw, 36px);
  --h2: clamp(20px, 2.2vw, 24px);
  --h3: clamp(17px, 1.8vw, 20px);
  --body: 16px;
  --small: 14px;

  /* Spacing System */
  --section-y: 48px;
  --stack: 16px;
  --gap: 24px;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 8px 24px rgba(0,0,0,.06);
  --shadow-sm: 0 4px 12px rgba(0,0,0,.04);
}

/* Enhanced Body */
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Figtree', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.65;
}

/* Container Polish */
.container-medium {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--gap);
}

.max-width-large {
  max-width: 760px;
  margin: 0 auto;
}

/* Hero Section - Updated Last Date */
.heading_h1 {
  font-family: 'Livvic', 'Figtree', sans-serif;
  font-size: var(--h1);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  color: var(--text);
}

.paragraph_large.text-color_secondary {
  font-size: var(--body);
  color: var(--muted);
  padding: 12px 20px;
  background: var(--card);
  border-left: 4px solid var(--accent-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--gap);
}

/* Typography Hierarchy */
.text-rich-text h2 {
  font-size: var(--h2);
  font-weight: 700;
  margin: var(--section-y) 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-light);
  color: var(--text);
  letter-spacing: -0.005em;
}

.text-rich-text h3 {
  font-size: var(--h3);
  font-weight: 600;
  margin: 32px 0 8px;
  color: var(--text);
}

.text-rich-text p,
.text-rich-text li {
  font-size: var(--body);
  line-height: 1.65;
  margin: 0 0 var(--stack);
}

.text-rich-text p:last-child {
  margin-bottom: 0;
}

/* Enhanced Lists */
.text-rich-text ul,
.text-rich-text ol {
  padding-left: 1.5rem;
  margin: 12px 0 24px;
}

.text-rich-text li {
  margin-bottom: 8px;
  padding-left: 4px;
}

.text-rich-text li strong {
  color: var(--text);
  font-weight: 600;
}

/* Premium Link Styling */
.text-rich-text a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent);
  transition: all 0.2s ease;
}

.text-rich-text a:hover {
  text-decoration-color: var(--accent-ink);
  opacity: 0.85;
}

/* Section Cards - Visual Breathing Room */
.text-rich-text h2:first-of-type {
  margin-top: 0;
}

/* Data Controller Card */
.text-rich-text h2:first-of-type + p {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--accent-border);
  margin-bottom: var(--gap);
}

.text-rich-text h2:first-of-type + p strong {
  display: inline-block;
  min-width: 140px;
  color: var(--text);
}

/* Table Component for Structured Data */
.legal-table {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 16px 0 24px;
  box-shadow: var(--shadow-sm);
}

.legal-table .row {
  display: grid;
  grid-template-columns: 220px 1fr;
  border-top: 1px solid var(--border-light);
}

.legal-table .row:first-child {
  background: var(--card-bg);
  font-weight: 600;
  border-top: none;
}

.legal-table .cell {
  padding: 12px 16px;
  font-size: var(--body);
}

.legal-table .cell:first-child {
  border-right: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.5);
}

/* Mobile Table Collapse */
@media (max-width: 640px) {
  .legal-table .row {
    grid-template-columns: 1fr;
  }

  .legal-table .cell:first-child {
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    background: var(--card-bg);
    font-weight: 600;
  }
}

/* Important Callouts */
.text-rich-text p strong:only-child {
  display: block;
  padding: 10px 16px;
  background: linear-gradient(135deg, #A8E6CF 0%, #158CEE 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

/* Code/Technical Terms */
code, pre {
  background: #F7F7F7;
  border-radius: 6px;
  padding: 2px 6px;
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 14px;
}

/* Footer Enhancement */
.footer.is-inverse {
  margin-top: 80px;
  padding: 40px 0;
}

.footer .divider {
  background: rgba(255, 255, 255, 0.15);
  height: 1px;
  margin: 24px 0;
}

.footer p {
  font-size: var(--small);
  opacity: 0.9;
}

/* Document History Section */
.text-rich-text h2:last-of-type + ul {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 20px 24px 20px 40px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--accent);
}

.text-rich-text h2:last-of-type + ul li {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: var(--small);
  color: var(--muted);
  margin-bottom: 6px;
}

.text-rich-text h2:last-of-type + ul li strong {
  color: var(--text);
  font-family: 'Figtree', sans-serif;
}

/* Sticky TOC (Optional - for future enhancement) */
@media (min-width: 1200px) {
  .legal-toc {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
  }
}

/* Touch Targets (Mobile) */
@media (max-width: 768px) {
  .text-rich-text a {
    padding: 4px 0;
    display: inline-block;
  }

  .container-medium {
    padding: 16px;
  }
}

/* Section Breathing Room */
.text-rich-text > h2:not(:first-of-type) {
  scroll-margin-top: 80px; /* For anchor links */
}

/* Loading Performance */
@supports (font-display: swap) {
  @font-face {
    font-family: 'Figtree';
    font-display: swap;
  }
}

/* Print Styles */
@media print {
  :root {
    --bg: white;
    --card: white;
  }

  .nav,
  .footer {
    display: none;
  }

  .text-rich-text h2 {
    page-break-after: avoid;
  }

  .text-rich-text a {
    color: var(--text);
    text-decoration: none;
  }

  .text-rich-text a::after {
    content: " (" attr(href) ")";
    font-size: 12px;
    color: var(--muted);
  }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: high) {
  :root {
    --text: #000000;
    --muted: #333333;
    --border: #999999;
  }
}

/* Focus Visible (Keyboard Navigation) */
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent-border);
  outline-offset: 2px;
  border-radius: 4px;
}
