/* ===== WRITEUP LAYOUT ===== */
.writeup-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

body {
  padding: 0;
  background-color: #0d1117;
}

/* ===== SIDEBAR ===== */
.sidebar {
  background-color: #0d1117;
  border-right: 1px solid #30363d;
  padding: 1.5rem;

  position: sticky;
  top: 0;
  height: 100vh;

  min-height: 0;   /* For scrolling */
  overflow-y: auto;   /* THIS fixes the cutoff */
  overflow-x: hidden;
}


.sidebar h2 {
  font-size: 1.2rem;
  color: #58a6ff;
  margin-bottom: 1rem;
}

/* Sidebar links */
.sidebar ul {
  list-style: none;
}

.sidebar li {
  margin-bottom: 0.4rem;
}

.sidebar a {
  text-decoration: none;
  color: #c9d1d9;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  display: block;
  transition: background 0.2s ease, color 0.2s ease;
}

.sidebar a:hover {
  background-color: #238636;
  color: #ffffff;
}

/* Back link */
.back-home {
  display: inline-block;
  margin-top: 2rem;
  color: #8b949e;
  font-size: 0.9rem;
}

.back-home:hover {
  color: #58a6ff;
}

/* ===== CONTENT AREA ===== */
.content {
  padding: 2.5rem;
}

/* Lists inside content */
.content ul,
.content ol {
  margin-left: 1.5rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  color: #c9d1d9;
}

.content li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.content li strong {
  color: #f0f6fc;
}

/* Challenge sections */
.content section {
  background-color: #161b22;
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  border-left: 5px solid #58a6ff;
}

/* Headings */
.content h1 {
  color: #58a6ff;
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.content h3 {
  color: #c9d1d9;
  margin-top: 1.5rem;
}

/* Text */
.content p {
  margin: 0.5rem 0 1rem 0;
  color: #c9d1d9;
}

/* Images */
.content img {
  max-width: 100%;
  border-radius: 6px;
  margin: 1rem 0;
  border: 1px solid #30363d;
}

/* ===== LINK STYLING ===== */
.content a {
  color: #58a6ff;             /* bright blue */
  text-decoration: none;      /* no underline by default */
  font-weight: 500;
  border-bottom: 1px solid transparent;  /* subtle underline space */
  transition: color 0.3s ease, border-color 0.3s ease;
}

.content a:hover,
.content a:focus {
  color: #79c0ff;             /* lighter blue on hover */
  border-bottom-color: #79c0ff;
  text-decoration: underline;
  outline: none;
}

/* Code blocks */
pre {
  background-color: #0d1117;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  color: #7ee787;
  font-family: "Fira Code", monospace;
  margin-top: 1rem;
}

/* Inline code */
code {
  background-color: #161b22;
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
  color: #7ee787;
}

/* ===== SIDEBAR DROPDOWN (DETAILS / SUMMARY) ===== */
.sidebar details {
  margin-bottom: 1rem;
}

.sidebar summary {
  cursor: pointer;
  color: #58a6ff;
  font-weight: bold;
  padding: 0.4rem 0;
  list-style: none;
}

.sidebar summary::-webkit-details-marker {
  display: none;
}

/* Custom arrow */
.sidebar summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 0.5rem;
  transition: transform 0.2s ease;
}

.sidebar details[open] summary::before {
  transform: rotate(90deg);
}

.sidebar details ul {
  margin-top: 0.5rem;
  padding-left: 1rem;
}

/* ===== GLOBAL PAGE SCROLLBAR (CLEAN + AUTO-HIDE) ===== */

/* Firefox */
html {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

/* Chrome, Edge, Safari */
html::-webkit-scrollbar {
  width: 8px;
}

html::-webkit-scrollbar-track {
  background: transparent;
}

html::-webkit-scrollbar-thumb {
  background-color: transparent;
  border-radius: 8px;
}

/* ===== SIDEBAR SCROLLBAR (CLEAN + AUTO-HIDE) ===== */

/* Firefox */
.sidebar {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

/* Chrome, Edge, Safari */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background-color: transparent;
  border-radius: 6px;
}
