/* Vancouver Community Directory Styles */

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: Georgia, "Times New Roman", serif;
  background: #fffef8;
  color: #222;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Links - softened colors, subtle underlines */
a {
  color: #0055aa;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:visited { color: #555; }

/* Focus styles for keyboard navigation */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #0055aa;
  outline-offset: 2px;
}
button:focus:not(:focus-visible) { outline: none; }
a:focus:not(:focus-visible) { outline: none; }

/* ========================================
   UNIFIED HEADER - spans full width
   ======================================== */
.site-header {
  display: flex;
  align-items: baseline;
  border-bottom: 1px dashed #bbb;
  background: #fafaf5;
  flex-shrink: 0;
}

.site-header .logo {
  width: 220px;
  min-width: 220px;
  padding: 10px 15px;
  display: block;
  text-decoration: none;
  color: #111;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.1em;
  font-weight: normal;
  letter-spacing: -0.01em;
  border-right: 1px solid #ccc;
}
.site-header .logo:hover { text-decoration: none; color: #000; }
.site-header .logo:visited { color: #111; }

.site-header .page-title {
  flex: 1;
  padding: 10px 30px;
  font-size: 1.1em;
  font-weight: normal;
  color: #222;
}

/* ========================================
   MAIN CONTAINER - sidebar + content
   ======================================== */
.main-container {
  display: flex;
  flex: 1;
  min-height: 0; /* Important for nested scroll */
}

/* Sidebar */
.sidebar {
  width: 220px;
  min-width: 220px;
  height: calc(100vh - 42px); /* Subtract header height */
  position: sticky;
  top: 0;
  overflow: hidden;
  border-right: 1px solid #ccc;
  padding: 0;
  background: #fafaf5;
  display: flex;
  flex-direction: column;
}

/* Navigation - scrollable list with fixed footer */
.sidebar ul {
  list-style: none;
  flex: 1;
  padding: 4px 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
}
.sidebar ul::-webkit-scrollbar { width: 6px; }
.sidebar ul::-webkit-scrollbar-track { background: transparent; }
.sidebar ul::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
.sidebar li a {
  display: block;
  padding: 4px 12px;
  font-size: 0.85em;
  line-height: 1.35;
  border-left: 2px solid transparent;
  color: #333;
}
.sidebar li a:visited { color: #333; }
.sidebar li a:hover {
  background: #f0f0e8;
  border-left-color: #0055aa;
  text-decoration: none;
}
.sidebar li a.active {
  background: #f0f0e8;
  border-left-color: #0055aa;
}
.emoji { display: inline-block; width: 20px; font-size: 0.9em; }

/* Footer - refined with dotted separator */
.sidebar-footer {
  padding: 10px 15px;
  border-top: 1px dotted #bbb;
  font-size: 0.7em;
  color: #777;
  line-height: 1.7;
  background: #f5f5f0;
  flex-shrink: 0;
}
.sidebar-footer a {
  color: #555;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}
.sidebar-footer a:hover {
  color: #0055aa;
  text-decoration-style: solid;
}
.counter { font-size: 0.9em; }

/* Main content */
.content {
  flex: 1;
  padding: 15px 30px 20px;
  max-width: 800px;
  overflow-y: auto;
}
.content h2 {
  font-size: 1em;
  font-weight: normal;
  margin-top: 24px;
  margin-bottom: 6px;
  color: #222;
  position: relative;
  padding-left: 10px;
  border-left: 2px solid #999;
}
.content h2:first-child {
  margin-top: 8px;
}
.content h2:hover {
  border-left-color: #0055aa;
}

/* Section headers (after hr) - different style */
.content hr + h2 {
  border-left: none;
  padding-left: 0;
  margin-top: 10px;
  color: #555;
  font-style: italic;
  font-size: 0.9em;
}
.content hr + h2:hover {
  border-left: none;
}
.content h2 .anchor {
  color: #bbb;
  font-size: 0.75em;
  margin-left: 4px;
}
.content h2 .anchor:hover { color: #0055aa; }
.content li { margin: 4px 0; list-style: none; }
.content hr {
  border: none;
  border-top: 1px dashed #ccc;
  margin: 20px 0;
}
.content a { color: #0055aa; }
.content a:visited { color: #666; }

/* Welcome page specific */
.welcome p { margin-bottom: 10px; color: #444; }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 700px) {
  .site-header {
    flex-direction: column;
  }
  .site-header .logo {
    width: 100%;
    min-width: 100%;
    border-right: none;
    border-bottom: 1px solid #ddd;
  }
  .site-header .page-title {
    padding: 8px 15px;
  }
  .main-container {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    min-width: 100%;
    height: auto;
    max-height: 40vh;
    position: relative;
    border-right: none;
    border-bottom: 1px solid #ccc;
  }
  .content { padding: 15px 20px; }
}
