/* OddStorm legal pages (Terms, Privacy) — namespaced .olg-* and scoped
   under body.os-modern. Shared modern-page baseline (body theme, glow
   backdrops, chrome z-index, scroll-behaviour) lives in oddstorm-new.css
   so every modern page gets it without loading legal.css. */


/* ── Page grid ───────────────────────────────────────────────────── */

body.os-modern .olg {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 32px 96px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 64px;
  font-family: var(--font-body);
  color: var(--text);
}


/* ── TOC aside — sticky on desktop, collapsible <details> on mobile ─ */

body.os-modern .olg-aside {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  align-self: start;
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow-y: auto;
  padding: 18px 16px;
  background: color-mix(in srgb, var(--surface-container-low) 80%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--shape-md);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
body.os-modern .olg-aside[open] > .olg-aside-summary,
body.os-modern .olg-aside > .olg-aside-summary {
  /* On desktop the summary is the heading "On this page".
     <details>/<summary> defaults are kept but we restyle. */
  list-style: none;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 12px;
  padding: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
}
body.os-modern .olg-aside-summary::-webkit-details-marker { display: none; }
body.os-modern .olg-aside-chevron {
  width: 14px;
  height: 14px;
  transition: transform var(--t-fast);
  display: none; /* desktop: chevron hidden, summary acts as label */
}

body.os-modern .olg-toc {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
body.os-modern .olg-toc a {
  display: block;
  padding: 7px 10px;
  border-radius: var(--shape-xs);
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition:
    color var(--t-fast),
    background var(--t-fast),
    border-color var(--t-fast);
}
body.os-modern .olg-toc a:hover {
  color: var(--text);
  background: var(--surface-container);
  text-decoration: none;
}
body.os-modern .olg-toc a.is-active {
  color: var(--text);
  border-left-color: var(--primary);
  background: var(--surface-container);
}


/* ── Main content ────────────────────────────────────────────────── */

body.os-modern .olg-main {
  min-width: 0;
}
body.os-modern .olg-eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--primary-soft);
}
body.os-modern .olg-h1 {
  margin: 0 0 10px;
  font-family: var(--font-body);
  font-size: 40px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.5px;
  color: var(--text);
}
body.os-modern .olg-meta {
  margin: 0 0 40px;
  font-size: 13px;
  color: var(--text-muted);
}
body.os-modern .olg-meta strong {
  color: var(--text);
  font-weight: 600;
}

body.os-modern .olg-section {
  scroll-margin-top: calc(var(--header-h) + 24px);
  margin-bottom: 44px;
}
body.os-modern .olg-section h2 {
  margin: 0 0 16px;
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  letter-spacing: -0.1px;
}
body.os-modern .olg-section h3 {
  margin: 28px 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
body.os-modern .olg-section p,
body.os-modern .olg-section li {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
}
body.os-modern .olg-section p:last-child,
body.os-modern .olg-section li:last-child {
  margin-bottom: 0;
}
body.os-modern .olg-section ul {
  padding-left: 20px;
  margin: 0 0 14px;
  list-style: disc;
}
body.os-modern .olg-section li {
  margin: 0 0 8px;
}
body.os-modern .olg-section a {
  color: var(--primary-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--t-fast);
}
body.os-modern .olg-section a:hover {
  color: var(--primary);
}
body.os-modern .olg-section strong {
  font-weight: 700;
  color: var(--text);
}

body.os-modern .olg-callout {
  margin: 0 0 14px;
  padding: 18px 22px;
  background: color-mix(in srgb, var(--surface-container) 80%, transparent);
  border-left: 3px solid var(--primary);
  border-radius: var(--shape-sm);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
body.os-modern .olg-callout strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--primary-soft);
  letter-spacing: 0.2px;
}

body.os-modern .olg-contact {
  margin-top: 24px;
  padding: 22px 26px;
  border: 1px solid var(--border);
  border-radius: var(--shape-md);
  background: color-mix(in srgb, var(--surface-container-low) 70%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
body.os-modern .olg-contact dl {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px 18px;
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}
body.os-modern .olg-contact dt {
  color: var(--text-muted);
  font-weight: 600;
}
body.os-modern .olg-contact dd {
  margin: 0;
  color: var(--text);
}


/* ── Responsive ─────────────────────────────────────────────────── */

@media (max-width: 960px) {
  body.os-modern .olg {
    grid-template-columns: 1fr;
    padding: 24px 16px 56px;
    gap: 20px;
  }

  /* Mobile TOC becomes a collapsible <details> card. Default is
     closed (set by JS on <960px); user taps "On this page" to open. */
  body.os-modern .olg-aside {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 14px 16px;
  }
  body.os-modern .olg-aside-summary {
    cursor: pointer;
    user-select: none;
    margin: 0 !important;
    padding: 4px 0 !important;
  }
  body.os-modern .olg-aside[open] .olg-aside-summary {
    margin: 0 0 12px !important;
  }
  body.os-modern .olg-aside-chevron {
    display: block;
    transition: transform var(--t-base);
    color: var(--text-muted);
  }
  body.os-modern .olg-aside[open] .olg-aside-chevron {
    transform: rotate(180deg);
  }
  body.os-modern .olg-toc a {
    padding: 10px 12px;
    font-size: 14px;
  }

  body.os-modern .olg-h1 {
    font-size: 30px;
    letter-spacing: -0.3px;
  }
  body.os-modern .olg-meta {
    margin-bottom: 28px;
  }
  body.os-modern .olg-section {
    margin-bottom: 32px;
  }
  body.os-modern .olg-section h2 {
    font-size: 20px;
  }
  body.os-modern .olg-section p,
  body.os-modern .olg-section li {
    font-size: 15px;
  }
  body.os-modern .olg-contact dl {
    grid-template-columns: 1fr;
    gap: 2px 0;
  }
  body.os-modern .olg-contact dt {
    margin-top: 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  body.os-modern .olg-contact dt:first-child {
    margin-top: 0;
  }
}
