/* Cerca (search.js): the button of the top bar and the box that Ctrl+K, ⌘K or «/» opens. */
.search-button {
  gap: 8px;
  color: var(--muted);
}
.search-button svg {
  width: 17px;
  height: 17px;
}
.search-button kbd {
  font:
    600 11px "DM Sans",
    sans-serif;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #7b8791;
  background: #f7f8f9;
}
.search-dialog {
  width: min(640px, calc(100% - 32px));
  margin-top: 12vh;
  max-height: 70vh;
  overflow: hidden;
  padding: 0;
}
.search-dialog[open] {
  display: flex;
  flex-direction: column;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.search-field svg {
  width: 20px;
  height: 20px;
  color: var(--muted);
  flex: none;
}
.search-field input {
  border: 0;
  margin: 0;
  padding: 6px 0;
  font-size: 17px;
  outline: none;
  background: transparent;
}
.search-field input:focus-visible,
html.dark .search-field input:focus-visible {
  outline: none;
}
/* ✕: closes, as Escape does */
.search-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: -4px -6px -4px 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}
.search-close:hover {
  background: #eef1f3;
  color: var(--ink);
}
html.dark .search-close:hover {
  background: #273449;
  color: #e2e8f0;
}
.search-field input::-webkit-search-cancel-button {
  display: none;
}
.search-results {
  overflow-y: auto;
  padding: 6px 0 10px;
}
.search-group {
  padding: 12px 20px 5px;
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  font-weight: 650;
  color: var(--muted);
}
.search-result {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 20px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
}
.search-result b {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* «Veure’n N més» of a group (search.js; proves amb agents, ronda 4) */
.search-result.search-more b {
  font-weight: 500;
  color: var(--muted);
}
.search-result small {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-result.active {
  background: #ecf4ec;
  box-shadow: inset 3px 0 0 #6bbc7e;
}
.search-hint {
  padding: 18px 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}
/* the scene the search took you to (Rodatge → Desglossament) */
.bd-scene.search-found,
.post-cut.search-found {
  outline: 3px solid #6eea8e;
  outline-offset: 4px;
  border-radius: 8px;
  transition: outline-color 0.6s;
}
@media (max-width: 760px) {
  .search-button span,
  .search-button kbd {
    display: none;
  }
  .search-button {
    padding: 9px;
  }
  .search-dialog {
    margin-top: 8px;
    max-height: calc(100dvh - 16px);
  }
  .search-result {
    flex-direction: column;
    gap: 2px;
  }
}
html.dark .search-button kbd {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}
html.dark .search-field {
  border-color: #334155;
}
html.dark .search-field input:not([type="checkbox"]) {
  color: #e2e8f0;
  background: transparent;
  border: 0;
}
html.dark .search-result {
  color: #e2e8f0;
}
html.dark .search-result.active {
  background: #1e3526;
  box-shadow: inset 3px 0 0 #6eea8e;
}
