/* Search results (/buscar/?q= and legacy /?s= on the homepage). */

#dica-search-page {
  display: block;
  max-width: 1120px;
  margin: 88px auto 0;
  padding: 24px var(--dica-gutter, 24px) 48px;
  box-sizing: border-box;
}

#dica-search-page .content-area {
  width: 100%;
}

.search-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 20px;
}

.search-heading {
  margin: 0;
  color: #0f1b3d;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.5px;
}

.search-heading span {
  color: #1f6fe5;
}

.search-count {
  margin: 6px 0 0;
  color: #334155;
  font-size: 15.5px;
}

.search-count strong {
  color: #0f1b3d;
}

.search-sort {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 10px;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
}

.search-sort[hidden] {
  display: none;
}

.search-sort select {
  min-width: 170px;
  height: 40px;
  padding: 0 34px 0 12px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%230f1b3d' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 10px center;
  background-repeat: no-repeat;
  background-size: 16px;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background-color: #fff;
  color: #0f1b3d;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.buscar-form {
  display: flex;
  gap: 10px;
  margin: 0 0 22px;
}

.buscar-form input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  height: 48px;
  padding: 0 16px;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #fff;
  color: #0f1b3d;
  font-family: inherit;
  font-size: 16px;
}

.buscar-form button {
  flex: none;
  height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: var(--dica-action, #1b4f9c);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.search-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 10px 22px 10px 12px;
  border: 1px solid #e6ebf3;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, .04);
  color: inherit;
  text-decoration: none !important;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.search-item:hover {
  border-color: #c7d7f3;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .08);
}

.search-item-thumb {
  display: block;
  flex: 0 0 176px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: #eef2f7;
}

.search-item-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
}

.search-item-text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.search-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  color: #1f6fe5;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.search-cat svg {
  max-width: none;
}

.search-item-title {
  margin: 0 0 4px;
  color: #0f1b3d;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
}

.search-item:hover .search-item-title {
  color: #1f6fe5;
}

.search-item-desc {
  display: -webkit-box;
  max-width: 640px;
  overflow: hidden;
  color: #64748b;
  font-size: 14px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.search-item-go {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border-radius: 50%;
  background: #eef4ff;
  color: #1f6fe5;
  transition: background-color .15s ease, color .15s ease;
}

.search-item-go svg {
  display: block;
  max-width: none;
}

.search-item:hover .search-item-go {
  background: #1f6fe5;
  color: #fff;
}

.search-empty {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 28px 24px;
  border: 1px dashed #d5deec;
  border-radius: 14px;
  color: #475569;
}

.search-empty strong {
  color: #0f1b3d;
  font-size: 17px;
}

html[data-theme="dark"] .search-heading,
html[data-theme="dark"] .search-count strong,
html[data-theme="dark"] .search-item-title,
html[data-theme="dark"] .search-empty strong {
  color: var(--dica-ink);
}

html[data-theme="dark"] .search-count,
html[data-theme="dark"] .search-sort,
html[data-theme="dark"] .search-item-desc,
html[data-theme="dark"] .search-empty {
  color: var(--dica-muted);
}

html[data-theme="dark"] .search-item,
html[data-theme="dark"] .search-sort select,
html[data-theme="dark"] .buscar-form input[type="search"] {
  border-color: var(--dica-border);
  background-color: var(--dica-surface-raised);
  box-shadow: none;
  color: var(--dica-ink);
}

html[data-theme="dark"] .search-heading span,
html[data-theme="dark"] .search-cat,
html[data-theme="dark"] .search-item:hover .search-item-title {
  color: var(--dica-action);
}

html[data-theme="dark"] .search-item-go {
  background: var(--dica-action-soft);
  color: var(--dica-action);
}

@media screen and (max-width: 720px) {
  #dica-search-page {
    margin-top: 72px;
    padding: 18px 16px 36px;
  }

  .search-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-heading {
    font-size: 24px;
  }

  .search-item {
    align-items: flex-start;
    gap: 12px;
    padding: 10px;
  }

  .search-item-thumb {
    flex-basis: 104px;
  }

  .search-item-title {
    font-size: 15.5px;
  }

  .search-item-desc {
    -webkit-line-clamp: 2;
    font-size: 13px;
  }

  .search-item-go {
    display: none;
  }
}
