/**
 * Site-wide search UI.
 *
 * Self-contained on purpose: the site's shared design sheet (public/styles.css)
 * is missing from this checkout, so nothing here depends on it.
 */

.sso-body-lock {
  overflow: hidden !important;
}

/* ── Overlay ───────────────────────────────────────────────────────────── */
.sso-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 16px 16px;
  background: rgba(4, 8, 14, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.sso-overlay.sso-active {
  opacity: 1;
  visibility: visible;
}

/* ── Panel ─────────────────────────────────────────────────────────────── */
.sso-modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 720px;
  max-height: 78vh;
  overflow: hidden;
  background: #0f151d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
  transform: translateY(-14px) scale(0.98);
  transition: transform 0.22s ease;
}

.sso-overlay.sso-active .sso-modal {
  transform: translateY(0) scale(1);
}

/* ── Input row ─────────────────────────────────────────────────────────── */
.sso-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sso-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.sso-input {
  width: 100%;
  padding: 12px 14px 12px 44px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.sso-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.sso-input:focus {
  border-color: #aa7961;
  background: rgba(255, 255, 255, 0.08);
}

.sso-input::-webkit-search-cancel-button,
.sso-input::-webkit-search-decoration,
.sso-input::-webkit-search-results-button,
.sso-input::-webkit-search-results-decoration {
  display: none;
  -webkit-appearance: none;
  appearance: none;
}

.sso-clear-btn,
.sso-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.sso-clear-btn {
  position: absolute;
  inset-inline-end: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.75rem;
}

.sso-clear-btn:hover {
  background: rgba(170, 121, 97, 0.28);
  border-color: #aa7961;
  color: #fff;
}

.sso-close-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-family: inherit;
}

.sso-close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* ── Results ───────────────────────────────────────────────────────────── */
.sso-results {
  flex: 1;
  min-height: 0;
  max-height: 60vh;
  overflow-y: auto;
  padding: 8px;
}

.sso-results::-webkit-scrollbar { width: 8px; }
.sso-results::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 8px;
}

.sso-empty-state,
.sso-no-results,
.sso-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
}

.sso-empty-state i,
.sso-no-results i {
  font-size: 2rem;
  opacity: 0.5;
}

.sso-status {
  flex-direction: row;
  justify-content: center;
  padding: 32px 20px;
  font-size: 0.9rem;
}

.sso-summary {
  padding: 10px 12px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
}

.sso-summary strong { color: #fff; }

/* Page group */
.sso-page-group {
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.sso-page-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sso-page-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: rgba(170, 121, 97, 0.2);
  color: #aa7961;
  font-size: 0.85rem;
}

.sso-page-label {
  font-weight: 600;
  color: #fff;
  font-size: 0.94rem;
}

.sso-page-count {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}

.sso-page-link {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 7px;
  background: rgba(170, 121, 97, 0.16);
  color: #d8b6a4;
  font-size: 0.76rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.sso-page-link:hover {
  background: #aa7961;
  color: #fff;
} 

.sso-page-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.sso-page-toggle:hover,
.sso-page-toggle:focus-visible {
  border-color: #aa7961;
  background: rgba(170, 121, 97, 0.2);
  color: #fff;
}

.sso-page-toggle svg {
  width: 16px;
  height: 16px;
}

.sso-page-group.is-collapsed .sso-page-items {
  display: none;
}

.sso-page-items {
  display: flex;
  flex-direction: column;
}

/* Result item */
.sso-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: background 0.15s;
}

.sso-result-item:last-child { border-bottom: 0; }

.sso-result-item:hover,
.sso-item-active {
  background: rgba(170, 121, 97, 0.14);
}

.sso-item-left {
  flex: 1;
  min-width: 0;
}

.sso-item-section {
  font-weight: 600;
  color: #fff;
  font-size: 0.9rem;
  margin-bottom: 3px;
}

.sso-item-text {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.82rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sso-item-arrow {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.8rem;
}

.sso-result-item:hover .sso-item-arrow,
.sso-item-active .sso-item-arrow { color: #aa7961; }

mark.sso-highlight {
  background: rgba(240, 144, 86, 0.92);
  color: #151719;
  border-radius: 2px;
  padding: 0 2px;
  font-weight: 700;
}

/* ── Header button ─────────────────────────────────────────────────────── */
#header-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  padding: 0;
  padding-top: 9px;
  transition: color 0.2s, transform 0.2s;
}

#header-search-btn:hover {
  color: #fff;
  transform: scale(1.1);
}

#header-search-btn svg {
  display: block;
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

#header-search-btn:focus-visible {
  outline: 2px solid #aa7961;
  outline-offset: 2px;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sso-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .sso-modal {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
    border-bottom: 0;
    transform: translateY(30px);
  }

  .sso-overlay.sso-active .sso-modal { transform: translateY(0); }

  .sso-results { max-height: 64vh; }

}