.page-header {
  margin-bottom: 3rem;
}

.search-icon-header {
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.5rem;
  opacity: 0.7;
}

/* Search form container */
.search-page-container {
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.search-form {
  position: relative;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Search input - styled to match your blog's aesthetic */
.search-input {
  width: 100%;
  background-color: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 0.75rem;
  color: #0f172a;
  font-size: 1.25rem;
  padding: 1rem 1rem 1rem 3.5rem;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.dark .search-input {
  background-color: #334155;
  border-color: #2d4650;
  color: #f8fafc;
}

.search-input:focus {
  background-color: #f8fafc;
  border-color: #3b82f6;
  outline: none;
}

.dark .search-input:focus {
  background-color: #001e28;
  border-color: orange;
  color: white;
}

.search-input::placeholder {
  color: #94a3b8;
}

.dark .search-input::placeholder {
  color: #64748b;
}

/* Search icon positioning */
.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
  pointer-events: none;
}

/* Search results area - no max-height, let it flow naturally */
.search-results-area {
  width: 100%;
}

/* Search results list - matches your cards-grid styling */
.search-results,
#search-results {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  width: 100%;
  align-items: stretch;
  list-style: none;
  padding: 0;
  margin: 0;
}

@media (max-width: 380px) {
  .search-results {
    grid-template-columns: 1fr;
  }
}

/* Search result item */
.search-result-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* Search card - matches your existing card styles */
.search-card {
  border: 2px solid #ccc;
  border-radius: 1rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
  transition: border-color 0.2s ease;
}

.dark .search-card {
  border-color: #2d4650;
}

.search-card:hover {
  border-color: orange;
}

/* Cover image for search results */
.search-card-cover {
  background-position: center;
  background-size: cover;
  height: 11rem;
  width: 100%;
  flex-shrink: 0;
}

/* Card body */
.search-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 1.5rem;
  text-align: center;
}

/* Card title */
.search-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.5rem;
  color: inherit;
}

/* Card summary */
.search-card-summary {
  color: #647894;
  font-size: 0.875rem;
  line-height: 1.4;
  max-width: 90%;
}

.dark .search-card-summary {
  color: #94a3b8;
}

/* No results message */
.search-noresults {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: #64748b;
  font-size: 1.125rem;
}

.dark .search-noresults {
  color: #94a3b8;
}

/* Focus states for keyboard navigation */
.search-card:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.dark .search-card:focus {
  outline-color: orange;
}

/* Responsive adjustments */
@media (min-width: 1020px) {
  .search-form {
    max-width: 70ch;
  }
  
  .search-input {
    font-size: 1.25rem;
    padding: 1.2rem 1.2rem 1.2rem 4rem;
  }
  
  .search-icon {
    left: 1.2rem;
  }
}
