/* Tutorials — page-specific styles (shared layout lives in layout.css)
   Two-column layout: fixed-width sidebar + flexible main column under 950px. */

/* Predictable sizing */
*, *::before, *::after { box-sizing: border-box; }

/* ================
   Two-column layout
   ================ */
.columns {
  display: flex;
  gap: 16px;            /* space between sidebar and main */
  align-items: stretch; /* children equal height (matches tallest item) */
  /* no explicit height needed; .content-box gets a px height from layout.js,
     making it the tallest item and the sidebar will stretch to match */
}

/* Left sidebar (no absolute positioning) */
.sidebar-left {
  flex: 0 0 160px;             /* keep existing width */
  background-color: rgba(244, 239, 255, 0.65);
  padding: 1rem;
  border-radius: 1rem;
  font-family: 'IM Fell English SC', serif;
  font-size: 18px;
  overflow-y: auto;            /* scroll if long */
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

/* Sidebar scrollbar styling */
.sidebar-left::-webkit-scrollbar { width: 8px; }
.sidebar-left::-webkit-scrollbar-thumb {
  background-color: #bda0ff;
  border-radius: 6px;
  border: 2px solid #f4efff;
}

/* Sidebar links — darker base for better readability */
.sidebar-left a {
  display: block;
  margin: 6px 0;
  color: #2c1b47;  /* darker purple for better contrast */
  text-decoration: none;
  text-align: center;
  font-weight: 600; /* slight bolding helps too */
}

.sidebar-left a:hover {
  color: var(--spellbound-lavender-1);
  text-shadow: var(--spellbound-glow-hover);
}

.sidebar-left a.active {
  color: var(--spellbound-lavender-1);
  text-shadow: var(--spellbound-glow-active);
  font-weight: bold;
}

/* Main column fills the remaining width and scrolls internally if needed */
.content-box {
  flex: 1 1 auto;       /* take remaining width */
  /* height: (px) is set by layout.js so the bottom sits 50px above viewport */
  overflow: auto;
  overflow-x: hidden;
  background-color: rgba(244, 239, 255, 0.65);
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

/* Add decorative stars between sidebar links */
.sidebar-left a::after {
  content: "✦";
  display: block;
  font-size: 14px;
  color: #bfaeff;
  text-align: center;
  margin: 4px 0;   /* space above and below star */
  text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

/* Remove star after the last link */
.sidebar-left a:last-child::after {
  content: none;
}

/* ===========================
   Page content & card styling
   =========================== */
.section-header {
  font-family: 'IM Fell English SC', serif;
  text-align: center;
  font-size: 32px;
  line-height: 1.2;
  color: var(--spellbound-purple-mystic);
  margin: 1.25rem 0 0.5rem;
  letter-spacing: 0.5px;
  scroll-margin-top: 90px; /* clear sticky nav when using anchors */
}

.section-card {
  background-color: rgba(244, 239, 255, 0.65);
  margin: 1rem 0;
  padding: 1rem;
  border-radius: 1rem;
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

.section-title {
  font-family: 'IM Fell English SC', serif;
  font-size: 28px;
  color: var(--spellbound-purple-mystic);
  margin: 0 0 .25rem;
  letter-spacing: .5px;
}

.section-sub { font-style: italic; color: #4b3a70; margin: 0 0 .5rem; }

.uc {
  display: inline-block;
  background: rgba(189,160,255,.25);
  border: 1px solid rgba(189,160,255,.55);
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  color: #2c1b47;
}

/* ================
   Mobile adjustments
   ================ */
@media (max-width: 1024px) {
  #global-nav-wrapper { width: 100%; }
  #global-nav { flex-wrap: wrap; font-size: 20px; }
  .header-row, .content-stack { width: 90%; }

  /* collapse to one column on mobile */
  .columns { display: block; }
  .sidebar-left { display: none; }
  .content-box { width: 100%; height: auto; }
}