/*!
 * Compact glassy search widget styling (sidebar + search results).
 * Matches newsletter widget interactive pattern: button appears on input.
 */

.widget_search .search-form,
.vu-blog-searchform .search-form {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: clamp(12px, 2.5vw, 14px);
  border-radius: 18px;
  color: var(--vu-ink, #1f2c57);
  background: transparent;
  overflow: visible;
}

/* Rely on sidebar system for vertical spacing */

.widget_search .search-form::before,
.vu-blog-searchform .search-form::before {
  content: "";
  position: absolute;
  inset: -6px;
  z-index: -2;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.08));
  border-radius: 22px;
  pointer-events: none;
}

.widget_search .search-form::after,
.vu-blog-searchform .search-form::after {
  content: "";
  position: absolute;
  inset: 2px;
  z-index: -1;
  background: var(--grad-surface-1, linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(245, 248, 255, 0.9)));
  border: 1px solid rgba(12, 24, 48, 0.12);
  border-radius: 18px;
  box-shadow: var(--vu-shadow-soft, 0 16px 28px rgba(5, 7, 19, 0.12));
  pointer-events: none;
}

.widget_search .search-form label,
.vu-blog-searchform .search-form label {
  position: relative;
  width: 100%;
  grid-column: 1 / -1;
  transition: grid-column 0.3s ease;
  margin: 0;
}

/* Contract to left column when typing */
.widget_search .search-form:has(.search-field:not(:placeholder-shown)) label,
.vu-blog-searchform .search-form:has(.search-field:not(:placeholder-shown)) label {
  grid-column: 1 / 2;
}

.widget_search .search-field,
.vu-blog-searchform .search-field {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(12, 24, 48, 0.14);
  background: rgba(255, 255, 255, 0.95);
  color: var(--vu-ink, #1f2c57);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.95em;
  height: 36px;
  line-height: 1.4;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.widget_search .search-field:focus,
.vu-blog-searchform .search-field:focus {
  border-color: var(--vu-gold, #ffd900);
  box-shadow: 0 0 0 2px rgba(255, 217, 0, 0.32);
}

.widget_search .search-field::placeholder,
.vu-blog-searchform .search-field::placeholder {
  font-size: 0.85em;
  color: rgba(31, 44, 87, 0.4);
  font-weight: 400;
}

/* Button hidden by default, slides in when typing */
.widget_search .search-submit,
.vu-blog-searchform .search-submit {
  appearance: none;
  border: 1px solid rgba(255, 217, 0, .45);
  border-radius: 10px;
  padding: 8px 14px;
  background: linear-gradient(135deg, #ffc600, #ffd900);
  color: #1a1f35;
  font-weight: 800;
  font-size: 14px;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 10px 20px rgba(255, 190, 79, 0.35);
  transform: translateX(-40px);
  transition: transform 0.3s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

/* Show button when input has text */
.widget_search .search-form:has(.search-field:not(:placeholder-shown)) .search-submit,
.vu-blog-searchform .search-form:has(.search-field:not(:placeholder-shown)) .search-submit {
  display: flex;
  transform: translateX(0);
}

.widget_search .search-submit:hover,
.widget_search .search-submit:focus-visible,
.vu-blog-searchform .search-submit:hover,
.vu-blog-searchform .search-submit:focus-visible {
  filter: brightness(1.07);
  box-shadow: 0 12px 24px rgba(255, 190, 79, 0.45);
}

.widget_search .search-submit:active,
.vu-blog-searchform .search-submit:active {
  transform: translateY(1px);
}

.widget_search .search-submit:focus-visible,
.vu-blog-searchform .search-submit:focus-visible {
  outline: 2px solid #1a1f35;
  outline-offset: 3px;
}

.widget_search .search-submit .genericon-search,
.vu-blog-searchform .search-submit .genericon-search {
  font-size: 1.1rem;
  line-height: 1;
}

.widget_search .screen-reader-text,
.vu-blog-searchform .screen-reader-text {
  position: absolute;
  clip: rect(1px, 1px, 1px, 1px);
  padding: 0;
  border: 0;
  height: 1px;
  width: 1px;
  overflow: hidden;
}

/* Responsive: stack on narrow viewports */
@media (max-width: 720px) {
  .widget_search .search-form,
  .vu-blog-searchform .search-form {
    grid-template-columns: 1fr;
  }

  .widget_search .search-form label,
  .vu-blog-searchform .search-form label {
    grid-column: 1 / -1;
  }

  .widget_search .search-form:has(.search-field:not(:placeholder-shown)) label,
  .vu-blog-searchform .search-form:has(.search-field:not(:placeholder-shown)) label {
    grid-column: 1 / -1;
  }

  .widget_search .search-form:has(.search-field:not(:placeholder-shown)) .search-submit,
  .vu-blog-searchform .search-form:has(.search-field:not(:placeholder-shown)) .search-submit {
    width: 100%;
    justify-content: flex-start;
    transform: translateX(0);
  }

  .widget_search .search-submit,
  .vu-blog-searchform .search-submit {
    width: auto;
  }
}
