/* Apply to everything */
* {
  box-sizing: border-box;
}

header {
  position: sticky;
  top: 0;
  width: 100%;
  background: #333;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  z-index: 1000;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  text-decoration: none; /* removes underline */
}

.nav-links {
  display: flex;
  gap: 1rem;
}

.nav-links a {
  color: white;
  text-decoration: none;
}

.nav-links a:hover {
  text-decoration: underline;
}

/* Hamburger (hidden on desktop) */
.hamburger {
  display: none;
  font-size: 2rem;
  cursor: pointer;
}

/* Mobile styles */
@media (max-width: 768px) {
  .nav-links {
    position: absolute;
    top: 60px;
    right: 0;
    background: #333;
    flex-direction: column;
    width: 200px;
    display: none;
    padding: 1rem;
  }

  .nav-links.active {
    display: flex;
  }

  .hamburger {
    display: block;
  }
}

main {
  padding: 2rem;
  line-height: 1.6;
}

section {
  min-height: 35vh;
  border-bottom: 1px solid #ddd;
}

body {
  font-family: sans-serif;
  line-height: 1.6;
  margin: 20px;
  background: #fefefe;
  color: #222;
}

h1, h2 {
  font-weight: 600;
}

.container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

/* Mobile layout */
@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr; /* one column on mobile */
  }
}

.column {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fafafa;
}

.hidden {
  display: none;
}

.controls {
  margin-bottom: 20px;
}

/*
button {
  margin-right: 10px;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  background: #007acc;
  color: white;
  cursor: pointer;
}

button:hover {
  background: #005fa3;
}

button.active {
  background: #005fa3;   
  font-weight: bold;
} 
*/

.controls button {
  background: #e0e0e0;   /* light gray */
  color: #000;           /* black text */
  border: none;
  padding: 10px 15px;
  margin: 5px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.2s ease, outline 0.2s ease;
}

.controls button:hover {
  background: #cccccc;   /* darker gray on hover */
}

.controls button.active {
  background: #0072ce;   /* bright accessible blue */
  color: #fff;           /* white text */
  font-weight: bold;
  outline: 3px solid #004b99;   /* darker blue outline */
  outline-offset: 2px;          /* space between outline and button */
}

/* TOC container positioning */
#tocContainer {
  position: relative;
  display: inline-block;
  margin-bottom: 1rem; /* spacing below TOC button */
}

/* TOC label/button */
.toc-label {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 2px solid #333;
  border-radius: 6px;
  background: #f9f9f9;
  cursor: pointer;
  user-select: none;
}

/* TOC dropdown menu */
.toc-menu {
  display: none;
  position: absolute; /* float over content */
  top: 100%;          /* right below label */
  left: 0;
  z-index: 1000;
  min-width: 200px;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #ffffff; /* solid background */
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Show TOC when checkbox is checked */
#tocToggle:checked ~ .toc-menu {
  display: block;
}

/* Style TOC links */
.toc-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-menu li {
  margin: 0.25rem 0;
}

.toc-menu a {
  text-decoration: none;
  color: #0066cc;
}

.toc-menu a:hover {
  text-decoration: underline;
}

/* Active state styling for label */
#tocToggle:checked + .toc-label {
  background: #333;
  color: white;
  outline: 2px solid #555;
}

/* Optional: make it responsive on mobile */
@media (max-width: 600px) {
  .toc-menu {
    min-width: 150px;
    font-size: 0.9rem;
  }
}

/* Hide the actual checkbox */
#tocToggle {
  position: absolute; /* remove from layout flow */
  opacity: 0;         /* invisible but still focusable/clickable */
  width: 0;
  height: 0;
}

