* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: #f3f3f3;
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  background-color: #2c3e50;
  color: white;
  padding: 1rem;
  position: fixed;
  height: 100vh;
}

.sidebar h2 {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
}

/* NEW: sidebar section headings (underlined) */
.sidebar-heading {
  font-size: 1rem;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid #3498db; /* underline accent */
  color: #ffffff;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  /* optional spacing between groups */
  margin-bottom: 0.75rem;
}

.sidebar nav a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.3s, padding-left 0.2s ease;
}

.sidebar nav a:hover {
  background-color: #34495e;
  padding-left: 5px;
}

.content {
  margin-left: 240px;
  padding: 2rem;
  width: 100%;
}

h2 {
  border-bottom: 2px solid #ccc;
  padding-bottom: 0.5rem;
  margin-top: 3rem;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 items per row */
  gap: 1rem;
  margin-top: 1rem;
}

.link-grid a {
  display: block;
  background-color: #3498db;
  color: white;
  text-align: center;
  padding: 1rem;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  transition: background 0.3s;
}

.link-grid a:hover {
  background-color: #2980b9;
}

/* Responsive behavior */
@media (max-width: 1024px) {
  .link-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 per row on tablets */
  }
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .content {
    margin-left: 0;
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .link-grid {
    grid-template-columns: 1fr; /* 1 per row on phones */
  }
}
/* Temporary highlight effect */
.section-highlight {
  animation: highlightFade 3s ease-out;
}

@keyframes highlightFade {
  0%   { background-color: #FFFF00; } /* yellow flash */
  100% { background-color: transparent; }
}
/* Fixed header layout + search */
.top-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  background: #e0e0e0;
  border-bottom: 1px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: space-between;  /* title left, search right */
  padding: 0 1rem;
  z-index: 1000;
}
.top-header h1 {
  margin: 0;
  font-size: 1.2rem;
  color: #333;
}
#site-search {
  display: flex;
  gap: .5rem;
}
#site-search input {
  padding: .45rem .6rem;
  border: 1px solid #bbb;
  border-radius: 6px;
  min-width: 220px;
}
#site-search button {
  padding: .45rem .8rem;
  border: 0;
  border-radius: 6px;
  background: #3498db;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
#site-search button:hover { background: #2980b9; }

/* Ensure sidebar/content clear the fixed header */
.sidebar { margin-top: 60px; }
.content { margin-top: 60px; }

/* Highlight effects (used after search jump) */
.section-highlight { animation: sectionFade 2s ease-out; }
@keyframes sectionFade { 0% { background:#fff3bf; } 100% { background:transparent; } }

.link-highlight {
  animation: linkPulse 2s ease-out;
  outline: 3px solid #ffeb3b; outline-offset: 2px;
}
@keyframes linkPulse { 0% { background:#fff3bf; } 100% { background:#3498db; } }

/* Mobile */
@media (max-width: 480px) {
  #site-search input { min-width: 140px; }
}
