/**
 * @file
 * RheumNow Discovery Search – full-screen modal overlay.
 * Brand palette: #1585fe (primary blue), #232323 (text), Poppins/Roboto fonts.
 */

/* ==========================================================================
   Hidden legacy block wrapper
   Keeps page.search region truthy without rendering the old form visually.
   ========================================================================== */
.rn-search-region-hidden {
  display: none !important;
}

/* ==========================================================================
   Body lock while modal is open
   ========================================================================== */
body.rn-search-modal-open {
  overflow: hidden;
}

/* ==========================================================================
   Trigger button
   Uses the existing .icon class inside .gva-search-region for positioning.
   We only need to override what's different from the old <span class="icon">.
   ========================================================================== */
button.rn-search-trigger {
  background: none;
  border: none;
  cursor: pointer;
  line-height: inherit;
  font-size: inherit;
  color: inherit;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

button.rn-search-trigger:hover,
button.rn-search-trigger:focus-visible {
  color: #1585fe;
  outline: none;
}

/* ==========================================================================
   Modal overlay
   ========================================================================== */
.rn-search-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 72px;
  /* animation base states */
}

.rn-search-modal[hidden] {
  display: none !important;
}

/* Backdrop */
.rn-search-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 18, 40, 0.75);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.rn-search-modal.is-open .rn-search-modal__backdrop {
  opacity: 1;
}

/* Panel */
.rn-search-modal__panel {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.12);
  width: 100%;
  max-width: 680px;
  margin: 0 16px;
  padding: 44px 44px 40px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  transform: translateY(-20px) scale(0.97);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.rn-search-modal.is-open .rn-search-modal__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Close button */
.rn-search-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  color: #aaa;
  font-size: 17px;
  padding: 8px;
  line-height: 1;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rn-search-modal__close:hover,
.rn-search-modal__close:focus-visible {
  color: #232323;
  background: #f2f2f2;
  outline: none;
}

/* ==========================================================================
   Search form
   ========================================================================== */

/* "Search RheumNow" label */
.rn-search-modal__label {
  display: block;
  font-family: Poppins, Roboto, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1585fe;
  margin-bottom: 18px;
}

/* Input row */
.rn-search-modal__input-wrap {
  display: flex;
  align-items: center;
  border-bottom: 2px solid #e2e2e2;
  transition: border-color 0.2s ease;
  gap: 10px;
}

.rn-search-modal__input-wrap:focus-within {
  border-color: #1585fe;
}

.rn-search-modal__input-icon {
  color: #c0c0c0;
  font-size: 17px;
  flex-shrink: 0;
  transition: color 0.2s;
}

.rn-search-modal__input-wrap:focus-within .rn-search-modal__input-icon {
  color: #1585fe;
}

.rn-search-modal__input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: Poppins, Roboto, sans-serif;
  font-size: 22px;
  font-weight: 300;
  color: #232323;
  padding: 10px 0 12px;
  caret-color: #1585fe;
}

.rn-search-modal__input::placeholder {
  color: #c8c8c8;
  font-weight: 300;
}

/* Remove browser-native clear button */
.rn-search-modal__input::-webkit-search-cancel-button {
  display: none;
}

/* Submit arrow button */
.rn-search-modal__submit {
  flex-shrink: 0;
  background: #1585fe;
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  padding: 10px 14px;
  line-height: 1;
  transition: background 0.18s, transform 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rn-search-modal__submit:hover {
  background: #0d6fd6;
  transform: scale(1.06);
}

.rn-search-modal__submit:focus-visible {
  outline: 2px solid #1585fe;
  outline-offset: 3px;
}

/* ==========================================================================
   Autocomplete – inline link list (not a floating dropdown)
   ========================================================================== */
.rn-search-modal__autocomplete {
  margin-top: 20px;
}

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

/* "Content with '[query]' in the title:" label */
.rn-search-ac-subheader {
  font-family: Poppins, Roboto, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #aaa;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 4px;
}

.rn-search-ac-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 6px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.12s;
}

.rn-search-ac-item:hover,
.rn-search-ac-item.is-active {
  background: #f3f8ff;
}

.rn-search-ac-icon {
  color: #d0d0d0;
  font-size: 11px;
  flex-shrink: 0;
}

.rn-search-ac-text {
  flex: 1;
  font-family: Poppins, Roboto, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #1585fe;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rn-search-ac-item:hover .rn-search-ac-text,
.rn-search-ac-item.is-active .rn-search-ac-text {
  text-decoration: underline;
}

.rn-search-ac-arrow {
  color: #ccc;
  font-size: 11px;
  flex-shrink: 0;
  transition: color 0.12s;
}

.rn-search-ac-item:hover .rn-search-ac-arrow,
.rn-search-ac-item.is-active .rn-search-ac-arrow {
  color: #1585fe;
}

/* ==========================================================================
   Popular searches / suggestion chips
   ========================================================================== */
.rn-search-modal__suggestions {
  margin-top: 30px;
}

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

.rn-search-modal__suggestions-label {
  font-family: Poppins, Roboto, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #aaa;
  margin: 0 0 12px;
}

.rn-search-modal__suggestions-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rn-search-modal__suggestion-chip {
  display: inline-block;
  background: #f0f6ff;
  color: #1585fe;
  border: 1.5px solid #d0e4ff;
  border-radius: 20px;
  padding: 7px 16px;
  font-family: Poppins, Roboto, sans-serif;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none !important;
  cursor: pointer;
  transition: background 0.16s, color 0.16s, border-color 0.16s, transform 0.1s;
  line-height: 1.3;
}

.rn-search-modal__suggestion-chip:hover,
.rn-search-modal__suggestion-chip:focus-visible {
  background: #1585fe;
  color: #fff !important;
  border-color: #1585fe;
  transform: scale(1.04);
  outline: none;
  text-decoration: none !important;
}

/* ==========================================================================
   Responsive – tablet / mobile
   ========================================================================== */
@media (max-width: 991px) {
  .rn-search-modal {
    padding-top: 56px;
  }
}

@media (max-width: 767px) {
  .rn-search-modal {
    padding-top: 0;
    align-items: stretch;
  }

  .rn-search-modal__panel {
    border-radius: 0;
    margin: 0;
    max-width: 100%;
    width: 100%;
    min-height: 100%;
    max-height: 100%;
    padding: 60px 24px 40px;
    box-shadow: none;
  }

  .rn-search-modal__input {
    font-size: 18px;
  }

  .rn-search-modal__close {
    top: 16px;
    right: 16px;
  }
}

@media (max-width: 480px) {
  .rn-search-modal__suggestions-list {
    gap: 6px;
  }

  .rn-search-modal__suggestion-chip {
    font-size: 12px;
    padding: 6px 12px;
  }

  .rn-search-modal__input {
    font-size: 17px;
  }
}
