/* ==========================================================================
   STANDARD PAGES (PRIVACY, TERMS, EDITORIAL) — pages.css
   Clean, Responsive Document Layout with High-Contrast Dark Mode
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. ROOT VARIABLES (Light & High-Readability Dark Mode)
   -------------------------------------------------------------------------- */
:root {
  --doc-bg: #ffffff;
  --doc-border: #e2e8f0;
  --doc-border-subtle: #f1f5f9;
  --doc-text-main: #09090b;
  --doc-text-body: #334155;
  --doc-text-muted: #64748b;
  --doc-accent: #2563eb;
  --doc-accent-hover: #1d4ed8;
  --doc-badge-bg: #eff6ff;
  --doc-note-bg: #f8fafc;
  --doc-note-border: #e2e8f0;
  --doc-code-bg: #f1f5f9;
  --doc-code-border: #e2e8f0;
  --doc-code-text: #0f172a;
}

html.dark-mode,
body.dark-mode {
  --doc-bg: #0e1017;
  --doc-border: #222634;
  --doc-border-subtle: #181b26;
  --doc-text-main: #f8fafc;
  --doc-text-body: #e2e8f0;
  --doc-text-muted: #94a3b8;
  --doc-accent: #60a5fa;
  --doc-accent-hover: #93c5fd;
  --doc-badge-bg: #14203d;
  --doc-note-bg: #141724;
  --doc-note-border: #23283a;
  --doc-code-bg: #181c2b;
  --doc-code-border: #282e44;
  --doc-code-text: #93c5fd;
}

/* --------------------------------------------------------------------------
   2. PAGE WRAPPER (Exact 1080px Header/Footer Shell Alignment)
   -------------------------------------------------------------------------- */
.doc-page-wrapper {
  position: relative;
  z-index: 5;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) clamp(12px, 2.5vw, 24px) clamp(48px, 7vw, 96px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: clamp(32px, 4.5vw, 56px);
}

/* --------------------------------------------------------------------------
   3. HERO HEADER (Consistent with About & Contact Pages)
   -------------------------------------------------------------------------- */
.page-hero-section {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(8px, 1.5vw, 20px) 0 0;
}

.page-tag-pill {
  display: inline-block;
  font-size: clamp(10px, 1vw, 11.5px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--doc-accent);
  background: var(--doc-badge-bg);
  padding: 5px 14px;
  border-radius: 9999px;
  margin-bottom: clamp(12px, 1.8vw, 18px);
}

.page-hero-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 0.8vw, 8px);
  line-height: 1.15;
  margin-bottom: clamp(14px, 2vw, 20px);
  max-width: 820px;
  width: 100%;
}

.page-hero-title .font-sans-bold {
  font-family: var(--font-display);
  font-size: clamp(26px, 4.5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--doc-text-main);
  text-align: center;
}

.page-hero-title .font-serif-italic {
  font-family: var(--font-serif);
  font-size: clamp(27px, 4.8vw, 52px);
  font-style: italic;
  font-weight: 500;
  color: var(--doc-text-main);
  text-align: center;
}

.page-hero-subhead {
  font-size: clamp(13px, 1.25vw, 16px);
  color: var(--doc-text-muted);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   4. TWO-COLUMN LAYOUT (Desktop TOC + Main Card)
   -------------------------------------------------------------------------- */
.doc-layout-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: clamp(24px, 3.5vw, 44px);
  align-items: flex-start;
  width: 100%;
}

/* Sticky TOC Sidebar (Desktop Only) */
.doc-toc-sidebar {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.doc-toc-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--doc-text-muted);
  margin-bottom: 6px;
  display: block;
}

.doc-toc-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.doc-toc-link {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--doc-text-muted);
  text-decoration: none;
  line-height: 1.4;
  transition: all 0.2s ease;
}

.doc-toc-link:hover {
  background: var(--doc-note-bg);
  color: var(--doc-text-main);
}

.doc-toc-link.active {
  background: var(--doc-note-bg);
  color: var(--doc-accent);
  font-weight: 600;
}

.doc-sidebar-meta {
  padding-top: 16px;
  border-top: 1px solid var(--doc-border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-meta-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--doc-text-muted);
}

.sidebar-meta-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--doc-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

.sidebar-meta-link:hover {
  color: var(--doc-accent-hover);
  text-decoration: underline;
}

/* Right Main Document Card */
.doc-main-card {
  background: var(--doc-bg);
  border: 1px solid var(--doc-border);
  border-radius: clamp(16px, 2.2vw, 24px);
  padding: clamp(24px, 4vw, 48px);
  box-sizing: border-box;
  width: 100%;
}

.doc-content-stream {
  display: flex;
  flex-direction: column;
  gap: clamp(30px, 4vw, 44px);
}

.doc-section {
  scroll-margin-top: 100px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.doc-section h2 {
  font-family: var(--font-display);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 700;
  color: var(--doc-text-main);
  letter-spacing: -0.02em;
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--doc-border-subtle);
}

.doc-section h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--doc-text-main);
  margin: 10px 0 2px;
}

.doc-section p {
  font-size: clamp(14px, 1.1vw, 15.5px);
  line-height: 1.78;
  color: var(--doc-text-body);
  margin: 0;
}

.doc-section strong {
  color: var(--doc-text-main);
  font-weight: 700;
}

.doc-section a {
  color: var(--doc-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.doc-section a:hover {
  color: var(--doc-accent-hover);
}

.doc-section ul {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.doc-section li {
  font-size: clamp(13.5px, 1.05vw, 15px);
  line-height: 1.72;
  color: var(--doc-text-body);
}

.doc-section li::marker {
  color: var(--doc-accent);
}

/* Callout Note */
.doc-note-box {
  background: var(--doc-note-bg);
  border: 1px solid var(--doc-note-border);
  border-left: 3px solid var(--doc-accent);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 4px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.doc-note-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--doc-text-main);
}

.doc-note-box p {
  font-size: 14px;
  color: var(--doc-text-body);
  line-height: 1.65;
}

/* Inline Code Snippet */
.doc-section code {
  font-family: monospace;
  font-size: 13px;
  font-weight: 600;
  background: var(--doc-code-bg);
  color: var(--doc-code-text);
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--doc-code-border);
}

/* --------------------------------------------------------------------------
   5. RESPONSIVE BREAKPOINTS (Hide Sidebar on Mobile & Tablet)
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .doc-layout-grid {
    grid-template-columns: 1fr;
  }

  /* Completely hide table of contents on tablet and mobile */
  .doc-toc-sidebar {
    display: none;
  }
}

@media (max-width: 580px) {
  .doc-main-card {
    padding: 22px 18px;
  }

  .doc-section ul {
    padding-left: 18px;
  }
}