/* styles.css — shared styles for competitive programming mastery site */

/* ========== Tailwind CDN handles base utilities ========== */
/* This file adds custom classes used across all pages.      */

/* ---------- Custom Neon Palette ---------- */
:root {
  --space: #0a0a1a;
  --neon:  #00ff88;
  --accent: #58a6ff;
  --thrust: #ff3366;
  --gold:   #ffb347;
  --deep:   #0d1117;
  --card:   #161b22;
  --border: #30363d;
  --muted:  #8b949e;
  --text:   #c9d1d9;
}

/* ---------- Body default ---------- */
body {
  scroll-behavior: smooth;
  line-height: 1.7;
}

/* ---------- Spacing tweaks for readability ---------- */
.chapter-desc {
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

.content-section {
  margin-bottom: 3rem;
}

.content-section h2 {
  margin-bottom: 1.25rem;
}

/* More room around takeaway list items */
.takeaway-list li {
  margin-bottom: 0.5rem;
}

/* More gap between code blocks and the next element */
.code-wrapper {
  margin-bottom: 1.5rem;
}

/* More room around tip/info/warn boxes */
.tip-box, .info-box, .warn-box {
  margin-bottom: 1.5rem;
}

/* More padding inside info boxes */
.tip-box, .info-box, .warn-box {
  padding: 1.25rem;
}

/* More vertical space between paragraphs */
p {
  margin-bottom: 0.75rem;
}

/* ---------- Code containers ---------- */
.code-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.code-wrapper pre {
  max-width: none;
  display: table;
  min-width: 100%;
}

/* ---------- Code blocks ---------- */
pre {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 0.875rem;
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
}

code {
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
  font-size: 0.875rem;
}

p > code,
li > code {
  background: #161b22;
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

/* ---------- Info / Tip / Warning boxes ---------- */
.tip-box {
  background: rgba(0, 255, 136, 0.08);
  border-left: 4px solid var(--neon);
  border-radius: 8px;
  padding: 1rem;
}

.warn-box {
  background: rgba(255, 51, 102, 0.08);
  border-left: 4px solid var(--thrust);
  border-radius: 8px;
  padding: 1rem;
}

.info-box {
  background: rgba(88, 166, 255, 0.08);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 1rem;
}

/* ---------- SVG illustration container ---------- */
.illo {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* ---------- Spacer ---------- */
.section-divider {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
  margin: 2.5rem 0;
}

/* ---------- Chapter header row (chapter number + Home link) ---------- */
.chapter-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
}

/* ---------- Chapter nav at bottom ---------- */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  padding-top: 1.5rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border);
}

/* ---------- Highlight target anchor ---------- */
:target {
  scroll-margin-top: 1.5rem;
}

/* ---------- Practice attempt counter badge ---------- */
.attempt-badge {
  display: inline-block;
  background: rgba(255, 179, 71, 0.15);
  color: var(--gold);
  border: 1px solid rgba(255, 179, 71, 0.3);
  border-radius: 9999px;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
}
