/* ── Fonts ────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ─────────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  background-color: #f8fafc;
  color: #1e293b;
  font-family: var(--font-primary, 'Inter', sans-serif);
  font-size: var(--text-body-sm, 16px);
  line-height: 1.6;
  letter-spacing: -0.02em;
  -webkit-font-smoothing: antialiased;
}

body {
  overflow-x: hidden;
  background-color: #f8fafc;
}

a { color: inherit; text-decoration: none; }
ul, ol { padding-left: 1.4em; }
li { margin-bottom: 8px; }
strong { font-weight: 600; color: #0f172a; }

/* ── Nav ──────────────────────────────────────────────────── */
.codes-nav {
  background-color: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.codes-nav-inner {
  max-width: var(--page-max-width, 1200px);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--spacing-24, 24px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-24, 24px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #0f172a;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.logo-icon {
  border: 1px solid #0f172a;
  color: #0f172a;
  padding: 4px 8px;
  font-size: 13px;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  border-radius: 4px;
}

.logo-text {
  font-size: 18px;
}

.codes-nav-links {
  display: flex;
  gap: var(--spacing-24, 24px);
}

.codes-nav-link {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #64748b;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: all 0.15s ease;
}

.codes-nav-link:hover, .codes-nav-link.active {
  color: #0f172a;
  border-bottom-color: #0f172a;
}

.btn-back {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  border: 1px solid #e2e8f0;
  padding: 8px 16px;
  border-radius: 10px;
  background-color: #ffffff;
  transition: all 0.2s ease;
  color: #0f172a;
}

.btn-back:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
}

/* ── Layout Container ─────────────────────────────────────── */
.codes-layout-container {
  max-width: var(--page-max-width, 1200px);
  margin: 0 auto;
  padding: 40px var(--spacing-24, 24px) 80px var(--spacing-24, 24px);
  display: flex;
  gap: 48px;
  position: relative;
}

/* ── Sidebar (Left Column) ────────────────────────────────── */
.codes-sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 96px;
  height: calc(100vh - 140px);
  overflow-y: auto;
  padding-right: 16px;
  border-right: 1px solid #e2e8f0;
}

/* Scrollbar styling for sidebar */
.codes-sidebar::-webkit-scrollbar {
  width: 4px;
}
.codes-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.codes-sidebar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-link {
  background: none;
  border: none;
  text-align: left;
  padding: 8px 12px;
  font-family: var(--font-primary, sans-serif);
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}

.sidebar-link:hover {
  color: #2563eb;
  background-color: #eff6ff;
}

.sidebar-link.active {
  color: #2563eb;
  background-color: #eff6ff;
  font-weight: 600;
}

/* ── Main Content (Right Column) ──────────────────────────── */
.codes-main {
  flex: 1;
  max-width: 840px;
}

/* ── Document Header ──────────────────────────────────────── */
.doc-header {
  margin-bottom: 48px;
}

.doc-eyebrow {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #2563eb;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.doc-heading {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.2;
  color: #0f172a;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.doc-lead {
  border-left: 4px solid #2563eb;
  padding-left: 20px;
  font-size: 18px;
  line-height: 1.6;
  color: #475569;
  margin-bottom: 24px;
}

.info-card {
  background-color: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
  margin-top: 32px;
}

.info-card p {
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 12px;
}

.info-card ul {
  padding-left: 20px;
  margin-bottom: 12px;
}

.info-card li {
  font-size: 14px;
  color: #475569;
}

.warning-text {
  font-size: 13px;
  font-weight: 500;
  color: #dc2626;
  margin: 0;
}

/* ── Guidelines Sections ──────────────────────────────────── */
.doc-section {
  margin-bottom: 60px;
  scroll-margin-top: 88px;
}

.doc-section h2 {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.doc-section p {
  font-size: 15px;
  line-height: 1.6;
  color: #334155;
  margin-bottom: 12px;
}

.doc-section p.bullet-indent {
  margin-left: 16px;
  border-left: 2px solid #e2e8f0;
  padding-left: 12px;
  color: #475569;
  font-size: 14.5px;
}

/* ── Abuses & Avoid Sections ──────────────────────────────── */
.abuses-header-block {
  margin-top: 80px;
  border-top: 1px solid #e2e8f0;
  padding-top: 48px;
  margin-bottom: 32px;
}

.abuses-header-block h2 {
  font-size: 30px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.abuses-header-block p {
  font-size: 15px;
  line-height: 1.6;
  color: #475569;
}

.abuses-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 768px) {
  .abuses-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.abuse-card {
  background-color: #ffffff;
  border: 1px solid #fee2e2;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
  transition: all 0.2s ease;
}

.abuse-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  border-color: #fca5a5;
}

.abuse-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: #991b1b;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.abuse-card p {
  font-size: 14px;
  line-height: 1.5;
  color: #475569;
}

/* Regulatory Note */
.regulatory-note {
  background-color: #f1f5f9;
  border-radius: 12px;
  padding: 20px;
  margin-top: 48px;
  font-size: 14px;
  color: #475569;
  font-style: italic;
  line-height: 1.5;
}

/* ── Footer ───────────────────────────────────────────────── */
.codes-footer {
  background-color: #ffffff;
  border-top: 1px solid #e2e8f0;
  padding: 40px 0;
  text-align: center;
}

.codes-footer-inner {
  max-width: var(--page-max-width, 1200px);
  margin: 0 auto;
  padding: 0 var(--spacing-24, 24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.footer-note {
  font-size: 12px;
  color: #64748b;
  max-width: 600px;
  line-height: 1.5;
}

.footer-copy {
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  color: #94a3b8;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 992px) {
  .codes-sidebar {
    display: none; /* Hide sidebar list on tablets and below to fit content */
  }
  .codes-layout-container {
    padding-top: 24px;
  }
  .doc-heading {
    font-size: 32px;
  }
}

/* Checkbox Hack Toggle Styles */
.nav-toggle-cb {
  display: none !important;
}

.nav-toggle-btn {
  display: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-ink-black, #0d0d0d);
  border-radius: 6px;
  color: var(--color-ink-black, #0d0d0d);
  z-index: 2001;
  transition: all 0.15s ease;
}

.nav-toggle-btn:hover {
  background-color: #f4f4f4;
}

.nav-toggle-cb:checked ~ .nav-toggle-btn {
  background-color: var(--color-ink-black, #0d0d0d);
  color: #ffffff;
  border-color: var(--color-ink-black, #0d0d0d);
}

.nav-toggle-cb:checked ~ .nav-toggle-btn .menu-open-icon {
  display: none !important;
}

.nav-toggle-cb:checked ~ .nav-toggle-btn .menu-close-icon {
  display: block !important;
}

@media (max-width: 768px) {
  .nav-toggle-btn {
    display: flex;
    order: 3;
  }

  .codes-nav {
    height: 64px !important;
  }

  .codes-nav-inner {
    height: 100% !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0 16px !important;
    gap: 12px !important;
    flex-wrap: nowrap !important;
  }

  .codes-nav-links {
    position: fixed !important;
    top: 0 !important;
    right: -300px !important;
    width: 280px !important;
    height: 100vh !important;
    background-color: #ffffff !important;
    border-left: 1px solid #e2e8f0 !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    padding: 80px 24px 24px 24px !important;
    gap: 8px !important;
    z-index: 2000 !important;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.08) !important;
    margin: 0 !important;
  }

  .nav-toggle-cb:checked ~ .codes-nav-links {
    transform: translateX(-300px) !important;
  }

  .codes-nav-link {
    font-size: 15px !important;
    padding: 12px 16px !important;
    border-bottom: none !important;
    border-left: 3px solid transparent !important;
    width: 100% !important;
    display: block !important;
    color: #64748b !important;
    transition: all 0.15s ease;
    text-align: left !important;
    white-space: normal !important;
  }

  .codes-nav-link:hover,
  .codes-nav-link.active {
    border-left-color: #0d0d0d !important;
    background-color: #f4f4f4 !important;
    color: #0d0d0d !important;
  }

  .btn-back {
    font-size: 11px !important;
    padding: 4px 10px !important;
    white-space: nowrap;
    flex-shrink: 0;
  }
}
