/* ============================================
   Zastrow Auto Group, LLC — Legal Pages Stylesheet
   Shared by privacy.html and terms-of-service.html
   ============================================ */

/* Scope isolation: prevent homepage section styles from polluting legal pages.
   Targets only <section> elements inside .legal-content (the main body area),
   NOT the header or footer. */
.legal-page .legal-content section {
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.legal-page .legal-content section::before,
.legal-page .legal-content section::after {
  display: none !important;
}

/* Legal content container — centered with auto margins */
.legal-content .container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================
   LEGAL PAGE HEADER (as <div> or <header>, NOT <section>)
   ============================================ */

.legal-page-header {
  position: relative;
  padding: 100px 24px 60px;
  background: linear-gradient(160deg, #171925 0%, #1E2030 50%, #171925 100%);
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.legal-page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 100%;
  background: radial-gradient(ellipse at center, rgba(56, 189, 248, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.legal-page-header .header-content {
  position: relative;
  z-index: 1;
}

.legal-page-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.legal-page-header .effective-date {
  font-size: 0.9rem;
  color: #9A9DB0;
  font-weight: 500;
}

/* ============================================
   TABLE OF CONTENTS
   ============================================ */

.toc {
  background: rgba(23, 25, 37, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 28px 32px;
  margin: 40px 0;
}

.toc h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.toc ol {
  list-style: none;
  counter-reset: toc-counter;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
}

.toc ol li {
  counter-increment: toc-counter;
  font-size: 0.875rem;
  line-height: 1.6;
}

.toc ol li::before {
  content: counter(toc-counter) '.';
  color: #38BDF8;
  font-weight: 600;
  margin-right: 6px;
}

.toc ol li a {
  color: #9A9DB0;
  text-decoration: none;
  transition: color 0.2s;
}

.toc ol li a:hover {
  color: #38BDF8;
}

/* ============================================
   LEGAL CONTENT TYPOGRAPHY
   ============================================ */

.legal-page {
  background: #0E1016;
  color: #E2E4EA;
  min-height: 100vh;
}

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

.legal-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-top: 48px;
  margin-bottom: 16px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  scroll-margin-top: 90px;
}

.legal-content h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.legal-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: #D0D4E0;
  margin-top: 24px;
  margin-bottom: 10px;
}

.legal-content p {
  font-size: 0.95rem;
  line-height: 1.8;
  color: #B0B4C0;
  margin-bottom: 16px;
}

.legal-content ul,
.legal-content ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.legal-content li {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #B0B4C0;
  margin-bottom: 8px;
}

.legal-content strong {
  color: #E2E4EA;
  font-weight: 600;
}

.legal-content a {
  color: #38BDF8;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-content a:hover {
  color: #0EA5E9;
}

.legal-content address {
  font-style: normal;
  color: #B0B4C0;
  line-height: 1.8;
}

/* Back to top link */
.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #38BDF8;
  text-decoration: none;
  margin-top: 8px;
  font-weight: 500;
  transition: color 0.2s;
}

.back-to-top:hover {
  color: #0EA5E9;
}

/* ============================================
   LEGAL FOOTER
   ============================================ */

.legal-page .site-footer {
  margin-top: 0;
}

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

@media (max-width: 768px) {
  .legal-page-header {
    padding: 80px 24px 40px;
  }

  .legal-content h2 {
    scroll-margin-top: 70px;
  }

  .toc {
    padding: 20px 20px;
  }

  .toc ol {
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 480px) {
  .legal-page-header h1 {
    font-size: 1.6rem;
  }

  .legal-content h2 {
    font-size: 1.25rem;
  }

  .legal-content p {
    font-size: 0.9rem;
  }
}
