/* ============================================================= */
/* SEARCH RESULTS STYLING (assets/css/search.css)                */
/* Uses CSS variables from style.css for consistency             */
/* Location: \assets\css\search.css                              */
/* ============================================================= */

/* ============================================ */
/* SEARCH INPUT BOX */
/* ============================================ */

#search-input {
  max-width: 300px;
  width: 100%;
  height: 40px;
  padding: 0.5em 1em;
  border: 2px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-bg-light);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.95em;
  transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

#search-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

@media (max-width: 768px) {
  #search-input {
    /* Reduce the width and max-width on mobile to prevent crowding */
    width: 70%; 
    max-width: 180px;
  }
}

/* ============================================ */
/* SEARCH RESULTS CONTAINER */
/* ============================================ */

/* The main container for search results */
#search-results {
  list-style: none;
  padding: 0;
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 8px var(--search-results-shadow);
  margin: 15px auto; 
  max-width: 90%; 
  z-index: 100; 
  display: none; /* KEY: HIDE BY DEFAULT */
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Show the list when JavaScript adds the 'active' class */
#search-results.active {
  display: block; 
}

/* ============================================ */
/* SEARCH RESULT ITEMS */
/* ============================================ */

/* Style for individual result items */
#search-results li {
  padding: 10px 15px;
  border-bottom: 1px solid var(--color-bg-medium);
  transition: border-color 0.3s ease;
}

#search-results li:last-child {
  border-bottom: none;
}

/* ============================================ */
/* SEARCH HEADER (Results Count) */
/* ============================================ */

#search-results li.search-header {
  background-color: var(--color-bg-medium);
  font-size: 0.9em;
  color: var(--color-primary);
  padding: 5px 15px;
  border-bottom: 1px solid var(--color-border);
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ============================================ */
/* SEARCH RESULT LINKS */
/* ============================================ */

/* Anchor link container */
#search-results li a {
  text-decoration: none;
  color: var(--color-text);
  display: block;
  transition: background-color 0.2s, color 0.3s ease;
}

#search-results li a:hover {
  background-color: var(--search-link-hover-bg);
}

/* ============================================ */
/* SEARCH RESULT CONTENT */
/* ============================================ */

/* Result Title */
#search-results li h4 {
  margin: 0 0 5px 0;
  color: var(--color-primary);
  font-family: 'Cinzel', serif;
  transition: color 0.3s ease;
}

/* Content Snippet */
#search-results li p {
  font-size: 0.9em;
  color: var(--color-text);
  margin: 0;
  transition: color 0.3s ease;
}

/* ============================================ */
/* RESPONSIVE DESIGN */
/* ============================================ */

/* Mobile responsive */
@media (max-width: 768px) {
  #search-input {
    max-width: 200px;
    height: 36px;
    font-size: 0.9em;
  }
}
