/* ═══════════════════════════════════════════
   CLAUDE CODE CHEATSHEET — ebookclaudecode.css
   Guia de referência completo e definitivo.
   Usa tokens.css (herda variáveis root).
   ═══════════════════════════════════════════ */

/* ── Hero ── */
.cheatsheet-hero {
  padding: clamp(80px, 12vw, 160px) 0 clamp(48px, 6vw, 80px);
  position: relative;
}
.cheatsheet-hero-inner {
  max-width: 920px;
}
.cheatsheet-hero .eyebrow {
  margin-bottom: 24px;
}
.cheatsheet-hero h1 {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: var(--tracking-tight);
  margin: 0;
}
.cheatsheet-hero h1 em {
  color: var(--accent);
  font-style: normal;
}
.cheatsheet-lead {
  margin-top: 20px;
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 1.6;
  color: var(--muted);
  max-width: 640px;
}

/* ── TOC Chips ── */
.cheatsheet-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}
.toc-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: var(--surface-1);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  font: 500 11px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  transition: all 0.2s ease;
  text-decoration: none;
}
.toc-chip:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  border-style: solid;
  color: var(--fg);
  transform: translateY(-1px);
}

/* ── Body / Sections ── */
.cheatsheet-body {
  padding-bottom: clamp(80px, 10vw, 140px);
}
.cheatsheet-body .shell--wide {
  --max: 1000px;
}

.cs-section {
  margin-top: clamp(48px, 6vw, 80px);
}
.cs-section:first-child {
  margin-top: 0;
}

.cs-section-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--border);
}
.cs-section-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: 500 14px/1 var(--font-mono);
  color: var(--accent);
  flex-shrink: 0;
}
.cs-section-head h2 {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: clamp(26px, 3.5vw, 40px);
  line-height: 1.1;
  letter-spacing: var(--tracking-tight);
  margin: 0;
}

.cs-section-lead {
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 24px;
  max-width: 720px;
}

/* ── Grid 2 cols ── */
.cs-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

/* ── Cards ── */
.cs-card {
  background: var(--surface-1);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.cs-card:hover {
  border-color: var(--accent);
  background: var(--surface-2);
}
.cs-card--full {
  grid-column: 1 / -1;
}
.cs-card h3 {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: 18px;
  line-height: 1.25;
  margin: 0 0 12px;
}
.cs-card .cs-desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 16px;
}

/* ── Code Wrap ── */
.cs-code-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-sunken);
  border: 1px solid var(--soft-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 10px;
}
.cs-code-wrap:last-child {
  margin-bottom: 0;
}
.cs-code-wrap code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg);
  flex: 1;
  overflow-x: auto;
  white-space: nowrap;
}
.cs-code-wrap--block {
  display: block;
  padding: 0;
  overflow: hidden;
}
.cs-code-wrap--block pre {
  margin: 0;
  padding: 16px 20px;
  overflow-x: auto;
}
.cs-code-wrap--block pre code {
  white-space: pre;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--fg);
}

/* ── Copy Button ── */
.cs-copy {
  flex-shrink: 0;
  padding: 5px 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: 500 10px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.cs-copy:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.cs-copy.copied {
  background: #A3E635;
  border-color: #A3E635;
  color: #000;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(163, 230, 53, 0.3);
}

/* ── Keyboard Grid ── */
.cs-kbd-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.cs-kbd-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface-1);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  transition: border-color 0.2s ease;
}
.cs-kbd-row:hover {
  border-color: var(--accent);
}
.cs-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 6px 12px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  border-bottom-width: 2px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  flex-shrink: 0;
}
.cs-kbd-desc {
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
}

/* ── Priority List ── */
.cs-priority-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cs-priority-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface-1);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  transition: border-color 0.2s ease;
}
.cs-priority-item:hover {
  border-color: var(--accent);
}
.cs-priority-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: 500 13px/1 var(--font-mono);
  color: var(--accent);
  flex-shrink: 0;
}
.cs-priority-item div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cs-priority-item code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg);
}
.cs-priority-item span {
  font-size: 13px;
  color: var(--muted);
}

/* ── Table ── */
.cs-table-wrap {
  background: var(--surface-1);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  overflow-x: auto;
}
.cs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.cs-table thead th {
  background: var(--surface-sunken);
  padding: 12px 18px;
  text-align: left;
  font: 500 11px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.cs-table tbody tr {
  border-bottom: 1px solid var(--soft-border);
  transition: background 0.15s ease;
}
.cs-table tbody tr:last-child {
  border-bottom: none;
}
.cs-table tbody tr:hover {
  background: var(--surface-2);
}
.cs-table td {
  padding: 12px 18px;
  color: var(--fg);
  vertical-align: top;
}
.cs-table td code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent);
  background: var(--surface-sunken);
  padding: 2px 6px;
  border-radius: 2px;
}

/* ── Key List (ul inside cards) ── */
.cs-key-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cs-key-list li {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  padding-left: 16px;
  position: relative;
}
.cs-key-list li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}
.cs-key-list li code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg);
  background: var(--surface-sunken);
  padding: 1px 5px;
  border-radius: 2px;
}
.cs-key-list li strong {
  color: var(--fg);
  font-weight: 600;
}

/* ── Alert Box ── */
.cs-alert {
  margin-top: 24px;
  padding: 16px 20px;
  background: var(--surface-sunken);
  border: 1px dashed var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}
.cs-alert strong {
  color: var(--fg);
}

/* ── Footer ── */
.cs-footer {
  margin-top: clamp(48px, 6vw, 80px);
  padding-top: 32px;
  border-top: 1px dashed var(--border);
  text-align: center;
}
.cs-footer p {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 8px;
}
.cs-footer a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cs-footer a:hover {
  color: var(--fg);
}

/* ── Inline code in paragraphs ── */
.cs-section p code,
.cs-card p code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg);
  background: var(--surface-sunken);
  padding: 2px 6px;
  border-radius: 2px;
}

/* ── Badges / Tags ── */
.cs-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font: 600 10px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.cs-badge--beginner {
  background: color-mix(in oklch, #A3E635 15%, var(--surface-sunken));
  color: #A3E635;
  border: 1px solid color-mix(in oklch, #A3E635 30%, transparent);
}
.cs-badge--intermediate {
  background: color-mix(in oklch, #FBBF24 15%, var(--surface-sunken));
  color: #FBBF24;
  border: 1px solid color-mix(in oklch, #FBBF24 30%, transparent);
}
.cs-badge--advanced {
  background: color-mix(in oklch, #F87171 15%, var(--surface-sunken));
  color: #F87171;
  border: 1px solid color-mix(in oklch, #F87171 30%, transparent);
}

/* ── Callouts / Tips Pro ── */
.cs-callout {
  margin-top: 20px;
  padding: 16px 20px;
  background: var(--surface-sunken);
  border: 1px dashed var(--border);
  border-left: 3px solid var(--accent-secondary);
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}
.cs-callout strong {
  color: var(--fg);
}
.cs-callout code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--fg);
  background: var(--surface-1);
  padding: 2px 6px;
  border-radius: 2px;
}
.cs-callout--pro {
  border-left-color: var(--accent);
  background: color-mix(in oklch, var(--accent-primary) 6%, var(--surface-sunken));
}
.cs-callout--pro::before {
  content: "PRO TIP — ";
  color: var(--accent);
  font-weight: 600;
}
.cs-callout--warn {
  border-left-color: #FBBF24;
  background: color-mix(in oklch, #FBBF24 6%, var(--surface-sunken));
}
.cs-callout--warn::before {
  content: "ATENÇÃO — ";
  color: #FBBF24;
  font-weight: 600;
}

/* ── Comparison Table ── */
.cs-compare-wrap {
  background: var(--surface-1);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  overflow-x: auto;
}
.cs-compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.cs-compare thead th {
  background: var(--surface-sunken);
  padding: 12px 16px;
  text-align: left;
  font: 500 11px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.cs-compare tbody tr {
  border-bottom: 1px solid var(--soft-border);
  transition: background 0.15s ease;
}
.cs-compare tbody tr:last-child {
  border-bottom: none;
}
.cs-compare tbody tr:hover {
  background: var(--surface-2);
}
.cs-compare td {
  padding: 12px 16px;
  color: var(--fg);
  vertical-align: top;
}
.cs-compare td:first-child {
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
}
.cs-compare td code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  background: var(--surface-sunken);
  padding: 2px 6px;
  border-radius: 2px;
}
.cs-compare .cs-check {
  color: #A3E635;
  font-weight: 700;
}
.cs-compare .cs-cross {
  color: #F87171;
  font-weight: 700;
}
.cs-compare .cs-partial {
  color: #FBBF24;
  font-weight: 700;
}

/* ── Section badge row ── */
.cs-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

/* ── Workflow cards ── */
.cs-workflow {
  background: var(--surface-1);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 16px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.cs-workflow:hover {
  border-color: var(--accent);
  background: var(--surface-2);
}
.cs-workflow h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: 16px;
  line-height: 1.3;
  margin: 0 0 8px;
  color: var(--fg);
}
.cs-workflow p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 14px;
}
.cs-workflow ol,
.cs-workflow ul {
  margin: 0 0 14px;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}
.cs-workflow li {
  margin-bottom: 6px;
}
.cs-workflow li code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg);
  background: var(--surface-sunken);
  padding: 1px 5px;
  border-radius: 2px;
}

/* ── Troubleshooting list ── */
.cs-trouble {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cs-trouble-item {
  background: var(--surface-1);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  transition: border-color 0.2s ease;
}
.cs-trouble-item:hover {
  border-color: var(--accent);
}
.cs-trouble-item h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: 15px;
  margin: 0 0 8px;
  color: var(--fg);
}
.cs-trouble-item h4 code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  background: var(--surface-sunken);
  padding: 2px 6px;
  border-radius: 2px;
}
.cs-trouble-item p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 10px;
}
.cs-trouble-item .cs-code-wrap {
  margin-bottom: 0;
}

/* ── Model cards ── */
.cs-model-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.cs-model-card {
  background: var(--surface-1);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.cs-model-card:hover {
  border-color: var(--accent);
  background: var(--surface-2);
}
.cs-model-card h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: 15px;
  margin: 0 0 6px;
  color: var(--fg);
}
.cs-model-card h4 code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent);
}
.cs-model-card p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
}
.cs-model-card .cs-badge {
  margin-bottom: 8px;
}

/* ── Light mode overrides ── */
html.light-mode .cs-badge--beginner {
  color: color-mix(in oklch, #4A7C0F 90%, var(--fg));
  border-color: color-mix(in oklch, #4A7C0F 40%, transparent);
}
html.light-mode .cs-badge--intermediate {
  color: color-mix(in oklch, #B45309 90%, var(--fg));
  border-color: color-mix(in oklch, #B45309 40%, transparent);
}
html.light-mode .cs-badge--advanced {
  color: color-mix(in oklch, #B91C1C 90%, var(--fg));
  border-color: color-mix(in oklch, #B91C1C 40%, transparent);
}

html.light-mode .cs-compare .cs-check {
  color: color-mix(in oklch, #4A7C0F 90%, var(--fg));
}
html.light-mode .cs-compare .cs-cross {
  color: color-mix(in oklch, #B91C1C 90%, var(--fg));
}
html.light-mode .cs-compare .cs-partial {
  color: color-mix(in oklch, #B45309 90%, var(--fg));
}

html.light-mode .cs-callout--warn::before {
  color: color-mix(in oklch, #B45309 90%, var(--fg));
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .cs-grid-2,
  .cs-kbd-grid,
  .cs-model-grid {
    grid-template-columns: 1fr;
  }
  .cheatsheet-toc {
    gap: 8px;
  }
  .toc-chip {
    padding: 6px 12px;
    font-size: 10px;
  }
  .cs-card {
    padding: 18px;
  }
  .cs-code-wrap {
    flex-wrap: wrap;
    gap: 8px;
  }
  .cs-code-wrap code {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    font-size: 12px;
  }
  .cs-kbd-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .cs-table-wrap,
  .cs-compare-wrap {
    font-size: 13px;
  }
  .cs-table td,
  .cs-table th,
  .cs-compare td,
  .cs-compare th {
    padding: 10px 12px;
  }
  .cs-workflow {
    padding: 18px;
  }
  .cs-model-card {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .cheatsheet-hero h1 {
    font-size: 36px;
  }
  .cs-section-head h2 {
    font-size: 24px;
  }
  .cs-section-head {
    gap: 10px;
  }
  .cs-section-num {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
  .cs-compare td:first-child {
    white-space: normal;
  }
}

/* 
  US-002: Prominent install CTAs in hero (PRD AC + critique P0).
  Reuses .cs-grid-2/.cs-card/.cs-code-wrap inside .cheatsheet-hero for dense cheatsheet consistency.
  Minimal extension: sharp rect (per DESIGN), dashed border, tokens, top-level visibility.
  .install-hero wrapper provides breathing + "meu fluxo" signal without new components.
  Extends existing hero/TOC rhythm + responsive media queries. No conflict with elevation or body cs-*.
*/
.install-hero {
  margin: 28px 0 12px;
  padding: 20px;
  background: var(--surface-sunken);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md); /* sharp per DESIGN */
  border-left: 3px solid var(--accent);
}
.install-hero .cs-card {
  background: var(--surface-1);
  border-style: dashed;
}
.install-hero .btn,
.install-hero .btn.secondary {
  /* reuse global .btn but scoped tighter for hero density; sharp rect already */
  font-size: 11px;
  padding: 8px 14px;
  letter-spacing: 0.04em;
}
.install-hero .cs-desc {
  font-size: 13px;
  margin-bottom: 8px;
}
@media (max-width: 680px) {
  .install-hero {
    padding: 14px;
    margin: 20px 0 8px;
  }
  .install-hero .cs-grid-2 {
    gap: 12px;
  }
}

/* US-002 reviewer fix: extract inline on desktop CTAs for reuse (no duplication, follows DESIGN/AGENTS pattern). */
.install-hero__desktop-ctas { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.install-hero__desktop-ctas .btn,
.install-hero__desktop-ctas .btn.secondary { font-size:11px; padding:8px 14px; letter-spacing:0.04em; }
