/*
 * ALG — Legal pages (Privacy, Terms, Refund, Shipping, Security)
 * Loaded for any page whose slug appears in $alg_legal_slugs (functions.php).
 *
 * Tokens (colors, fonts) live in the parent style.css :root block.
 */

/* ── HERO BAND ───────────────────────────────── */
.alg-legal-hero {
  background: var(--c-bg-card);
  color: var(--c-white);
  padding: 4.5rem 0 3.5rem;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw !important;
  margin-right: -50vw !important;
  max-width: 100vw !important;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.alg-legal-hero__inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 32px;
}

.alg-legal-hero h1.alg-legal-hero__title,
.alg-legal-hero .alg-legal-hero__title {
  font-family: var(--font-display) !important;
  font-size: clamp(1.75rem, 3.5vw, 2.75rem) !important;
  font-weight: var(--fw-bold) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.02em !important;
  line-height: 1.1 !important;
  color: var(--c-white) !important;
  margin: 0 0 0.75rem !important;
  padding: 0 !important;
}

.alg-legal-hero__updated {
  font-family: var(--font-sans) !important;
  font-size: 13px !important;
  font-weight: var(--fw-medium) !important;
  letter-spacing: 0.04em !important;
  color: rgba(255,255,255,0.55) !important;
  margin: 0 !important;
  text-transform: uppercase;
}

/* ── BODY ────────────────────────────────────── */
.alg-legal {
  background: var(--c-bg-page);
  color: var(--c-white);
  padding: 4rem 0 6rem;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw !important;
  margin-right: -50vw !important;
  max-width: 100vw !important;
}

.alg-legal__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 56px;
  align-items: start;
}

/* ── TABLE OF CONTENTS ──────────────────────── */
.alg-legal__toc {
  position: sticky;
  top: 100px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 20px 22px;
}

.alg-legal h2.alg-legal__toc-title,
.alg-legal .alg-legal__toc-title {
  font-family: var(--font-sans) !important;
  font-size: 11px !important;
  font-weight: var(--fw-bold) !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: rgba(255,255,255,0.55) !important;
  margin: 0 0 14px !important;
  padding: 0 !important;
}

.alg-legal__toc ol {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  counter-reset: legal-toc;
}

.alg-legal__toc li {
  counter-increment: legal-toc;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.alg-legal__toc li::before,
.alg-legal__toc li::marker { content: none !important; }

.alg-legal__toc a {
  display: block;
  font-family: var(--font-sans) !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  color: rgba(255,255,255,0.78) !important;
  text-decoration: none !important;
  padding: 6px 0 6px 26px;
  position: relative;
  transition: color var(--t-fast) ease;
}

.alg-legal__toc a::before {
  content: counter(legal-toc) ".";
  position: absolute;
  left: 0;
  top: 6px;
  color: rgba(255,255,255,0.4);
  font-weight: var(--fw-medium);
  font-size: 12px;
  min-width: 22px;
}

.alg-legal__toc a:hover {
  color: var(--c-yellow) !important;
}

/* ── BODY CONTENT ───────────────────────────── */
.alg-legal__body {
  min-width: 0;
}

.alg-legal__section {
  margin: 0 0 2.5rem;
  scroll-margin-top: 100px;
}

.alg-legal__section:last-child { margin-bottom: 0; }

.alg-legal h2.alg-legal__section-title,
.alg-legal .alg-legal__section-title {
  font-family: var(--font-display) !important;
  font-size: clamp(1.15rem, 1.6vw, 1.4rem) !important;
  font-weight: var(--fw-bold) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.02em !important;
  line-height: 1.25 !important;
  color: var(--c-white) !important;
  margin: 0 0 1rem !important;
  padding: 0 !important;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.alg-legal__section-num {
  color: var(--c-yellow);
  font-weight: var(--fw-black);
  flex: 0 0 auto;
}

.alg-legal__section p {
  font-family: var(--font-sans) !important;
  font-size: 0.95rem !important;
  font-weight: var(--fw-regular) !important;
  line-height: 1.75 !important;
  color: rgba(255,255,255,0.82) !important;
  margin: 0 0 1rem !important;
}

.alg-legal__section p:last-child { margin-bottom: 0 !important; }

.alg-legal__section p strong {
  color: var(--c-white) !important;
  font-weight: var(--fw-bold);
}

.alg-legal__section p a {
  color: var(--c-yellow) !important;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.alg-legal__section p a:hover {
  color: var(--c-yellow-dark) !important;
}

/* ── RESPONSIVE ─────────────────────────────── */
@media (max-width: 1024px) {
  .alg-legal__inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .alg-legal__toc {
    position: static;
    top: auto;
  }
}

@media (max-width: 768px) {
  .alg-legal-hero { padding: 3rem 0 2.5rem; }
  .alg-legal { padding: 3rem 0 4rem; }
  .alg-legal__inner { padding: 0 20px; }
  .alg-legal__section { margin-bottom: 2rem; }
  .alg-legal h2.alg-legal__section-title { font-size: 1.05rem !important; }
  .alg-legal__section p { font-size: 0.9rem !important; }
}
