/* style-spark.css
   SparkNotes-inspired theme for Honors Biology study pages
   ------------------------------------------------------
   Usage: link this CSS in your HTML to apply SparkNotes-like styling.
*/
:root {
  --bg: #fafafa;
  --text: #333;
  --card-bg: #fff;
  --accent: #f7f700;
  /* …other variables… */
}

.dark-mode {
  --bg: #222;
  --text: #eee;
  --card-bg: #333;
  --accent: #f7c600;
  /* adjust others (borders, shadows) as needed */
}

body {
  background: var(--bg);
  color: var(--text);
}
/* e.g. */
.summary, .quiz, .widget {
  background: var(--card-bg);
  /* etc */
}
/* -----------------------------------------------------
   Base & Reset
   ----------------------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Open Sans', sans-serif;
  color: #333;
  background: #fafafa;
  line-height: 1.6;
}

/* -----------------------------------------------------
   Typography
   ----------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: 'Georgia', serif;
  color: #222;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1em;
}

/* -----------------------------------------------------
   Links & Buttons
   ----------------------------------------------------- */
a {
  color: #0066cc;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

button, .button {
  display: inline-block;
  background: #f7f700;
  color: #222;
  border: none;
  padding: 0.5em 1em;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s ease;
}
button:hover, .button:hover {
  background: #e6e100;
}

/* -----------------------------------------------------
   Layout: Header & Nav
   ----------------------------------------------------- */
.header {
  background: #fff200;
  padding: 1rem 2rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header h1 {
  color: #222;
}

.nav {
  background: #fff;
  border-bottom: 1px solid #ddd;
}
.nav ul {
  display: flex;
  list-style: none;
}
.nav li {
  margin-right: 2rem;
}
.nav a {
  padding: 1rem 0;
  display: block;
  font-weight: bold;
  color: #222;
}
.nav a.active, .nav a:hover {
  color: #000;
  border-bottom: 3px solid #f7f700;
}

/* -----------------------------------------------------
   Sidebar
   ----------------------------------------------------- */
.sidebar {
  position: fixed;
  top: 5rem;
  left: 0;
  width: 220px;
  height: calc(100% - 5rem);
  background: #fff;
  border-right: 1px solid #ddd;
  overflow-y: auto;
  padding: 1rem;
}
.sidebar a {
  display: block;
  padding: 0.5rem 0;
  color: #333;
}
.sidebar a.active, .sidebar a:hover {
  color: #000;
  font-weight: bold;
}

/* -----------------------------------------------------
   Main Content
   ----------------------------------------------------- */
.main {
  margin-left: 240px;
  padding: 2rem;
  max-width: 800px;
}

/* -----------------------------------------------------
   Summary Box (SparkNotes-style yellow box)
   ----------------------------------------------------- */
.summary {
  background: #fff200;
  padding: 1rem 1.5rem;
  border-radius: 4px;
  margin: 1.5rem 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.summary h3 {
  margin-bottom: 0.5rem;
}
.summary p {
  margin-bottom: 0.5rem;
}

/* -----------------------------------------------------
   Section Blocks
   ----------------------------------------------------- */
.section {
  margin-bottom: 2rem;
}
.section-title {
  border-left: 4px solid #fff200;
  padding-left: 0.5rem;
  margin-bottom: 1rem;
}
.section-content ul,
.section-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

/* -----------------------------------------------------
   Interactive Widget Containers
   ----------------------------------------------------- */
.widget {
  background: #fff;
  padding: 1rem;
  border-radius: 4px;
  margin: 1rem 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.widget h4 {
  margin-bottom: 0.75rem;
}
.widget-output {
  background: #f0f0f0;
  padding: 0.75rem;
  border-radius: 4px;
  min-height: 3rem;
  margin-top: 0.5rem;
  font-family: monospace;
}

/* -----------------------------------------------------
   Quiz Styles
   ----------------------------------------------------- */
.quiz {
  background: #fff;
  padding: 1rem;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.quiz p {
  margin: 0.75rem 0;
}
.quiz label {
  display: block;
  margin-bottom: 0.5rem;
}
.quiz .feedback {
  margin-top: 1rem;
  font-weight: bold;
}

/* -----------------------------------------------------
   Responsive Adjustments
   ----------------------------------------------------- */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .nav ul { flex-wrap: wrap; }
}

.header {
  position: fixed;
  top: 0;
  left: 220px;         /* width of your sidebar */
  right: 0;
  z-index: 1000;
  transition: top 0.3s ease-in-out;
}

/* push the content down so it isn't hidden under the header */
.main {
  margin-top: 8rem;     /* adjust to your header’s height */
}

/* on small screens, remove left offset if sidebar collapses */
@media (max-width: 800px) {
  .header {
    left: 0;
  }
  .main {
    margin-top: 8rem;
  }
}

/* ===============================
   Center main content between
   sidebar and right edge
   =============================== */

/* CENTER MAIN CONTENT AWAY FROM SIDEBAR */
/* Adjust --sidebar-width to your actual sidebar width (220px) */
:root {
  --sidebar-width: 220px;
  --main-max-width: 800px;    /* adjust for line length */
}

/* Make .main use the full remaining width */
.main {
  margin-left: var(--sidebar-width);
  padding: 2rem;
}

/* Center and constrain each block inside .main */
.main > .summary,
.main > .diagram-container,
.main > .section,
.main > .interactive,
.main > .hw-widget,
.main > .quiz {
  max-width: var(--main-max-width);
  margin-left: auto;
  margin-right: auto;
}