/* =====================================================
   BLANK INK AMAZON — Documentation Layout
   ===================================================== */

/* ── Doc Layout ── */
.doc-layout {
  display: flex;
  min-height: 100vh;
  padding-top: 60px;
}

/* ── Sidebar ── */
.doc-sidebar {
  width: 272px;
  flex-shrink: 0;
  position: fixed;
  top: 60px;
  left: 0;
  height: calc(100vh - 60px);
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid rgba(246,244,239,0.07);
  background: #0d0d0d;
  padding: 20px 0 40px;
  scrollbar-width: thin;
  scrollbar-color: rgba(31,191,107,0.2) transparent;
  z-index: 50;
}

.doc-sidebar::-webkit-scrollbar { width: 3px; }
.doc-sidebar::-webkit-scrollbar-thumb { background: rgba(31,191,107,0.2); }

.doc-sidebar-search {
  padding: 0 16px 12px;
  border-bottom: 1px solid rgba(246,244,239,0.07);
  margin-bottom: 12px;
}

.sidebar-search-input {
  width: 100%;
  background: rgba(246,244,239,0.05);
  border: 1px solid rgba(246,244,239,0.1);
  border-radius: 6px;
  padding: 8px 12px 8px 32px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--bone);
  outline: none;
  transition: border-color 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='6' cy='6' r='4.5' stroke='rgba(246,244,239,0.3)' stroke-width='1.2'/%3E%3Cpath d='M9.5 9.5L12 12' stroke='rgba(246,244,239,0.3)' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
}

.sidebar-search-input:focus { border-color: rgba(31,191,107,0.4); }
.sidebar-search-input::placeholder { color: rgba(246,244,239,0.3); }

.doc-nav-group {
  margin-bottom: 4px;
}

.doc-nav-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: rgba(246,244,239,0.4);
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}

.doc-nav-group-title:hover { color: rgba(246,244,239,0.7); }

.doc-nav-group-title .group-icon { font-size: 13px; }

.doc-nav-group-title .chevron {
  margin-left: auto;
  font-size: 10px;
  transition: transform 0.25s;
  color: rgba(246,244,239,0.25);
}

.doc-nav-group.open .chevron { transform: rotate(90deg); }

.doc-nav-group-title.active-group {
  color: var(--profit);
}

.doc-nav-items {
  display: none;
  padding-bottom: 4px;
}

.doc-nav-group.open .doc-nav-items { display: block; }

.doc-nav-item {
  display: block;
  padding: 7px 16px 7px 36px;
  font-size: 13px;
  color: rgba(246,244,239,0.5);
  text-decoration: none;
  line-height: 1.4;
  transition: color 0.15s, background 0.15s;
  border-left: 2px solid transparent;
  margin-left: 0;
  position: relative;
}

.doc-nav-item:hover {
  color: rgba(246,244,239,0.85);
  background: rgba(246,244,239,0.03);
}

.doc-nav-item.active {
  color: var(--profit);
  border-left-color: var(--profit);
  background: rgba(31,191,107,0.06);
  font-weight: 500;
}

.doc-nav-module-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(246,244,239,0.6);
  text-decoration: none;
  transition: color 0.15s;
}

.doc-nav-module-link:hover { color: var(--bone); }

/* ── Main content ── */
.doc-content-wrap {
  flex: 1;
  min-width: 0;
  margin-left: 272px;
  display: flex;
}

.doc-content {
  flex: 1;
  min-width: 0;
  padding: 52px 64px 80px;
  max-width: 820px;
}

/* ── Right outline ── */
.doc-outline {
  width: 224px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
  height: fit-content;
  padding: 0 24px;
  display: none;
}

@media (min-width: 1280px) {
  .doc-outline { display: block; }
  .doc-content { max-width: 760px; }
}

.doc-outline-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: rgba(246,244,239,0.35);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.doc-outline-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.doc-outline-item a {
  display: block;
  font-size: 12px;
  color: rgba(246,244,239,0.4);
  text-decoration: none;
  padding: 4px 0 4px 12px;
  border-left: 2px solid rgba(246,244,239,0.08);
  transition: color 0.15s, border-color 0.15s;
  line-height: 1.4;
}

.doc-outline-item a:hover { color: rgba(246,244,239,0.8); }
.doc-outline-item.active a { color: var(--profit); border-left-color: var(--profit); }

.doc-outline-item.level-3 a { padding-left: 24px; font-size: 11px; }

/* ── Breadcrumb ── */
.doc-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(246,244,239,0.35);
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.doc-breadcrumb a {
  color: rgba(246,244,239,0.35);
  text-decoration: none;
  transition: color 0.15s;
}

.doc-breadcrumb a:hover { color: var(--profit); }
.doc-breadcrumb .sep { color: rgba(246,244,239,0.2); }
.doc-breadcrumb .current { color: rgba(246,244,239,0.6); }

/* ── Content Typography ── */
.doc-content h1 {
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--bone);
  margin-bottom: 16px;
  text-transform: uppercase;
}

.doc-content .lesson-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.doc-content .lesson-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--profit);
  text-transform: uppercase;
  background: rgba(31,191,107,0.1);
  padding: 4px 10px;
  border: 1px solid rgba(31,191,107,0.2);
}

.doc-content .lesson-module {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: rgba(246,244,239,0.35);
  text-transform: uppercase;
}

.doc-divider {
  width: 48px;
  height: 2px;
  background: var(--profit);
  margin-bottom: 32px;
}

.doc-content .lead {
  font-size: 18px;
  color: rgba(246,244,239,0.75);
  line-height: 1.7;
  margin-bottom: 40px;
  border-left: 3px solid var(--profit);
  padding-left: 20px;
}

.doc-content h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--bone);
  margin: 48px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(246,244,239,0.08);
  scroll-margin-top: 80px;
}

.doc-content h2:first-of-type { margin-top: 32px; }

.doc-content h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--bone);
  margin: 32px 0 12px;
  scroll-margin-top: 80px;
}

.doc-content h4 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--profit);
  text-transform: uppercase;
  margin: 24px 0 8px;
  font-family: var(--font-mono);
}

.doc-content p {
  font-size: 15px;
  color: rgba(246,244,239,0.72);
  line-height: 1.75;
  margin-bottom: 16px;
}

.doc-content strong { color: var(--bone); font-weight: 600; }
.doc-content em { color: var(--profit); font-style: italic; }

.doc-content ul, .doc-content ol {
  padding-left: 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.doc-content ul li, .doc-content ol li {
  font-size: 15px;
  color: rgba(246,244,239,0.72);
  line-height: 1.65;
}

.doc-content ul { list-style: none; padding-left: 0; }
.doc-content ul li { padding-left: 20px; position: relative; }
.doc-content ul li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--profit);
  font-size: 13px;
  top: 1px;
}

.doc-content ol { list-style: none; counter-reset: ol-counter; padding-left: 0; }
.doc-content ol li {
  counter-increment: ol-counter;
  padding-left: 32px;
  position: relative;
}
.doc-content ol li::before {
  content: counter(ol-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  background: var(--profit);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

/* ── Callout Boxes ── */
.callout {
  display: flex;
  gap: 16px;
  padding: 20px 24px;
  border-radius: 4px;
  margin: 28px 0;
  border-left: 3px solid;
}

.callout-icon { font-size: 20px; flex-shrink: 0; line-height: 1.4; }

.callout-content p:last-child { margin-bottom: 0; }
.callout-content strong { display: block; font-size: 13px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 6px; font-family: var(--font-mono); }

.callout-tip {
  background: rgba(31,191,107,0.06);
  border-color: var(--profit);
}
.callout-tip .callout-content strong { color: var(--profit); }
.callout-tip .callout-content p { color: rgba(246,244,239,0.7); font-size: 14px; line-height: 1.65; }

.callout-warning {
  background: rgba(255,165,0,0.06);
  border-color: #ffaa00;
}
.callout-warning .callout-content strong { color: #ffaa00; }
.callout-warning .callout-content p { color: rgba(246,244,239,0.7); font-size: 14px; line-height: 1.65; }

.callout-danger {
  background: rgba(255,80,80,0.06);
  border-color: #ff5050;
}
.callout-danger .callout-content strong { color: #ff5050; }
.callout-danger .callout-content p { color: rgba(246,244,239,0.7); font-size: 14px; line-height: 1.65; }

.callout-info {
  background: rgba(100,160,255,0.06);
  border-color: #64a0ff;
}
.callout-info .callout-content strong { color: #64a0ff; }
.callout-info .callout-content p { color: rgba(246,244,239,0.7); font-size: 14px; line-height: 1.65; }

/* ── Tables ── */
.doc-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
  overflow: hidden;
}

.doc-content table th {
  background: rgba(31,191,107,0.1);
  color: var(--profit);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(31,191,107,0.2);
}

.doc-content table td {
  padding: 10px 14px;
  color: rgba(246,244,239,0.7);
  border-bottom: 1px solid rgba(246,244,239,0.06);
  vertical-align: top;
  line-height: 1.5;
}

.doc-content table tr:hover td { background: rgba(246,244,239,0.02); }
.doc-content table strong { color: var(--bone); }

/* ── Code / Mono ── */
.doc-content code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(31,191,107,0.1);
  color: var(--profit);
  padding: 2px 6px;
  border-radius: 3px;
}

.doc-content pre {
  background: rgba(246,244,239,0.04);
  border: 1px solid rgba(246,244,239,0.08);
  border-radius: 6px;
  padding: 20px 24px;
  overflow-x: auto;
  margin: 20px 0;
}

.doc-content pre code {
  background: none;
  padding: 0;
  color: var(--bone);
  font-size: 13px;
}

/* ── Key-value cards ── */
.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.kv-card {
  background: rgba(246,244,239,0.03);
  border: 1px solid rgba(246,244,239,0.08);
  padding: 16px;
  border-radius: 4px;
  transition: border-color 0.2s;
}

.kv-card:hover { border-color: rgba(31,191,107,0.25); }

.kv-card-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--profit);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.kv-card-value {
  font-size: 14px;
  color: rgba(246,244,239,0.75);
  line-height: 1.5;
}

/* ── Step list ── */
.steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 20px 0;
  position: relative;
}

.steps::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 32px;
  bottom: 16px;
  width: 1px;
  background: rgba(31,191,107,0.2);
}

.step {
  display: flex;
  gap: 20px;
  padding: 0 0 28px;
  position: relative;
}

.step-num {
  width: 32px;
  height: 32px;
  background: var(--profit);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  position: relative;
  z-index: 1;
}

.step-content {}

.step-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--bone);
  margin-bottom: 8px;
}

.step-desc {
  font-size: 14px;
  color: rgba(246,244,239,0.65);
  line-height: 1.6;
}

/* ── Comparison table ── */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
}

.compare-col {}

.compare-col-header {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 16px;
  margin-bottom: 0;
}

.compare-col.good .compare-col-header {
  background: rgba(31,191,107,0.1);
  color: var(--profit);
}

.compare-col.bad .compare-col-header {
  background: rgba(255,80,80,0.08);
  color: #ff5050;
}

.compare-items {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(246,244,239,0.08);
  border-top: none;
}

.compare-items li {
  font-size: 13px;
  color: rgba(246,244,239,0.7);
  padding: 9px 16px;
  border-bottom: 1px solid rgba(246,244,239,0.06);
  line-height: 1.4;
}

.compare-items li:last-child { border-bottom: none; }
.compare-items li::before { display: none; }

/* ── Lesson nav (prev/next) ── */
.lesson-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid rgba(246,244,239,0.08);
}

.lesson-nav-btn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 24px;
  border: 1px solid rgba(246,244,239,0.1);
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}

.lesson-nav-btn:hover {
  border-color: rgba(31,191,107,0.35);
  background: rgba(31,191,107,0.04);
}

.lesson-nav-btn.next { text-align: right; }

.lesson-nav-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(246,244,239,0.35);
  text-transform: uppercase;
}

.lesson-nav-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--bone);
}

.lesson-nav-arrow {
  color: var(--profit);
  font-size: 18px;
}

/* ── Sidebar toggle (mobile) ── */
.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 200;
  width: 48px;
  height: 48px;
  background: var(--profit);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(31,191,107,0.4);
}

.sidebar-toggle svg { pointer-events: none; }

.doc-sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0,0,0,0.6);
  z-index: 49;
  backdrop-filter: blur(4px);
}

/* ── Mobile responsive ── */
@media (max-width: 900px) {
  .doc-sidebar {
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 100;
  }
  .doc-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0,0,0,0.6);
  }
  .doc-sidebar-overlay.visible { display: block; }
  .doc-content-wrap { margin-left: 0; }
  .doc-content { padding: 40px 28px 60px; }
  .sidebar-toggle { display: flex; }
  .lesson-nav { grid-template-columns: 1fr; }
  .compare-grid { grid-template-columns: 1fr; }
  .kv-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .doc-content { padding: 28px 20px 60px; }
  .doc-content h1 { font-size: 26px; }
  .doc-content h2 { font-size: 19px; }
  .doc-content h3 { font-size: 16px; }
  .kv-grid { grid-template-columns: 1fr; }
  .callout { flex-direction: column; gap: 10px; padding: 16px; }
}
