/* ============================================
   BestSubscribers Docs — Core Styles
   Colors: #000, #fff, #01AF5D (accent)
   ============================================ */

:root {
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-text-secondary: #555;
  --color-accent: #01AF5D;
  --color-accent-hover: #019a50;
  --color-border: #e5e5e5;
  --color-sidebar-bg: #fafafa;
  --color-code-bg: #f5f5f5;
  --color-code-border: #e0e0e0;
  --sidebar-width: 260px;
  --header-height: 56px;
  --content-max-width: 780px;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'DM Mono', 'SFMono-Regular', Consolas, monospace;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
}

a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-hover); text-decoration: underline; }

img { max-width: 100%; height: auto; border-radius: 6px; }

/* ---- Header ---- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 100;
}

.header-logo {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-logo .accent { color: var(--color-accent); }

.header-logo a {
  color: inherit;
  text-decoration: none;
}

.header-logo a:hover {
  text-decoration: none;
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-link {
  font-size: 14px;
  color: var(--color-text-secondary);
}

.header-link:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
  stroke: var(--color-text);
}

/* ---- Layout ---- */
.layout {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

/* ---- Sidebar ---- */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--color-sidebar-bg);
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  padding: 24px 0;
  z-index: 90;
}

.sidebar-section {
  margin-bottom: 8px;
}

.sidebar-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
  padding: 8px 24px;
}

.sidebar-link {
  display: block;
  font-size: 14px;
  color: var(--color-text);
  padding: 6px 24px;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
}

.sidebar-link:hover {
  background: rgba(1, 175, 93, 0.06);
  color: var(--color-accent);
  text-decoration: none;
}

.sidebar-link.active {
  color: var(--color-accent);
  border-left-color: var(--color-accent);
  background: rgba(1, 175, 93, 0.06);
  font-weight: 600;
}

.sidebar-sublink {
  padding-left: 40px;
  font-size: 13px;
}

/* ---- Main Content ---- */
.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 40px 48px 80px;
}

.content {
  max-width: var(--content-max-width);
}

/* ---- Typography ---- */
.content h1 {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 8px;
  color: var(--color-text);
}

.content h2 {
  font-size: 22px;
  font-weight: 700;
  margin-top: 48px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

.content h3 {
  font-size: 18px;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 8px;
}

.content p {
  margin-bottom: 16px;
  color: var(--color-text);
}

.content ul, .content ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.content li {
  margin-bottom: 6px;
}

.page-description {
  font-size: 17px;
  color: var(--color-text-secondary);
  margin-bottom: 32px;
}

/* ---- Code ---- */
code {
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--color-code-bg);
  border: 1px solid var(--color-code-border);
  padding: 2px 6px;
  border-radius: 4px;
}

pre {
  background: var(--color-code-bg);
  border: 1px solid var(--color-code-border);
  border-radius: 6px;
  padding: 16px 20px;
  overflow-x: auto;
  margin-bottom: 20px;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13.5px;
  line-height: 1.6;
}

/* ---- Callouts ---- */
.callout {
  padding: 16px 20px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14.5px;
  line-height: 1.6;
}

.callout-info {
  background: rgba(1, 175, 93, 0.07);
  border-left: 3px solid var(--color-accent);
}

.callout-warning {
  background: #fff8e6;
  border-left: 3px solid #f0b429;
}

.callout-title {
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 14px;
}

/* ---- Screenshots / Images ---- */
.screenshot {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin: 20px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* ---- LLMs.txt Bar ---- */
.llms-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-code-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 10px 16px;
  margin-bottom: 32px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.llms-bar span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.llms-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-text);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 13px;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.llms-copy-btn:hover {
  background: var(--color-accent);
}

.llms-copy-btn.copied {
  background: var(--color-accent);
}

/* ---- Table ---- */
.content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 14.5px;
}

.content th, .content td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
}

.content th {
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
  border-bottom: 2px solid var(--color-border);
}

/* ---- Prev / Next nav ---- */
.page-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
  gap: 16px;
}

.page-nav a {
  display: flex;
  flex-direction: column;
  padding: 14px 20px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--color-text);
  transition: border-color 0.15s ease;
  min-width: 180px;
}

.page-nav a:hover {
  border-color: var(--color-accent);
  text-decoration: none;
}

.page-nav .label {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: 2px;
}

.page-nav .next { text-align: right; margin-left: auto; }

/* ---- Footer ---- */
.footer {
  margin-top: 80px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .menu-toggle { display: block; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    background: #fff;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.08);
  }

  .main {
    margin-left: 0;
    padding: 32px 20px 60px;
  }

  .content h1 { font-size: 26px; }
  .content h2 { font-size: 20px; }

  .page-nav { flex-direction: column; }
  .page-nav a { min-width: auto; }
  .page-nav .next { text-align: left; }
}

/* ---- Utility ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
