/* Legal pages — responsive layout & scan-friendly hierarchy */

.page-legal {
  overflow-x: hidden;
}

.lg-page {
  padding: clamp(3rem, 8vw, 5rem) 0 clamp(2.5rem, 6vw, 4.5rem);
  background: var(--bg-dark);
  min-height: calc(100vh - 64px);
  overflow-x: hidden;
}

.lg-page .container {
  width: 100%;
  max-width: 920px;
}

/* Top nav between legal pages */
.lg-page-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-card);
}

.lg-page-nav-link {
  color: var(--light-text);
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.875rem 1rem;
  text-decoration: none;
  border-bottom: 1px solid var(--border-color);
  transition: color 0.15s ease, background 0.15s ease;
}

.lg-page-nav-link:last-child {
  border-bottom: none;
}

.lg-page-nav-link.active {
  color: var(--dark-text);
  background: rgba(245, 197, 24, 0.08);
  box-shadow: inset 3px 0 0 var(--primary-brown);
}

.lg-page-nav-link:hover:not(.active) {
  color: var(--dark-text);
  background: rgba(255, 255, 255, 0.03);
}

@media (min-width: 640px) {
  .lg-page-nav {
    flex-direction: row;
    border-radius: 999px;
    padding: 4px;
    gap: 4px;
  }

  .lg-page-nav-link {
    flex: 1;
    text-align: center;
    border-bottom: none;
    border-radius: 999px;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    box-shadow: none;
  }

  .lg-page-nav-link.active {
    background: rgba(245, 197, 24, 0.14);
    box-shadow: none;
  }
}

/* Hero */
.lg-hero {
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

.lg-hero-title {
  font-size: clamp(1.5rem, 5vw, 2.125rem);
  font-weight: 700;
  color: var(--dark-text);
  margin: 0 0 0.625rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.lg-hero-subtitle {
  color: var(--light-text);
  font-size: clamp(0.9375rem, 2.5vw, 1.0625rem);
  line-height: 1.6;
  max-width: 42rem;
  margin: 0;
}

/* Table of contents (regulation) */
.lg-toc {
  margin-bottom: clamp(1.25rem, 3vw, 1.75rem);
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-panel);
}

.lg-toc__label {
  margin: 0 0 0.75rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--light-text);
}

.lg-toc__links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.lg-toc__links a {
  display: block;
  padding: 0.5rem 0.625rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--dark-text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.lg-toc__links a:hover {
  border-color: var(--border-color);
  background: rgba(245, 197, 24, 0.08);
  color: var(--primary-brown);
}

@media (min-width: 480px) {
  .lg-toc__links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .lg-toc__links {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Warning callout */
.lg-warning-box {
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-left-width: 4px;
  border-left-color: #f59e0b;
  padding: clamp(0.875rem, 3vw, 1.125rem) clamp(1rem, 3vw, 1.25rem);
  background: rgba(245, 158, 11, 0.08);
  border-radius: 0 10px 10px 0;
  margin-bottom: clamp(1.25rem, 3vw, 1.75rem);
}

.lg-warning-box p {
  margin: 0;
  color: var(--dark-text);
  font-size: clamp(0.875rem, 2.5vw, 0.9375rem);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.lg-warning-box strong {
  color: #fbbf24;
}

/* Numbered sections stack */
.lg-sections {
  counter-reset: lg-section;
  display: flex;
  flex-direction: column;
  gap: clamp(0.875rem, 2.5vw, 1.25rem);
}

.lg-section {
  counter-increment: lg-section;
  padding: clamp(1rem, 3.5vw, 1.5rem);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-card);
  scroll-margin-top: 5rem;
  min-width: 0;
}

.lg-section > h2 {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: clamp(1rem, 3.2vw, 1.1875rem);
  font-weight: 700;
  color: var(--dark-text);
  margin: 0 0 0.875rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.lg-section > h2::before {
  content: counter(lg-section);
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.35rem;
  border-radius: 8px;
  background: rgba(245, 197, 24, 0.14);
  color: var(--primary-brown);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1;
  margin-top: 0.05em;
}

.lg-section h3 {
  font-size: clamp(0.9375rem, 2.5vw, 1rem);
  font-weight: 600;
  color: var(--dark-text);
  margin: 1.25rem 0 0.5rem;
  line-height: 1.4;
}

.lg-section p {
  color: var(--light-text);
  line-height: 1.65;
  font-size: clamp(0.875rem, 2.5vw, 0.9375rem);
  margin: 0 0 0.75rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.lg-section p:last-child {
  margin-bottom: 0;
}

.lg-section ul,
.lg-section ol {
  margin: 0.25rem 0 0;
  padding-inline-start: 1.125rem;
  color: var(--light-text);
}

.lg-section ul {
  list-style: disc;
}

.lg-section ol {
  list-style: decimal;
}

.lg-section li {
  font-size: clamp(0.875rem, 2.5vw, 0.9375rem);
  line-height: 1.65;
  margin-bottom: 0.625rem;
  padding-inline-start: 0.25rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.lg-section li:last-child {
  margin-bottom: 0;
}

.lg-section a {
  color: var(--primary-brown);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lg-section a:hover {
  color: var(--dark-brown);
}

/* Standalone section (privacy data controller) */
.lg-section--solo {
  margin-bottom: clamp(0.875rem, 2.5vw, 1.25rem);
}

.lg-section--solo > h2::before {
  content: none;
  display: none;
}

/* Meta grid */
.lg-meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.625rem;
  margin-top: 0.25rem;
}

@media (min-width: 540px) {
  .lg-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.lg-meta-item {
  padding: 0.75rem 0.875rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
  min-width: 0;
}

.lg-meta-item dt {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--light-text);
  margin-bottom: 0.25rem;
}

.lg-meta-item dd {
  margin: 0;
  color: var(--dark-text);
  font-weight: 600;
  font-size: clamp(0.8125rem, 2.5vw, 0.9375rem);
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.lg-meta-item dd a {
  color: var(--primary-brown);
}

/* CMS / default prose body */
.lg-content-card {
  padding: clamp(1rem, 3.5vw, 1.5rem);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-card);
  min-width: 0;
}

.lg-prose {
  color: var(--light-text);
  line-height: 1.65;
  font-size: clamp(0.875rem, 2.5vw, 0.9375rem);
  min-width: 0;
}

.lg-prose > *:first-child {
  margin-top: 0;
}

.lg-prose > *:last-child {
  margin-bottom: 0;
}

.lg-prose h2 {
  color: var(--dark-text);
  font-size: clamp(1.0625rem, 3vw, 1.25rem);
  font-weight: 700;
  margin: 1.75rem 0 0.625rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

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

.lg-prose h3 {
  color: var(--dark-text);
  font-size: clamp(0.9375rem, 2.5vw, 1.0625rem);
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.lg-prose p {
  margin: 0 0 0.875rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.lg-prose ul,
.lg-prose ol {
  margin: 0 0 0.875rem;
  padding-inline-start: 1.125rem;
}

.lg-prose ul {
  list-style: disc;
}

.lg-prose ol {
  list-style: decimal;
}

.lg-prose li {
  margin-bottom: 0.5rem;
  padding-inline-start: 0.25rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.lg-prose li:last-child {
  margin-bottom: 0;
}

.lg-prose a {
  color: var(--primary-brown);
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.lg-prose strong {
  color: var(--dark-text);
  font-weight: 600;
}

/* Footer cross-links */
.lg-footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-top: clamp(1.5rem, 4vw, 2rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

@media (min-width: 480px) {
  .lg-footer-links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
  }
}

.lg-footer-links a {
  color: var(--primary-brown);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
}

.lg-footer-links a:hover {
  text-decoration: underline;
}
@media (max-width: 380px) {
  .lg-section > h2 {
    gap: 0.5rem;
  }

  .lg-section > h2::before {
    min-width: 1.5rem;
    height: 1.5rem;
    font-size: 0.75rem;
  }

  .lg-section ul,
  .lg-section ol,
  .lg-prose ul,
  .lg-prose ol {
    padding-inline-start: 1rem;
  }
}
