/* Search command palette overlay */

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: min(12vh, 96px) 20px 40px;
  background: rgba(6, 5, 3, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

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

.search-overlay:not([hidden]).is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.search-palette {
  width: min(640px, 100%);
  background: rgba(16, 13, 9, 0.96);
  border: 1px solid rgba(217, 180, 91, 0.32);
  border-radius: 10px;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  overflow: hidden;
  transform-origin: top center;
}

.search-palette-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid rgba(217, 180, 91, 0.12);
}

.search-palette-icon {
  font-size: 22px;
  color: var(--goldBright);
  opacity: 0.85;
  line-height: 1;
  margin-top: 6px;
}

.search-palette-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 8px 0;
  font-size: 18px;
  color: #f2e8cf;
  font-family: var(--font-body);
}

.search-palette-input:focus {
  outline: none;
}

.search-palette-input::placeholder {
  color: #7a6d52;
}

.search-palette-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 12px 20px 14px;
  border-top: 1px solid rgba(217, 180, 91, 0.1);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #6e6350;
}

.search-palette-foot kbd {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(217, 180, 91, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: #a89a78;
  font-size: 10px;
  margin-right: 4px;
}

.btn-search.is-palette-open {
  border-color: #d9b45b;
  color: #d9b45b;
  box-shadow: 0 0 16px rgba(217, 180, 91, 0.2);
}

@media (max-width: 600px) {
  .search-overlay {
    padding-top: 8vh;
    align-items: flex-start;
  }
  .search-palette-foot {
    font-size: 10px;
  }
}

/* Warm Parchment Light Mode */
html[data-theme="light"] .search-overlay { background: rgba(28, 21, 16, 0.45); }
html[data-theme="light"] .search-palette {
  background: #FFFDF8;
  border-color: #D2C2A0;
  box-shadow: 0 32px 80px rgba(42, 33, 23, 0.28);
}
html[data-theme="light"] .search-palette-head { border-bottom-color: #E3D8C3; }
html[data-theme="light"] .search-palette-icon { color: #9A6A12; }
html[data-theme="light"] .search-palette-input { color: #1C1510; }
html[data-theme="light"] .search-palette-input::placeholder { color: #6D5F4B; }
html[data-theme="light"] .search-palette-foot { border-top-color: #E3D8C3; color: #6D5F4B; }
html[data-theme="light"] .search-palette-foot kbd { border-color: #D2C2A0; background: #F3ECDD; color: #3B3226; }
