/* FISHQ local search, article tools, and project page enhancements. */
.fishq-search-host {
  position: relative;
}

.fishq-search-suggestions {
  position: absolute;
  z-index: 1200;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  min-width: 280px;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid rgba(94, 114, 228, 0.18);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(31, 41, 55, 0.16);
}

#leftbar_part1 .fishq-search-suggestions {
  left: 14px;
  right: 14px;
  top: calc(100% + 4px);
}

#argon_search_modal .fishq-search-suggestions {
  position: relative;
  top: auto;
  min-width: 0;
  margin-top: 8px;
  box-shadow: none;
}

.fishq-search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 6px;
  color: #32325d;
  text-decoration: none !important;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.fishq-search-result:hover,
.fishq-search-result:focus,
.fishq-search-result[aria-selected="true"] {
  background: rgba(94, 114, 228, 0.1);
  color: var(--themecolor, #5e72e4);
  outline: none;
}

.fishq-search-result:focus-visible,
.fishq-mobile-toc-trigger:focus-visible,
.fishq-code-enhanced .hljs-control-btn:focus-visible,
.fishq-project-link:focus-visible {
  outline: 2px solid var(--themecolor, #5e72e4);
  outline-offset: 2px;
}

.fishq-search-result-title {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fishq-search-result-meta,
.fishq-search-status {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 12px;
}

.fishq-search-status {
  padding: 12px 10px;
  text-align: center;
}

.fishq-search-status.is-error {
  color: #b42318;
}

.fishq-mobile-article-tools {
  display: none;
}

.fishq-code-header {
  position: absolute;
  z-index: 1;
  top: 13px;
  right: 142px;
  left: 88px;
  display: flex;
  align-items: center;
  min-height: 24px;
  gap: 10px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.72);
  font-family: Consolas, Menlo, Monaco, monospace;
  font-size: 11px;
  line-height: 1.2;
  pointer-events: none;
  text-transform: uppercase;
}

.fishq-code-language {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fishq-code-lines {
  margin-left: auto;
  white-space: nowrap;
}

.fishq-code-enhanced .hljs-control {
  z-index: 2;
}

.fishq-code-enhanced .hljs-control:focus-within {
  opacity: 1;
}

.fishq-code-enhanced .hljs-control .hljs-control-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 30px;
  min-height: 30px;
  margin-left: 4px;
  border-radius: 4px;
}

.fishq-code-enhanced .hljs-control .hljs-control-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.12);
}

.fishq-projects-intro {
  margin-bottom: 24px;
  padding: 18px 20px;
  border-left: 3px solid var(--themecolor, #5e72e4);
  background: rgba(94, 114, 228, 0.06);
}

.fishq-projects-kicker {
  margin: 0 0 8px;
  color: var(--themecolor, #5e72e4);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.fishq-projects-intro h2 {
  margin-top: 0;
}

.fishq-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin: 20px 0 30px;
}

.fishq-project-card {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--color-border-on-foreground-deeper, #e4e4e7);
  border-radius: 8px;
  background: var(--color-foreground, #ffffff);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.fishq-project-card:hover {
  border-color: var(--themecolor, #5e72e4);
  box-shadow: 0 10px 24px rgba(50, 50, 93, 0.1);
  transform: translateY(-2px);
}

.fishq-project-index {
  color: var(--themecolor, #5e72e4);
  font-family: Consolas, Menlo, Monaco, monospace;
  font-size: 12px;
  font-weight: 700;
}

.fishq-project-card h3 {
  margin: 12px 0 8px;
  font-size: 18px;
}

.fishq-project-card p {
  flex: 1;
  margin-bottom: 16px;
  color: #64748b;
  font-size: 14px;
  line-height: 1.7;
}

.fishq-project-status {
  display: inline-flex;
  align-self: flex-start;
  margin-bottom: 14px;
  padding: 3px 8px;
  border: 1px solid rgba(45, 206, 137, 0.28);
  border-radius: 999px;
  color: #16834f;
  font-size: 12px;
  line-height: 1.4;
}

.fishq-project-link {
  color: var(--themecolor, #5e72e4);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.fishq-project-link:hover {
  text-decoration: underline;
}

.fishq-project-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 24px;
}

.fishq-project-facts div {
  padding: 14px;
  border-top: 2px solid var(--themecolor, #5e72e4);
  background: rgba(94, 114, 228, 0.05);
}

.fishq-project-facts dt {
  color: #64748b;
  font-size: 12px;
}

.fishq-project-facts dd {
  margin: 4px 0 0;
  color: var(--themecolor, #5e72e4);
  font-size: 20px;
  font-weight: 700;
}

html.darkmode .fishq-search-suggestions,
html.darkmode .fishq-project-card {
  border-color: #3d3d49;
  background: #202027;
}

html.darkmode .fishq-search-result,
html.darkmode .fishq-project-card p,
html.darkmode .fishq-project-facts dt {
  color: #cbd5e1;
}

html.darkmode .fishq-projects-intro,
html.darkmode .fishq-project-facts div {
  background: rgba(94, 114, 228, 0.14);
}

@media screen and (max-width: 900px) {
  .fishq-mobile-article-tools {
    display: flex;
    margin: 0 0 18px;
  }

  .fishq-mobile-toc-trigger {
    display: flex;
    width: 100%;
    min-height: 44px;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid rgba(94, 114, 228, 0.28);
    border-radius: 6px;
    background: rgba(94, 114, 228, 0.08);
    color: var(--themecolor, #5e72e4);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
  }

  .fishq-mobile-toc-trigger:hover {
    background: rgba(94, 114, 228, 0.14);
  }

  .fishq-mobile-toc-icon {
    font-size: 20px;
    line-height: 1;
  }

  .fishq-mobile-toc-count {
    margin-left: auto;
    font-size: 12px;
    font-weight: 400;
    opacity: 0.75;
  }

  .fishq-code-header {
    right: 112px;
    left: 78px;
  }

  .fishq-project-grid {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 520px) {
  .fishq-search-suggestions {
    min-width: 0;
  }

  .fishq-code-header {
    right: 102px;
    left: 72px;
    font-size: 10px;
  }

  .fishq-code-lines {
    display: none;
  }

  .fishq-project-facts {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fishq-search-result,
  .fishq-project-card,
  .fishq-project-card:hover {
    transition: none;
    transform: none;
  }
}
