/* The feed owns this navigation; the rest of the blog keeps its original layout. */
html, .preview-shell { scrollbar-color: #235d72 #090d18; scrollbar-width: thin; }
html::-webkit-scrollbar, .preview-shell::-webkit-scrollbar { width: 10px; }
html::-webkit-scrollbar-track, .preview-shell::-webkit-scrollbar-track { background: #090d18; }
html::-webkit-scrollbar-thumb, .preview-shell::-webkit-scrollbar-thumb { background: #235d72; border: 2px solid #090d18; border-radius: 99px; }
html::-webkit-scrollbar-thumb:hover, .preview-shell::-webkit-scrollbar-thumb:hover { background: #00c7e2; }
.layout,
.layout.sidebar-small {
  width: 100%;
  max-width: none;
  justify-content: space-between;
  gap: clamp(20px, 2vw, 38px);
  padding: 26px 24px 90px;
  transition: grid-template-columns 320ms cubic-bezier(.22, 1, .36, 1);
}
.layout { grid-template-columns: 260px minmax(0, 760px) 255px; }
.layout.sidebar-small { grid-template-columns: 70px minmax(0, 760px) 255px; }

.sidebar,
.sidebar-small .sidebar {
  position: sticky;
  top: 92px;
  align-self: start;
  max-height: calc(100dvh - 106px);
  overflow: hidden;
  padding: 0;
  border-radius: 15px;
  transition: border-color 260ms ease, box-shadow 260ms ease;
}
.sidebar:hover,
.sidebar:focus-within { border-color: rgba(0, 240, 255, .32); box-shadow: 0 12px 40px rgba(0, 240, 255, .045); }
.sidebar-content {
  max-height: calc(100dvh - 108px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: 14px 22px 14px 14px;
}
.sidebar-content::-webkit-scrollbar { display: none; }
.sidebar-small .sidebar-content { padding: 12px 10px; }
.sidebar-expand {
  height: var(--sidebar-expand-height, auto);
  overflow: hidden;
  opacity: 1;
  transition: height 340ms cubic-bezier(.22, 1, .36, 1), opacity 220ms ease;
}
.sidebar-small .sidebar-expand { height: 0; opacity: 0; }

.sidebar-scrollbar {
  position: absolute;
  z-index: 3;
  top: 10px;
  right: 4px;
  bottom: 10px;
  width: 9px;
  border-radius: 99px;
  background: rgba(0, 240, 255, .035);
  opacity: 0;
  transform: translateX(4px) scaleX(.72);
  transition: opacity 260ms ease, transform 260ms ease, background-color 200ms ease;
  cursor: pointer;
  touch-action: none;
  pointer-events: none;
}
.sidebar.has-scroll .sidebar-scrollbar { opacity: .34; pointer-events: auto; }
.sidebar.has-scroll:hover .sidebar-scrollbar,
.sidebar.has-scroll:focus-within .sidebar-scrollbar,
.sidebar.has-scroll.scroll-dragging .sidebar-scrollbar {
  opacity: 1;
  transform: translateX(0) scaleX(1);
  background: rgba(0, 240, 255, .09);
}
.sidebar-thumb {
  position: absolute;
  inset: 0 1px auto;
  height: 40px;
  border-radius: 99px;
  background: linear-gradient(180deg, #25556d, #217d96);
  box-shadow: inset 0 0 0 1px rgba(0, 240, 255, .18);
  transition: background 200ms ease, box-shadow 200ms ease, filter 200ms ease;
}
.sidebar-scrollbar:hover .sidebar-thumb,
.sidebar.scroll-dragging .sidebar-thumb {
  background: linear-gradient(180deg, #43ddef, #00c7e2);
  box-shadow: 0 0 16px rgba(0, 240, 255, .35);
}
.sidebar.scroll-dragging .sidebar-thumb { filter: brightness(1.25); }

.sidebar-top button {
  display: grid;
  place-items: center;
  transition: border-color 200ms ease, background-color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}
.sidebar-top button:hover { color: var(--cyan); border-color: rgba(0, 240, 255, .55); background: rgba(0, 240, 255, .1); box-shadow: 0 0 14px rgba(0, 240, 255, .1); }
.sidebar-top button:active { transform: scale(.9); }
.menu-icon { display: grid; gap: 4px; width: 15px; }
.menu-icon span { display: block; width: 100%; height: 1.5px; border-radius: 3px; background: currentColor; transition: transform 300ms cubic-bezier(.22, 1, .36, 1), opacity 180ms ease; }
.sidebar-small .menu-icon span:first-child { transform: translateY(5.5px) rotate(-45deg); }
.sidebar-small .menu-icon span:nth-child(2) { opacity: 0; transform: scaleX(.2); }
.sidebar-small .menu-icon span:last-child { transform: translateY(-5.5px) rotate(45deg); }
.sidebar-heading,
.topic-text,
.topic-count,
.topic-heading,
.sidebar-foot { transition: opacity 190ms ease, transform 260ms ease; }
.topic-link { transition: background-color 220ms ease, color 220ms ease, border-color 220ms ease, transform 220ms ease; }
.topic-link:hover { transform: translateX(2px); }
.sidebar-small .sidebar-heading,
.sidebar-small .topic-text,
.sidebar-small .topic-count,
.sidebar-small .topic-heading,
.sidebar-small .sidebar-foot { display: initial; opacity: 0; pointer-events: none; }
.sidebar-small .topic-text,
.sidebar-small .topic-count { width: 0; flex: 0 0 0; overflow: hidden; }
.sidebar-small .sidebar-heading { position: absolute; }
.sidebar-small .topic-heading,
.sidebar-small .sidebar-foot { position: absolute; }
.sidebar-small .topic-link { gap: 0; }
.sidebar-small .sidebar-top { justify-content: center; }

@media (max-width: 1260px) and (min-width: 761px) {
  .layout { grid-template-columns: 230px minmax(0, 1fr); }
  .layout.sidebar-small { grid-template-columns: 70px minmax(0, 1fr); }
  .main { max-width: 850px; }
}
@media (max-width: 760px) {
  .layout,
  .layout.sidebar-small { display: block; padding: 16px 14px 60px; }
  .sidebar,
  .sidebar-small .sidebar { position: relative; top: auto; max-height: none; margin-bottom: 18px; }
  .sidebar-content,
  .sidebar-small .sidebar-content { max-height: none; overflow: visible; padding: 10px; }
  .sidebar-scrollbar { display: none; }
  .sidebar-expand { height: 0; opacity: 0; overflow: hidden; transform: translateY(-8px); transition: height 340ms cubic-bezier(.22, 1, .36, 1), opacity 230ms ease, transform 340ms cubic-bezier(.22, 1, .36, 1); }
  .sidebar.is-open .sidebar-expand { height: var(--sidebar-expand-height, 0px); opacity: 1; transform: translateY(0); }
  .sidebar .topic-section,
  .sidebar .sidebar-foot { display: block; }
  .sidebar.is-open .menu-icon span:first-child { transform: translateY(5.5px) rotate(45deg); }
  .sidebar.is-open .menu-icon span:nth-child(2) { opacity: 0; transform: scaleX(.2); }
  .sidebar.is-open .menu-icon span:last-child { transform: translateY(-5.5px) rotate(-45deg); }
}
@media (prefers-reduced-motion: reduce) {
  .layout, .sidebar, .sidebar-scrollbar, .sidebar-thumb, .sidebar-expand,
  .menu-icon span, .sidebar-top button, .topic-link { transition-duration: .01ms !important; }
}
