/* Search bar */
.nav-btn-bar {
  position: relative;
}

#nav-search-box {
  position: absolute;
  top: 3.5rem;
  right: 0;
  width: 300px;
  background: var(--body-bg, white);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.5rem;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

#nav-search-box input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid currentColor;
  border-radius: 4px;
  background: none;
  color: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
}

#nav-search-results {
  list-style: none;
  padding: 0;
  margin-top: 0.5rem;
}

#nav-search-results li {
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--border-color);
}

.search-snippet {
  font-size: 0.75rem;
  color: var(--gray-text);
  margin: 0.2rem 0 0.5rem 0;
  line-height: 1.4;
}

#nav-search-results mark {
  background: #ffd580;
  color: #000;
  border-radius: 2px;
  padding: 0 2px;
}

body.dark-mode #nav-search-results mark {
  background: #7c6200;
  color: #ffd580;
}

#nav-search-btn,
#theme-toggle-nav {
    color: var(--gray-text);
    opacity: 0.8;
}

#nav-search-btn:hover,
#theme-toggle-nav:hover {
    opacity: 1;
}

/* Toggle dark-mode  */
#theme-toggle-sidebar {
  background: none;
  border: 1px solid currentColor;
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  cursor: pointer;
  font-size: 1rem;
}

.sidebar-toggle-btn {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

#theme-toggle-nav {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

/* Default: light mode */
body {
  --body-color: #000;
  --body-bg: #fff;
  --border-color: #ddd;
  --gray: rgba(0,0,0,.5);
  --gray-bg: rgba(0,0,0,.033);
  --gray-text: rgba(0,0,0,.625);
  --menu-text: rgba(0,0,0,.25);
}

/* Dark mode */
body.dark-mode {
  --body-color: #ccc;
  --body-bg: #1a1a1a;
  --border-color: #444;
  --gray: rgba(255,255,255,.5);
  --gray-bg: rgba(255,255,255,.033);
  --gray-text: rgba(255,255,255,.625);
  --menu-text: rgba(255,255,255,.25);
}

/* Links */
hy-push-state a { color: #262baa; }
body.dark-mode hy-push-state a { color: #79aaff; }

/* Strong */
body.dark-mode strong { color: #f0e6c8; }

/* --- About --- */

/* .social-icons ul {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  list-style: none;
  padding: 0;
}

.social-icons li {
  margin: 0;
} */

/* --- Menu: sidebar navigation --- */

.sidebar-nav ul {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-left: 0;
  list-style: none;
}

.sidebar-nav-item {
  text-align: left;
  width: 100%;
}

/* --- Posts --- */

#markdown-toc {
  max-height: none !important;
  overflow: visible !important;
  border: 1px solid #311694;
}

/* #markdown-toc {
  position: sticky;
  max-height: 90vh;
  overflow-y: auto;
  width: 250px;
  margin-left: 2rem;
  margin-bottom: 1rem;
  border: 1px solid #311694;
  border-radius: 4px;
  padding: 1rem 1rem 1rem 2rem;
} */

/* sticky ? */
/* #markdown-toc {
  position: fixed;
  max-height: 100vh;
  overflow-y: auto;
  border: 1px solid #311694;
  padding: 1rem 1rem 1rem 2rem;
  border-radius: 4px;
} */

.size-small  { width: 30%; }
.size-medium { width: 60%; }
.size-large  { width: 90%; }
.size-full   { width: 90%; }

img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

img[alt~="smaller"] { max-width: 20%; }
img[alt~="small"]   { max-width: 30%; }
img[alt~="medium"]  { max-width: 60%; }
img[alt~="full"]    { max-width: 100%; }
img[alt~="center"]  {
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

img[alt~="inline_circle"] {
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
}

pre code {
  font-size: 0.9rem;
}

img + em {
  display: block;
  text-align: center;
  font-size: 0.9em;
  opacity: 0.8;
}

.note {
  border-left: 4px solid #4da3ff;
  padding-left: 1rem;
  margin: 1.5rem 0;
}
