/* ============================================================
   Styles.css — site-wide base styles ONLY.
   Component styles live in their own files:
   header.css / footer.css / sidebar.css / course.css /
   rightpanel.css / tryit.css
   ============================================================ */

:root {
  --accent: #FA541C;
  --accent-dark: #d94010;
  --accent-soft: #fff3ec;
  --ink: #1a1a2e;
  --ink-2: #16213e;
  --text: #1a1a1a;
  --muted: #666;
  --line: #eee;
  --code-bg: #1e1e3f;
  --code-bg-deep: #0d1117;
  --font-ui: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-code: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  overflow: visible;
  background: #fff;
  font-family: var(--font-ui);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* 3-column learning layout: left nav | content | right panel */
.learning-container {
  display: grid;
  grid-template-columns: 250px 1fr 320px;
  align-items: start;
  width: 100%;
}

/* Previous / Next buttons at the bottom of each lesson */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.btn-nav {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 14.5px;
  padding: 11px 22px;
  border-radius: 8px;
  transition: background .15s, transform .1s;
}
.btn-nav:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-nav.disabled { opacity: .5; cursor: not-allowed; background: #999; }

/* Visible keyboard focus everywhere */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ── Mobile code block overflow fix ───────────────────────────
   Prevents <pre> and <code> from causing horizontal viewport overflow on mobile.
   Code blocks scroll independently instead of breaking the layout.           */
pre, code {
  max-width: 100%;
  overflow-x: auto;
  word-break: break-word;
}
pre { white-space: pre; }

/* Ensure images never overflow content area */
img { max-width: 100%; height: auto; display: block; }

/* Content area should not overflow on any screen */
.content-area { word-wrap: break-word; overflow: visible; }

@media (max-width: 1200px) {
  .learning-container { grid-template-columns: 1fr; }
}
