/* =========================================================
   LEGAL / POLICY PAGES (Privacy, GDPR, Terms, Cookies)
   Tab nav at top → unclassed prose content below.
   Single .legal__content wrapper styles every semantic tag.
   ========================================================= */

/* =========================================================
   PAGE HERO — title + tab navigation
   ========================================================= */
.legal-hero {
  position: relative;
  padding-top: calc(var(--header-h) + 32px);
  padding-bottom: 0;
  background: #fff;
  border-bottom: 1px solid var(--border);
  clip-path: inset(0);
  overflow: hidden;
}

.legal-hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.legal-hero__bg-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(28, 25, 23, .07) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 90% 90% at 25% 50%, #000 30%, transparent 95%);
  -webkit-mask-image: radial-gradient(ellipse 90% 90% at 25% 50%, #000 30%, transparent 95%);
}

.legal-hero__bg-glow {
  position: absolute;
  top: 50%;
  right: -10%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle,
      rgba(28, 25, 23, .14) 0%,
      rgba(28, 25, 23, .04) 40%,
      rgba(28, 25, 23, 0) 70%);
  filter: blur(40px);
  transform: translateY(-50%);
  animation: legal-glow 8s ease-in-out infinite alternate;
}

@keyframes legal-glow {
  0% {
    opacity: .6;
    transform: translateY(-50%) scale(.9);
  }

  100% {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
  }
}

.legal-hero>.container {
  position: relative;
  z-index: 1;
}

.legal-crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: clamp(28px, 4vw, 40px);
  font-size: var(--t-xs);
  color: var(--text-muted);
}

.legal-crumbs a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}

.legal-crumbs a:hover {
  color: var(--text);
}

.legal-crumbs i {
  font-size: .75rem;
  color: var(--text-light);
}

.legal-crumbs span {
  color: var(--text);
  font-weight: 500;
}

.legal-hero__meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 14px;
}

.legal-hero__meta::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--text-muted);
}

.legal-hero__title {
  font-size: clamp(1.85rem, 3.6vw, 2.6rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -.025em;
  color: var(--text);
  margin-bottom: 12px;
}

.legal-hero__subtitle {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 680px;
  margin-bottom: clamp(28px, 4vw, 40px);
}

/* =========================================================
   TAB NAVIGATION
   ========================================================= */
.legal-tabs {
  display: flex;
  gap: 4px;
  align-items: stretch;
  /* Sit on the section's bottom border so the active tab can
     visually merge with the page below */
  margin-bottom: -1px;
  overflow-x: auto;
  scrollbar-width: none;
}

.legal-tabs::-webkit-scrollbar {
  display: none;
}

.legal-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--t-fast) var(--ease),
    background var(--t-fast) var(--ease);
}

.legal-tab i {
  font-size: 1rem;
  /* Soft brand-blue tint by default — strong accent when active */
  color: rgba(28, 25, 23, .55);
  transition: color var(--t-fast) var(--ease);
}

.legal-tab:hover {
  color: var(--text);
  background: rgba(28, 25, 23, .03);
}

.legal-tab:hover i {
  color: var(--accent);
}

/* Active tab — connects visually to content area below */
.legal-tab.is-active {
  background: var(--bg-soft);
  border-color: var(--border);
  color: var(--text);
  font-weight: 600;
}

.legal-tab.is-active i {
  color: var(--accent);
}

/* =========================================================
   CONTENT AREA — auto-styles every semantic tag inside
   ========================================================= */
.legal-body {
  padding: clamp(48px, 7vw, 80px) 0;
  background: var(--bg-soft);
}

.legal-body__wrap {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

/* Sticky meta sidebar — last updated, version, PDF link */
.legal-meta {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 22px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.legal-meta__group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.legal-meta__label {
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--text-muted);
  font-weight: 500;
}

.legal-meta__value {
  font-size: var(--t-sm);
  color: var(--text);
  font-weight: 500;
}

.legal-meta__divider {
  height: 1px;
  background: var(--border);
}

/* =========================================================
   .legal__content — typography for unclassed prose
   Backend can dump raw HTML and every tag is styled here.
   ========================================================= */
.legal__content {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: clamp(28px, 5vw, 56px);
  color: var(--text);
  font-size: var(--t-sm);
  line-height: 1.7;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* ---------- HEADINGS ---------- */
.legal__content h1,
.legal__content h2,
.legal__content h3,
.legal__content h4,
.legal__content h5,
.legal__content h6 {
  color: var(--text);
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.25;
  margin: 1.8em 0 .55em;
}

.legal__content> :first-child {
  margin-top: 0;
}

.legal__content h1 {
  font-size: clamp(1.35rem, 2.2vw, 1.65rem);
  letter-spacing: -.02em;
  margin-top: 0;
}

.legal__content h2 {
  font-size: clamp(1.1rem, 1.6vw, 1.25rem);
  padding-top: .3em;
  margin-top: 2em;
  position: relative;
}

/* Decorative accent bar before h2 — subtle visual rhythm */
.legal__content h2::before {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: var(--accent);
  margin-bottom: .8em;
  border-radius: 2px;
}

.legal__content h3 {
  font-size: clamp(.98rem, 1.3vw, 1.05rem);
  margin-top: 1.6em;
}

.legal__content h4 {
  font-size: .95rem;
  margin-top: 1.4em;
}

.legal__content h5,
.legal__content h6 {
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-top: 1.4em;
}

/* ---------- PARAGRAPHS & INLINE ---------- */
.legal__content p {
  margin: 0 0 1.1em;
  color: var(--text-muted);
}

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

.legal__content strong,
.legal__content b {
  color: var(--text);
  font-weight: 600;
}

.legal__content em,
.legal__content i {
  font-style: italic;
}

.legal__content u {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.legal__content small {
  font-size: .85em;
  color: var(--text-muted);
}

.legal__content sub,
.legal__content sup {
  font-size: .75em;
  color: var(--text-muted);
}

.legal__content mark {
  background: rgba(28, 25, 23, .12);
  color: var(--text);
  padding: 0 4px;
  border-radius: 3px;
}

.legal__content del,
.legal__content s {
  color: var(--text-light);
  text-decoration: line-through;
}

/* ---------- LINKS ---------- */
.legal__content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: color var(--t-fast) var(--ease);
}

.legal__content a:hover {
  color: var(--accent-hover, #292524);
  text-decoration-thickness: 2px;
}

/* ---------- LISTS (ul, ol, nested) ---------- */
.legal__content ul,
.legal__content ol {
  margin: 0 0 1.1em;
  padding-left: 1.5em;
  color: var(--text-muted);
}

.legal__content ul li,
.legal__content ol li {
  margin: .35em 0;
  padding-left: .25em;
  line-height: 1.65;
}

.legal__content ul li::marker {
  color: var(--accent);
}

.legal__content ol li::marker {
  color: var(--accent);
  font-weight: 600;
}

/* Nested list styling — different bullet, tighter spacing */
.legal__content ul ul,
.legal__content ol ol,
.legal__content ul ol,
.legal__content ol ul {
  margin: .35em 0;
}

.legal__content ul ul li::marker {
  /* En-dash style for nested */
  content: '– ';
}

/* ---------- BLOCKQUOTE ---------- */
.legal__content blockquote {
  margin: 1.4em 0;
  padding: 14px 20px;
  background: var(--bg-soft);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  color: var(--text-muted);
  font-style: italic;
}

.legal__content blockquote p:last-child {
  margin-bottom: 0;
}

/* ---------- CODE ---------- */
.legal__content code {
  font-family: 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  font-size: .9em;
  padding: 2px 6px;
  background: var(--bg-softer);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
}

.legal__content pre {
  margin: 1.4em 0;
  padding: 16px 20px;
  background: var(--bg-softer);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
  font-size: .9em;
  line-height: 1.55;
}

.legal__content pre code {
  padding: 0;
  background: transparent;
  border: none;
}

/* ---------- TABLES ---------- */
.legal__content table {
  width: 100%;
  margin: 1.5em 0;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md, 10px);
  overflow: hidden;
  font-size: var(--t-xs);
}

.legal__content thead {
  background: var(--bg-softer);
}

.legal__content th,
.legal__content td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.55;
}

.legal__content th {
  font-weight: 600;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
}

.legal__content tbody tr:last-child td {
  border-bottom: none;
}

.legal__content tbody tr:hover {
  background: var(--bg-soft);
}

/* ---------- HORIZONTAL RULE ---------- */
.legal__content hr {
  margin: 2em 0;
  border: none;
  height: 1px;
  background: var(--border);
}

/* ---------- IMAGES & MEDIA ---------- */
.legal__content img,
.legal__content video {
  max-width: 100%;
  height: auto;
  margin: 1.4em 0;
  border-radius: 8px;
  display: block;
}

.legal__content figure {
  margin: 1.4em 0;
}

.legal__content figcaption {
  margin-top: 8px;
  font-size: var(--t-xs);
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
}

/* ---------- DEFINITION LIST ---------- */
.legal__content dl {
  margin: 1.1em 0;
}

.legal__content dt {
  font-weight: 600;
  color: var(--text);
  margin-top: .8em;
}

.legal__content dd {
  margin: .25em 0 0 1.5em;
  color: var(--text-muted);
}

/* ---------- KBD / ABBR ---------- */
.legal__content kbd {
  font-family: 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;
  font-size: .85em;
  padding: 2px 6px;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  box-shadow: 0 1px 0 var(--border-strong);
  color: var(--text);
}

.legal__content abbr[title] {
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: help;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 992px) {
  .legal-body__wrap {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .legal-meta {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 24px;
    align-items: center;
  }

  .legal-meta__divider {
    display: none;
  }
}

@media (max-width: 768px) {
  .legal-tab {
    padding: 11px 16px;
    font-size: var(--t-xs);
  }

  .legal__content {
    padding: 24px 22px;
  }

  .legal__content h2::before {
    margin-bottom: .7em;
  }
}

@media (max-width: 576px) {
  .legal-meta {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .legal__content table {
    font-size: var(--t-xs);
  }

  .legal__content th,
  .legal__content td {
    padding: 10px 12px;
  }
}