/*!
 * Copyright © 2025 OHTCC (ohtccwa.org)
 * All rights reserved.
 *
 * This file is the property of Olympia Hindu Temple & Cultural Center (OHTCC).
 * Unauthorized copying, modification, or redistribution of this file,
 * via any medium, is strictly prohibited without prior written permission.
 * OHTCC SITE SEARCH — Gyan Search Modal
 */
.search-trigger-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.3rem;
  opacity: 0.9;
  transition: opacity 0.2s;
  padding: 4px 4px !important;
}
.search-trigger-btn:hover,
.search-trigger-btn:focus {
  opacity: 1;
  color: #f5c842;
  box-shadow: none;
  outline: none;
}
#search-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(60, 20, 0, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex !important;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 16px 16px;
}

#search-overlay:not([style*="display:none"]):not([style*="display: none"]) {
  animation: searchFadeIn 0.18s ease;
}

#search-overlay[style*="display:none"],
#search-overlay[style*="display: none"] {
  display: none !important;
}

@keyframes searchFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

#search-modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 640px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  overflow: hidden;
  /* remove animation from here */
}

/* only animate when overlay is visible */
#search-overlay:not([style*="display:none"]):not([style*="display: none"]) #search-modal {
  animation: searchSlideDown 0.2s ease;
}

@keyframes searchSlideDown {
  from { transform: translateY(-20px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

#search-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #8B1A1A; /* OHTCC maroon */
  padding: 14px 18px;
}

#search-brand {
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  letter-spacing: 0.02em;
}

#search-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.85;
  transition: opacity 0.15s;
}
#search-close:hover { opacity: 1; }

#search-input-wrap {
  padding: 16px 18px 10px;
  border-bottom: 1px solid #f0e6d3;
}

#search-input {
  width: 100%;
  border: 2px solid #d4813a;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 1rem;
  outline: none;
  color: #3a1a00;
  transition: border-color 0.2s;
}
#search-input:focus {
  border-color: #8B1A1A;
}

#search-results-wrap {
  padding: 10px 18px;
  max-height: 420px;
  overflow-y: auto;
}

#search-hint {
  color: #999;
  font-size: 0.9rem;
  text-align: center;
  padding: 20px 0 10px;
  margin: 0;
}

#search-results .pagefind-ui__result {
  border-bottom: 1px solid #f5ede0;
  padding: 12px 0;
}
#search-results .pagefind-ui__result:last-child {
  border-bottom: none;
}
#search-results .pagefind-ui__result-title a {
  color: #8B1A1A;
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
}
#search-results .pagefind-ui__result-title a:hover {
  text-decoration: underline;
}
#search-results .pagefind-ui__result-excerpt {
  color: #555;
  font-size: 0.88rem;
  margin-top: 4px;
}
#search-results .pagefind-ui__result-excerpt mark {
  background: #fde8c0;
  color: #8B1A1A;
  border-radius: 2px;
  padding: 0 2px;
}

#search-footer {
  background: #fdf5ec;
  border-top: 1px solid #f0e6d3;
  padding: 8px 18px;
  font-size: 0.78rem;
  color: #999;
  text-align: right;
}
#search-footer a { color: #d4813a; }
#search-footer kbd {
  background: #e0e0e0;
  border: 1px solid #aaa;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 0.75rem;
  color: #222;
}

/* Mobile adjustments */
@media (max-width: 576px) {
  #search-overlay {
    padding: 20px 10px 10px;
    align-items: flex-start;
  }
  #search-modal {
    border-radius: 10px;
  }
  #search-results-wrap {
    max-height: 55vh;
  }
}