/* ============================================================
   OnePoundEmail — docs.css
   Extends style.css. Import AFTER style.css.
   ============================================================ */

.docs-container {
  max-width: 1160px;
  margin: 0 auto;
}
/* ── DOCS LAYOUT ── */
.docs-shell {
  display: grid;
  grid-template-columns: 272px 1fr 220px;
  grid-template-rows: 1fr;
  min-height: calc(100vh - 64px);
  margin-top: 64px;
  align-items: start;
}

/* ── LEFT SIDEBAR ── */
.docs-sidebar {
  position: sticky; top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto; overflow-x: hidden;
  background: var(--bg2);
  border-right: 1px solid var(--border2);
  padding: 2rem 0 4rem;
  transition: background 0.35s, border-color 0.35s;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-track { background: transparent; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

/* Search */
.docs-search {
  margin: 0 1.25rem 1.75rem;
  position: relative;
}
.docs-search input {
  width: 100%; padding: 0.55rem 0.85rem 0.55rem 2.25rem;
  background: var(--card); border: 1px solid var(--border2);
  border-radius: 8px; font-family: 'Outfit', sans-serif;
  font-size: 0.82rem; color: var(--text);
  transition: border-color 0.2s, background 0.35s, color 0.35s;
  outline: none;
}
.docs-search input::placeholder { color: var(--muted); }
.docs-search input:focus { border-color: var(--blue); }
.docs-search svg {
  position: absolute; left: 0.65rem; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; stroke: var(--muted); fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  pointer-events: none;
}

/* Nav group */
.docs-nav-group { margin-bottom: 0.25rem; }
.docs-nav-group-label {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.45rem 1.25rem;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text); font-family: 'JetBrains Mono', monospace;
  cursor: pointer; user-select: none;
  border-radius: 0;
  transition: color 0.2s;
}
.docs-nav-group-label svg {
  width: 12px; height: 12px; stroke: var(--muted); fill: none;
  stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.25s; flex-shrink: 0;
}
.docs-nav-group.open .docs-nav-group-label svg { transform: rotate(180deg); }

.docs-nav-items {
  overflow: hidden;
  max-height: 0;
}
.docs-nav-group.open .docs-nav-items {
  max-height: 600px;
  transition: max-height 0.3s cubic-bezier(0.4,0,0.2,1);
}
.docs-nav-group:not(.open) .docs-nav-items {
  transition: max-height 0.25s cubic-bezier(0.4,0,0.2,1);
}

.docs-nav-items a {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.38rem 1.25rem 0.38rem 1.5rem;
  font-size: 0.845rem; color: var(--muted2); text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  position: relative;
}
.docs-nav-items a:hover { color: var(--text); background: rgba(59,130,246,0.04); }
.docs-nav-items a.active {
  color: var(--blue-bright);
  border-left-color: var(--blue);
  background: rgba(59,130,246,0.06);
  font-weight: 600;
}

/* Divider between groups */
.docs-nav-divider {
  height: 1px; background: var(--border2);
  margin: 0.75rem 1.25rem;
}

/* Back to site link at the bottom of sidebar */
.docs-sidebar-footer {
  padding: 1.5rem 1.25rem 0;
  margin-top: 1rem;
  border-top: 1px solid var(--border2);
}
.docs-sidebar-footer a {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem; color: var(--muted); text-decoration: none;
  transition: color 0.2s;
}
.docs-sidebar-footer a:hover { color: var(--blue-bright); }
.docs-sidebar-footer svg {
  width: 13px; height: 13px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ── MAIN CONTENT ── */
.docs-content {
  min-width: 0;
  padding: 3.5rem 3.5rem 6rem;
}

/* Breadcrumb */
.docs-breadcrumb {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.75rem; color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 2rem;
}
.docs-breadcrumb a { color: var(--muted); text-decoration: none; transition: color 0.2s; }
.docs-breadcrumb a:hover { color: var(--blue-bright); }
.docs-breadcrumb svg { width: 10px; height: 10px; stroke: var(--muted); fill: none; stroke-width: 2.5; }
.docs-breadcrumb span:last-child { color: var(--muted2); }

/* Article heading */
.docs-article-title {
  font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 800;
  letter-spacing: -0.03em; color: var(--text); margin-bottom: 0.75rem;
  line-height: 1.15;
}
.docs-article-lead {
  font-size: 1rem; color: var(--muted2); line-height: 1.75;
  margin-bottom: 2.5rem; padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border2);
}

/* Content typography */
.docs-body h2 {
  font-size: 1.35rem; font-weight: 700; color: var(--text);
  margin: 2.75rem 0 1rem; padding-top: 0.25rem;
  letter-spacing: -0.02em; scroll-margin-top: 90px;
}
.docs-body h3 {
  font-size: 1.05rem; font-weight: 700; color: var(--text);
  margin: 2rem 0 0.75rem; scroll-margin-top: 90px;
}
.docs-body p {
  color: var(--muted2); font-size: 0.95rem; line-height: 1.85;
  margin-bottom: 1rem;
}
.docs-body a {
  color: var(--blue-bright); text-decoration: underline;
  text-decoration-color: rgba(96,165,250,0.35);
  transition: text-decoration-color 0.2s;
}
.docs-body a:hover { text-decoration-color: var(--blue-bright); }
.docs-body strong { color: var(--text); font-weight: 700; }
.docs-body ul, .docs-body ol {
  color: var(--muted2); font-size: 0.95rem; line-height: 1.85;
  padding-left: 1.5rem; margin-bottom: 1.25rem;
}
.docs-body li { margin-bottom: 0.4rem; }
.docs-body hr {
  border: none; border-top: 1px solid var(--border2); margin: 2.5rem 0;
}

/* Code inline */
.docs-body code {
  font-family: 'JetBrains Mono', monospace; font-size: 0.82em;
  color: var(--blue-bright);
  background: var(--icon-bg); border: 1px solid var(--icon-bdr);
  padding: 0.1em 0.4em; border-radius: 5px;
}

/* Code block */
.docs-body pre {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 12px; padding: 1.4rem 1.6rem;
  overflow-x: auto; margin: 1.5rem 0;
  position: relative;
  transition: background 0.35s;
}
.docs-body pre code {
  background: none; border: none; padding: 0;
  font-size: 0.85rem; color: var(--text); line-height: 1.7;
}

/* Copy button on code blocks */
.code-wrap { position: relative; }
.copy-btn {
  position: absolute; top: 0.65rem; right: 0.65rem;
  background: var(--card2); border: 1px solid var(--border2);
  color: var(--muted); border-radius: 6px;
  padding: 0.25rem 0.6rem; font-size: 0.68rem;
  font-family: 'JetBrains Mono', monospace; letter-spacing: 0.05em;
  cursor: pointer; transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.copy-btn:hover { color: var(--text); border-color: var(--blue); background: var(--icon-bg); }
.copy-btn.copied { color: #4ade80; border-color: rgba(74,222,128,0.3); }

/* Callout / tip boxes */
.docs-callout {
  border-radius: 10px; padding: 1rem 1.25rem;
  margin: 1.5rem 0; gap: 0.85rem; align-items: flex-start;
  font-size: 0.9rem; line-height: 1.7;
}
.docs-callout svg {
  width: 16px; height: 16px; flex-shrink: 0; margin-top: 0.15rem;
  fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.docs-callout.info {
  background: rgba(59,130,246,0.07); border: 1px solid rgba(59,130,246,0.2);
  color: var(--muted2);
}
.docs-callout.info svg { stroke: var(--blue-bright); }
.docs-callout.warning {
  background: rgba(251,191,36,0.07); border: 1px solid rgba(251,191,36,0.2);
  color: var(--muted2);
}
.docs-callout.warning svg { stroke: #fbbf24; }
.docs-callout.success {
  background: rgba(74,222,128,0.07); border: 1px solid rgba(74,222,128,0.2);
  color: var(--muted2);
}
.docs-callout.success svg { stroke: #4ade80; }
.docs-callout-body strong { color: var(--text); }

/* Step list */
.docs-steps { list-style: none; padding: 0; margin: 1.5rem 0; counter-reset: steps; }
.docs-steps li {
  counter-increment: steps;
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 1.1rem 1.25rem; margin-bottom: 0.75rem;
  background: var(--card); border: 1px solid var(--border2);
  border-radius: 12px; font-size: 0.92rem; color: var(--muted2);
  line-height: 1.7; transition: border-color 0.2s, background 0.35s;
}
.docs-steps li:hover { border-color: var(--hover-bdr); }
.docs-steps li::before {
  content: counter(steps);
  min-width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-dim));
  color: white; font-size: 0.72rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-family: 'JetBrains Mono', monospace;
  box-shadow: 0 0 12px rgba(59,130,246,0.3);
}

/* Prev / Next nav */
.docs-pagination {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1rem; margin-top: 4rem; padding-top: 2.5rem;
  border-top: 1px solid var(--border2);
}
.docs-page-link {
  display: flex; flex-direction: column; gap: 0.3rem;
  padding: 1rem 1.25rem; border-radius: 12px;
  border: 1px solid var(--border2); text-decoration: none;
  background: var(--card); transition: border-color 0.2s, transform 0.2s, background 0.35s;
}
.docs-page-link:hover { border-color: var(--hover-bdr); transform: translateY(-2px); }
.docs-page-link.prev { align-items: flex-start; }
.docs-page-link.next { align-items: flex-end; }
.docs-page-dir {
  font-size: 0.68rem; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
  display: flex; align-items: center; gap: 0.35rem;
}
.docs-page-dir svg {
  width: 12px; height: 12px; stroke: currentColor; fill: none;
  stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
}
.docs-page-name { font-size: 0.9rem; font-weight: 600; color: var(--text); }

/* ── RIGHT TOC ── */
.docs-toc {
  position: sticky; top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 2.5rem 1.5rem 4rem;
  border-left: 1px solid var(--border2);
  background: var(--bg);
  transition: background 0.35s;
  scrollbar-width: none;
}
.docs-toc::-webkit-scrollbar { display: none; }

.docs-toc-label {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--muted); font-family: 'JetBrains Mono', monospace;
  margin-bottom: 0.85rem;
}
.docs-toc nav { display: flex; flex-direction: column; gap: 0.1rem; }
.docs-toc nav a {
  font-size: 0.8rem; color: var(--muted); text-decoration: none;
  padding: 0.28rem 0.6rem;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  line-height: 1.45;
}
.docs-toc nav a:hover { color: var(--muted2); background: rgba(59,130,246,0.04); }
.docs-toc nav a.toc-active {
  color: var(--blue-bright); border-left-color: var(--blue);
  background: rgba(59,130,246,0.06); font-weight: 600;
}
.docs-toc nav a.toc-h3 { padding-left: 1.25rem; font-size: 0.77rem; }

/* ── DOCS HOME ── */
.docs-home {
  max-width: 1100px; margin: 0 auto;
  padding: 7rem 2rem 4rem;
}
.docs-home-hero {
  margin-bottom: 4rem;
}
.docs-home-hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.8rem); font-weight: 800;
  letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 1rem;
  color: var(--text);
  background: none; -webkit-text-fill-color: unset;
}
.docs-home-hero h1 span {
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.docs-home-hero p {
  font-size: 1.05rem; color: var(--muted2); line-height: 1.7;
  margin-bottom: 2rem;
}
.docs-home-actions { display: flex; gap: 0.85rem; flex-wrap: wrap; }

/* Category grid */
.docs-cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.docs-cat-card {
  background: var(--card); border: 1px solid var(--border2);
  border-radius: 16px; padding: 1.75rem;
  text-decoration: none; display: flex; flex-direction: column; gap: 1rem;
  position: relative; overflow: hidden;
  transition: border-color 0.3s, transform 0.25s, box-shadow 0.3s, background 0.35s;
}
.docs-cat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59,130,246,0), transparent);
  transition: background 0.4s;
}
.docs-cat-card:hover {
  border-color: var(--hover-bdr); transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.12);
}
.docs-cat-card:hover::before {
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
}
.docs-cat-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--icon-bg); border: 1px solid var(--icon-bdr);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.3s;
}
.docs-cat-card:hover .docs-cat-icon { background: rgba(59,130,246,0.18); }
.docs-cat-icon svg {
  width: 19px; height: 19px; stroke: var(--blue-bright); fill: none;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.docs-cat-title {
  font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 0.3rem;
}
.docs-cat-title a {
  color: var(--text); text-decoration: none; transition: color 0.2s;
}
.docs-cat-card:hover .docs-cat-title a { color: var(--blue-bright); }
.docs-cat-desc { font-size: 0.83rem; color: var(--muted2); line-height: 1.6; }
.docs-cat-links { margin-top: auto; display: flex; flex-direction: column; gap: 0.25rem; }
.docs-cat-links a {
  font-size: 0.8rem; color: var(--muted); text-decoration: none;
  display: flex; align-items: center; gap: 0.4rem; transition: color 0.2s;
}
.docs-cat-links a:hover { color: var(--blue-bright); }
.docs-cat-links a svg {
  width: 11px; height: 11px; stroke: currentColor; fill: none;
  stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;
}

/* ── MOBILE: hamburger hides sidebar, overlay ── */
.docs-sidebar-toggle {
  display: none; position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 300;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--blue); border: none; cursor: pointer;
  box-shadow: 0 4px 20px rgba(59,130,246,0.45);
  align-items: center; justify-content: center;
}
.docs-sidebar-toggle svg {
  width: 20px; height: 20px; stroke: white; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.docs-sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 149;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
}

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .docs-shell { grid-template-columns: 240px 1fr; }
  .docs-toc { display: none; }
  .docs-content { padding: 2.5rem 2rem 5rem; }
}
@media (max-width: 900px) {
  .docs-cat-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .docs-shell { grid-template-columns: 1fr; }
  .docs-sidebar {
    position: fixed; top: 64px; left: 0; bottom: 0; z-index: 150;
    width: 280px; transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1), background 0.35s;
  }
  .docs-sidebar.open { transform: translateX(0); }
  .docs-sidebar-overlay { display: block; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
  .docs-sidebar-overlay.open { opacity: 1; pointer-events: all; }
  .docs-sidebar-toggle { display: flex; }
  .docs-content { padding: 2rem 1.25rem 4rem; }
  .docs-pagination { grid-template-columns: 1fr; }
  .docs-cat-grid { grid-template-columns: 1fr; }
  .docs-home { padding: 3rem 1.25rem 5rem; }
}