/* ── Claude Code Guide ──
   Restyled to the relaunch theme system (build / studio). All colours, fonts,
   radii and shadows reference the shared tokens in static/css/theme/tokens.css
   so this page matches the rest of the site. See THEME_GUIDE.md. */

.ccg-page {
  min-height: 100vh;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.7;
}

/* ── Mobile Menu Button ── */
.ccg-menu-btn {
  display: none; background: none; border: none;
  font-size: 20px; cursor: pointer; color: var(--muted); padding: 8px 12px;
  position: fixed; top: 70px; left: 8px; z-index: 95;
  background: var(--surface); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

/* ── Layout ── */
.ccg-layout {
  display: flex;
  /* Match the navbar's content box: max-w-7xl (1280px) minus its lg:px-8 (2×32px) gutters. */
  max-width: 1216px;
  margin: 0 auto;
  padding-top: 0;
}
.ccg-content-area {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 24px;
}

/* ── Right Ad Sidebar ── */
.ccg-right-ad {
  width: 300px;
  flex-shrink: 0;
  padding: 48px 20px 60px 0;
}
.ccg-right-ad-sticky {
  position: sticky;
  top: 110px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Sidebar ── */
.ccg-sidebar {
  /* Fixed to the viewport — never scrolls with the page. Internal overflow only when content exceeds height. */
  position: fixed;
  top: 52px;
  /* Align the sidebar's TOC *text* (not its box) with the navbar logo: the box left is the
     navbar content box left — (100vw - 1216px)/2 — shifted further left by the 20px inner
     padding so the text lands flush under the logo. clamp keeps a gutter on narrow screens. */
  left: max(0px, calc((100vw - 1216px) / 2 - 20px));
  width: 220px;
  height: calc(100vh - 52px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 20px;
  background: var(--surface);
  z-index: 5;
  flex-shrink: 0;
  /* Firefox: scrollbar collapses to "none" by default. Reveals as "thin" only on hover. */
  scrollbar-width: none;
  scrollbar-color: var(--line) transparent;
}
.ccg-sidebar:hover,
.ccg-sidebar:focus-within {
  scrollbar-width: thin;
}
/* WebKit (Chrome / Safari / Edge): zero-width by default so no gutter is reserved. Expands on hover. */
.ccg-sidebar::-webkit-scrollbar {
  width: 0;
  background: transparent;
}
.ccg-sidebar:hover::-webkit-scrollbar,
.ccg-sidebar:focus-within::-webkit-scrollbar {
  width: 6px;
}
.ccg-sidebar::-webkit-scrollbar-track {
  background: transparent;
  border: none;
  box-shadow: none;
}
.ccg-sidebar::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
  transition: background 0.15s ease;
}
.ccg-sidebar:hover::-webkit-scrollbar-thumb,
.ccg-sidebar:focus-within::-webkit-scrollbar-thumb {
  background: var(--line);
}
.ccg-sidebar:hover::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}
.ccg-sidebar:hover::-webkit-scrollbar-thumb:active {
  background: var(--muted);
}
/* Clean tapered separator on the right edge — fades at the top and bottom so it doesn't read as a hard rule. */
.ccg-sidebar::after {
  content: "";
  position: absolute;
  top: 32px;
  right: 0;
  bottom: 32px;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    var(--line) 12%,
    var(--line) 88%,
    transparent 100%
  );
  pointer-events: none;
}
/* Push the right-hand content past the now-fixed sidebar. */
.ccg-content-area {
  margin-left: 220px;
}
.ccg-toc-title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); margin-bottom: 14px;
  font-family: var(--font-mono);
}
.ccg-toc-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; background: none; border: none;
  padding: 6px 0; font-size: 13px; color: var(--muted);
  cursor: pointer; text-align: left;
  font-family: var(--font-body);
  transition: color 0.15s;
}
.ccg-toc-item:hover { color: var(--ink); }
.ccg-toc-item.active { color: var(--ink); font-weight: 600; }
.ccg-toc-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--line); flex-shrink: 0;
  transition: all 0.2s;
}
.ccg-toc-item.active .ccg-toc-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.ccg-toc-footer {
  margin-top: 24px; padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px;
}
.ccg-toc-link { font-size: 12px; color: var(--muted); text-decoration: none; }
.ccg-toc-link:hover { color: var(--ink); }

/* ── Main ── */
.ccg-main {
  flex: 1; min-width: 0;
  padding: 0 48px 60px;
  max-width: 820px;
}

/* ── Hero ── */
.ccg-hero { padding: 48px 0 0; }
.ccg-hero-eyebrow {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--accent); margin-bottom: 10px;
  font-family: var(--font-mono);
}
.ccg-h1 {
  font-size: 40px; font-weight: 700; color: var(--ink);
  margin: 0 0 16px; line-height: 1.15;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}
.ccg-hero-desc {
  font-size: 16.5px; color: var(--muted);
  line-height: 1.65; max-width: 580px; margin: 0 0 20px;
}
.ccg-hero-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.ccg-meta-chip {
  font-size: 12px; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 4px 12px; border-radius: var(--radius-pill); font-weight: 500;
}

/* ── Section Headings ── */
html { scroll-padding-top: 110px; }
.ccg-section-head { padding-top: 8px; margin-bottom: 20px; scroll-margin-top: 110px; }
.ccg-h2 {
  font-size: 26px; font-weight: 700; color: var(--ink);
  margin: 0 0 6px;
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}
.ccg-h2-anchor {
  display: inline-block;
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--line);
  text-decoration: none;
  vertical-align: middle;
  opacity: 0;
  transition: color .15s ease, opacity .15s ease;
  user-select: none;
}
.ccg-h2:hover .ccg-h2-anchor { opacity: 1; }
.ccg-h2-anchor:hover { color: var(--accent); }
.ccg-h2-anchor.copied { color: var(--signal); opacity: 1; }
.ccg-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-body);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 9999;
}
.ccg-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.ccg-h3 {
  font-size: 17px; font-weight: 700; color: var(--ink);
  margin: 28px 0 10px;
  font-family: var(--font-body);
}
.ccg-section-sub { font-size: 14.5px; color: var(--muted); margin: 0; line-height: 1.5; }

/* ── Text ── */
.ccg-p { color: var(--ink); margin-bottom: 16px; line-height: 1.7; }
.ccg-ic {
  background: var(--surface-2); color: var(--muted);
  padding: 2px 6px; border-radius: 4px;
  font-size: 13px; font-family: var(--font-mono);
  font-weight: 500;
}

/* ── External Link ── */
.ccg-ext-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}
.ccg-ext-link:hover { text-decoration: underline; color: var(--accent-strong); }

/* ── Screenshot ── */
.ccg-screenshot {
  max-width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  margin-bottom: 16px;
}

/* ── Divider ── */
.ccg-divider { height: 1px; background: var(--line); margin: 36px 0; }

/* ── Code Blocks ──
   Kept dark on the light studio theme — code panels reuse the shared ink
   primitives so they read as the same "terminal" surface site-wide. */
.ccg-code-wrap {
  border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 14px; position: relative;
  background: var(--c-ink-800);
}
.ccg-code-top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 14px;
  background: var(--c-ink-900);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ccg-code-lbl {
  font-size: 11px; font-weight: 600;
  color: var(--c-ink-400);
  font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.ccg-copy-btn {
  background: rgba(148,163,184,0.1);
  border: 1px solid rgba(148,163,184,0.15);
  color: var(--c-ink-400); padding: 3px 10px;
  border-radius: 5px; font-size: 11px;
  font-weight: 600; cursor: pointer;
  font-family: var(--font-mono);
}
.ccg-copy-btn:hover { background: rgba(148,163,184,0.2); }
.ccg-copy-btn.floating {
  position: absolute; top: 10px; right: 10px; z-index: 2;
}
.ccg-code-pre {
  margin: 0; padding: 14px 18px;
  font-size: 13px; line-height: 1.65;
  color: var(--c-ink-300);
  font-family: var(--font-mono);
  overflow-x: auto; white-space: pre-wrap;
  word-break: break-word;
}

/* ── Callout ── */
.ccg-callout {
  padding: 14px 18px; border-radius: var(--radius-sm);
  border-left: 3px solid; margin-bottom: 16px;
  font-size: 13.5px; color: var(--ink);
}
.ccg-callout.tip { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.ccg-callout.warning { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn) 22%, var(--surface)); }
.ccg-callout.pro { border-left-color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 9%, var(--surface)); }
.ccg-callout-label {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.ccg-callout.tip .ccg-callout-label { color: var(--accent-strong); }
.ccg-callout.warning .ccg-callout-label { color: color-mix(in srgb, var(--warn) 45%, var(--ink)); }
.ccg-callout.pro .ccg-callout-label { color: color-mix(in srgb, var(--accent-2) 65%, var(--ink)); }
.ccg-callout > div:last-child { line-height: 1.6; }

/* ── Tables ── */
.ccg-table-wrap {
  overflow-x: auto; border-radius: var(--radius-sm);
  border: 1px solid var(--line); margin-bottom: 16px;
}
.ccg-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ccg-table th {
  text-align: left; padding: 10px 16px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.ccg-table td {
  padding: 9px 16px; color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.ccg-table tr:nth-child(even) { background: var(--surface-2); }
.ccg-cmd-code {
  background: var(--surface-2); color: var(--ink);
  padding: 2px 7px; border-radius: 4px;
  font-size: 12px; font-family: var(--font-mono);
  font-weight: 600;
}

/* ── Shortcuts Grid ── */
.ccg-shortcut-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-bottom: 8px;
}
.ccg-shortcut-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; background: var(--surface-2);
  border-radius: var(--radius-sm); border: 1px solid var(--line);
}
.ccg-kbd {
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 600; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 5px; padding: 3px 8px;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.ccg-shortcut-desc { font-size: 13px; color: var(--muted); }

/* ── Skill Chips ── */
.ccg-chip-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-bottom: 8px;
}
.ccg-skill-chip {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 14px; background: var(--surface-2);
  border-radius: var(--radius-sm); border: 1px solid var(--line);
}

/* ── Tri Grid ── */
.ccg-tri-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 12px; margin-bottom: 20px;
}
.ccg-mini-card {
  padding: 16px; background: var(--surface-2);
  border-radius: var(--radius-sm); border: 1px solid var(--line);
  border-top: 3px solid var(--line);
}
.ccg-mini-card.amber { border-top-color: var(--warn); }
.ccg-mini-card.blue { border-top-color: var(--accent); }
.ccg-mini-card.purple { border-top-color: var(--accent-2); }
.ccg-mini-card-title {
  font-weight: 700; color: var(--ink);
  font-size: 14px; margin-bottom: 6px;
}
.ccg-mini-card-body { color: var(--muted); font-size: 13.5px; line-height: 1.55; }

/* ── Pillars ── */
.ccg-pillar {
  padding: 20px; background: var(--surface-2);
  border-radius: var(--radius-sm); border: 1px solid var(--line);
}
.ccg-pillar-num {
  font-size: 28px; font-weight: 800;
  font-family: var(--font-mono);
  line-height: 1;
}
.ccg-pillar-num.blue { color: var(--accent); }
.ccg-pillar-num.purple { color: var(--accent-2); }
.ccg-pillar-num.amber { color: var(--warn); }
.ccg-pillar-title {
  margin: 10px 0 6px; color: var(--ink);
  font-size: 15px; font-weight: 700;
}
.ccg-pillar-desc { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }

/* ── Cycle ── */
.ccg-cycle-visual {
  display: flex; align-items: stretch;
  justify-content: center; gap: 0;
  flex-wrap: nowrap; margin: 16px 0 20px;
}
.ccg-cycle-step {
  text-align: center; padding: 14px 10px 12px;
  background: var(--surface-2); border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  border-top: 3px solid var(--line);
  min-width: 0; flex: 1;
}
.ccg-cycle-step-num {
  font-size: 20px; font-weight: 800;
  font-family: var(--font-mono);
  line-height: 1;
}
.ccg-cycle-step-label {
  font-weight: 700; color: var(--ink);
  font-size: 14px; margin: 6px 0 4px;
}
.ccg-cycle-step-desc {
  font-size: 11.5px; color: var(--muted);
  line-height: 1.3;
}
.ccg-cycle-arrow {
  color: var(--line); font-size: 18px;
  font-weight: 700; margin: 0 3px;
  font-family: var(--font-mono);
  display: flex; align-items: center;
  flex-shrink: 0;
}

/* ── Comparison ── */
.ccg-comparison-box {
  display: flex; gap: 0;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 20px;
}
.ccg-comparison-col { flex: 1; padding: 20px; }
.ccg-comparison-divider { width: 1px; background: var(--line); }
.ccg-comparison-header {
  font-weight: 700; color: var(--ink);
  font-size: 15px; margin-bottom: 10px;
}
.ccg-comparison-header.purple { color: var(--accent-2); }
.ccg-comparison-list {
  margin: 0; padding-left: 18px;
  color: var(--muted); font-size: 13.5px;
  line-height: 1.8; list-style: disc;
}

/* ── Prompt Blocks ── */
.ccg-prompt-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm); overflow: hidden;
  margin-bottom: 12px;
}
.ccg-prompt-top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.ccg-prompt-title {
  font-weight: 700; color: var(--ink);
  font-size: 14px; font-family: var(--font-body);
}
.ccg-prompt-when { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ccg-prompt-pre {
  margin: 0; padding: 14px 16px;
  font-size: 13px; line-height: 1.6;
  color: var(--muted); font-family: var(--font-mono);
  white-space: pre-wrap; word-break: break-word;
}

/* ── FAQ ── */
.ccg-faq-item { border-bottom: 1px solid var(--line); }
.ccg-faq-q {
  width: 100%; background: none; border: none;
  padding: 14px 0; display: flex;
  justify-content: space-between; align-items: center;
  cursor: pointer; font-size: 14.5px;
  font-weight: 600; color: var(--ink);
  text-align: left; font-family: var(--font-body);
}
.ccg-faq-icon {
  color: var(--muted); font-size: 18px;
  transition: transform 0.2s;
}
.ccg-faq-item.open .ccg-faq-icon { transform: rotate(45deg); }
.ccg-faq-a {
  display: none; padding: 0 0 14px;
  color: var(--muted); font-size: 13.5px; line-height: 1.65;
}
.ccg-faq-item.open .ccg-faq-a { display: block; }

/* ── Footer CTA ── */
.ccg-footer-cta {
  margin-top: 48px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.ccg-footer-cta-inner { padding: 32px; }
.ccg-footer-cta-inner h3 {
  margin: 0 0 8px; color: var(--ink);
  font-size: 20px; font-family: var(--font-display);
}
.ccg-footer-cta-inner p {
  margin: 0 0 20px; color: var(--muted); line-height: 1.6;
}
.ccg-cta-btn-large {
  display: inline-block; background: var(--accent);
  color: #fff; padding: 10px 22px;
  border-radius: var(--radius-sm); font-size: 14px;
  font-weight: 700; text-decoration: none;
  transition: background 0.15s;
}
.ccg-cta-btn-large:hover { background: var(--accent-strong); color: #fff; }

/* ── Credit ── */
.ccg-credit {
  text-align: center; padding: 32px 0;
  font-size: 12px; color: var(--muted);
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .ccg-right-ad { display: none; }
}

@media (max-width: 900px) {
  .ccg-tri-grid { grid-template-columns: 1fr; }
  .ccg-shortcut-grid { grid-template-columns: 1fr; }
  .ccg-chip-row { grid-template-columns: 1fr; }
  .ccg-comparison-box { flex-direction: column; }
  .ccg-comparison-divider { width: 100%; height: 1px; }
  .ccg-cycle-visual { flex-wrap: wrap; justify-content: center; }
  .ccg-cycle-step { min-width: 80px; flex: 0 1 auto; }
  .ccg-cycle-arrow { margin: 4px 2px; }
}

@media (max-width: 768px) {
  .ccg-menu-btn { display: block; }
  .ccg-sidebar {
    position: fixed; left: -280px;
    width: 260px; top: 52px;
    height: calc(100vh - 52px);
    background: var(--surface); z-index: 90;
    transition: left 0.25s ease;
    box-shadow: none;
    overflow-y: auto;
  }
  .ccg-sidebar.open {
    left: 0;
    box-shadow: var(--shadow);
  }
  /* On mobile the sidebar is a slide-in drawer, so the content reclaims the full width. */
  .ccg-content-area {
    margin-left: 0;
  }
  .ccg-main { padding: 0 20px 60px; }
  .ccg-h1 { font-size: 30px; }
  html { scroll-padding-top: 70px; }
  .ccg-section-head { scroll-margin-top: 70px; }
}
