:root {
  --accent: #3b82f6;
  --text: #111827;
  --bg: #f9fafb;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

header {
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  padding: 0.5rem 0;
  margin-bottom: 1rem;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
}

.logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.logo img.logo-icon {
  height: 1.5rem;
  width: auto;
  margin-right: 0.25rem;
  display: inline-block;
  vertical-align: middle;
}

.main-nav a {
  margin-left: 1.5rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  position: relative;
}

.main-nav a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  background: var(--accent);
  left: 0;
  bottom: -4px;
  transition: width 0.2s ease;
}

.main-nav a:hover::after {
  width: 100%;
}

/* Hide menu icon by default */
.menu-icon {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hide the checkbox */
#menu-toggle {
  display: none;
}

/* Default nav style */
.main-nav {
  display: flex;
  gap: 1.5rem;
}

/* Responsive layout */
@media (max-width: 640px) {
  header .container {
    flex-wrap: wrap;
  }

  .menu-icon {
    display: block;
  }

  .main-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    margin-top: 1rem;
  }

  #menu-toggle:checked + .menu-icon + .main-nav {
    display: flex;
  }

  .main-nav a {
    padding: 0.5rem 0;
  }
}

p {
  margin-bottom: 1rem;
}

main {
  flex: 1;
  padding: 2rem 1rem;
}

footer {
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  padding: 1rem 0;
  font-size: 0.875rem;
  margin-top: auto;
}

footer .container {
  text-align: center;
}

footer p {
  margin-bottom: 0.25rem;
}

footer small {
  display: block;
  color: #6b7280;
  font-size: 0.75rem;
}
.hero {
  text-align: center;
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.hero p {
  font-size: 1.125rem;
  color: #374151;
}

.site-description {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1rem;
  color: #1f2937;
  line-height: 1.75;
}

.site-description p + p {
  margin-top: 1rem;
}

.two-column-layout {
  display: flex;
  gap: 2rem;
}

/* === Sidebar === */
.sidebar {
  width: 220px; /* slightly wider to avoid wrapping */
  flex-shrink: 0;
}

.sidebar h2 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.sidebar ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.sidebar a {
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: normal;
  line-height: 1.3;
}

.sidebar a:hover {
  text-decoration: underline;
}

.sidebar a.selected,
.sidebar .unit-list a.is-active {
  font-weight: bold;
  color: var(--accent);
}

@media (max-width: 640px) {
  .two-column-layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    margin-bottom: 1rem; /* ↓ reduce this */
  }

  .content-area {
    width: 100%;
  }

  /* Sidebar collapsing menu (already mostly there) */
  .sidebar .unit-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .sidebar .brand__toggle[aria-expanded="true"] + .unit-list {
    max-height: 1000px; /* ← bump it to be sure it fits any content */
  }
}

/* === Sidebar Brand Menu === */

.sidebar .brand {
  margin-bottom: 0.5rem;
}

.sidebar .brand__toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  padding: 0.25rem 0;
  width: 100%;
  cursor: pointer;
}

.sidebar .brand__toggle:hover {
  color: var(--accent);
}

.sidebar .chevron {
  width: 0.75rem;
  height: 0.75rem;
  transition: transform 0.2s ease;
  margin-left: 0.25rem;
  flex-shrink: 0;
}

.sidebar .brand__toggle[aria-expanded="true"] .chevron {
  transform: rotate(90deg);
}

.sidebar .unit-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.sidebar .brand__toggle[aria-expanded="true"] + .unit-list {
  max-height: 500px; /* adjust as needed based on actual list size */
}

.sidebar .unit-list li {
  margin: 0;
  padding: 0;
}

.content-area > h2 {
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.content-area > h1,
.content-area > p,
.content-area > ul,
.content-area > ol {
  margin-bottom: 1.25rem;
}

.content-area ul {
  list-style-position: inside;
  padding-left: 0;
  margin-left: 0;
}

/* =========  Mobile sidebar toggle  ========= */
.sidebar-menu-icon {
  display: none;           /* desktop */
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  margin: 0 0 0.5rem;      /* a little space before content */
}

#sidebar-toggle {          /* hide the checkbox itself */
  display: none;
}

@media (max-width: 640px) {
  .sidebar-menu-icon {     /* show the label/hamburger on phones */
    display: flex;
    align-items: center;
    gap: 0.35rem;
  }

  /* Hide sidebar until the box is checked */
  #sidebar-toggle + .sidebar-menu-icon + .two-column-layout .sidebar {
    display: none;
  }

  /* When the visitor taps the label, the sidebar slides in */
  #sidebar-toggle:checked + .sidebar-menu-icon + .two-column-layout .sidebar {
    display: block;
  }
}