/* Capo Horn Lab — unified left sidebar (site-wide)
   Injected by assets/js/sidebar.js — do not edit page HTML directly. */

#chl-sidebar,
body > aside#chl-sidebar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  bottom: 0 !important;
  width: 232px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: rgba(7, 11, 18, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid rgba(227, 59, 47, 0.16);
  padding: 22px 0 20px;
  overflow-y: auto;
}

#chl-sidebar .sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 16px;
}
#chl-sidebar .sb-brand img {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}
#chl-sidebar .sb-brand .sb-name {
  line-height: 1.1;
}
#chl-sidebar .sb-brand strong {
  display: block;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f2e7e3;
}
#chl-sidebar .sb-brand small {
  font-family: 'DM Mono', monospace;
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(242, 231, 227, 0.45);
}

#chl-sidebar .sb-group-label {
  padding: 0 20px 8px;
  font-family: 'DM Mono', monospace;
  font-size: 8.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(242, 231, 227, 0.32);
}

#chl-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

#chl-sidebar nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 20px;
  text-decoration: none;
  color: rgba(242, 231, 227, 0.72);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  border-left: 2px solid transparent;
  transition: all 0.16s ease;
}
#chl-sidebar nav a .sb-idx {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  color: rgba(242, 231, 227, 0.28);
  letter-spacing: 0.05em;
}
#chl-sidebar nav a:hover {
  color: #f2e7e3;
  background: rgba(227, 59, 47, 0.07);
}
#chl-sidebar nav a.active {
  color: #f2e7e3;
  background: rgba(227, 59, 47, 0.12);
  border-left-color: #E33B2F;
}
#chl-sidebar nav a.active .sb-idx {
  color: #E33B2F;
}
#chl-sidebar nav a.sb-cta {
  margin: 8px 12px 0;
  padding: 10px 16px;
  justify-content: center;
  border: 1px solid #E33B2F;
  color: #E33B2F;
  border-left: 1px solid #E33B2F;
  font-weight: 600;
}
#chl-sidebar nav a.sb-cta:hover {
  background: #E33B2F;
  color: #070b12;
}
#chl-sidebar nav a.sb-cta .sb-idx { display: none; }

#chl-sidebar .sb-foot {
  margin-top: auto;
  padding: 16px 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#chl-sidebar .sb-foot a {
  text-decoration: none;
  color: rgba(242, 231, 227, 0.6);
  transition: color 0.16s ease;
}
#chl-sidebar .sb-foot a:hover {
  color: #E33B2F;
}

/* ── Auth links (login/signup) ── */
#chl-sidebar .sb-foot > a:not(.sb-user):not(.sb-logout) {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 4px;
}

/* ── User avatar + name ── */
#chl-sidebar .sb-user {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 6px 0 2px !important;
  color: #f7e8e2 !important;
  font-family: 'DM Sans', sans-serif !important;
  font-size: 12px !important;
  font-weight: 500;
  letter-spacing: 0.01em !important;
  border: none !important;
  flex: none !important;
}
#chl-sidebar .sb-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #E33B2F;
  color: #f7e8e2;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
#chl-sidebar .sb-user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#chl-sidebar .sb-logout {
  font-size: 10px;
  font-family: 'DM Mono', monospace !important;
  padding: 2px 0 6px 36px !important;
  color: rgba(242, 231, 227, 0.45) !important;
  letter-spacing: 0.04em !important;
  border: none !important;
  flex: none !important;
}
#chl-sidebar .sb-logout:hover {
  color: #E33B2F !important;
}

/* Desktop: shift page content right, hide legacy top navs */
@media (min-width: 900px) {
  body.chl-has-sidebar {
    padding-left: 232px;
  }
  /* Left-align content — remove the centering gap next to the sidebar */
  body.chl-has-sidebar .container,
  body.chl-has-sidebar .wrap,
  body.chl-has-sidebar .hero-content,
  body.chl-has-sidebar .hero p,
  body.chl-has-sidebar .section-header,
  body.chl-has-sidebar .newsletter-box,
  body.chl-has-sidebar .newsletter-form,
  body.chl-has-sidebar .ch-footer-grid {
    margin-left: 0;
    margin-right: auto;
  }
  body.chl-has-sidebar .hero-content,
  body.chl-has-sidebar .section-header,
  body.chl-has-sidebar .newsletter-box,
  body.chl-has-sidebar .ch-footer-bottom {
    text-align: left;
  }
  body.chl-has-sidebar .ch-nav,
  body.chl-has-sidebar header.mast > nav.nav {
    display: none !important;
  }
}

/* Mobile: hide sidebar, keep legacy nav */
@media (max-width: 899px) {
  #chl-sidebar {
    transform: translateX(-100%);
    transition: transform 0.24s ease;
  }
  #chl-sidebar.chl-open {
    transform: translateX(0);
  }
  body.chl-has-sidebar {
    padding-left: 0;
  }
}

/* Mobile toggle button (shown only on mobile) */
#chl-sidebar-toggle {
  display: none;
}
@media (max-width: 899px) {
  #chl-sidebar-toggle {
    display: flex;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 61;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: rgba(7, 11, 18, 0.85);
    border: 1px solid rgba(227, 59, 47, 0.35);
    border-radius: 6px;
    cursor: pointer;
  }
  #chl-sidebar-toggle svg {
    width: 20px;
    height: 20px;
    stroke: #E33B2F;
  }
}
