/* Site-wide Dhivehi search */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-search {
  position: relative;
  flex: 0 1 200px;
  min-width: 130px;
  max-width: 240px;
  z-index: 950;
}

.site-search-form {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f0f5fb;
  border: 1px solid rgba(22, 84, 147, 0.18);
  border-radius: 999px;
  padding: 4px 12px 4px 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.site-search.is-open .site-search-form,
.site-search-form:focus-within {
  border-color: rgba(22, 84, 147, 0.45);
  box-shadow: 0 0 0 3px rgba(22, 84, 147, 0.1);
  background: #fff;
}

.site-search-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: #165493;
  opacity: 0.85;
}

.site-search-input {
  width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  color: #0e3c6a;
  outline: none;
  padding: 6px 0;
}

.site-search-input::placeholder {
  color: #6b8fb5;
  opacity: 1;
}

.site-search-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  min-width: min(320px, calc(100vw - 32px));
  max-height: min(70vh, 420px);
  overflow: auto;
  background: #fff;
  border: 1px solid rgba(22, 84, 147, 0.14);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(14, 60, 106, 0.16);
  padding: 8px 0;
}

.site-search-panel[hidden] {
  display: none;
}

.site-search-status {
  margin: 0;
  padding: 12px 16px;
  font-size: 13px;
  color: #6b8fb5;
  text-align: center;
}

.site-search-group-label {
  margin: 8px 16px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #165493;
  opacity: 0.75;
}

.site-search-hit {
  display: block;
  padding: 10px 16px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.site-search-hit:hover,
.site-search-hit:focus-visible {
  background: #eef4fb;
  outline: none;
}

.site-search-hit-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #0e3c6a;
  line-height: 1.35;
}

.site-search-hit-meta {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: #6b8fb5;
  line-height: 1.35;
}

.site-search-mark {
  background: rgba(255, 214, 102, 0.55);
  border-radius: 2px;
  padding: 0 1px;
}

@media (max-width: 768px) {
  .apps-bar {
    flex-wrap: wrap;
    height: auto;
    min-height: var(--site-appsbar-h);
    padding: 6px 12px;
    gap: 8px;
  }

  .apps-bar > .nav-donate-btn {
    order: -2;
    margin-right: 0;
    flex: 0 0 auto;
    max-width: calc(100% - 8px);
    padding: 5px 10px;
    min-height: 32px;
    font-size: 11px;
  }

  .apps-bar-tools {
    flex: 1 1 100%;
    flex-wrap: wrap;
    gap: 8px;
    align-items: stretch;
  }

  .apps-bar-tools .site-search {
    order: -1;
    flex: 1 1 100%;
    max-width: none;
    min-width: 0;
  }

  .apps-bar .nav-promo-wrap {
    flex: 1 1 auto;
    justify-content: center;
  }

  .site-search-form {
    padding: 3px 10px;
  }

  .site-search-input {
    font-size: 13px;
    padding: 5px 0;
  }

  .site-search-panel {
    position: fixed;
    top: var(--site-header-h, 104px);
    right: 12px;
    left: 12px;
    min-width: 0;
    max-height: calc(100vh - var(--site-header-h, 104px) - 24px);
  }
}

@media (min-width: 769px) {
  .apps-bar-tools .site-search {
    flex: 0 1 220px;
    max-width: 280px;
  }
}
