* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: inherit;
  line-height: 1.6;
  margin: 0;
  padding: 20px;
  background-color: transparent;
  color: #222;
}

@media screen and (max-width: 641px) {
  body { padding: 10px; }
}

.container {
  max-width: 1095px;
  margin: 0 auto;
  background-color: transparent;
  padding: 0;
}

.scontainer {
  max-width: 1095px;
  margin: 0 auto;
  background-color: transparent;
  padding: 0 0 20px 0;
}

/* Search form */
.search-form {
  display: flex;
  margin-bottom: 30px;
  gap: 8px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  width: 100%;
  min-width: 200px;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  background: #fff;
  color: #222;
}

.search-input:focus {
  border-color: #999;
}

.search-button {
  padding: 10px 20px;
  background-color: #111;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  transition: background-color 0.2s;
}

.search-button:hover {
  background-color: #333;
}

.photo-search-button {
  padding: 10px 20px;
  background-color: #555;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  transition: background-color 0.2s;
}

.photo-search-button:hover {
  background-color: #777;
}

.view-all-button {
  padding: 10px 20px;
  background-color: #fff;
  color: #111;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  text-decoration: none;
  text-align: center;
  transition: border-color 0.2s;
}

.view-all-button:hover {
  border-color: #999;
}

/* Results count + sort */
.results-count {
  font-size: 14px;
  color: #555;
  margin-bottom: 16px;
}

.results-count a {
  color: #555;
  text-decoration: none;
  margin-left: 12px;
}

.results-count a:hover,
.results-count a.active {
  color: #111;
  font-weight: 700;
}

.result-count {
  font-weight: 700;
  color: #111;
}

/* Results grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 30px;
}

@media (max-width: 1025px) {
  .results-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}

@media (max-width: 641px) {
  .results-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .search-form { flex-direction: column; }
  .search-input { width: 100%; }
}

.result-item {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  background: #f5f5f5;
}

.result-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.result-item img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  aspect-ratio: 1/1;
}

.photo-search-item img {
  aspect-ratio: auto;
  object-fit: contain;
}

.title-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.55);
  color: #fff;
  padding: 8px;
  font-size: 13px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title-overlay:hover {
  background: rgba(0,0,0,0.8);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  margin-top: 30px;
  flex-wrap: wrap;
  gap: 5px;
}

.pagination-link {
  display: inline-block;
  padding: 7px 12px;
  background: #f0f0f0;
  color: #333;
  border-radius: 4px;
  text-decoration: none;
  font-size: 13px;
  transition: background 0.2s;
}

.pagination-link:hover {
  background: #ddd;
}

.pagination-current {
  display: inline-block;
  padding: 7px 12px;
  background: #111;
  color: #fff;
  border-radius: 4px;
  font-size: 13px;
}

.pagination-dots {
  display: inline-block;
  padding: 7px 6px;
  color: #999;
  font-size: 13px;
}

.no-results {
  text-align: center;
  padding: 40px 0;
  color: #888;
  font-size: 16px;
}

/* Autocomplete */
.ui-autocomplete {
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 9999;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
}

.ui-menu-item {
  padding: 8px 12px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
}

.ui-menu-item:hover {
  background: #f5f5f5;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
