* {
  box-sizing: border-box;
}

:root {
  --bg: #eef3f8;
  --panel: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --border: #cbd5e1;
  --tag: #e2e8f0;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, #e9f2ff 0%, var(--bg) 100%);
  color: var(--text);
}

.wrap {
  width: min(100% - 2rem, 1000px);
  margin: 0 auto;
}

.site-header {
  padding: 2.5rem 0 1.5rem;
}

.site-header h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(2rem, 4vw, 3rem);
}

.site-header p {
  margin: 0;
  color: var(--muted);
}

.controls {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.controls label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.control-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.controls input,
.controls button {
  min-height: 44px;
  border: 1px solid var(--border);
  font: inherit;
}

.controls input {
  flex: 1 1 320px;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
}

.controls button {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  background: var(--panel);
}

#searchBtn {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

#searchBtn:hover,
#searchBtn:focus-visible {
  background: var(--accent-dark);
}

#sortBtn.active {
  background: #dbeafe;
  border-color: #93c5fd;
}

.status {
  margin: 0.75rem 0 0;
  color: var(--muted);
  min-height: 1.2em;
}

.hike-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 2rem;
}

.hike-card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.hike-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

.hike-content {
  padding: 1rem;
}

.hike-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: space-between;
}

.hike-content h2 {
  margin: 0;
  font-size: 1.45rem;
}

.hike-distance {
  font-weight: 700;
  color: var(--accent-dark);
}

.hike-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.85rem 0;
}

.hike-tag {
  background: var(--tag);
  border: 1px solid var(--border);
  color: #334155;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  font-size: 0.9rem;
}

.hike-content p {
  margin: 0.55rem 0;
  line-height: 1.5;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-top: 0.85rem;
  color: var(--muted);
}

.rating {
  display: inline-block;
}

.empty-state {
  background: var(--panel);
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  text-align: center;
  color: var(--muted);
}

@media (min-width: 760px) {
  .hike-card {
    flex-direction: row;
  }

  .hike-image {
    width: 320px;
    min-width: 320px;
    aspect-ratio: auto;
    height: 100%;
  }
}