/* ============================================ */
/* LEGAL PAGES - Premium Layout Styles         */
/* ============================================ */

/* Page Header */
.legal-page-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-bottom: 1px solid #e0e4e8;
  padding: 60px 0 50px;
}

.legal-page-header-content {
  max-width: 800px;
}

.legal-page-header h1 {
  font-size: 2.5rem;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0 0 12px 0;
  letter-spacing: -0.02em;
}

.legal-last-updated {
  font-size: 0.875rem;
  color: #6c757d;
  margin: 0;
}

/* Main Content Area */
.legal-page-content {
  padding: 60px 0 80px;
  background: #ffffff;
}

/* Layout Grid */
.legal-page-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 60px;
  align-items: start;
}

/* Table of Contents */
.legal-toc {
  display: block;
  position: relative;
  align-self: start;
}

.legal-toc-sticky {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid #e9ecef;
}

.legal-toc-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6c757d;
  margin: 0 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid #e9ecef;
}

.legal-toc-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  z-index: 10;
}

.legal-toc-item {
  margin: 0;
  padding: 0;
}

.legal-toc-item-sub {
  padding-left: 12px;
}

.legal-toc-link {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  font-size: 0.875rem;
  color: #495057;
  background: none;
  border: none;
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.4;
  text-decoration: none;
  position: relative;
  z-index: 10;
  pointer-events: auto;
}

.legal-toc-link:hover {
  color: #1a1a2e;
  background: #f8f9fa;
  text-decoration: none;
}

.legal-toc-item.active .legal-toc-link {
  color: #7A8C9F;
  border-left-color: #7A8C9F;
  background: rgba(122, 140, 159, 0.05);
  font-weight: 500;
}

/* Main Article */
.legal-article {
  max-width: 720px;
}

/* Content Styling */
.legal-content {
  font-size: 1rem;
  line-height: 1.8;
  color: #333;
}

/* Headings */
.legal-content h2,
.legal-content h3,
.legal-content .legal-heading[id] {
  scroll-margin-top: 140px;
}

.legal-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1a1a2e;
  margin: 48px 0 20px 0;
  padding-top: 24px;
  border-top: 1px solid #e9ecef;
  letter-spacing: -0.01em;
}

.legal-content h2:first-child,
.legal-content .legal-heading[id]:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.legal-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #2d2d44;
  margin: 32px 0 16px 0;
}

.legal-content h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #3d3d5c;
  margin: 24px 0 12px 0;
}

/* Paragraphs */
.legal-content p {
  margin: 0 0 20px 0;
  color: #4a4a4a;
}

/* Lists */
.legal-content ul,
.legal-content ol {
  margin: 0 0 24px 0;
  padding-left: 24px;
}

.legal-content li {
  margin-bottom: 10px;
  color: #4a4a4a;
  line-height: 1.7;
}

.legal-content li::marker {
  color: #7A8C9F;
}

/* Strong / Bold text */
.legal-content strong,
.legal-content b {
  font-weight: 600;
  color: #1a1a2e;
}

/* Links */
.legal-content a {
  color: #7A8C9F;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.legal-content a:hover {
  color: #5a6c7d;
}

/* Blockquotes - for key points or summaries */
.legal-content blockquote {
  margin: 24px 0;
  padding: 20px 24px;
  background: #f8f9fa;
  border-left: 4px solid #7A8C9F;
  border-radius: 0 8px 8px 0;
  font-style: normal;
}

.legal-content blockquote p {
  margin-bottom: 0;
  color: #495057;
}

.legal-content blockquote p:not(:last-child) {
  margin-bottom: 12px;
}

/* Tables */
.legal-content table {
  width: 100%;
  margin: 24px 0;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.legal-content th,
.legal-content td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #e9ecef;
}

.legal-content th {
  background: #f8f9fa;
  font-weight: 600;
  color: #1a1a2e;
}

.legal-content tr:hover td {
  background: #fafbfc;
}

/* Horizontal rules - section dividers */
.legal-content hr {
  border: none;
  height: 1px;
  background: #e9ecef;
  margin: 48px 0;
}

/* Support Section */
.legal-support-section {
  margin-top: 64px;
  padding-top: 48px;
  border-top: 1px solid #e9ecef;
}

.legal-support-content {
  background: linear-gradient(135deg, #f8f9fa 0%, #f1f3f5 100%);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
}

.legal-support-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0 0 8px 0;
}

.legal-support-content p {
  font-size: 0.9375rem;
  color: #6c757d;
  margin: 0 0 20px 0;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.legal-support-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: #7A8C9F;
  color: #ffffff;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.legal-support-link:hover {
  background: #6a7c8f;
  color: #ffffff;
  transform: translateY(-1px);
}

.legal-support-link svg {
  transition: transform 0.2s ease;
}

.legal-support-link:hover svg {
  transform: translateX(3px);
}

/* ============================================ */
/* RESPONSIVE STYLES                            */
/* ============================================ */

/* Tablet */
@media (max-width: 1024px) {
  .legal-page-layout {
    grid-template-columns: 220px 1fr;
    gap: 40px;
  }

  .legal-article {
    max-width: 100%;
  }
}

/* Mobile - Hide TOC, single column */
@media (max-width: 768px) {
  .legal-page-header {
    padding: 40px 0 32px;
  }

  .legal-page-header h1 {
    font-size: 1.75rem;
  }

  .legal-page-content {
    padding: 40px 0 60px;
  }

  .legal-page-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .legal-toc {
    display: none;
  }

  .legal-content {
    font-size: 0.9375rem;
  }

  .legal-content h2 {
    font-size: 1.25rem;
    margin: 36px 0 16px 0;
    padding-top: 20px;
  }

  .legal-content h3 {
    font-size: 1.125rem;
    margin: 24px 0 12px 0;
  }

  .legal-support-content {
    padding: 24px 20px;
  }

  .legal-support-content h3 {
    font-size: 1.125rem;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .legal-page-header {
    padding: 32px 0 24px;
  }

  .legal-page-header h1 {
    font-size: 1.5rem;
  }

  .legal-content {
    font-size: 0.875rem;
    line-height: 1.75;
  }

  .legal-content ul,
  .legal-content ol {
    padding-left: 20px;
  }

  .legal-content blockquote {
    padding: 16px 18px;
    margin: 20px 0;
  }
}

/* ============================================ */
/* KEY POINTS BOX (Optional use in content)    */
/* ============================================ */

/* To use: wrap summary text in <div class="key-points">...</div> in your HTML content */
.legal-content .key-points {
  margin: 24px 0 32px 0;
  padding: 20px 24px;
  background: linear-gradient(135deg, #f0f4f8 0%, #e8ecf1 100%);
  border-radius: 10px;
  border: 1px solid #dce1e7;
}

.legal-content .key-points-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6c757d;
  margin-bottom: 12px;
}

.legal-content .key-points ul {
  margin: 0;
  padding-left: 20px;
}

.legal-content .key-points li {
  font-size: 0.9375rem;
  color: #495057;
  margin-bottom: 6px;
}

.legal-content .key-points li:last-child {
  margin-bottom: 0;
}

/* ============================================ */
/* PRINT STYLES                                 */
/* ============================================ */
@media print {
  .legal-toc {
    display: none;
  }

  .legal-page-layout {
    grid-template-columns: 1fr;
  }

  .legal-support-section {
    display: none;
  }

  .legal-page-header {
    background: none;
    border-bottom: 2px solid #000;
  }

  .legal-content a {
    color: #000;
    text-decoration: underline;
  }

  .legal-content a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}
