/* ============================================================
   Search inside a series — series page form and results
   (template-parts/manga/manga-chapters.php, series-search.js),
   and the reader's match highlight and bar (find-in-chapter.js).
   ============================================================ */

.ao-series-find {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
}

.ao-series-find input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  font: inherit;
  color: var(--ao-text);
  background: var(--ao-bg-alt);
  border: 1px solid var(--ao-border);
  border-radius: var(--ao-radius-full);
}

.ao-series-find input[type="search"]:focus {
  outline: 2px solid var(--ao-primary);
  outline-offset: 1px;
}

.ao-series-find__btn {
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--ao-primary);
  border: 0;
  border-radius: var(--ao-radius-full);
  cursor: pointer;
}

.ao-series-find__btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.ao-series-find__results {
  margin: 0 0 16px;
  padding: 12px 14px;
  background: var(--ao-bg-card);
  border: 1px solid var(--ao-border);
  border-radius: var(--ao-radius-lg);
  max-height: 480px;
  overflow: auto;
}

.ao-series-find__message,
.ao-series-find__summary {
  margin: 0;
  color: var(--ao-text-light);
}

.ao-series-find__summary {
  margin-bottom: 8px;
  font-size: 0.9em;
}

.ao-series-find__chapter {
  padding: 10px 0;
  border-top: 1px solid var(--ao-border);
}

.ao-series-find__chapter-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
  color: var(--ao-text);
  text-decoration: none;
}

.ao-series-find__count,
.ao-series-find__more {
  font-size: 0.85em;
  font-weight: 400;
  color: var(--ao-text-light);
  white-space: nowrap;
}

.ao-series-find__more {
  margin: 4px 0 0;
}

.ao-series-find__snippet {
  display: block;
  margin-top: 6px;
  padding: 6px 10px;
  font-size: 0.92em;
  line-height: 1.5;
  color: var(--ao-text);
  text-decoration: none;
  border-left: 3px solid var(--ao-border);
  border-radius: 0 var(--ao-radius) var(--ao-radius) 0;
}

.ao-series-find__snippet:hover,
.ao-series-find__snippet:focus-visible {
  background: var(--ao-bg-alt);
  border-left-color: var(--ao-primary);
}

.ao-series-find mark,
.ao-series-find__results mark,
.ao-find-hit {
  padding: 0 1px;
  color: inherit;
  background: rgba(250, 204, 21, 0.4);
  border-radius: 2px;
}

/* Reader */
.ao-find-hit.is-current {
  color: #111;
  background: rgba(250, 204, 21, 0.95);
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.95);
}

.ao-find-bar {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100vw - 32px);
  padding: 6px 6px 6px 14px;
  color: var(--ao-text);
  background: var(--ao-bg-card);
  border: 1px solid var(--ao-border);
  border-radius: var(--ao-radius-full);
  box-shadow: var(--ao-shadow);
  transform: translateX(-50%);
}

.ao-find-bar__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ao-find-bar__count {
  color: var(--ao-text-light);
  font-variant-numeric: tabular-nums;
}

.ao-find-bar__btn {
  width: 32px;
  height: 32px;
  font-size: 18px;
  line-height: 1;
  color: inherit;
  background: var(--ao-bg-alt);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.ao-find-bar__btn:hover,
.ao-find-bar__btn:focus-visible {
  color: #fff;
  background: var(--ao-primary);
}
