/* ============================================================
   GOAT DEEPER — legal pages (privacy policy / terms of use)
   Loaded after styles.css; reuses its tokens, nav and footer.
   ============================================================ */

/* ---------- Simplified nav for legal pages ---------- */
.nav--legal { background: rgba(7,7,12,0.72); backdrop-filter: blur(16px) saturate(140%); border-bottom-color: var(--line); }
.nav__links--legal { font-size: 15px; }
.nav__links--legal a.is-current { color: var(--gold); }
.nav__links--legal a.is-current::after { width: 100%; }

/* Language swap (EN | FR) */
.langswap {
  display: flex; align-items: center; gap: 2px;
  padding: 4px; border-radius: 12px;
  background: var(--glass); border: 1px solid var(--line);
}
.langswap__opt {
  font-family: var(--display); font-weight: 800; font-size: 12px; letter-spacing: .06em;
  color: var(--text-faint);
  padding: 6px 11px; border-radius: 9px;
  transition: color .2s, background .2s;
}
.langswap__opt:hover { color: var(--text); }
.langswap__opt.is-active { color: #1a1400; background: linear-gradient(180deg, var(--gold-light), var(--gold)); }

/* ---------- Page shell ---------- */
.legal { max-width: var(--maxw); margin: 0 auto; padding: 132px clamp(18px, 4vw, 48px) 40px; }

.legal__head { text-align: center; max-width: 760px; margin: 0 auto clamp(48px, 6vw, 76px); }
.legal__head h1 { font-size: clamp(36px, 5.6vw, 64px); margin: 22px 0 18px; }
.legal__lede { color: var(--text-dim); font-size: 17px; max-width: 42em; margin: 0 auto; }
.legal__meta {
  margin-top: 26px; display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px;
  color: var(--text-faint); font-size: 13px; letter-spacing: .04em;
  padding: 10px 18px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--line);
}
.legal__meta strong { color: var(--text-dim); font-weight: 600; }

/* ---------- At a glance ---------- */
.glance { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: clamp(48px, 6vw, 80px); }
.glance .card h3 { font-size: 17px; margin: 0 0 10px; }
.glance .card p { font-size: 14.5px; }
.glance .card::before {
  content: ""; display: block; width: 34px; height: 3px; border-radius: 99px;
  background: linear-gradient(90deg, var(--gold), transparent);
  margin-bottom: 18px;
}

/* ---------- Layout: sticky TOC + prose ---------- */
.legal__layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }

.toc { position: sticky; top: 96px; max-height: calc(100vh - 130px); overflow-y: auto; padding-right: 6px; }
.toc__title {
  font-family: var(--display); font-weight: 800; font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 16px;
}
.toc ol { list-style: none; counter-reset: toc; display: flex; flex-direction: column; gap: 2px; }
.toc a {
  counter-increment: toc;
  display: block; padding: 7px 12px 7px 34px; position: relative;
  font-size: 14px; line-height: 1.35; color: var(--text-faint);
  border-radius: 9px; border-left: 2px solid transparent;
  transition: color .2s, background .2s, border-color .2s;
}
.toc a::before {
  content: counter(toc); position: absolute; left: 12px; top: 7px;
  font-variant-numeric: tabular-nums; font-size: 12px; opacity: .55;
}
.toc a:hover { color: var(--text); background: var(--glass); }
.toc a.is-active { color: var(--gold); background: rgba(252,202,6,0.07); border-left-color: var(--gold); }
.toc::-webkit-scrollbar { width: 6px; }
.toc::-webkit-scrollbar-thumb { background: rgba(252,202,6,0.22); border-radius: 99px; }

/* ---------- Prose ---------- */
.legal__body { max-width: 74ch; font-size: 16px; color: var(--text-dim); }
.legal__body > section { scroll-margin-top: 96px; padding-bottom: 46px; }
.legal__body > section + section { border-top: 1px solid var(--line); padding-top: 46px; }

.legal__body h2 {
  font-size: clamp(22px, 2.6vw, 30px); color: var(--text);
  margin-bottom: 20px; display: flex; align-items: baseline; gap: 14px;
}
.legal__body h2 .n {
  font-size: 13px; font-family: var(--body); font-weight: 700;
  color: var(--gold); letter-spacing: .1em; flex: 0 0 auto;
  padding-top: 4px;
}
.legal__body h3 { font-size: 17px; color: var(--text); margin: 30px 0 12px; letter-spacing: 0; }
.legal__body p { margin-bottom: 16px; }
.legal__body p:last-child, .legal__body ul:last-child { margin-bottom: 0; }
.legal__body strong { color: var(--text); font-weight: 600; }
.legal__body em { color: var(--gold); font-style: normal; }

.legal__body a:not(.btn) { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: rgba(252,202,6,0.4); }
.legal__body a:not(.btn):hover { text-decoration-color: var(--gold); }

.legal__body ul { list-style: none; margin: 0 0 18px; display: flex; flex-direction: column; gap: 10px; }
.legal__body li { position: relative; padding-left: 22px; }
.legal__body li::before {
  content: ""; position: absolute; left: 2px; top: 10px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold); opacity: .7;
}
.legal__body ul ul { margin: 10px 0 0; }

/* Tables */
.legal__table { width: 100%; overflow-x: auto; margin: 0 0 20px; border-radius: 16px; border: 1px solid var(--line); background: var(--glass); }
.legal__table table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 480px; }
.legal__table th, .legal__table td { text-align: left; padding: 13px 16px; vertical-align: top; }
.legal__table thead th {
  font-family: var(--display); font-weight: 800; font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold); background: rgba(252,202,6,0.05);
  border-bottom: 1px solid var(--line);
}
.legal__table tbody tr + tr td { border-top: 1px solid rgba(255,255,255,0.06); }
.legal__table td strong { color: var(--text); }
[dir="rtl"] .legal__table th, [dir="rtl"] .legal__table td { text-align: right; }

/* Callout */
.callout {
  position: relative;
  padding: 20px 22px 20px 24px;
  margin: 0 0 20px;
  border-radius: 16px;
  background: rgba(252,202,6,0.055);
  border: 1px solid rgba(252,202,6,0.22);
  font-size: 15px;
}
.callout p:last-child { margin-bottom: 0; }
.callout__label {
  display: block;
  font-family: var(--display); font-weight: 800; font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 10px;
}

/* Placeholder awaiting STORIA's registry details — remove once filled */
.todo {
  background: rgba(255, 90, 90, 0.16);
  color: #ffb3b3;
  border: 1px dashed rgba(255, 120, 120, 0.55);
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 0.92em;
  font-weight: 600;
}

/* Footer links on legal pages */
.footer__nav a.is-current { color: var(--gold); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .legal__layout { grid-template-columns: 1fr; }
  .toc {
    position: static; max-height: none; padding: 20px 18px;
    border-radius: var(--radius); background: var(--glass); border: 1px solid var(--line);
    margin-bottom: 40px;
  }
  .toc ol { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px; }
  .toc a.is-active { background: rgba(252,202,6,0.07); }
}
@media (max-width: 700px) {
  .legal { padding-top: 112px; }
  .nav__links--legal { display: none; }
}
