/**
 * Search Page Styles
 * Matches kodansha.us search design
 */

.search-page {
  background: var(--color-white);
  min-height: 80vh;
}

.search-page .wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

/* Search Container */
.search {
  /* Main search container */
}

/* Search Input */
.search__input-wrapper {
  margin-top: 1rem;
  position: relative;
  margin-bottom: 2rem;
}

.search__input,
#search-input {
  color: var(--color-gray-dark);
  width: 100%;
  padding: 1rem 3rem 1rem 1rem;
  font-size: 2rem;
  border: none;
  border-bottom: 2px solid var(--color-black);
  border-radius: 0;
  letter-spacing: -1.5px;
  background: var(--color-white);
}

.search__input:focus {
  outline: none;
  border-color: var(--color-black);
}

.search__input::placeholder {
  color: var(--color-gray);
}

.search__button {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-black);
}

.search__button:hover {
  opacity: 0.7;
}

/* Recent Searches */
.search__recent-searches {
  margin-bottom: 2rem;
}

.search__recent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.search__recent-title {
  margin: 0;
}

.search__clear-history {
  background: transparent;
  border: none;
  color: var(--color-gray-dark);
  cursor: pointer;
  transition: color 0.2s ease;
}

.search__clear-history:hover {
  color: var(--color-black);
}

.search__recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.search__recent-item {
  margin: 0;
  padding: 0;
}

.search__recent-button {
  background: #f5f5f5;
  border: 1px solid var(--color-gray-mid);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  cursor: pointer;
  border-radius: 2px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.search__recent-button:hover {
  background: #e5e5e5;
  border-color: var(--color-black);
}

/* Search Results */
.search__results {
  margin-top: 2rem;
}

.search__results-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid #e0e0e0;
}

.search__result-item {
  border-bottom: 1px solid #e0e0e0;
}

.search__result-link {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem 0;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.2s ease;
}

.search__result-link:hover {
  background-color: #f9f9f9;
}

.search__result-image {
  flex-shrink: 0;
  width: 80px;
  height: 120px;
  background: #f0f0f0;
  overflow: hidden;
}

.search__result-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search__result-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
}

.search__result-type {
  font-size: 0.75rem;
  font-family: "Maax Medium";
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #666;
}

.search__result-title {
  font-size: 1.25rem;
  font-family: "Maax Bold";
  font-weight: 400;
  line-height: 1.3;
  color: var(--color-black);
}

.search__result-creator {
  font-size: 0.875rem;
  color: #666;
  line-height: 1.4;
}

/* Loading State */
.search__loading {
  text-align: center;
  padding: 3rem 1rem;
  color: #666;
  font-size: 1rem;
}

/* No Results */
.search__no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: #666;
  font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .search-page .wrap {
    padding: 2rem 1rem;
  }

  .search__result-link {
    gap: 1rem;
    padding: 1rem 0;
  }

  .search__result-image {
    width: 60px;
    height: 90px;
  }

  .search__result-title {
    font-size: 1rem;
  }

  .search__result-creator {
    font-size: 0.8125rem;
  }
}

/* Screen reader only text */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}
